from Configurables import HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.DataInputs.hepmc.Path = "hepmc" from Configurables import SimG4Svc, SimG4GdmlTestDetector det = SimG4GdmlTestDetector("SimG4GdmlTestDetector", gdml="../data/TestBoxCaloSD.gdml") geantservice = SimG4Svc("SimG4Svc", detector=det, physicslist='SimG4TestPhysicsList', actions='SimG4FullSimActions') from Configurables import SimG4Alg, SimG4SaveTestCalHits savecaltool = SimG4SaveTestCalHits("saveECalHits") savecaltool.DataOutputs.caloClusters.Path = "caloClusters" savecaltool.DataOutputs.caloHits.Path = "caloHits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveTestCalHits/saveECalHits"]) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testCellId_gdml.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(TopAlg=[reader, hepmc_converter, hepmc_dump, geantsim, out], EvtSel='NONE', EvtMax=32, ExtSvc=[podiosvc, geantservice], OutputLevel=INFO)
inspecttool = InspectHitsCollectionsTool("inspect", readoutNames=["ECalHits"], OutputLevel = DEBUG) savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames = ["ECalHits"], OutputLevel = DEBUG) savecaltool.positionedCaloHits.Path = "positionedCaloHits" savecaltool.caloHits.Path = "caloHits" 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="ECalHitsReverseOrder", OutputLevel = DEBUG) # clusters are needed, with deposit position and cellID in bits resegment.inhits.Path = "positionedCaloHits" resegment.outhits.Path = "newCaloHits" from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testResegmentationXYZ.root") out.outputCommands = ["keep *"] ApplicationMgr(EvtSel='NONE', EvtMax=30, TopAlg=[reader, hepmc_converter, geantsim, resegment, out], ExtSvc = [podiosvc, geoservice, geantservice], OutputLevel=DEBUG)
nEtaWindow=windE, nPhiWindow=windP, nEtaPosition=posE, nPhiPosition=posP, nEtaDuplicates=dupE, nPhiDuplicates=dupP, nEtaFinal=finE, nPhiFinal=finP, energyThreshold=threshold, ellipse=True, OutputLevel=DEBUG) createClusters.clusters.Path = "CaloClusters" createClusters.clusterCells.Path = "CaloClusterCells" 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, rewriteECalEC, rewriteHCalEC,
# Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4PrimariesFromEdmTool savecaltool = SimG4SaveCalHits("saveCalHits", readoutNames=["ECalHits"]) savecaltool.DataOutputs.positionedCaloHits.Path = "positionedCaloHits" 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=["SimG4SaveCalHits/saveCalHits"], eventProvider=particle_converter) from Configurables import PodioOutput ## PODIO algorithm out = PodioOutput("out", filename="out_fast_calo_100GeV_fullpi.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[ # gen reader, hepmc_converter, geantsim, out ], EvtSel='NONE', EvtMax=1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[ podioevent, geoservice, geantservice # , ppservice
physicslist="SimG4FtfpBert", actions="SimG4FullSimActions", ) from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4PrimariesFromEdmTool savetrackertool = SimG4SaveTrackerHits( "SimG4SaveTrackerHits", readoutNames=["TrackerBarrelReadout", "TrackerEndcapReadout"]) savetrackertool.DataOutputs.positionedTrackHits.Path = "positionedHits" savetrackertool.DataOutputs.trackHits.Path = "hits" 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)
physicslisttool = SimG4UserLimitPhysicsList("Physics", fullphysics="SimG4FtfpBert") # attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", physicslist=physicslisttool, regions=[regiontool]) # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg, SimG4PrimariesFromEdmTool # 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", eventProvider=particle_converter) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", filename="out_geant_userLimits.root") out.outputCommands = ["keep *"] out.OutputLevel = DEBUG # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[gen, hepmc_converter, geantsim, out], EvtSel='NONE', EvtMax=10, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podioevent, geoservice, geantservice], OutputLevel=INFO)
oldReadoutName='ECalBarrelEta', oldSegmentationIds=['eta'], newReadoutName='ECalBarrelPhiEta') resegmentEcal.inhits.Path = "ECalBarrelPositions" resegmentEcal.outhits.Path = "ECalBarrelCells" createcellsEndcap = CreateCaloCells("CreateCaloCellsEndcap", doCellCalibration=True, calibTool=calibcellsEndcap, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcellsEndcap.hits.Path = "ECalEndcapHits" createcellsEndcap.cells.Path = "ECalEndcapCells" out = PodioOutput("out", filename="output_ecalInclinedWithEndcapDigi_test.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"] #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True createcellsBarrel.AuditExecute = True positionsEcalBarrel.AuditExecute = True resegmentEcal.AuditExecute = True createcellsEndcap.AuditExecute = True out.AuditExecute = True
pandoralg.ECalToHadGeVCalibrationBarrel = 1.12 #very small effect pandoralg.ECalToHadGeVCalibrationEndCap = 1.12 pandoralg.HCalToHadGeVCalibration = 1.07 pandoralg.MuonToMipCalibration = 10.0 pandoralg.DigitalMuonHits = 0 pandoralg.MaxHCalHitHadronicEnergy = 1.0 pandoralg.UseOldTrackStateCalculation = 0 pandoralg.AbsorberRadLengthECal = 0.2854 pandoralg.AbsorberIntLengthECal = 0.0101 pandoralg.AbsorberRadLengthHCal = 0.0569 pandoralg.AbsorberIntLengthHCal = 0.006 pandoralg.AbsorberRadLengthOther = 0.0569 pandoralg.AbsorberIntLengthOther = 0.006 ############################################################################## # write PODIO file from Configurables import PodioOutput write = PodioOutput("write") write.filename = "pan_test.root" write.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr(TopAlg=[read, pandoralg], EvtSel='NONE', EvtMax=10, ExtSvc=[dsvc, gearSvc], HistogramPersistency="ROOT", 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.positionedCaloHits.Path = "positionedCaloHits" savecaltool.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)
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_volumes.root") out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[reader, hepmc_converter, hepmc_dump, geantsim, out], EvtSel='NONE', EvtMax=100, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=INFO)
seed_tool.seedingLayerIndices2 = (0, 2) seed_tool.trackSeeds.Path = "trackSeeds" seed_tool.readoutName = "TrackerBarrelReadout" from Configurables import RecTrackAlg RecTrackAlg = RecTrackAlg() RecTrackAlg.TrackerPositionedHits.Path = "TrackerHitsPosition" # PODIO algorithm outputfile = "combiSeeding_Example.root" if args.outputfile: outputfile = args.outputfile from Configurables import PodioOutput out = PodioOutput("out", filename=outputfile, OutputLevel=DEBUG) out.outputCommands = ["keep *"] # get number of events from arguments nEvents = 2 if args.nevents: nEvents = args.nevents from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[podioinput, RecTrackAlg, out], EvtSel='NONE', EvtMax=nEvents, ExtSvc=[podioevent, geoservice], OutputLevel=DEBUG,
podioinput = PodioInput("PodioReader", collections=["HCalHits"], OutputLevel=DEBUG) from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', '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.hits.Path="HCalHits" createcells.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 MergeLayers merge = MergeLayers( "mergeLayers", # common part of the name of the group of volumes to merge volumeName="slice", # corresponding identifier in the readout for the volumes that should be merged identifier="z", # readout - bitfield description from the geometry service readout="ECalHits", # specify how many volumes to merge # if it is a constant number (e.g. merge every second volume with previous one), 'MergeCells' can be used # below: merge first 3k volumes into new one (id=0), next 10k into second one (id=1) and last 3k into third volume (id=2) merge=[3000, 10001, 3000], OutputLevel=DEBUG) merge.DataInputs.inhits.Path = "caloHits" merge.DataOutputs.outhits.Path = "newCaloHits" from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testMergeLayers.root") out.outputCommands = ["keep *"] ApplicationMgr(EvtSel='NONE', EvtMax=1, TopAlg=[gen, hepmc_converter, geantsim, merge, out], ExtSvc=[podiosvc, geoservice, geantservice, ppservice], OutputLevel=DEBUG)
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 )
outputs=[ "DelphesSaveChargedParticles/muons", "DelphesSaveChargedParticles/electrons", "DelphesSaveChargedParticles/charged", "DelphesSaveNeutralParticles/photons", "DelphesSaveNeutralParticles/neutral", "DelphesSaveGenJets/genJets", "DelphesSaveJets/jets", "DelphesSaveMet/met" ]) delphessim.DataInputs.hepmc.Path = "hepmc" delphessim.DataOutputs.genParticles.Path = "genParticles" delphessim.DataOutputs.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" #out.outputCommands = ["drop *", # "keep genParticles", # "keep genVertices", # "keep genJets", # "keep genJetsToMC"] out.outputCommands = ["keep *"] ############################################################ # # Run modules # ############################################################ # Run Pythia + Delphes
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_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 createTopoClusters.AuditExecute = True
particle_converter.DataInputs.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs = ["SimG4SaveSmearedParticles/saveSmearedParticles"], eventProvider=particle_converter) from Configurables import SimG4FastSimHistograms hist = SimG4FastSimHistograms("fastHist") hist.DataInputs.particles.Path = "smearedParticles" hist.DataInputs.particlesMCparticles.Path = "particleMCparticleAssociation" THistSvc().Output = ["rec DATAFILE='histTklayout.root' TYP='ROOT' OPT='RECREATE'"] THistSvc().PrintAll=True THistSvc().AutoSave=True THistSvc().AutoFlush=True THistSvc().OutputLevel=VERBOSE # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", filename = "out_fast_tklayout.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 )
# Translates EDM to G4Event, passes the event to G4, writes out outputs via tools from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4PrimariesFromEdmTool # first, create a tool that saves the tracker hits # 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 = [savetrackertool], eventProvider=particle_converter) # PODIO algorithm from Configurables import PodioOutput out = PodioOutput() out.outputCommands = ["keep *"] out.filename = "out_geant_fullsim.root" # ApplicationMgr 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=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, rewriteECalEC, rewriteHCalEC, positionsExtHcal, resegmentExtHcal, createEcalBarrelCells, createHcalBarrelCells, createEcalEndcapCells, createClusters, out
full.FTDSpacePoints = ftdspname full.SITRawHits = "NotNeedForPixelSIT" full.SETRawHits = sethitname full.FTDRawHits = ftdhitname full.TPCTracks = "ClupatraTracks" # add standalone TPC or DC track here full.SiTracks = "SubsetTracks" full.OutputTracks = "MarlinTrkTracks" full.SITHitToTrackDistance = 3. full.SETHitToTrackDistance = 5. #full.OutputLevel = DEBUG #TODO: more reconstruction, PFA etc. # output from Configurables import PodioOutput out = PodioOutput("outputalg") out.filename = "CRD_o1_v02-SimRec00.root" out.outputCommands = ["keep *"] # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( #TopAlg = [genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spSET, spFTD, digiDC, tracking, forward, subset, clupatra, full, out], TopAlg=[ genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spSET, spFTD, digiDC, tracking, forward, subset, full, out ], EvtSel='NONE', EvtMax=10, ExtSvc=[ rndmengine, rndmgensvc, dsvc, evtseeder, geosvc, gearsvc,
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
"InspectHitsCollectionsTool/inspect" ]) from Configurables import MergeCells merge = MergeCells( "mergeCells", # take the bitfield description from the geometry service readout="ECalHits", # cells in which field should be merged identifier="x", # how many cells to merge # for signed fields (segmentation cells) this needs to be odd to keep middle cell centred in 0 # for unsigned field (volumes) this may be any number merge=3, OutputLevel=DEBUG) merge.DataInputs.inhits.Path = "caloHits" merge.DataOutputs.outhits.Path = "newCaloHits" from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testMergeCells.root") out.outputCommands = ["keep *"] ApplicationMgr(EvtSel='NONE', EvtMax=30, TopAlg=[reader, hepmc_converter, geantsim, merge, out], ExtSvc=[podiosvc, geoservice, geantservice], OutputLevel=DEBUG)
gun.hepmc.Path = "hepmc" from Configurables import HepMCToEDMConverter hepmc_converter = HepMCToEDMConverter("Converter") hepmc_converter.hepmc.Path = "hepmc" hepmc_converter.genparticles.Path = "allGenParticles" hepmc_converter.genvertices.Path = "allGenVertices" histo = HepMCHistograms("GenHistograms") histo.hepmc.Path = "hepmc" THistSvc().Output = [ "rec DATAFILE='GenHistograms.root' TYP='ROOT' OPT='RECREATE'" ] THistSvc().PrintAll = True THistSvc().AutoSave = True THistSvc().AutoFlush = True THistSvc().OutputLevel = VERBOSE from Configurables import PodioOutput out = PodioOutput("out", filename="output_gen.root") out.outputCommands = ["keep *"] ApplicationMgr( TopAlg=[gun, dumper, writer, hepmc_converter, out], EvtSel='NONE', ExtSvc=[podioevent], EvtMax=1, OutputLevel=VERBOSE, SvcOptMapping=["Gaudi::ParticlePropertySvc/ParticlePropertySvc"])
from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4PrimariesFromEdmTool, InspectHitsCollectionsTool inspecttool = InspectHitsCollectionsTool("inspect", readoutNames=["Hits"], OutputLevel = DEBUG) saveParticletool = SimG4SaveCalHits("saveParticles", readoutNames = ["Hits"]) saveParticletool.positionedCaloHits.Path = "positionedCaloHits" saveParticletool.caloHits.Path = "caloHits" particle_converter = SimG4PrimariesFromEdmTool("EdmConverter") particle_converter.genParticles.Path = "allGenParticles" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveParticles", "InspectHitsCollectionsTool/inspect"], eventProvider=particle_converter) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", OutputLevel=DEBUG, filename="out_dd4hepStopParticleSD.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 )
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_flatNoise_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 out.AuditExecute = True ApplicationMgr(
towers.hcalBarrelCells.Path = "emptyCaloCells" towers.hcalExtBarrelCells.Path = "emptyCaloCells" towers.hcalEndcapCells.Path = "emptyCaloCells" towers.hcalFwdCells.Path = "emptyCaloCells" createclusters = CreateCaloClustersSlidingWindow("CreateCaloClusters", towerTool = towers, nEtaWindow = 7, nPhiWindow = 15, nEtaPosition = 5, nPhiPosition = 11, nEtaDuplicates = 5, nPhiDuplicates = 11, nEtaFinal = 7, nPhiFinal = 15, energyThreshold = 8, ) 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( TopAlg = [podioinput,
from Gaudi.Configuration import * from Configurables import ApplicationMgr ApplicationMgr().EvtSel = 'NONE' ApplicationMgr().EvtMax = 3 from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") podioevent.input = "http://fccsw.web.cern.ch/fccsw/testsamples/out_particle_gun.root" ApplicationMgr().ExtSvc += [podioevent] from Configurables import PodioInput podioinput = PodioInput("PodioReader") podioinput.collections = ["GenParticles"] podioinput.OutputLevel = DEBUG ApplicationMgr().TopAlg += [podioinput] from Configurables import PodioOutput out = PodioOutput("out") out.filename = "out_read_podio_input.root" out.OutputLevel = DEBUG out.outputCommands = ["keep *"] ApplicationMgr().TopAlg += [out]
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_dd4hepCaloSD_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)
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],
"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] )