예제 #1
0
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]
예제 #2
0
# 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)
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,
                # order is important, as GeoSvc is needed by G4SimSvc
                ExtSvc = [podioevent, geoservice, geantservice, audsvc],
# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4Svc
# giving the names of tools will initialize the tools of that type
geantservice = SimG4Svc("SimG4Svc")
geantservice.detector =     "SimG4DD4hepDetector"
geantservice.physicslist =  "SimG4FtfpBert"
geantservice.actions =      "SimG4FullSimActions"
ApplicationMgr().ExtSvc += [geantservice]

# Geant4 algorithm
# save tools are set up alongside the geoservice
from Configurables import SimG4Alg
geantsim = SimG4Alg("SimG4Alg")
from Configurables import SimG4SaveTrackerHits
from Configurables import SimG4PrimariesFromEdmTool
geantsim.eventProvider = SimG4PrimariesFromEdmTool("EdmConverter")
geantsim.eventProvider.GenParticles.Path = "GenParticles"
ApplicationMgr().TopAlg += [geantsim]

# PODIO algorithm
from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "out_geant_fullsim_fccee_cld_hepevt.root"
out.OutputLevel = DEBUG
out.outputCommands = ["keep *"]
ApplicationMgr().TopAlg += [out]


예제 #5
0
    "rec DATAFILE='histSF_fccee_inclined_e50GeV_eta0_1events.root' TYP='ROOT' OPT='RECREATE'"
]
THistSvc().PrintAll = True
THistSvc().AutoSave = True
THistSvc().AutoFlush = False
THistSvc().OutputLevel = INFO

#CPU information
from Configurables import AuditorSvc, ChronoAuditor
chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]
geantsim.AuditExecute = True
hist.AuditExecute = True

from Configurables import PodioOutput
### PODIO algorithm
out = PodioOutput("out", OutputLevel=DEBUG)
out.outputCommands = ["keep *"]
out.filename = "fccee_samplingFraction_inclinedEcal.root"

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr(
    TopAlg=[geantsim, hist, out],
    EvtSel='NONE',
    EvtMax=70,
    # order is important, as GeoSvc is needed by G4SimSvc
    ExtSvc=[podioevent, geoservice, geantservice, audsvc],
    OutputLevel=DEBUG)
예제 #6
0
# 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
 )
예제 #7
0
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
 )
예제 #8
0
# 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]

예제 #9
0
  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]

ApplicationMgr(
    TopAlg = list_of_algorithms,
    EvtSel = 'NONE',
예제 #10
0
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,
                )


예제 #11
0
  '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,
 )
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_hcaldetailedwedge_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, ]

예제 #13
0
# algorithm for the overlay
from Configurables import PileupOverlayAlg
overlay = PileupOverlayAlg()
overlay.pileupFilenames = pileupFilenames
overlay.randomizePileup = False
overlay.mergeTools = ["PileupParticlesMergeTool/MyPileupParticlesMergeTool",
  "PileupTrackHitMergeTool/MyTrackHitMergeTool"]
overlay.PileUpTool = pileuptool






# PODIO algorithm
from Configurables import PodioOutput
out = PodioOutput("out",
                   OutputLevel=DEBUG)
out.outputCommands = ["keep *"]
out.filename = "output_overlaid_with_pileup.root"

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr( TopAlg=[podioinput, overlay, out],
                EvtSel='NONE',
                EvtMax=1,
                ExtSvc=[podioevent,],
                OutputLevel=DEBUG
 )
예제 #14
0
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
resegment.AuditExecute = True
resegmentExt.AuditExecute = True
positions2.AuditExecute = True
                   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
createHcalCells.AuditExecute = True
createExtHcalCells.AuditExecute = True
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],
    EvtSel='NONE',
예제 #17
0
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)
예제 #18
0
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 = ["BarHCal_Readout"])
savehcaltool.positionedCaloHits.Path = "HCalPositionedHits"
savehcaltool.caloHits.Path = "HCalHits"
# 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, ppservice],
                OutputLevel=DEBUG
 )
예제 #19
0
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
if delphesHepMCInFile == "":
예제 #20
0
                                        OutputLevel=DEBUG)

geantsim = SimG4Alg("SimG4Alg",
                    outputs=[
                        "SimG4SaveCalHits/saveHCalHits",
                        "InspectHitsCollectionsTool/inspect"
                    ],
                    eventProvider=pgun,
                    OutputLevel=DEBUG)

# PODIO algorithm
from Configurables import PodioOutput

out = PodioOutput("out", OutputLevel=DEBUG)
out.outputCommands = ["keep *"]
out.filename = "output_hcalSim_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',
예제 #21
0
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],
                EvtSel = 'NONE',
                EvtMax   = 5,
