Пример #1
0
from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4PrimariesFromEdmTool, InspectHitsCollectionsTool
inspecttool = InspectHitsCollectionsTool("inspect", readoutNames=["ECalHits"], OutputLevel = DEBUG)

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/inspect"],
                    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
 )
Пример #2
0
### \file
### \ingroup BasicExamples
### | **input (alg)**                                                                                                              | other algorithms                   |                                  |                                       | **output (alg)**                                |
### | ----------------------------------------------------                                                                         | ---------------------------------- | ---------------------            | ------------------------------------- | ----------------------------------------------- |
### | generate single particle events from a given list of types, with momentum, phi and theta from a given range, saving to HepMC | creating the histograms for HepMC   | convert `HepMC::GenEvent` to EDM | dump `HepMC::GenEvent`                | write the EDM output to ROOT file using PODIO   |

from Gaudi.Configuration import *
from GaudiKernel import SystemOfUnits as units

from Configurables import FCCDataSvc
## Data service

podioevent = FCCDataSvc("EventDataSvc")
from Configurables import ApplicationMgr, THistSvc
from Configurables import HepMCDumper, MomentumRangeParticleGun, HepMCHistograms, FlatSmearVertex, ConstPileUp

dumper = HepMCDumper("Dumper")
dumper.hepmc.Path = "hepmc"

from Configurables import HepMCFileWriter
writer = HepMCFileWriter("MyHepMCFileWriter")
writer.hepmc.Path = "hepmc"

guntool = MomentumRangeParticleGun("SignalProvider", PdgCodes=[-211])
guntool2 = MomentumRangeParticleGun("PileUpProvider", PdgCodes=[11])

smeartool = FlatSmearVertex("smeartoolname")
smeartool.xVertexMin = -10 * units.mm
smeartool.xVertexMax = 10 * units.mm
smeartool.yVertexMin = -10 * units.mm
smeartool.yVertexMax = 10 * units.mm
Пример #3
0
ecalBarrelReadoutName = "ECalBarrelPhiEta"
ecalEndcapReadoutName = "EMECPhiEtaReco"
ecalFwdReadoutName = "EMFwdPhiEta"
# HCAL readouts
hcalBarrelReadoutName = "HCalBarrelReadout"
hcalExtBarrelReadoutName = "HCalExtBarrelReadout"
hcalEndcapReadoutName = "HECPhiEtaReco"
hcalFwdReadoutName = "HFwdPhiEta"
# Tail Catcher readout
tailCatcherReadoutName = "Muons_Readout"
##############################################################################################################
#######                                        INPUT                                             #############
##############################################################################################################
# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import ApplicationMgr, FCCDataSvc, PodioInput, PodioOutput
podioevent = FCCDataSvc("EventDataSvc", input=input_name)

podioinput = PodioInput("PodioReader",
                        collections=[
                            "TrackerPositionedHits", "ECalBarrelCells",
                            "HCalBarrelCells", "HCalExtBarrelCells",
                            "ECalEndcapCells", "HCalEndcapCells",
                            "ECalFwdCells", "HCalFwdCells", "TailCatcherCells",
                            "GenParticles", "GenVertices"
                        ],
                        OutputLevel=DEBUG)

##############################################################################################################
#######                                       RECALIBRATE ECAL                                   #############
##############################################################################################################
Пример #4
0
from Gaudi.Configuration import *
from Configurables import ApplicationMgr, HepMCReader, HepMCDumper, FCCDataSvc

albersevent = FCCDataSvc("EventDataSvc")

reader = HepMCReader("Reader", Filename="example_MyPythia.dat")
reader.DataOutputs.hepmc.Path = "hepmc"

from Configurables import HepMCConverter
hepmc_converter = HepMCConverter("Converter")
hepmc_converter.DataInputs.hepmc.Path="hepmc"
hepmc_converter.DataOutputs.genparticles.Path="allGenParticles"
hepmc_converter.DataOutputs.genvertices.Path="allGenVertices"

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detector='file:DetectorDescription/Detectors/compact/TestTracker.xml',
                    OutputLevel = DEBUG)

from Configurables import GeantSvc, GdmlDetector
det = GdmlDetector("GdmlDetector", gdml = "Sim/SimG4Common/gdml/example.xml")
geantservice = GeantSvc("GeantSvc", config="GeantFullSimConfig", detector="GdmlDetector")
geantservice.addTool(det)

from Configurables import GeantFullSimAlg
geantsim = GeantFullSimAlg("GeantFullSimAlg")
geantsim.DataInputs.genParticles.Path="allGenParticles"
geantsim.DataOutputs.trackClusters.Path = "clusters"
geantsim.DataOutputs.trackHits.Path = "hits"
geantsim.DataOutputs.trackHitsClusters.Path = "hitClusterAssociation"

Пример #5
0
from Gaudi.Configuration import *

from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent = FCCDataSvc("EventDataSvc",
                        input="output_ecalSim_e50GeV_eta0_10events.root")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import PodioInput
podioinput = PodioInput("PodioReader",
                        collections=["ECalHits", "ECalPositionedHits"],
                        OutputLevel=DEBUG)

