From aeed94816b465f030c5d0557834c3b407d8a1668 Mon Sep 17 00:00:00 2001
From: Morfouace <pierre.morfouace@gmail.com>
Date: Tue, 26 Apr 2022 15:36:57 +0200
Subject: [PATCH] Adding BGO material to MaterialManager.cc

---
 Inputs/EventGenerator/gamma.source        |  2 +-
 NPSimulation/Core/MaterialManager.cc      | 12 ++++++++++++
 NPSimulation/Detectors/Plastic/Plastic.cc |  3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Inputs/EventGenerator/gamma.source b/Inputs/EventGenerator/gamma.source
index 53a46e49b..5a15fd86f 100644
--- a/Inputs/EventGenerator/gamma.source
+++ b/Inputs/EventGenerator/gamma.source
@@ -7,7 +7,7 @@ Isotropic
  EnergyLow= 12 MeV
  EnergyHigh= 12 MeV
  HalfOpenAngleMin= 0 deg
- HalfOpenAngleMax= 1 deg
+ HalfOpenAngleMax= 2 deg
  x0= 0 mm
  y0= 0 mm
  z0= 0 mm
diff --git a/NPSimulation/Core/MaterialManager.cc b/NPSimulation/Core/MaterialManager.cc
index 4eb3f2db6..c207c08ce 100644
--- a/NPSimulation/Core/MaterialManager.cc
+++ b/NPSimulation/Core/MaterialManager.cc
@@ -845,6 +845,18 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name,
       return material;
     }
 
+    else if (Name == "BGO") {
+      if (!density)
+        density = 7.13 * g / cm3;
+      G4Material* material = new G4Material("NPS_" + Name, density, 3);
+      material->AddElement(GetElementFromLibrary("Bi"), 4);
+      material->AddElement(GetElementFromLibrary("Ge"), 3);
+      material->AddElement(GetElementFromLibrary("O"), 12);
+      m_Material[Name] = material;
+      return material;
+    }
+
+
 
     else if (Name == "BaF2") {
       if (!density)
diff --git a/NPSimulation/Detectors/Plastic/Plastic.cc b/NPSimulation/Detectors/Plastic/Plastic.cc
index fe2a6008e..2be3b77a4 100644
--- a/NPSimulation/Detectors/Plastic/Plastic.cc
+++ b/NPSimulation/Detectors/Plastic/Plastic.cc
@@ -60,7 +60,7 @@ using namespace CLHEP;
 namespace PLASTIC{
   // Energy and time Resolution
   const G4double ResoTime    = 1.         ;// Resolution in ns  //
-  //const G4double ResoEnergy  = 0.1         ;// Resolution in %
+  //const G4double ResoEnergy  = 0.08/2.35         ;// Resolution in %
   const G4double ResoEnergy  = 1*keV;         // Resolution 
 }
 
@@ -347,6 +347,7 @@ void Plastic::ReadSensitive(const G4Event* event){
 
   unsigned int size = Scorer->GetMult();
   for(unsigned int i=0; i<size; i++){
+    //double Energy = RandGauss::shoot(Scorer->GetEnergy(i), Scorer->GetEnergy(i)*ResoEnergy);
     double Energy = RandGauss::shoot(Scorer->GetEnergy(i), ResoEnergy);
     double Time = RandGauss::shoot(Scorer->GetTime(i), ResoTime);
     int DetectorNbr = Scorer->GetLevel(i)[0];
-- 
GitLab