예제 #22
0
                                                 nEtaWindow=7,
                                                 nPhiWindow=15,
                                                 nEtaPosition=3,
                                                 nPhiPosition=11,
                                                 nEtaDuplicates=5,
                                                 nPhiDuplicates=11,
                                                 nEtaFinal=winEta,
                                                 nPhiFinal=winPhi,
                                                 energyThreshold=enThreshold)
createclusters.clusters.Path = "caloClusters"

# PODIO algorithm
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput
out = PodioOutput("out")
out.outputCommands = ["keep *"]
out.filename = output_name

THistSvc().Output = [
    "rec DATAFILE='hist_" + output_name + "' TYP='ROOT' OPT='RECREATE'"
]
THistSvc().PrintAll = True
THistSvc().AutoSave = True
THistSvc().AutoFlush = False
THistSvc().OutputLevel = INFO

#CPU information
from Configurables import AuditorSvc, ChronoAuditor
chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]
out.AuditExecute = True
예제 #23
0
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
#
############################################################
예제 #24
0
from Gaudi.Configuration import *

from Configurables import k4DataSvc
podioevent = k4DataSvc("EventDataSvc")

from Configurables import TestAlgorithmWithTFile
producer = TestAlgorithmWithTFile()

from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "output_TestAlgorithmWithTFile_framework.root"
out.outputCommands = ["keep *"]

from Configurables import ApplicationMgr
ApplicationMgr(
    TopAlg=[producer, out],
    EvtSel="NONE",
    EvtMax=100,
    ExtSvc=[podioevent],
    OutputLevel=INFO,
    StopOnSignal=True,
)
예제 #25
0
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
               )
예제 #26
0
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
 )
예제 #27
0
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
)
from Configurables import SimG4SingleParticleGeneratorTool
pgun=SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",saveEdm=True,
                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( TopAlg = [geantsim, out],
                EvtSel = 'NONE',
                EvtMax   = num_events,
                # order is important, as GeoSvc is needed by G4SimSvc
                ExtSvc = [podioevent, geoservice, geantservice, audsvc],
예제 #29
0
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,
                # order is important, as GeoSvc is needed by G4SimSvc
                ExtSvc = [podioevent, geoservice, geantservice, audsvc],
예제 #30
0
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,
                    ]
예제 #31
0
# 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_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)
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
#
############################################################
예제 #33
0
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],
                EvtSel = 'NONE',
                EvtMax   = 1,
#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
)
예제 #35
0
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, ]

예제 #36
0
full.FTDPixelTrackerHits = ftdhitname
full.FTDSpacePoints = ftdspname
full.SITRawHits     = sithitname
full.SETRawHits     = sethitname
full.FTDRawHits     = ftdhitname
full.TPCTracks = "NULL" # 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-v01-SimRec00.root"
out.outputCommands = ["keep *"]

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr(
    TopAlg = [genalg, detsimalg, digiVXD, digiSIT, digiSET, digiFTD, spSIT, spSET, spFTD, tracking, forward, subset, full, out],
    EvtSel = 'NONE',
    EvtMax = 10,
    ExtSvc = [rndmengine, rndmgensvc, dsvc, evtseeder, geosvc, gearsvc, tracksystemsvc],
    HistogramPersistency = 'ROOT',
    OutputLevel = INFO
)
예제 #37
0
# 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)
예제 #38
0
파일: sim_endcap.py 프로젝트: HEP-FCC/FCCSW
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,
                # order is important, as GeoSvc is needed by G4SimSvc
                ExtSvc = [podioevent, geoservice, geantservice, audsvc],
예제 #39
0
pythia8gentool = PythiaInterface()
pythia8gentool.Filename = "Pythia_ee_ZH_Htautau.cmd"

# Write the HepMC::GenEvent to the data service
from Configurables import GenAlg

pythia8gen = GenAlg()
pythia8gen.SignalProvider = pythia8gentool
pythia8gen.hepmc.Path = "hepmc"
ApplicationMgr().TopAlg += [pythia8gen]

# 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.hepmcStatusList = []  # convert particles with all statuses
hepmc_converter.genparticles.Path = "genParticles"
hepmc_converter.genvertices.Path = "genVertices"
ApplicationMgr().TopAlg += [hepmc_converter]

# FCC event-data model output -> define objects to be written out
from Configurables import PodioOutput

out = PodioOutput("out")
out.filename = "FCCOutput.root"
out.outputCommands = [
    "keep *",
]
ApplicationMgr().TopAlg += [out]
예제 #40
0
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)
                             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

