diff --git a/FCCee/IDEA/compact/IDEA_o2_v01/DectDimensions_IDEA_o2_v01.xml b/FCCee/IDEA/compact/IDEA_o2_v01/DectDimensions_IDEA_o2_v01.xml index d8e9a9470..ced713ca0 100644 --- a/FCCee/IDEA/compact/IDEA_o2_v01/DectDimensions_IDEA_o2_v01.xml +++ b/FCCee/IDEA/compact/IDEA_o2_v01/DectDimensions_IDEA_o2_v01.xml @@ -269,7 +269,7 @@ - + diff --git a/FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml b/FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml index eb4f52957..3e72430dc 100644 --- a/FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml +++ b/FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml @@ -47,7 +47,7 @@ - + @@ -58,6 +58,9 @@ + + + diff --git a/FCCee/IDEA/compact/IDEA_o2_v01/SCEPCal.xml b/FCCee/IDEA/compact/IDEA_o2_v01/SCEPCal.xml index d3cdf46f6..fdba2e3c1 100644 --- a/FCCee/IDEA/compact/IDEA_o2_v01/SCEPCal.xml +++ b/FCCee/IDEA/compact/IDEA_o2_v01/SCEPCal.xml @@ -980,8 +980,8 @@ - - + + @@ -1006,7 +1006,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - system:4,eta:11,phi:11,depth:4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/detector/calorimeter/SCEPCalConstructor.cpp b/detector/calorimeter/SCEPCalConstructor.cpp index 0af2bfa3c..1db386119 100644 --- a/detector/calorimeter/SCEPCalConstructor.cpp +++ b/detector/calorimeter/SCEPCalConstructor.cpp @@ -203,19 +203,21 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S dd4hep::Polyhedra endcap1AssemblyShape(PHI_SEGMENTS,D_PHI_GLOBAL/2,2*M_PI,zEndcap1Polyhedra,rminEndcap1Polyhedra,rmaxEndcap1Polyhedra); dd4hep::Volume endcap1AssemblyVol("endcap1AssemblyVol",endcap1AssemblyShape,theDetector.material("Vacuum")); endcap1AssemblyVol.setVisAttributes(theDetector,endcapAssemblyGlobalVisXML.visStr()); - auto timingAssemblyVolId =segmentation->setVolumeID(3,0,0,0); + auto timingAssemblyVolId =segmentation->setVolumeID(6,0,0,0); int timingAssemblyVolId32=segmentation->getFirst32bits(timingAssemblyVolId); - auto barrelAssemblyVolId =segmentation->setVolumeID(1,0,0,0); + auto barrelAssemblyVolId =segmentation->setVolumeID(4,0,0,0); int barrelAssemblyVolId32=segmentation->getFirst32bits(barrelAssemblyVolId); - auto endcapAssemblyVolId =segmentation->setVolumeID(2,0,0,0); + auto endcapAssemblyVolId =segmentation->setVolumeID(5,0,0,0); int endcapAssemblyVolId32=segmentation->getFirst32bits(endcapAssemblyVolId); - auto endcap1AssemblyVolId =segmentation->setVolumeID(2,1,0,0); + auto endcap1AssemblyVolId =segmentation->setVolumeID(5,1,0,0); int endcap1AssemblyVolId32=segmentation->getFirst32bits(endcap1AssemblyVolId); experimentalHall.placeVolume(timingAssemblyVol,timingAssemblyVolId32); dd4hep::PlacedVolume barrelPlacedVol =experimentalHall.placeVolume(barrelAssemblyVol,barrelAssemblyVolId32); experimentalHall.placeVolume(endcapAssemblyVol,endcapAssemblyVolId32); experimentalHall.placeVolume(endcap1AssemblyVol,endcap1AssemblyVolId32); + barrelPlacedVol.addPhysVolID("system", detectorXML.id()); + ScepcalDetElement.setPlacement(barrelPlacedVol); int numCrystalsBarrel = 0; @@ -265,24 +267,24 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S Position dispSipmLg(0,0,lT/2-sipmth/2); Position dispSipmTr(0,wT-sipmth/2,0); - auto timingLgId64=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,3); - auto timingTrId64=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,6); + auto timingLgId64=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,3); + auto timingTrId64=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,6); int timingLgId32=segmentation->getFirst32bits(timingLgId64); int timingTrId32=segmentation->getFirst32bits(timingTrId64); dd4hep::PlacedVolume timingLgp=tileAssemblyVolume.placeVolume(timingCrystalLgVol,timingLgId32,dispLg); dd4hep::PlacedVolume timingTrp=tileAssemblyVolume.placeVolume(timingCrystalTrVol,timingTrId32,dispTr); - timingLgp.addPhysVolID("system",3); + timingLgp.addPhysVolID("system",6); timingLgp.addPhysVolID("eta",nTile*nCy+nC); timingLgp.addPhysVolID("phi",iPhi); timingLgp.addPhysVolID("depth",3); - timingTrp.addPhysVolID("system",3); + timingTrp.addPhysVolID("system",6); timingTrp.addPhysVolID("eta",nTile*nCy+nC); timingTrp.addPhysVolID("phi",iPhi); timingTrp.addPhysVolID("depth",6); - auto sipmLgId64_1=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,4); - auto sipmLgId64_2=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,5); - auto sipmTrId64_1=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,7); - auto sipmTrId64_2=segmentation->setVolumeID(3,nTile*nCy+nC ,iPhi,8); + auto sipmLgId64_1=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,4); + auto sipmLgId64_2=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,5); + auto sipmTrId64_1=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,7); + auto sipmTrId64_2=segmentation->setVolumeID(6,nTile*nCy+nC ,iPhi,8); int sipmLgId32_1=segmentation->getFirst32bits(sipmLgId64_1); int sipmLgId32_2=segmentation->getFirst32bits(sipmLgId64_2); int sipmTrId32_1=segmentation->getFirst32bits(sipmTrId64_1); @@ -291,19 +293,19 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S dd4hep::PlacedVolume sipmLgp2=tileAssemblyVolume.placeVolume(sipmBoxLgVol,sipmLgId32_2,dispLg-dispSipmLg); dd4hep::PlacedVolume sipmTrp1=tileAssemblyVolume.placeVolume(sipmBoxTrVol,sipmTrId32_1,dispTr+dispSipmTr); dd4hep::PlacedVolume sipmTrp2=tileAssemblyVolume.placeVolume(sipmBoxTrVol,sipmTrId32_2,dispTr-dispSipmTr); - sipmLgp1.addPhysVolID("system",3); + sipmLgp1.addPhysVolID("system",6); sipmLgp1.addPhysVolID("eta",nTile*nCy+nC); sipmLgp1.addPhysVolID("phi",iPhi); sipmLgp1.addPhysVolID("depth",4); - sipmLgp2.addPhysVolID("system",3); + sipmLgp2.addPhysVolID("system",6); sipmLgp2.addPhysVolID("eta",nTile*nCy+nC); sipmLgp2.addPhysVolID("phi",iPhi); sipmLgp2.addPhysVolID("depth",5); - sipmTrp1.addPhysVolID("system",3); + sipmTrp1.addPhysVolID("system",6); sipmTrp1.addPhysVolID("eta",nTile*nCy+nC); sipmTrp1.addPhysVolID("phi",iPhi); sipmTrp1.addPhysVolID("depth",7); - sipmTrp2.addPhysVolID("system",3); + sipmTrp2.addPhysVolID("system",6); sipmTrp2.addPhysVolID("eta",nTile*nCy+nC); sipmTrp2.addPhysVolID("phi",iPhi); sipmTrp2.addPhysVolID("depth",8); @@ -374,17 +376,17 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S crystalRVol.setVisAttributes(theDetector,crystalRXML.visStr()); crystalFVol.setSensitiveDetector(sens); crystalRVol.setSensitiveDetector(sens); - auto crystalFId64=segmentation->setVolumeID(1,N_THETA_ENDCAP+iTheta ,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,1); - auto crystalRId64=segmentation->setVolumeID(1,N_THETA_ENDCAP+iTheta ,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,2); + auto crystalFId64=segmentation->setVolumeID(4,N_THETA_ENDCAP+iTheta ,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,1); + auto crystalRId64=segmentation->setVolumeID(4,N_THETA_ENDCAP+iTheta ,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,2); int crystalFId32=segmentation->getFirst32bits(crystalFId64); int crystalRId32=segmentation->getFirst32bits(crystalRId64); dd4hep::PlacedVolume crystalFp=barrelPhiAssemblyVolume.placeVolume(crystalFVol,crystalFId32,Transform3D(rot,dispF)); dd4hep::PlacedVolume crystalRp=barrelPhiAssemblyVolume.placeVolume(crystalRVol,crystalRId32,Transform3D(rot,dispR)); - crystalFp.addPhysVolID("system",1); + crystalFp.addPhysVolID("system",4); crystalFp.addPhysVolID("eta",N_THETA_ENDCAP+iTheta); crystalFp.addPhysVolID("phi",iPhi*N_PHI_BARREL_CRYSTAL+nGamma); crystalFp.addPhysVolID("depth",1); - crystalRp.addPhysVolID("system",1); + crystalRp.addPhysVolID("system",4); crystalRp.addPhysVolID("eta",N_THETA_ENDCAP+iTheta); crystalRp.addPhysVolID("phi",iPhi*N_PHI_BARREL_CRYSTAL+nGamma); crystalRp.addPhysVolID("depth",2); @@ -437,17 +439,17 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S crystalRVol.setVisAttributes(theDetector,projRXML.visStr()); crystalFVol.setSensitiveDetector(sens); crystalRVol.setSensitiveDetector(sens); - auto crystalFId64=segmentation->setVolumeID(4,iTheta,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,1); - auto crystalRId64=segmentation->setVolumeID(4,iTheta,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,2); + auto crystalFId64=segmentation->setVolumeID(7,iTheta,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,1); + auto crystalRId64=segmentation->setVolumeID(7,iTheta,iPhi*N_PHI_BARREL_CRYSTAL+nGamma,2); int crystalFId32=segmentation->getFirst32bits(crystalFId64); int crystalRId32=segmentation->getFirst32bits(crystalRId64); dd4hep::PlacedVolume crystalFp=barrelPhiAssemblyVolume.placeVolume(crystalFVol,crystalFId32,Transform3D(rot,dispF)); dd4hep::PlacedVolume crystalRp=barrelPhiAssemblyVolume.placeVolume(crystalRVol,crystalRId32,Transform3D(rot,dispR)); - crystalFp.addPhysVolID("system",4); + crystalFp.addPhysVolID("system",7); crystalFp.addPhysVolID("eta",iTheta); crystalFp.addPhysVolID("phi",iPhi*N_PHI_BARREL_CRYSTAL+nGamma); crystalFp.addPhysVolID("depth",1); - crystalRp.addPhysVolID("system",4); + crystalRp.addPhysVolID("system",7); crystalRp.addPhysVolID("eta",iTheta); crystalRp.addPhysVolID("phi",iPhi*N_PHI_BARREL_CRYSTAL+nGamma); crystalRp.addPhysVolID("depth",2); @@ -529,31 +531,31 @@ create_detector_SCEPCal(dd4hep::Detector &theDetector,xml_h xmlElement,dd4hep::S crystalRVol.setVisAttributes(theDetector,crystalRXML.visStr()); crystalFVol.setSensitiveDetector(sens); crystalRVol.setSensitiveDetector(sens); - auto crystalFId64=segmentation->setVolumeID(2,iTheta,iPhi*nPhiEndcapCrystal+nGamma,1); - auto crystalRId64=segmentation->setVolumeID(2,iTheta,iPhi*nPhiEndcapCrystal+nGamma,2); + auto crystalFId64=segmentation->setVolumeID(5,iTheta,iPhi*nPhiEndcapCrystal+nGamma,1); + auto crystalRId64=segmentation->setVolumeID(5,iTheta,iPhi*nPhiEndcapCrystal+nGamma,2); int crystalFId32=segmentation->getFirst32bits(crystalFId64); int crystalRId32=segmentation->getFirst32bits(crystalRId64); dd4hep::PlacedVolume crystalFp=endcapRingAssemblyVolume.placeVolume(crystalFVol,crystalFId32,Transform3D(rot,dispF)); dd4hep::PlacedVolume crystalRp=endcapRingAssemblyVolume.placeVolume(crystalRVol,crystalRId32,Transform3D(rot,dispR)); - crystalFp.addPhysVolID("system",2); + crystalFp.addPhysVolID("system",5); crystalFp.addPhysVolID("eta",iTheta); crystalFp.addPhysVolID("phi",iPhi*nPhiEndcapCrystal+nGamma); crystalFp.addPhysVolID("depth",1); - crystalRp.addPhysVolID("system",2); + crystalRp.addPhysVolID("system",5); crystalRp.addPhysVolID("eta",iTheta); crystalRp.addPhysVolID("phi",iPhi*nPhiEndcapCrystal+nGamma); crystalRp.addPhysVolID("depth",2); - auto crystalFId641=segmentation->setVolumeID(2,N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta,iPhi*nPhiEndcapCrystal+nGamma,1); - auto crystalRId641=segmentation->setVolumeID(2,N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta,iPhi*nPhiEndcapCrystal+nGamma,2); + auto crystalFId641=segmentation->setVolumeID(5,N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta,iPhi*nPhiEndcapCrystal+nGamma,1); + auto crystalRId641=segmentation->setVolumeID(5,N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta,iPhi*nPhiEndcapCrystal+nGamma,2); int crystalFId321=segmentation->getFirst32bits(crystalFId641); int crystalRId321=segmentation->getFirst32bits(crystalRId641); dd4hep::PlacedVolume crystalFp1=endcap1RingAssemblyVolume.placeVolume(crystalFVol,crystalFId321,Transform3D(rot,dispF)); dd4hep::PlacedVolume crystalRp1=endcap1RingAssemblyVolume.placeVolume(crystalRVol,crystalRId321,Transform3D(rot,dispR)); - crystalFp1.addPhysVolID("system",2); + crystalFp1.addPhysVolID("system",5); crystalFp1.addPhysVolID("eta",N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta); crystalFp1.addPhysVolID("phi",iPhi*nPhiEndcapCrystal+nGamma); crystalFp1.addPhysVolID("depth",1); - crystalRp1.addPhysVolID("system",2); + crystalRp1.addPhysVolID("system",5); crystalRp1.addPhysVolID("eta",N_THETA_ENDCAP+N_THETA_BARREL+N_THETA_ENDCAP-iTheta); crystalRp1.addPhysVolID("phi",iPhi*nPhiEndcapCrystal+nGamma); crystalRp1.addPhysVolID("depth",2); diff --git a/detectorSegmentations/src/SCEPCalSegmentation_k4geo.cpp b/detectorSegmentations/src/SCEPCalSegmentation_k4geo.cpp index c87eb9303..71d810f35 100644 --- a/detectorSegmentations/src/SCEPCalSegmentation_k4geo.cpp +++ b/detectorSegmentations/src/SCEPCalSegmentation_k4geo.cpp @@ -63,7 +63,8 @@ Vector3D SCEPCalSegmentation_k4geo::myPosition(const CellID& cID) const { int N_PHI_BARREL_CRYSTAL=floor(2*M_PI*Rin/(PHI_SEGMENTS*nomfw)); double D_PHI_BARREL_CRYSTAL=D_PHI_GLOBAL/N_PHI_BARREL_CRYSTAL; - if (system == 3) { + // timing + if (system == 6) { double thC_end =THETA_SIZE_ENDCAP+D_THETA_BARREL/2; double r0slice_end =Rin/sin(thC_end); double y0slice_end =r0slice_end*tan(D_THETA_BARREL/2.); @@ -98,7 +99,8 @@ Vector3D SCEPCalSegmentation_k4geo::myPosition(const CellID& cID) const { else if (nDepth_in==7) {return rotZ*(dispTimingAssembly +dispTileAssembly +dispTr +dispSipmTr);} else if (nDepth_in==8) {return rotZ*(dispTimingAssembly +dispTileAssembly +dispTr -dispSipmTr);} } - else if (system == 2) { + // endcap + else if (system == 5) { int nTheta; if (nEta_inN_THETA_ENDCAP+N_THETA_BARREL) { @@ -130,7 +132,8 @@ Vector3D SCEPCalSegmentation_k4geo::myPosition(const CellID& cID) const { return rotY*(dispSlice+rotZ*dispR); } } - else if (system == 1) { + // barrel + else if (system == 4) { int nTheta =nEta_in-N_THETA_ENDCAP; int nPhi =int(nPhi_in/N_PHI_BARREL_CRYSTAL); int nGamma =nPhi_in%N_PHI_BARREL_CRYSTAL; @@ -154,7 +157,8 @@ Vector3D SCEPCalSegmentation_k4geo::myPosition(const CellID& cID) const { return (dispSlice+rotZ*dispR); } } - else if (system == 4) { + // projective fill + else if (system == 7) { int nTheta =nEta_in; int nPhi =int(nPhi_in/N_PHI_BARREL_CRYSTAL); int nGamma =nPhi_in%N_PHI_BARREL_CRYSTAL; diff --git a/example/SteeringFile_IDEA_o2_v01.py b/example/SteeringFile_IDEA_o2_v01.py index 9133c506c..2f11b8e8f 100644 --- a/example/SteeringFile_IDEA_o2_v01.py +++ b/example/SteeringFile_IDEA_o2_v01.py @@ -4,7 +4,7 @@ SIM = DD4hepSimulation() ## The compact XML file, or multiple compact files, if the last one is the closer. -SIM.compactFile = ["../FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml"] +SIM.compactFile = ["FCCee/IDEA/compact/IDEA_o2_v01/IDEA_o2_v01.xml"] ## Lorentz boost for the crossing angle, in radian! SIM.crossingAngleBoost = 0.0 SIM.enableDetailedShowerMode = False @@ -12,11 +12,11 @@ SIM.enableG4Gun = False SIM.enableGun = True ## InputFiles for simulation .stdhep, .slcio, .HEPEvt, .hepevt, .pairs, .hepmc, .hepmc.gz, .hepmc.xz, .hepmc.bz2, .hepmc3, .hepmc3.gz, .hepmc3.xz, .hepmc3.bz2, .hepmc3.tree.root files are supported -SIM.inputFiles = [] +SIM.inputFiles = ["/home/wonyongc/src/calvision/SCEPCal-public/examples/wzp6_ee_ZZ_test_ecm240_1k.stdhep"] ## Macro file to execute for runType 'run' or 'vis' SIM.macroFile = "" ## number of events to simulate, used in batch mode -SIM.numberOfEvents = 10 +SIM.numberOfEvents = 1 ## Outputfile from the simulation: .slcio, edm4hep.root and .root output files are supported SIM.outputFile = "IDEA_o2_v01.root" ## Physics list to use in simulation @@ -103,8 +103,10 @@ ## List of patterns matching sensitive detectors of type Calorimeter. SIM.action.calorimeterSDTypes = ["calorimeter"] -## Replace SDAction for DREndcapTubes subdetector -SIM.action.mapActions["DREndcapTubes"] = "DRTubesSDAction" +## Replace SDAction for subdetectors +SIM.action.mapActions = { 'SCEPCal' : "SCEPCalSDAction_DRHit", + 'DREndcapTubes' : "DRTubesSDAction" } + ## Configure the regexSD for DREndcapTubes subdetector SIM.geometry.regexSensitiveDetector["DREndcapTubes"] = { "Match": ["DRETS"], @@ -184,7 +186,7 @@ } ## a map between patterns and filter objects, using patterns to attach filters to sensitive detector -SIM.filter.mapDetFilter = {} +SIM.filter.mapDetFilter = {'SCEPCal' : 'edep1kev'} ## default filter for tracking sensitive detectors; this is applied if no other filter is used for a tracker SIM.filter.tracker = "edep1kev" @@ -243,7 +245,7 @@ ################################################################################ ## direction of the particle gun, 3 vector -SIM.gun.direction = (0, 0, 1) +SIM.gun.direction = (0, 0, 0) ## choose the distribution of the random direction for theta ## @@ -277,10 +279,10 @@ SIM.gun.isotrop = False ## Maximal momentum when using distribution (default = 0.0) -SIM.gun.momentumMax = 10000.0 +SIM.gun.momentumMax = 10.0*GeV ## Minimal momentum when using distribution (default = 0.0) -SIM.gun.momentumMin = 0.0 +SIM.gun.momentumMin = 10.0*GeV SIM.gun.multiplicity = 1 SIM.gun.particle = "e-" @@ -440,7 +442,25 @@ ## # arbitrary options can be created and set via the steering file or command line ## SIM.outputConfig.myExtension = '.csv' ## - +def setupEDM4hepOutputDR(dd4hepSimulation): + from DDG4 import EventAction, Kernel + dd = dd4hepSimulation + evt_edm4hep = EventAction(Kernel(), 'Geant4Output2EDM4hep_DRC/' + dd.outputFile, True) + evt_edm4hep.Control = True + output = dd.outputFile + if not dd.outputFile.endswith(dd.outputConfig.myExtension): + output = dd.outputFile + dd.outputConfig.myExtension + evt_edm4hep.Output = output + evt_edm4hep.enableUI() + Kernel().eventAction().add(evt_edm4hep) + eventPars = dd.meta.parseEventParameters() + evt_edm4hep.RunHeader = dd.meta.addParametersToRunHeader(dd) + evt_edm4hep.EventParametersString, evt_edm4hep.EventParametersInt, evt_edm4hep.EventParametersFloat = eventPars + evt_edm4hep.RunNumberOffset = dd.meta.runNumberOffset if dd.meta.runNumberOffset > 0 else 0 + evt_edm4hep.EventNumberOffset = dd.meta.eventNumberOffset if dd.meta.eventNumberOffset > 0 else 0 + return None +SIM.outputConfig.userOutputPlugin = setupEDM4hepOutputDR +SIM.outputConfig.myExtension = '.root' ################################################################################ ## Configuration for the Particle Handler/ MCTruth treatment @@ -507,7 +527,7 @@ ## Set of Generator Statuses that are used to mark unstable particles that should decay inside of Geant4. ## -SIM.physics.alternativeDecayStatuses = set() +# SIM.physics.alternativeDecayStatuses = set() ## If true, add decay processes for all particles. ## @@ -589,7 +609,7 @@ def setupCerenkov(kernel): seq = kernel.physicsList() cerenkov = PhysicsList(kernel, "Geant4CerenkovPhysics/CerenkovPhys") - cerenkov.MaxNumPhotonsPerStep = 1000 + cerenkov.MaxNumPhotonsPerStep = 100 # cerenkov.MaxBetaChangePerStep = 10.0 # cerenkov.TrackSecondariesFirst = True cerenkov.VerboseLevel = 0 diff --git a/example/scepcal_steering.py b/example/scepcal_steering.py index 0e0643f91..0590f6aee 100644 --- a/example/scepcal_steering.py +++ b/example/scepcal_steering.py @@ -17,6 +17,38 @@ opticalPhysics = True +def setupCerenkovScint(kernel): + from DDG4 import PhysicsList + seq = kernel.physicsList() + + scint = PhysicsList(kernel, 'Geant4ScintillationPhysics/ScintillationPhys') + scint.VerboseLevel = 0 + scint.TrackSecondariesFirst = True + scint.enableUI() + seq.adopt(scint) + + cerenkov = PhysicsList(kernel, 'Geant4CerenkovPhysics/CerenkovPhys') + cerenkov.VerboseLevel = 0 + cerenkov.MaxNumPhotonsPerStep = 10 + cerenkov.MaxBetaChangePerStep = 10.0 + cerenkov.TrackSecondariesFirst = True + cerenkov.enableUI() + seq.adopt(cerenkov) + + ph = PhysicsList(kernel, 'Geant4OpticalPhotonPhysics/OpticalGammaPhys') + ph.addParticleConstructor('G4OpticalPhoton') + ph.VerboseLevel = 0 + ph.enableUI() + seq.adopt(ph) + + return None +if opticalPhysics: + SIM.physics.setupUserPhysics(setupCerenkovScint) + print ("Optical physics is ON !") +else: + print ("Optical physics is OFF !") + + # SIM.inputFiles = ['examples/wzp6_ee_ZZ_test_ecm240_1k.stdhep'] # SIM.outputFile = 'examples/wzp6_ee_ZZ_test_ecm240_n1_cut0_BEonly.root' SIM.numberOfEvents = 1 @@ -108,37 +140,6 @@ def setupEDM4hepOutputDR(dd4hepSimulation): 5101, 5103, 5503} SIM.physics.zeroTimePDGs = {17, 11, 13, 15} -def setupCerenkovScint(kernel): - from DDG4 import PhysicsList - seq = kernel.physicsList() - - scint = PhysicsList(kernel, 'Geant4ScintillationPhysics/ScintillationPhys') - scint.VerboseLevel = 0 - scint.TrackSecondariesFirst = True - scint.enableUI() - seq.adopt(scint) - - cerenkov = PhysicsList(kernel, 'Geant4CerenkovPhysics/CerenkovPhys') - cerenkov.VerboseLevel = 0 - cerenkov.MaxNumPhotonsPerStep = 10 - cerenkov.MaxBetaChangePerStep = 10.0 - cerenkov.TrackSecondariesFirst = True - cerenkov.enableUI() - seq.adopt(cerenkov) - - ph = PhysicsList(kernel, 'Geant4OpticalPhotonPhysics/OpticalGammaPhys') - ph.addParticleConstructor('G4OpticalPhoton') - ph.VerboseLevel = 0 - ph.enableUI() - seq.adopt(ph) - - return None -if opticalPhysics: - SIM.physics.setupUserPhysics(setupCerenkovScint) - print ("Optical physics is ON !") -else: - print ("Optical physics is OFF !") - SIM.random.enableEventSeed = False SIM.random.file = None SIM.random.luxury = 1