diff --git a/NPSimulation/include/VEventGenerator.hh b/NPSimulation/include/VEventGenerator.hh index 9da49d9a756c617f5e4f7f98dc7ada9458501545..8a46fab7ec650a3af85c7ae752939341d4ccb9f5 100644 --- a/NPSimulation/include/VEventGenerator.hh +++ b/NPSimulation/include/VEventGenerator.hh @@ -53,7 +53,7 @@ public: virtual ~VEventGenerator(); public: - virtual void ReadConfiguration(string,int dump=0) {dump=0;}; + virtual void ReadConfiguration(string,int dump=0) {dump*=1;}; virtual void GenerateEvent(G4Event*) {}; virtual void InitializeRootOutput() {}; diff --git a/NPSimulation/src/EventGeneratorBeam.cc b/NPSimulation/src/EventGeneratorBeam.cc index c7399854ec9d83c1bf449a17efac3687f137af1d..ac543c4ace268c9f45cfefc29b76709c48d834c6 100644 --- a/NPSimulation/src/EventGeneratorBeam.cc +++ b/NPSimulation/src/EventGeneratorBeam.cc @@ -102,7 +102,7 @@ void EventGeneratorBeam::GenerateEvent(G4Event* anEvent){ G4ThreeVector BeamDir(Xdir,Ydir,Zdir); G4ThreeVector BeamPos(x0,y0,z0); Beam_theta = BeamDir.theta() ; - Beam_phi = BeamDir.phi() ; + Beam_phi = BeamDir.phi() ; Beam_phi *= 1; FinalBeamEnergy = m_Target->SlowDownBeam(m_particle, InitialBeamEnergy,z0,Beam_theta); /////////////////////////////////////////////////////// ///// Add the Beam particle to the particle Stack ///// @@ -123,4 +123,4 @@ void EventGeneratorBeam::InitializeRootOutput(){ TTree *pTree = pAnalysis->GetTree(); pTree->Branch("InitialConditions", "TInitialConditions", &m_InitConditions); } -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... \ No newline at end of file +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/NPSimulation/src/MUST2Array.cc b/NPSimulation/src/MUST2Array.cc index 48252f18927f6fd65291e0614f59336821f760b8..9e578584feef3320fbed649d4e197338b046e520 100644 --- a/NPSimulation/src/MUST2Array.cc +++ b/NPSimulation/src/MUST2Array.cc @@ -152,10 +152,6 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, ////////////// Starting Volume Definition ////////////////////// //////////////////////////////////////////////////////////////// -// Little trick to avoid warning in compilation: Use a PVPlacement "buffer". -// If don't you will have a Warning unused variable 'myPVP' - G4PVPlacement* PVPBuffer ; - G4Trd* solidMM = new G4Trd("MUST2Telescope" + DetectorNumber, 0.5*FaceFront, 0.5*FaceBack, 0.5*FaceFront, 0.5*FaceBack, 0.5*Length); G4LogicalVolume* logicMM = new G4LogicalVolume(solidMM, m_MaterialIron, "MUST2Telescope" + DetectorNumber, 0, 0, 0); @@ -163,7 +159,7 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4String Name = "MUST2Telescope" + DetectorNumber ; - PVPBuffer = new G4PVPlacement( G4Transform3D(*MMrot, MMpos) , + new G4PVPlacement( G4Transform3D(*MMrot, MMpos) , logicMM , Name , world , @@ -180,7 +176,7 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4Trd* solidVacBox = new G4Trd("solidVacBox", 0.5*SiliconFace, 0.5*CsIFaceFront, 0.5*SiliconFace, 0.5*CsIFaceFront, 0.5*VacBoxThickness); G4LogicalVolume* logicVacBox = new G4LogicalVolume(solidVacBox, m_MaterialVacuum, "logicVacBox", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionVacBox, logicVacBox, Name + "_VacBox", logicMM, false, 0); + new G4PVPlacement(0, positionVacBox, logicVacBox, Name + "_VacBox", logicMM, false, 0); logicVacBox->SetVisAttributes(G4VisAttributes::Invisible); @@ -195,8 +191,8 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4Box* solidAluStrip = new G4Box("AluBox", 0.5*SiliconFace, 0.5*SiliconFace, 0.5*AluStripThickness); G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, m_MaterialAluminium, "logicAluStrip", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripFront, logicAluStrip, Name + "_AluStripFront", logicMM, false, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripBack, logicAluStrip, Name + "_AluStripBack", logicMM, false, 0); + new G4PVPlacement(0, positionAluStripFront, logicAluStrip, Name + "_AluStripFront", logicMM, false, 0); + new G4PVPlacement(0, positionAluStripBack, logicAluStrip, Name + "_AluStripBack", logicMM, false, 0); logicAluStrip->SetVisAttributes(G4VisAttributes::Invisible); @@ -205,7 +201,7 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4Box* solidSilicon = new G4Box("solidSilicon", 0.5*SiliconFace, 0.5*SiliconFace, 0.5*SiliconThickness); G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon, m_MaterialSilicon, "logicSilicon", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicMM, false, 0); + new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicMM, false, 0); ///Set Silicon strip sensible @@ -231,7 +227,7 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4LogicalVolume* logicSiLi = new G4LogicalVolume(solidSiLi, m_MaterialAluminium, Name + "_SiLi" , 0, 0, 0); - PVPBuffer = new G4PVPlacement( G4Transform3D(*rotSiLi, G4ThreeVector(0,0,0) ) , + new G4PVPlacement( G4Transform3D(*rotSiLi, G4ThreeVector(0,0,0) ) , logicSiLi , Name + "_SiLi", logicVacBox , @@ -372,27 +368,27 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, // up - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LT_up , logicSiLi_LT , Name + "_SiLi_Pad9" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RT_up , logicSiLi_RT , Name + "_SiLi_Pad10" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LC1_up , logicSiLi_LC1 , Name + "_SiLi_Pad11" , logicSiLi , false , 0); - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RC1_up , logicSiLi_RC1 , Name + "_SiLi_Pad12" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_LT_up , logicSiLi_LT , Name + "_SiLi_Pad9" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RT_up , logicSiLi_RT , Name + "_SiLi_Pad10" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC1_up , logicSiLi_LC1 , Name + "_SiLi_Pad11" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_RC1_up , logicSiLi_RC1 , Name + "_SiLi_Pad12" , logicSiLi , false , 0); - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LB_up , logicSiLi_LB , Name + "_SiLi_Pad16" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RB_up , logicSiLi_RB , Name + "_SiLi_Pad15" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LC2_up , logicSiLi_LC2 , Name + "_SiLi_Pad14" , logicSiLi , false , 0); - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RC2_up , logicSiLi_RC2 , Name + "_SiLi_Pad13" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_LB_up , logicSiLi_LB , Name + "_SiLi_Pad16" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RB_up , logicSiLi_RB , Name + "_SiLi_Pad15" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC2_up , logicSiLi_LC2 , Name + "_SiLi_Pad14" , logicSiLi , false , 0); + new G4PVPlacement(0 , positionSiLi_RC2_up , logicSiLi_RC2 , Name + "_SiLi_Pad13" , logicSiLi , false , 0); // down - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LT_down , logicSiLi_LT , Name + "_SiLi_Pad2" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RT_down , logicSiLi_RT , Name + "_SiLi_Pad1" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LC1_down , logicSiLi_LC1 , Name + "_SiLi_Pad4" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RC1_down , logicSiLi_RC1 , Name + "_SiLi_Pad3" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LT_down , logicSiLi_LT , Name + "_SiLi_Pad2" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RT_down , logicSiLi_RT , Name + "_SiLi_Pad1" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC1_down , logicSiLi_LC1 , Name + "_SiLi_Pad4" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RC1_down , logicSiLi_RC1 , Name + "_SiLi_Pad3" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LB_down , logicSiLi_LB , Name + "_SiLi_Pad7" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RB_down , logicSiLi_RB , Name + "_SiLi_Pad8" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_LC2_down , logicSiLi_LC2 , Name + "_SiLi_Pad5" , logicSiLi , false , 0) ; - PVPBuffer = new G4PVPlacement(0 , positionSiLi_RC2_down , logicSiLi_RC2 , Name + "_SiLi_Pad6" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LB_down , logicSiLi_LB , Name + "_SiLi_Pad7" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RB_down , logicSiLi_RB , Name + "_SiLi_Pad8" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_LC2_down , logicSiLi_LC2 , Name + "_SiLi_Pad5" , logicSiLi , false , 0) ; + new G4PVPlacement(0 , positionSiLi_RC2_down , logicSiLi_RC2 , Name + "_SiLi_Pad6" , logicSiLi , false , 0) ; @@ -434,14 +430,14 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4Trd* solidCsI = new G4Trd("csI", 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIFaceFront, 0.5*CsIFaceBack, 0.5*CsIThickness); G4LogicalVolume* logicCsI = new G4LogicalVolume(solidCsI, m_MaterialAluminium, Name + "_CsI_Mylar", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionCsI, logicCsI, Name + "_CsI_Mylar", logicMM, false, 0); + new G4PVPlacement(0, positionCsI, logicCsI, Name + "_CsI_Mylar", logicMM, false, 0); G4ThreeVector positionMylarCsI = G4ThreeVector(0, 0, MylarCsIThickness * 0.5 - CsIThickness * 0.5); G4Box* solidMylarCsI = new G4Box("MylarCsIBox", 0.5*CsIFaceFront, 0.5*CsIFaceFront, 0.5*MylarCsIThickness); G4LogicalVolume* logicMylarCsI = new G4LogicalVolume(solidMylarCsI, m_MaterialMyl, Name + "_CsI_Mylar", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionMylarCsI, logicMylarCsI, Name + "_CsI_Mylar", logicCsI, false, 0); + new G4PVPlacement(0, positionMylarCsI, logicMylarCsI, Name + "_CsI_Mylar", logicCsI, false, 0); logicCsI->SetVisAttributes(G4VisAttributes::Invisible); @@ -498,10 +494,10 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4ThreeVector positionCristal3 = G4ThreeVector(-XEdge2, YEdge1, 0); G4ThreeVector positionCristal4 = G4ThreeVector(-XEdge2, YEdge2, 0); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal1, logicCristal1, Name + "_CsI_Cristal1", logicCsI, false, 1); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal2, logicCristal2, Name + "_CsI_Cristal2", logicCsI, false, 2); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal3, logicCristal3, Name + "_CsI_Cristal3", logicCsI, false, 3); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal4, logicCristal4, Name + "_CsI_Cristal4", logicCsI, false, 4); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal1, logicCristal1, Name + "_CsI_Cristal1", logicCsI, false, 1); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal2, logicCristal2, Name + "_CsI_Cristal2", logicCsI, false, 2); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal3, logicCristal3, Name + "_CsI_Cristal3", logicCsI, false, 3); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal4, logicCristal4, Name + "_CsI_Cristal4", logicCsI, false, 4); G4ThreeVector positionCristal1b = G4ThreeVector(XEdge1, -YEdge1, 0 * mm); @@ -509,30 +505,30 @@ void MUST2Array::VolumeMaker( G4int TelescopeNumber, G4ThreeVector positionCristal3b = G4ThreeVector(XEdge2, -YEdge1, 0); G4ThreeVector positionCristal4b = G4ThreeVector(XEdge2, -YEdge2, 0); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal1b, logicCristal1, Name + "_CsI_Cristal5", logicCsI, false, 5); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal2b, logicCristal2, Name + "_CsI_Cristal6", logicCsI, false, 6); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal3b, logicCristal3, Name + "_CsI_Cristal7", logicCsI, false, 7); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal4b, logicCristal4, Name + "_CsI_Cristal8", logicCsI, false, 8); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal1b, logicCristal1, Name + "_CsI_Cristal5", logicCsI, false, 5); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal2b, logicCristal2, Name + "_CsI_Cristal6", logicCsI, false, 6); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal3b, logicCristal3, Name + "_CsI_Cristal7", logicCsI, false, 7); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal4b, logicCristal4, Name + "_CsI_Cristal8", logicCsI, false, 8); G4ThreeVector positionCristal1s = G4ThreeVector(-XEdge1, -YEdge1, 0 * mm); G4ThreeVector positionCristal2s = G4ThreeVector(-XEdge1, -YEdge2, 0); G4ThreeVector positionCristal3s = G4ThreeVector(-XEdge2, -YEdge1, 0); G4ThreeVector positionCristal4s = G4ThreeVector(-XEdge2, -YEdge2, 0); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal1s, logicCristal1s, Name + "_CsI_Cristal9", logicCsI, false, 9); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal2s, logicCristal2s, Name + "_CsI_Cristal10", logicCsI, false, 10); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal3s, logicCristal3s, Name + "_CsI_Cristal11", logicCsI, false, 11); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 0.), positionCristal4s, logicCristal4sbis, Name + "_CsI_Cristal12", logicCsI, false, 12); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal1s, logicCristal1s, Name + "_CsI_Cristal9", logicCsI, false, 9); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal2s, logicCristal2s, Name + "_CsI_Cristal10", logicCsI, false, 10); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal3s, logicCristal3s, Name + "_CsI_Cristal11", logicCsI, false, 11); + new G4PVPlacement(Rotation(180., 0., 0.), positionCristal4s, logicCristal4sbis, Name + "_CsI_Cristal12", logicCsI, false, 12); G4ThreeVector positionCristal1sb = G4ThreeVector(XEdge1, YEdge1, 0 * mm); G4ThreeVector positionCristal2sb = G4ThreeVector(XEdge1, YEdge2, 0); G4ThreeVector positionCristal3sb = G4ThreeVector(XEdge2, YEdge1, 0); G4ThreeVector positionCristal4sb = G4ThreeVector(XEdge2, YEdge2, 0); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal1sb, logicCristal1s, Name + "_CsI_Cristal13", logicCsI, false, 13); - PVPBuffer = new G4PVPlacement(Rotation(180, 0, 0), positionCristal2sb, logicCristal2s, Name + "_CsI_Cristal14", logicCsI, false, 14); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal3sb, logicCristal3s, Name + "_CsI_Cristal15", logicCsI, false, 15); - PVPBuffer = new G4PVPlacement(Rotation(180., 0., 180.), positionCristal4sb, logicCristal4s, Name + "_CsI_Cristal16", logicCsI, false, 16); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal1sb, logicCristal1s, Name + "_CsI_Cristal13", logicCsI, false, 13); + new G4PVPlacement(Rotation(180, 0, 0), positionCristal2sb, logicCristal2s, Name + "_CsI_Cristal14", logicCsI, false, 14); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal3sb, logicCristal3s, Name + "_CsI_Cristal15", logicCsI, false, 15); + new G4PVPlacement(Rotation(180., 0., 180.), positionCristal4sb, logicCristal4s, Name + "_CsI_Cristal16", logicCsI, false, 16); ///Set CsI sensible logicCristal1->SetSensitiveDetector(m_CsIScorer);