ApplicationMgr(
예제 #42
0
from Configurables import DetSimSvc
detsimsvc = DetSimSvc("DetSimSvc")

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 = "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)
예제 #43
0
                                          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
positionsHcalFwd.AuditExecute = True
예제 #44
0
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,
        tracksystemsvc
                                        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(
    TopAlg=[geantsim, out],
    EvtSel='NONE',
예제 #46
0
from Gaudi.Configuration import *

from Configurables import k4DataSvc
podioevent = k4DataSvc("EventDataSvc")

from Configurables import CreateExampleEventData
producer = CreateExampleEventData()

from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "output_k4test_exampledata.root"
out.outputCommands = ["keep *"]

from Configurables import ApplicationMgr
ApplicationMgr(
    TopAlg=[producer, out],
    EvtSel="NONE",
    EvtMax=100,
    ExtSvc=[podioevent],
    OutputLevel=INFO,
)
                                     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
createEcalBarrelCellsStep1.AuditExecute = True
positionsEcalBarrel.AuditExecute = True
resegmentEcalBarrel.AuditExecute = True
createEcalBarrelCells.AuditExecute = True
createEcalEndcapCells.AuditExecute = True
createEcalFwdCells.AuditExecute = True
createHcalCells.AuditExecute = True
createExtHcalCells.AuditExecute = True
예제 #48
0
                                   "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
ApplicationMgr(TopAlg=[pythia8gen, delphessim, out],
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,
                # order is important, as GeoSvc is needed by G4SimSvc
                ExtSvc = [podioevent, geoservice, geantservice, audsvc],
예제 #50
0
geantservice.actions = actions
geantservice.magneticField = field
# range cut
geantservice.g4PostInitCommands += ["/run/setCut 0.1 mm"]
geantservice.g4PostInitCommands += ["/tracking/storeTrajectory 1"]
ApplicationMgr().ExtSvc += [geantservice]

from Configurables import SimG4PrimariesFromEdmTool
particle_converter = SimG4PrimariesFromEdmTool("EdmConverter")
particle_converter.genParticles.Path = "GenParticles"

from Configurables import SimG4Alg
geantsim = SimG4Alg("SimG4Alg")
geantsim.outputs = geant_output_tool_list
geantsim.eventProvider = particle_converter
main.TopAlg += [geantsim]

from Configurables import PodioOutput
out = PodioOutput("out")
out.outputCommands = ["keep *"]
out.filename = "muons_for_seeding.root"
ApplicationMgr().TopAlg += [out]

#CPU information
from Configurables import AuditorSvc, ChronoAuditor
chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]
geantsim.AuditExecute = True
out.AuditExecute = True
예제 #51
0
                                        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)
예제 #52
0
                               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
geantsim.AuditExecute = True
createEcalBarrelCellsStep1.AuditExecute = True
resegmentEcalBarrel.AuditExecute = True
createEcalBarrelCells.AuditExecute = True
createHcalBarrelCells.AuditExecute = True
out.AuditExecute = True
예제 #53
0
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,
  )
예제 #54
0
파일: plcio_write.py 프로젝트: zoujh/CEPCSW
#!/usr/bin/env python

from Gaudi.Configuration import *

from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc")

from Configurables import PlcioWriteAlg
alg = PlcioWriteAlg("PlcioWriteAlg")
alg.HeaderCol.Path = "EventHeader"
alg.OutputCol.Path = "MCParticle"

from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "test.root"
out.outputCommands = ["keep *"]

# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr(TopAlg=[alg, out],
               EvtSel='NONE',
               EvtMax=10,
               ExtSvc=[dsvc],
               OutputLevel=DEBUG)
예제 #55
0
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],
)
예제 #56
0
                                        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,
    # order is important, as GeoSvc is needed by G4SimSvc
예제 #57
0
from Configurables import CombinatorialSeedingTest, CombinatorialSeedingTool

seed_tool = CombinatorialSeedingTool()
seed_tool.seedingLayerIndices0=(0,0)
seed_tool.seedingLayerIndices1=(0,1)
seed_tool.seedingLayerIndices2=(0,2)
seed_tool.trackSeeds.Path = "trackSeeds"
seed_tool.readoutName = "TrackerBarrelReadout"

combi_seeding = CombinatorialSeedingTest()
combi_seeding.TrackSeedingTool = seed_tool
combi_seeding.positionedTrackHits.Path = "positionedHits"


# PODIO algorithm
from Configurables import PodioOutput
out = PodioOutput("out",
                   OutputLevel=DEBUG)
out.outputCommands = ["keep *"]
out.filename="combiSeeding_Example.root"

from Configurables import ApplicationMgr
ApplicationMgr( TopAlg = [gen, hepmc_converter, geantsim, combi_seeding, out],
                EvtSel = 'NONE',
                EvtMax   = 2,
                # order is important, as GeoSvc is needed by SimG4Svc
                ExtSvc = [podioevent, geoservice, geantservice,],
                OutputLevel=DEBUG
 )