saveecaltool.DataOutputs.caloHits.Path = "ECalHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") from Configurables import SimG4SingleParticleGeneratorTool pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName="e-",energyMin=energy,energyMax=energy,etaMin=-0.01,etaMax=0.01, OutputLevel =DEBUG) geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun, OutputLevel=DEBUG) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_ecalSim_e50GeV_eta0_10events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, out], EvtSel = 'NONE', EvtMax = num_events,
mergehits_barrel.positionedHits.Path = "positionedHits_barrel" mergehits_barrel.trackHits.Path = "trackHits_barrel" mergehits_barrel.mergedHits.Path = "merged_barrel" mergehits_endcap = MergeHits("MergeHitsEndcap", OutputLevel=INFO) mergehits_endcap.positionedHits.Path = "positionedHits_endcap" mergehits_endcap.trackHits.Path = "trackHits_endcap" mergehits_endcap.mergedHits.Path = "merged_endcap" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", filename=outfilename, OutputLevel=INFO) out.outputCommands = ["keep *", "keep GenParticles", "keep GenVertices" ] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [pythia8gen, hepmc_converter, genfilter, geantsim, mergehits_barrel, mergehits_endcap, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podioevent, geoservice, geantservice], OutputLevel=INFO )
OutputLevel=DEBUG) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc") from Configurables import SimG4Alg, SimG4SaveCalHits, InspectHitsCollectionsTool inspecttool = InspectHitsCollectionsTool("inspect", readoutNames=["ECalHits"], OutputLevel=DEBUG) savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames=["ECalHits"], OutputLevel=DEBUG) savecaltool.DataOutputs.positionedCaloHits.Path = "positionedCaloHits" savecaltool.DataOutputs.caloHits.Path = "caloHits" geantsim = SimG4Alg("SimG4Alg", outputs=[ "SimG4SaveCalHits/saveECalHits", "InspectHitsCollectionsTool/inspect" ]) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testPhiEtaSegmentation.root") out.outputCommands = ["keep *"] ApplicationMgr(EvtSel='NONE', EvtMax=1, TopAlg=[reader, hepmc_converter, geantsim, out], ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=DEBUG)
#savehcaltool = G4SaveCalHits("saveHCalHits", caloType = "HCal") #savehcaltool.DataOutputs.caloClusters.Path = "HCalClusters" #savehcaltool.DataOutputs.caloHits.Path = "HCalHits" saveecaltool = G4SaveCalHits("saveECalHits", caloType = "ECal") saveecaltool.DataOutputs.caloClusters.Path = "ECalClusters" saveecaltool.DataOutputs.caloHits.Path = "ECalHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") geantsim = G4SimAlg("G4SimAlg", outputs= [#"G4SaveCalHits/saveHCalHits", "G4SaveCalHits/saveECalHits"]) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=INFO) if CLUSTER==1: #otherwise use the generic name output.root for Grid runs out.filename = "e"+str(int(ENE/1e3))+"_part"+str(i)+".root" out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, out], EvtSel = 'NONE', EvtMax = EVTMAX, # order is important, as GeoSvc is needed by G4SimSvc ExtSvc = [podioevent, geoservice, geantservice], OutputLevel=INFO )
# Name of that tool in GAUDI is "XX/YY" where XX is the tool class name ("SimG4SaveTrackerHits") # and YY is the given name ("saveTrackerHits") savetrackertool = SimG4SaveTrackerHits( "saveTrackerHits", readoutNames=["TrackerBarrelReadout", "TrackerEndcapReadout"]) savetrackertool.positionedTrackHits.Path = "positionedHits" savetrackertool.trackHits.Path = "hits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveTrackerHits/saveTrackerHits"], eventProvider=particle_converter) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #out.filename = "tracker_with_field.root" out.filename = myFilePath.split('/')[-1].replace('.xml', '_hits.root') # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[gen, hepmc_converter, geantsim, out], EvtSel='NONE', EvtMax=5000, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[ppservice, podioevent, geoservice, geantservice], OutputLevel=DEBUG)
'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml' ], OutputLevel=INFO) from Configurables import CreateCaloCells createcells = CreateCaloCells("CreateCaloCells", doCellCalibration=False, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcells.DataInputs.hits.Path = "HCalHits" createcells.DataOutputs.cells.Path = "HCalCells" out = PodioOutput("out", filename="output_HCalCells_digitisation_noNoise.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True createcells.AuditExecute = True out.AuditExecute = True ApplicationMgr( TopAlg=[podioinput, createcells, out],
from Configurables import RewriteBitfield rewrite = RewriteBitfield("Rewrite", # old bitfield (readout) oldReadoutName = "EMECPhiEta", # specify which fields are going to be deleted removeIds = ["sublayer"], # new bitfield (readout), with new segmentation newReadoutName = "EMECPhiEtaReco", debugPrint = 10, OutputLevel = DEBUG) # clusters are needed, with deposit position and cellID in bits rewrite.inhits.Path = "caloHits" rewrite.outhits.Path = "caloRecoHits" # PODIO algorithm from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out") out.outputCommands = ["keep *"] out.filename = "rewrittenBitfield_ecalEndcapSim.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, rewrite, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by G4SimSvc ExtSvc = [podiosvc, geoservice, geantservice], OutputLevel=INFO)
particleName="e-", energyMin=50000, energyMax=50000, etaMin=2, etaMax=2) geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel=VERBOSE) positions.hits.Path = "caloHits" positions.positionedHits.Path = "caloPositions" # PODIO algorithm from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out") out.outputCommands = ["keep *"] out.filename = "positions_ecalEndcapSim.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[geantsim, positions, out], EvtSel='NONE', EvtMax=1, # order is important, as GeoSvc is needed by G4SimSvc ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=INFO)
particle_converter.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs = ["SimG4SaveTrackerHits/saveTrackerHits"], eventProvider=particle_converter) from Configurables import FastGaussSmearDigi fastdigi = FastGaussSmearDigi() fastdigi.trackHits.Path = "hits" fastdigi.smearedHits.Path = "smearedHits" fastdigi.readoutName = "TrackerBarrelReadout" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename="fastDigi_Example.root" from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [gen, hepmc_converter, geantsim, fastdigi, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podioevent, geoservice, geantservice,], OutputLevel=DEBUG )
volumeName = volumeName, # how many cells to merge merge = hcalFwdNumberOfLayersToMerge, OutputLevel = INFO) mergelayersHcalFwd.inhits.Path = "HCalFwdHits" mergelayersHcalFwd.outhits.Path = "mergedHCalFwdHits" createHcalFwdCells = CreateCaloCells("CreateHcalFwdCaloCells", doCellCalibration=True, calibTool=calibHcalFwd, addCellNoise=False, filterCellNoise=False, OutputLevel=INFO) createHcalFwdCells.hits.Path="mergedHCalFwdHits" createHcalFwdCells.cells.Path="HCalFwdCells" out = PodioOutput("out", OutputLevel=INFO) out.outputCommands = ["drop *", "keep ECalBarrelCells", "keep ECalEndcapCells", "keep ECalFwdCells", "keep HCalBarrelCells", "keep HCalBarrelPositions", "keep HCalExtBarrelCells", "keep HCalEndcapCells", "keep HCalFwdCells", "keep GenParticles","keep GenVertices"] out.filename = "output_fullCalo_SimAndDigi_pi50GeV_"+str(num_events)+"events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createEcalBarrelCellsStep1.AuditExecute = True positionsEcalBarrel.AuditExecute = True resegmentEcalBarrel.AuditExecute = True createEcalBarrelCells.AuditExecute = True createEcalEndcapCells.AuditExecute = True createEcalFwdCells.AuditExecute = True
from Gaudi.Configuration import * from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") from Configurables import CreateExampleEventData producer = CreateExampleEventData() producer.magicNumberOffset = 200 from Configurables import PodioOutput out = PodioOutput("out") out.filename = "dummyEventData3.root" out.outputCommands = ["keep *"] from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[producer, out], EvtSel="NONE", EvtMax=10, ExtSvc=[podioevent], OutputLevel=INFO, )
if simargs.geantinos: from Configurables import SimG4GeantinosFromEdmTool geantino_converter = SimG4GeantinosFromEdmTool() geantsim.eventProvider = geantino_converter else: geantsim.eventProvider = particle_converter # PODIO algorithm from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput podioevent = FCCDataSvc("EventDataSvc") out = PodioOutput("out") out.outputCommands = ["keep *"] out.filename = output_name #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True out.AuditExecute = True list_of_algorithms = [genalg, hepmc_converter, genfilter, geantsim, out]
'file:Detector/DetFCChhTrackerTkLayout/compact/Tracker.xml']) from Configurables import TrackingGeoSvc trkgeoservice = TrackingGeoSvc("TrackingGeometryService") from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") from Configurables import ExtrapolationTest exTest = ExtrapolationTest() exTest.positionedTrackHits.Path="positionedHits" from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = 'output_trkExtrapolationTest.root' from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [exTest, out], EvtSel = 'NONE', EvtMax = 1000, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podioevent, geoservice, geantservice, trkgeoservice, ], OutputLevel=DEBUG, )
particleName="e-", energyMin=energy, energyMax=energy, etaMin=-1.5, etaMax=1.5, OutputLevel=DEBUG) geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun, OutputLevel=DEBUG) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_ecalSim_e50GeV_" + str(num_events) + "events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(
delphessim.DataOutputs.electronsToMC.Path = "electronsToMC" delphessim.DataOutputs.electronsToITags.Path = "electronsToITags" delphessim.DataOutputs.chargedToMC.Path = "chargedToMC" delphessim.DataOutputs.neutralToMC.Path = "neutralToMC" delphessim.DataOutputs.photonsToMC.Path = "photonsToMC" delphessim.DataOutputs.photonsToITags.Path = "photonsToITags" delphessim.DataOutputs.jetsToParts.Path = "jetsToParts" delphessim.DataOutputs.jetsToFlavor.Path = "jetsToFlavor" delphessim.DataOutputs.jetsToBTags.Path = "jetsToBTags" delphessim.DataOutputs.jetsToCTags.Path = "jetsToCTags" delphessim.DataOutputs.jetsToTauTags.Path = "jetsToTauTags" ## FCC event-data model output -> define objects to be written out from Configurables import PodioOutput out = PodioOutput("out",OutputLevel=messageLevelOut) out.filename = "FCCDelphesOutput.root" #out.outputCommands = ["drop *", # "keep genParticles", # "keep genVertices", # "keep genJets", # "keep genJetsToMC"] out.outputCommands = ["keep *"] ############################################################ # # Run modules # ############################################################ # Run Pythia + Delphes
# Change INFO to DEBUG for printout of each deposit # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") from Configurables import SimG4SingleParticleGeneratorTool pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName="e-",energyMin=energy,energyMax=energy,etaMin=-0.36,etaMax=0.36, OutputLevel =DEBUG) geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveHCalHits"], eventProvider=pgun, OutputLevel=DEBUG) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_hcalSim_e"+str(int(energy/1000))+"GeV_eta036_1events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, out], EvtSel = 'NONE', EvtMax = num_events,
savetool = SimG4SaveCalHits("saveHits",readoutNames = ["ECalHitsEta"]) savetool.positionedCaloHits.Path = "PositionedHits" savetool.caloHits.Path = "Hits" geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveHits"], OutputLevel=DEBUG) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel = VERBOSE) positions.hits.Path = "Hits" positions.positionedHits.Path = "Positions" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "positions_ecalInclinedSim.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True positions.AuditExecute = True out.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [reader, hepmc_converter, hepmc_dump, geantsim, positions, out],
hepmc_converter2 = HepMCToEDMConverter("Converter2") hepmc_converter2.hepmc.Path="hepmc2" hepmc_converter2.genparticles.Path="pileupGenParticles" hepmc_converter2.genvertices.Path="pileupGenVertices" from Configurables import GenMerge mergealg = GenMerge() mergealg.pileupGenParticles.Path="pileupGenParticles" mergealg.pileupGenVertices.Path="pileupGenVertices" mergealg.signalGenParticles.Path="signalGenParticles" mergealg.signalGenVertices.Path="signalGenVertices" mergealg.allGenParticles.Path="allGenParticles" mergealg.allGenVertices.Path="allGenVertices" from Configurables import PodioOutput out = PodioOutput("out", filename = "output_gen.root") out.outputCommands = ["keep *", "drop pileupGenVertices", "drop pileupGenParticles", "drop signalGenVertices", "drop signalGenParticles"] ApplicationMgr( TopAlg=[gun1, gun2, hepmc_converter1, hepmc_converter2, mergealg, out], EvtSel='NONE', ExtSvc = [podioevent], EvtMax=1, OutputLevel=VERBOSE, )
"DelphesSaveMet/met"]) delphessim.hepmc.Path = "hepmc" delphessim.genParticles.Path = "skimmedGenParticles" delphessim.mcEventWeights.Path = "mcEventWeights" ### Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path="hepmc" hepmc_converter.genparticles.Path="genParticles" hepmc_converter.genvertices.Path="genVertices" ## FCC event-data model output -> define objects to be written out from Configurables import PodioOutput out = PodioOutput("out",OutputLevel=messageLevelOut) out.filename = "FCCDelphesOutput.root" if args.outputfile != '': out.filename = args.outputfile #out.outputCommands = ["drop *", # "keep genParticles", # "keep genVertices", # "keep genJets", # "keep genJetsToMC"] out.outputCommands = ["keep *", "drop genParticles", "drop genVertices"] ############################################################ # # Run modules #
[0.198] * 18 + [0.204] * 18 + [0.210] * 18 + [0.215] * 18, readoutName="ECalHitsEta", layerFieldName="layer") from Configurables import CreateCaloCells createcells = CreateCaloCells("CreateCaloCells", doCellCalibration=True, calibTool=calibcells, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcells.hits.Path = "ECalHits" createcells.cells.Path = "caloCells" out = PodioOutput("out", filename="output_ecalInclinedDigi_test.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createcells.AuditExecute = True out.AuditExecute = True ApplicationMgr( TopAlg=[geantsim, createcells, out], EvtSel='NONE',
savetrackertool.trackHits.Path = "hits" savehisttool = SimG4SaveParticleHistory("saveHistory") savehisttool.mcParticles.Path = "simParticles" savehisttool.genVertices.Path = "simVertices" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=[savetrackertool, savehisttool, ], eventProvider=particle_converter) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "tracker_with_field.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(TopAlg=[gen, hepmc_converter, geantsim, out], EvtSel='NONE', EvtMax=2, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podioevent, geoservice, geantservice], OutputLevel=DEBUG )
geoservice = GeoSvc( "GeoSvc", detectors=['file:Test/TestGeometry/data/TestBoxCaloSD_segmentation.xml']) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist='SimG4TestPhysicsList', actions='SimG4FullSimActions') from Configurables import SimG4Alg, SimG4SaveCalHits savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames=["ECalHits"]) savecaltool.positionedCaloHits.Path = "positionedCaloHits" savecaltool.caloHits.Path = "caloHits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"]) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testCellId_dd4hep.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[reader, hepmc_converter, hepmc_dump, geantsim, out], EvtSel='NONE', EvtMax=32, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=INFO)
pythiafile = "Generation/data/Pythia_standard.cmd" from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") from Configurables import PythiaInterface pythia8gen = PythiaInterface("Pythia8Interface", Filename=pythiafile) pythia8gen.DataOutputs.hepmc.Path = "hepmcevent" from Configurables import HepMCConverter hepmc_converter = HepMCConverter("Converter") hepmc_converter.DataInputs.hepmc.Path = "hepmcevent" hepmc_converter.DataOutputs.genparticles.Path = "allGenParticles" hepmc_converter.DataOutputs.genvertices.Path = "allGenVertices" from Configurables import PodioOutput ### PODIO algorithm out = PodioOutput("out", OutputLevel=DEBUG) out.filename = "pythia_test.root" out.outputCommands = ["keep *"] from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[pythia8gen, hepmc_converter, out], EvtSel="NONE", EvtMax=5, ExtSvc=[podioevent], OutputLevel=DEBUG )
savetool = SimG4SaveCalHits("saveHits", readoutNames=["ECalHitsEta"]) savetool.positionedCaloHits.Path = "PositionedHits" savetool.caloHits.Path = "Hits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveHits"], OutputLevel=DEBUG) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel=VERBOSE) positions.hits.Path = "Hits" positions.positionedHits.Path = "Positions" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "positions_ecalInclinedSim.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True positions.AuditExecute = True out.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(
activeVolumesNumber = 10, activeVolumesEta = [1.2524, 1.2234, 1.1956, 1.15609, 1.1189, 1.08397, 1.0509, 0.9999, 0.9534, 0.91072], OutputLevel= DEBUG) from Configurables import CreateCaloCells createcells = CreateCaloCells("CreateCaloCells", geometryTool = barrelHcalGeometry, calibTool=calibHcells, doCellCalibration = True, addCellNoise = True, filterCellNoise = False, noiseTool = noise, OutputLevel = DEBUG) createcells.hits.Path="HCalBarrelCellsStep1" createcells.cells.Path="HCalCells" out = PodioOutput("out", filename="output_HCalCells_digitisation_allCells.root", OutputLevel = DEBUG) out.outputCommands = ["keep *", "drop HCalBarrelCellsStep1"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True rewriteHCal.AuditExecute = True createcells.AuditExecute = True out.AuditExecute = True ApplicationMgr( TopAlg = [podioinput, rewriteHCal,
# attach those tools to the G4 service from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc") geantservice.physicslist = physicslisttool geantservice.regions = [regiontool] ApplicationMgr().ExtSvc += [geantservice] # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") geantsim = SimG4Alg("SimG4Alg") from Configurables import SimG4PrimariesFromEdmTool geantsim.eventProvider = SimG4PrimariesFromEdmTool("EdmConverter") geantsim.eventProvider.GenParticles.Path = "GenParticles" ApplicationMgr().TopAlg += [geantsim] #todo: add savetools? # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out") out.filename = "out_geant_fullsim_userlimits.root" out.outputCommands = ["keep *"] out.OutputLevel = DEBUG ApplicationMgr().TopAlg += [out]
# next, create the G4 algorithm, giving the list of names of tools ("XX/YY") from Configurables import SimG4SingleParticleGeneratorTool pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName="e-",energyMin=ENE,energyMax=ENE,etaMin=-0.01,etaMax=0.01, OutputLevel =INFO) #Following lines do not work, no idea why: #pgun.DataOutputs.genParticles.Path = "genParticles" #pgun.DataOutputs.genVertices.Path="genVertices" geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=INFO) out.outputCommands = ["keep *"] out.filename = "output.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, out], EvtSel = 'NONE', EvtMax = EVTMAX,
calibcells = CalibrateInLayersTool("Calibrate", # sampling fraction obtained using SamplingFractionInLayers from DetStudies package samplingFraction = [0.168] * 4 + [0.176] * 4 + [0.184] * 4 + [0.191] * 4 + [0.198] * 4 + [0.204] * 4 + [0.210] * 4 + [0.215] * 4, readoutName = "ECalHitsEta", layerFieldName = "cell") from Configurables import CreateCaloCells createcells = CreateCaloCells("CreateCaloCells", doCellCalibration=True, calibTool=calibcells, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcells.hits.Path="ECalHits" createcells.cells.Path="caloCells" out = PodioOutput("out", filename="output_ecalInclinedDigi_test.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createcells.AuditExecute = True out.AuditExecute = True ApplicationMgr( TopAlg = [geantsim, createcells, out
pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName = "mu-", energyMin = 1000, energyMax = 1000, etaMin = 0, etaMax = 0, OutputLevel = DEBUG) geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveTrackerHits/saveHits"], eventProvider = pgun, OutputLevel=DEBUG) from Configurables import CreateVolumeTrackPositions positions = CreateVolumeTrackPositions("positions", OutputLevel = VERBOSE) positions.hits.Path = "Hits" positions.positionedHits.Path = "Positions" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "positions_trackerSim.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True positions.AuditExecute = True out.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, positions, out],
geantsim = SimG4Alg("SimG4Alg", outputs=[ "SimG4SaveCalHits/saveECalHits", "InspectHitsCollectionsTool/inspect" ]) from Configurables import RedoSegmentation resegment = RedoSegmentation( "ReSegmentation", # old bitfield (readout) oldReadoutName="ECalHits", # specify which fields are going to be deleted oldSegmentationIds=["x", "y", "z"], # new bitfield (readout), with new segmentation newReadoutName="ECalHitsPhiEta", OutputLevel=DEBUG) # clusters are needed, with deposit position and cellID in bits resegment.DataInputs.inhits.Path = "positionedCaloHits" resegment.DataOutputs.outhits.Path = "newCaloHits" from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testResegmentationRPhi.root") out.outputCommands = ["keep *"] ApplicationMgr(EvtSel='NONE', EvtMax=30, TopAlg=[reader, hepmc_converter, geantsim, resegment, out], ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=DEBUG)
from Configurables import SimG4SaveCalHits savehcaltool = SimG4SaveCalHits("saveHCalHits", readoutNames = ["HCalBarrelReadout"]) savehcaltool.positionedCaloHits.Path = "HCalBarrelPositionedHits" savehcaltool.caloHits.Path = "HCalBarrelHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") g4pconverter = SimG4GeantinosFromEdmTool() geantsim = SimG4Alg("SimG4Alg", outputs= [savehcaltool, savetrajectorytool], eventProvider=g4pconverter) ## ouput from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=INFO) out.outputCommands = ["keep *"] out.filename = 'output_hcal_geantscan.root' from Configurables import ChronoAuditor chronoauditor = ChronoAuditor() from Configurables import MemStatAuditor memauditor = MemStatAuditor() from Configurables import MemoryAuditor memauditor2 = MemoryAuditor() from Configurables import AuditorSvc auditorsvc_handle = AuditorSvc() auditorsvc_handle.Auditors = [ chronoauditor, memauditor, memauditor2, ]
# how many cells to merge merge=hcalFwdNumberOfLayersToMerge, OutputLevel=INFO) mergelayersHcalFwd.inhits.Path = "HCalFwdHits" mergelayersHcalFwd.outhits.Path = "mergedHCalFwdHits" createHcalFwdCells = CreateCaloCells("CreateHcalFwdCaloCells", doCellCalibration=True, calibTool=calibHcalFwd, addCellNoise=False, filterCellNoise=False, OutputLevel=INFO) createHcalFwdCells.hits.Path = "mergedHCalFwdHits" createHcalFwdCells.cells.Path = "HCalFwdCells" out = PodioOutput("out", OutputLevel=INFO) out.outputCommands = [ "drop *", "keep ECalBarrelCells", "keep ECalEndcapCells", "keep ECalFwdCells", "keep HCalBarrelCells", "keep HCalExtBarrelCells", "keep HCalEndcapCells", "keep HCalFwdCells", "keep GenParticles", "keep GenVertices" ] out.filename = "output_fullCalo_SimAndDigi_e50GeV_" + str( num_events) + "events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True
#Fill a collection of CaloHitPositions for detailed Cluster analysis from Configurables import CreateCaloCellPositions positionsClusterBarrel =CreateCaloCellPositions("positionsClusterBarrel", positionsECalBarrelTool = ECalBcells, positionsHCalBarrelTool = HCalBcells, positionsHCalExtBarrelTool = HCalExtBcells, positionsEMECTool = EMECcells, positionsHECTool = HECcells, positionsEMFwdTool = ECalFwdcells, positionsHFwdTool = HCalFwdcells, hits = "caloClusterBarrelCells", positionedHits = "caloClusterBarrelCellPositions", OutputLevel = INFO) out = PodioOutput("out", filename = "output_BarrelTopo_electrNoise_50GeVe_3ev.root", OutputLevel = DEBUG) out.outputCommands =["drop *", "keep GenParticles", "keep GenVertices", "keep caloClustersBarrel","keep caloClusterBarrelCells", "keep caloClusterBarrelCellPositions"] #CPU information from Configurables import AuditorSvc,ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors =[chra] podioinput.AuditExecute = True createemptycells.AuditExecute =True createEcalBarrelCells.AuditExecute = True createHcalBarrelCells.AuditExecute =True createTopoClusters.AuditExecute = True positionsClusterBarrel.AuditExecute = True ApplicationMgr(TopAlg =
createclusters = CreateCaloClustersSlidingWindow("CreateCaloClusters", towerTool=towers, nEtaWindow=7, nPhiWindow=15, nEtaPosition=5, nPhiPosition=11, nEtaDuplicates=5, nPhiDuplicates=11, nEtaFinal=7, nPhiFinal=15, energyThreshold=8, OutputLevel=DEBUG) createclusters.clusters.Path = "caloClusters" out = PodioOutput("output", filename="output_ecalReco_noiseFromFile_test.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True createclusters.AuditExecute = True createcells.AuditExecute = True mergelayers.AuditExecute = True out.AuditExecute = True ApplicationMgr(
hits="ECalBarrelCellsStep2", cells="ECalBarrelCells") # Create cells in HCal # 1. step - merge hits into cells with the default readout createHcalBarrelCells = CreateCaloCells("CreateHCaloCells", doCellCalibration=True, calibTool=calibHcells, addCellNoise = False, filterCellNoise = False, OutputLevel = INFO, hits="HCalBarrelHits", cells="HCalBarrelCells") ################ Output from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=INFO) #Save information about generated particles & calorimeter cells, drop G4 hits and the intermediate steps #out.outputCommands = ["drop *", "keep ECalBarrelCells", "keep HCalBarrelCells", "keep GenParticles","keep GenVertices"] #Save all out.outputCommands = ["keep *"] import uuid out.filename = "output_fullCalo_SimAndDigi_"+str(momentum)+"GeV_"+uuid.uuid4().hex+".root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] genalg_pgun.AuditExecute = True hepmc_converter.AuditExecute = True
overlay.randomizePileup = False overlay.mergeTools = ["PileupParticlesMergeTool/MyPileupParticlesMergeTool", "PileupTrackHitMergeTool/MyTrackHitsMergeTool"] overlay.PileUpTool = pileuptool from Configurables import CreateExampleEventData producer = CreateExampleEventData() producer.magicNumberOffset = 300 producer.trackhits.Path = "trackHits" producer.positionedtrackhits.Path = "positionedTrackHits" producer.calohits.Path = "caloHits" producer.positionedcalohits.Path = "positionedCaloHits" producer.genparticles.Path = "genParticles" producer.genvertices.Path = "genVertices" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["drop *", "keep overlaid*"] out.filename = "dummyEventDataOverlaid.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[producer, overlay, out], EvtSel='NONE', EvtMax=300, ExtSvc=[podioevent,], OutputLevel=DEBUG, )
from Configurables import DetSimAlg detsimalg = DetSimAlg("DetSimAlg") detsimalg.RandomSeeds = seed # detsimalg.VisMacs = ["vis.mac"] detsimalg.RunCmds = [ # "/tracking/verbose 1", ] detsimalg.AnaElems = [ # example_anatool.name() # "ExampleAnaElemTool", "Edm4hepWriterAnaElemTool" ] detsimalg.RootDetElem = "WorldDetElemTool" # output from Configurables import PodioOutput out = PodioOutput("outputalg") out.filename = "CRD-oi-v0j-Sim00.root" out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [genalg, detsimalg, out], EvtSel = 'NONE', EvtMax = 100, ExtSvc = [rndmengine, rndmgensvc, dsvc, geosvc], OutputLevel=INFO )
driftchamber_sensdettool.DedxSimTool = dedxoption from Configurables import DummyDedxSimTool from Configurables import BetheBlochEquationDedxSimTool if dedxoption == "DummyDedxSimTool": dedx_simtool = DummyDedxSimTool("DummyDedxSimTool") elif dedxoption == "BetheBlochEquationDedxSimTool": dedx_simtool = BetheBlochEquationDedxSimTool( "BetheBlochEquationDedxSimTool") ############################################################################## # POD I/O ############################################################################## from Configurables import PodioOutput out = PodioOutput("outputalg") out.filename = "test-detsim10.root" out.outputCommands = ["keep *"] ############################################################################## # ApplicationMgr ############################################################################## from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[genalg, detsimalg, out], EvtSel='NONE', EvtMax=10, ExtSvc=[rndmengine, dsvc, geosvc], )
from Gaudi.Configuration import * from Configurables import k4DataSvc podioevent = k4DataSvc("EventDataSvc") from Configurables import k4FWCoreTest_cellID_writer, k4FWCoreTest_cellID_reader producer = k4FWCoreTest_cellID_writer() consumer = k4FWCoreTest_cellID_reader() from Configurables import PodioOutput out = PodioOutput("out") out.filename = "output_k4test_exampledata_cellid.root" out.outputCommands = ["keep *"] from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[producer, consumer, out], EvtSel="NONE", EvtMax=10, ExtSvc=[podioevent], OutputLevel=INFO, StopOnSignal=True, )
from fcc_gen_config import * from fcc_det_config import * from fcc_sim_config import * from fcc_sim_config_with_calo import * # PODIO algorithm from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") from Configurables import PodioOutput out = PodioOutput("out") out.filename = "output.root" out.outputCommands = [ "keep *", ] list_of_algorithms = [ genalg_pgun, hepmc_converter, genfilter, geantsim, out, ] list_of_services = [ podioevent, geoservice, geantservice, ]
# and a tool that saves the calorimeter hits from Configurables import SimG4Alg, SimG4SaveCalHits savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames = ["EMECPhiEta"]) savecaltool.positionedCaloHits.Path = "positionedCaloHits" savecaltool.caloHits.Path = "caloHits" from Configurables import SimG4SingleParticleGeneratorTool pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName="e-",energyMin=50000,energyMax=50000,etaMin=-2,etaMax=-2) geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel = VERBOSE) positions.hits.Path = "caloHits" positions.positionedHits.Path = "caloPositions" # PODIO algorithm from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out") out.outputCommands = ["keep *"] out.filename = "positions_ecalNegativeEndcapSim.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, positions, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by G4SimSvc ExtSvc = [podiosvc, geoservice, geantservice], OutputLevel=INFO)
# clusters are needed, with deposit position and cellID in bits positions2 = CreateVolumeCaloPositions("positions2", OutputLevel=VERBOSE) positions2.hits.Path = "newHCalCells" positions2.positionedHits.Path = "newHCalPositions" positionsExt2 = CreateVolumeCaloPositions("positionsExt2", OutputLevel=VERBOSE) positionsExt2.hits.Path = "newExtHCalCells" positionsExt2.positionedHits.Path = "newExtHCalPositions" # Ecal cell positions positionsEcal = CreateVolumeCaloPositions("positionsEcal", OutputLevel=VERBOSE) positionsEcal.hits.Path = "ECalBarrelCells" positionsEcal.positionedHits.Path = "ECalBarrelPositions" out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_combCalo_" + str(particleType) + str(int( energy / GeV)) + "GeV.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createEcells.AuditExecute = True createHcells.AuditExecute = True createExtHcells.AuditExecute = True positions.AuditExecute = True positionsExt.AuditExecute = True
actions="SimG4FullSimActions", ) from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4PrimariesFromEdmTool savetrackertool = SimG4SaveTrackerHits( "SimG4SaveTrackerHits", readoutNames=["TrackerBarrelReadout", "TrackerEndcapReadout"]) savetrackertool.DataOutputs.trackClusters.Path = "clusters" savetrackertool.DataOutputs.trackHits.Path = "hits" savetrackertool.DataOutputs.trackHitsClusters.Path = "hitClusterAssociation" particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.DataInputs.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveTrackerHits/SimG4SaveTrackerHits"], eventProvider=particle_converter) from Configurables import PodioOutput out = PodioOutput("out", filename="out_full_moreEvents.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] ApplicationMgr( TopAlg=[reader, hepmc_converter, geantsim, out], EvtSel='NONE', EvtMax=10, ## order! geo needed by geant ExtSvc=[podioevent, geoservice, geantservice], OutputLevel=DEBUG)
"SimG4SaveTrackerHits/saveTrackerHits_Endcap", #, SimG4SaveTrackerHits/saveTrackerHits_DCH" "SimG4SaveTrackerHits/saveTrackerHits_IT_Barrel", "SimG4SaveTrackerHits/saveTrackerHits_IT_Endcap", "SimG4SaveTrackerHits/saveTrackerHits_OT_Barrel", "SimG4SaveTrackerHits/saveTrackerHits_OT_Endcap", "SimG4SaveCalHits/saveLumicalHits", "SimG4SaveCalHits/saveEcalBarrelHits", "SimG4SaveCalHits/saveEcalEndcapHits", "SimG4SaveCalHits/saveHcalBarrelHits", "SimG4SaveCalHits/saveHcalEndcapHits" ], eventProvider=particle_converter) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", filename=outfilename, OutputLevel=DEBUG) out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [reader, geantsim, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podioevent, geoservice, geantservice], OutputLevel=DEBUG )
debugPrint = 10, OutputLevel = DEBUG, inhits = "HCalPositions", outhits = "newHCalCells") # clusters are needed, with deposit position and cellID in bits positions2 = CreateVolumeCaloPositions("positions2", OutputLevel = VERBOSE) positions2.hits.Path = "newHCalCells" positions2.positionedHits.Path = "newHCalPositions" # Ecal cell positions positionsEcal = CreateVolumeCaloPositions("positionsEcal", OutputLevel = VERBOSE) positionsEcal.hits.Path = "ECalCells" positionsEcal.positionedHits.Path = "ECalPositions" out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_combCalo_"+str(particleType)+str(int(energy/GeV))+"GeV.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createEcells.AuditExecute = True createHcells.AuditExecute = True positions.AuditExecute = True resegment.AuditExecute = True positions2.AuditExecute = True out.AuditExecute = True
readoutNames=["TrackerSiliconHits"]) savetrackertool.DataOutputs.trackClusters.Path = "clusters" savetrackertool.DataOutputs.trackHits.Path = "hits" savetrackertool.DataOutputs.trackHitsClusters.Path = "hitClusterAssociation" particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.DataInputs.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=[ "SimG4SaveTrackerHits/SimG4SaveTrackerHits", "InspectHitsCollectionsTool" ], eventProvider=particle_converter) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", OutputLevel=DEBUG, filename="out_dd4hepTrackerSD_2cm.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[gen, hepmc_converter, hepmc_dump, geantsim, out], EvtSel='NONE', EvtMax=1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podiosvc, ppservice, geoservice, geantservice], OutputLevel=DEBUG)
#Fill a collection of CaloHitPositions for detailed Cluster analysis from Configurables import CreateCaloCellPositions positionsClusterBarrel =CreateCaloCellPositions("positionsClusterBarrel", positionsECalBarrelTool = ECalBcells, positionsHCalBarrelTool = HCalBcells, positionsHCalExtBarrelTool = HCalExtBcells, positionsEMECTool = EMECcells, positionsHECTool = HECcells, positionsEMFwdTool = ECalFwdcells, positionsHFwdTool = HCalFwdcells, hits = "splitCaloClusterCells", positionedHits = "caloClusterBarrelCellPositions", OutputLevel = INFO) out = PodioOutput("out", filename = "output_BarrelTopo_electrNoise_fullGran_100GeVpi_3ev.root", OutputLevel = DEBUG) out.outputCommands =["keep *"] #CPU information from Configurables import AuditorSvc,ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors =[chra] podioinput.AuditExecute = True createemptycells.AuditExecute =True createEcalBarrelCells.AuditExecute = True createHcalBarrelCells.AuditExecute =True createTopoClusters.AuditExecute = True positionsClusterBarrel.AuditExecute = True ApplicationMgr(TopAlg =
detsimalg.RunCmds = [ # "/tracking/verbose 1", ] detsimalg.AnaElems = [ # example_anatool.name() # "ExampleAnaElemTool", "Edm4hepWriterAnaElemTool" ] detsimalg.RootDetElem = "WorldDetElemTool" from Configurables import CalorimeterSensDetTool cal_sensdettool = CalorimeterSensDetTool("CalorimeterSensDetTool") cal_sensdettool.CalNamesApplyBirks = ["EcalBarrel"] # output from Configurables import PodioOutput out = PodioOutput("outputalg") out.filename = "RCEcalSim00.root" out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(TopAlg=[genalg, detsimalg, out], EvtSel='NONE', EvtMax=10, ExtSvc=[rndmengine, rndmgensvc, dsvc, geosvc], OutputLevel=INFO)
physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4PrimariesFromEdmTool savehcaltool = SimG4SaveCalHits("saveECalHits", readoutNames = ["ECalHits"]) savehcaltool.DataOutputs.caloClusters.Path = "caloClusters" savehcaltool.DataOutputs.caloHits.Path = "caloHits" particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.DataInputs.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits", "InspectHitsCollectionsTool"], eventProvider=particle_converter) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", OutputLevel=DEBUG, filename="out_simpleCaloSD_2cm.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [gen, hepmc_converter, hepmc_dump, geantsim, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podiosvc, ppservice, geoservice, geantservice], OutputLevel=DEBUG )
threshold = 12 createClusters = CreateCaloClustersSlidingWindow("CreateClusters", towerTool=towers, nEtaWindow=windE, nPhiWindow=windP, nEtaPosition=posE, nPhiPosition=posP, nEtaDuplicates=dupE, nPhiDuplicates=dupP, nEtaFinal=finE, nPhiFinal=finP, energyThreshold=threshold) createClusters.clusters.Path = "CaloClusters" out = PodioOutput("out", filename="output_allCalo_reco_noise.root") out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True createClusters.AuditExecute = True out.AuditExecute = True ApplicationMgr(TopAlg=[ podioinput, createEcalBarrelCells, createEcalEndcapCells, createClusters, out ],
gun = GenAlg('ParticleGunAlg', SignalProvider=guntool) gun.hepmc.Path = "hepmcevent" ### Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path="hepmcevent" hepmc_converter.genparticles.Path="GenParticle" hepmc_converter.genvertices.Path="Genvertex" # from CMS_detector_cfg import detservice from SCTau_detector_cfg import detservice from papas_cfg import papasalg #output fcc particles to root # out = PodioOutput("out", OutputLevel=INFO) out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] ApplicationMgr( ## all algorithms should be put here TopAlg=[gun, hepmc_converter, papasalg, out], EvtSel='NONE', ## number of events EvtMax=100000, ## all services should be put here ExtSvc = [podioevent, detservice, particlePropertySvc], OutputLevel = DEBUG, SvcOptMapping = ["Gaudi::ParticlePropertySvc/ParticlePropertySvc"] )
createClusters = CreateCaloClustersSlidingWindow("CreateClusters", towerTool=towers, nEtaWindow=windE, nPhiWindow=windP, nEtaPosition=posE, nPhiPosition=posP, nEtaDuplicates=dupE, nPhiDuplicates=dupP, nEtaFinal=finE, nPhiFinal=finP, energyThreshold=threshold, OutputLevel=DEBUG) createClusters.clusters.Path = "CaloClusters" out = PodioOutput("out", filename="output_allCalo_reco.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True createClusters.AuditExecute = True out.AuditExecute = True ApplicationMgr( TopAlg=[podioinput, rewriteHcal, rewriteExtHcal, createClusters, out],
saveecaltool.caloHits.Path = "ECalHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") from Configurables import SimG4SingleParticleGeneratorTool pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True, particleName="e-",energyMin=100000,energyMax=100000,etaMin=2.,etaMax=2, OutputLevel =DEBUG) geantsim = SimG4Alg("SimG4Alg", outputs= ["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun, OutputLevel=DEBUG) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_ecalSim_endcap_e100GeV_5events.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [geantsim, out], EvtSel = 'NONE', EvtMax = 5,
positionsTool=HECcells, hits = "HCalEndcapCells", positionedHits = "HCalEndcapCellPositions", OutputLevel = INFO) positionsEcalFwd = CreateCellPositions("positionsEcalFwd", positionsTool=ECalFwdcells, hits = "ECalFwdCells", positionedHits = "ECalFwdCellPositions", OutputLevel = INFO) positionsHcalFwd = CreateCellPositions("positionsHcalFwd", positionsTool=HCalFwdcells, hits = "HCalFwdCells", positionedHits = "HCalFwdCellPositions", OutputLevel = INFO) out = PodioOutput("out", OutputLevel=DEBUG) out.filename = "digi_cellPositions_50GeVelectrons.root" out.outputCommands = ["keep *","drop ECalBarrelCells","drop ECalEndcapCells","drop ECalFwdCells","drop HCalBarrelCells", "drop HCalExtBarrelCells", "drop HCalEndcapCells", "drop HCalFwdCells"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] podioinput.AuditExecute = True positionsEcalBarrel.AuditExecute = True positionsEcalEndcap.AuditExecute = True positionsEcalFwd.AuditExecute = True positionsHcalBarrel.AuditExecute = True positionsHcalExtBarrel.AuditExecute = True positionsHcalEndcap.AuditExecute = True
saveendcaptool = SimG4SaveCalHits("saveECalEndcapHits", readoutNames = ["EMECPhiEta"]) saveendcaptool.positionedCaloHits.Path = "ECalEndcapPositionedHits" saveendcaptool.caloHits.Path = "ECalEndcapHits" savefwdtool = SimG4SaveCalHits("saveECalFwdHits", readoutNames = ["EMFwdPhiEta"]) savefwdtool.positionedCaloHits.Path = "ECalFwdPositionedHits" savefwdtool.caloHits.Path = "ECalFwdHits" savehcaltool = SimG4SaveCalHits("saveHCalHits", readoutNames = ["HCalBarrelReadout"]) savehcaltool.positionedCaloHits.Path = "HCalBarrelPositionedHits" savehcaltool.caloHits.Path = "HCalBarrelHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs = ["SimG4SaveTrackerHits/saveTrackerHits", "SimG4SaveCalHits/saveECalBarrelHits", "SimG4SaveCalHits/saveECalEndcapHits", "SimG4SaveCalHits/saveECalFwdHits", "SimG4SaveCalHits/saveHCalHits"], eventProvider=particle_converter) from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "output_geant_pgun_fullsim.root" from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[gen, hepmc_converter, geantsim, out], EvtSel='NONE', EvtMax=1, ## order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podioevent, geoservice, geantservice], OutputLevel=INFO )
"Leakages" ], OutputLevel = DEBUG ) from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors = [ 'file:share/compact/DRcalo.xml' ] ) from Configurables import DRcalib2D calib2d = DRcalib2D("DRcalib2D", OutputLevel=DEBUG) from Configurables import PodioOutput podiooutput = PodioOutput("PodioOutput", filename = "reco.root", OutputLevel = DEBUG) podiooutput.outputCommands = ["keep *"] ApplicationMgr( TopAlg = [ podioinput, calib2d, podiooutput ], EvtSel = 'NONE', EvtMax = 10, ExtSvc = [dataservice, geoservice] )
savecaltool.DataOutputs.caloHits.Path = "caloHits" # next, create the G4 algorithm, giving the list of names of tools ("XX/YY") particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.DataInputs.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs = ["SimG4SaveSmearedParticles/saveSmearedParticles", "SimG4SaveCalHits/saveCalHits"], eventProvider=particle_converter) from Configurables import SimG4FastSimHistograms hist = SimG4FastSimHistograms("fastHist") hist.DataInputs.particlesMCparticles.Path = "particleMCparticleAssociation" THistSvc().Output = ["rec DATAFILE='histFormula.root' TYP='ROOT' OPT='RECREATE'"] THistSvc().PrintAll=True THistSvc().AutoSave=True THistSvc().AutoFlush=True THistSvc().OutputLevel=INFO from Configurables import PodioOutput ## PODIO algorithm out = PodioOutput("out", filename = "out_fast_tracker_formula_calo_gflash.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [reader, hepmc_converter, geantsim, hist, out], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [podioevent, geoservice, geantservice], OutputLevel=INFO)
delphessim.DataOutputs.recCharged.Path = "recCharged" delphessim.DataOutputs.recNeutral.Path = "recNeutral" delphessim.DataOutputs.recPhotons.Path = "recPhotons" delphessim.DataOutputs.recJets.Path = "recJets" delphessim.DataOutputs.recMETs.Path = "recMETs" delphessim.DataOutputs.recMuonsToMC.Path = "recMuonsToMC" delphessim.DataOutputs.recElectronsToMC.Path = "recElectronsToMC" delphessim.DataOutputs.recChargedToMC.Path = "recChargedToMC" delphessim.DataOutputs.recNeutralToMC.Path = "recNeutralToMC" delphessim.DataOutputs.recPhotonsToMC.Path = "recPhotonsToMC" delphessim.DataOutputs.recJetsToMC.Path = "recJetsToMC" ## FCC event-data model output -> define objects to be written out from Configurables import PodioOutput out = PodioOutput("out",OutputLevel=messageLevelOut) out.filename = "FCCDelphesOutput.root" out.outputCommands = ["drop *", "keep genParticles", "keep genVertices", "keep recMuons", "keep recElectrons", "keep recCharged", "keep recPhotons", "keep recJets", "keep recMETs", "keep recMuonsToMC", "keep recElectronsToMC", "keep recChargedToMC", "keep recPhotonsToMC", "keep recJetsToMC"]