from Configurables import GeoSvc
geoservice = GeoSvc(
    "GeoSvc",
    detectors=[
        'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
        'file:Detector/DetFCChhECalSimple/compact/FCChh_ECalBarrel_Mockup.xml'
    ],
    OutputLevel=INFO)

# common ECAL specific information
# readout name
ecalReadoutName = "ECalHitsPhiEta"
# active material identifier name
ecalIdentifierName = "active_layer"
# active material volume name
ecalVolumeName = "LAr_sensitive"
# ECAL bitfield names & values
ecalFieldNames = ["system", "ECAL_Cryo", "bath", "EM_barrel"]
ecalBarrelReadoutName = "ECalBarrelPhiEta"
ecalEndcapReadoutName = "EMECPhiEtaReco"
ecalFwdReadoutName = "EMFwdPhiEta"
hcalBarrelReadoutName = "HCalBarrelReadout"
hcalExtBarrelReadoutName = "HCalExtBarrelReadout"
hcalBarrelReadoutPhiEtaName = "BarHCal_Readout_phieta"
hcalExtBarrelReadoutPhiEtaName = "ExtBarHCal_Readout_phieta"
hcalEndcapReadoutName = "HECPhiEta"
hcalFwdReadoutName = "HFwdPhiEta"
# Number of events
num_events = 3

from Gaudi.Configuration import *
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent = FCCDataSvc("EventDataSvc", input="output_fullCalo_SimAndDigi_e50GeV_"+str(num_events)+"events.root")
# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import PodioInput
podioinput = PodioInput("PodioReader",
                        collections = [ecalBarrelCellsName, ecalEndcapCellsName, ecalFwdCellsName,
                                       hcalBarrelCellsName, hcalExtBarrelCellsName, hcalEndcapCellsName, hcalFwdCellsName])

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detectors=[  'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
                                           'file:Detector/DetFCChhTrackerTkLayout/compact/Tracker.xml',
                                           'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml',
                                           'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml',
                                           'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalExtendedBarrel_TileCal.xml',
                                           'file:Detector/DetFCChhCalDiscs/compact/Endcaps_coneCryo.xml',
                                           'file:Detector/DetFCChhCalDiscs/compact/Forward_coneCryo.xml'],
                    OutputLevel = WARNING)
Пример #7
0
import os
from Gaudi.Configuration import *

import GaudiKernel.SystemOfUnits as units
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent = FCCDataSvc(
    "EventDataSvc",
    input=
    "root://eospublic.cern.ch//eos/experiment/fcc/ee/tutorial/fccee_idea_pgun.root"
)

from Configurables import PodioInput, ReadTestConsumer
podioinput = PodioInput("PodioReader",
                        collections=["positionedHits_DCH"],
                        OutputLevel=DEBUG)
# Parses the given xml file
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc",
                    detectors=[
                        os.environ.get("FCC_DETECTORS", "") +
                        '/Detector/DetFCCeeIDEA/compact/FCCee_DectMaster.xml',
                    ])

from Configurables import CreateDCHHits
createhits = CreateDCHHits("CreateDCHHits",
                           readoutName="DriftChamberCollection",
                           EdepCut=100 * 1e-9,
                           DCACut=0.8,
                           OutputLevel=INFO)
Пример #8
0
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput
from GaudiKernel import SystemOfUnits as units

import argparse
recoparser = argparse.ArgumentParser()
recoparser.add_argument('-r','--rootfile', type=str, default=None, help='rootfile')
recoargs, _ = recoparser.parse_known_args()
rootfile = recoargs.rootfile
print "=================================="
print "rootfile = ", rootfile
print "=================================="



## read in generated particles from ROOT via podio
podioevent   = FCCDataSvc("EventDataSvc", input=rootfile) #"Sim/SimPapas/data/ee_ZH_Zmumu_Hbb.root")

from Configurables import PodioInput, ReadTestConsumer
podioinput = PodioInput("PodioReader", collections=["GenVertex", "GenParticle"], OutputLevel=DEBUG)

from  CMS_detector_cfg import detservice
from papas_cfg import papasalg_pdebug

#output fcc particles to root
from Configurables import PodioOutput
out = PodioOutput("out",
                  OutputLevel=INFO)
out.outputCommands = ["keep *"]

from Configurables import ApplicationMgr
ApplicationMgr(
Пример #9
0
from Gaudi.Configuration import *

from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

# v01 production - min. bias events
podioevent = FCCDataSvc(
    "EventDataSvc",
    input="/eos/project/f/fccsw-web/testsamples/caloCells_minBiasEvent.root")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import PodioInput

podioinput = PodioInput("in", collections=["ECalBarrelCells"])

from Configurables import GeoSvc
geoservice = GeoSvc(
    "GeoSvc",
    detectors=[
        'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
        'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml'
    ],
    OutputLevel=WARNING)

# Pileup in ECal Barrel
# readout name
ecalBarrelReadoutNamePhiEta = "ECalBarrelPhiEta"

# geometry tool
from Configurables import TubeLayerPhiEtaCaloTool
ecalBarrelGeometry = TubeLayerPhiEtaCaloTool(
    "EcalBarrelGeo",