ApplicationMgr().ExtSvc += [podioevent]

# from Configurables import HepMCReader
from Configurables import HepEVTReader
reader = HepEVTReader("HepEVTReader")
reader.HepEVTFilename = 'input_example_GuineaPig.hepevt'
reader.GenParticles.Path = "GenParticles"
ApplicationMgr().TopAlg += [reader]

# DD4hep geometry service
from Configurables import GeoSvc
## parse the given xml file
path_to_detectors = os.environ.get("FCCDETECTORS", "")
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = [
                          os.path.join(path_to_detectors, 'Detector/DetFCCeeCLD/compact/FCCee_o2_v02/FCCee_o2_v02.xml'),
                       ]


from Configurables import SimG4Alg
from Configurables import SimG4SaveCalHits
from Configurables import SimG4SaveTrackerHits
savetrackertool = SimG4SaveTrackerHits("saveTrackerHits_Barrel")
savetrackertool.readoutNames = ["VertexBarrelCollection"]
savetrackertool.SimTrackHits.Path = "hits_VXD_barrel"
SimG4Alg("SimG4Alg").outputs += [savetrackertool]

from Configurables import SimG4SaveTrackerHits
savetrackertool_endcap = SimG4SaveTrackerHits("saveTrackerHits_Endcap")
savetrackertool_endcap.readoutNames = ["VertexEndcapCollection"]
savetrackertool_endcap.SimTrackHits.Path = "hits_VXD_endcap"
Esempio n. 2
0
from Configurables import HepMCToEDMConverter
hepmc_converter = HepMCToEDMConverter()
hepmc_converter.hepmc.Path="hepmc"
hepmc_converter.GenParticles.Path="GenParticles"

################## Simulation setup
# Detector geometry
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
# if FCC_DETECTORS is empty, this should use relative path to working directory
path_to_detector = os.environ.get("FCCDETECTORS", "")
detectors_to_use=[
                    'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
                  ]
# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
geoservice.OutputLevel = WARNING

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4Svc
geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions")

# Range cut
geantservice.g4PreInitCommands += ["/run/setCut 0.1 mm"]

# Magnetic field
from Configurables import SimG4ConstantMagneticFieldTool
if magneticField == 1:
    field = SimG4ConstantMagneticFieldTool("SimG4ConstantMagneticFieldTool", FieldComponentZ=-2*tesla, FieldOn=True,IntegratorStepper="ClassicalRK4")
else:
Esempio n. 3
0
import os
from Gaudi.Configuration import *

# DD4hep geometry service
from Configurables import GeoSvc
## parse the given xml file
path_to_detectors = os.environ.get("FCCDETECTORS", "")
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = [
    os.path.join(path_to_detectors,
                 'Detector/DetFCCeeCLD/compact/FCCee_DectMaster.xml'),
]

from Configurables import SimG4Alg
from Configurables import SimG4SaveTrackerHits
savetrackertool = SimG4SaveTrackerHits("saveTrackerHits_Barrel")
savetrackertool.readoutNames = ["VertexBarrelCollection"]
savetrackertool.SimTrackHits.Path = "hits_VXD_barrel"
SimG4Alg("SimG4Alg").outputs += [savetrackertool]

from Configurables import SimG4SaveTrackerHits
savetrackertool_endcap = SimG4SaveTrackerHits("saveTrackerHits_Endcap")
savetrackertool_endcap.readoutNames = ["VertexEndcapCollection"]
savetrackertool_endcap.SimTrackHits.Path = "hits_VXD_endcap"
SimG4Alg("SimG4Alg").outputs += [savetrackertool_endcap]

from Configurables import SimG4SaveTrackerHits
savetrackertool_ITB = SimG4SaveTrackerHits("saveTrackerHits_IT_Barrel")
savetrackertool_ITB.readoutNames = ["InnerTrackerBarrelCollection"]
savetrackertool_ITB.SimTrackHits.Path = "hits_IT_barrel"
SimG4Alg("SimG4Alg").outputs += [savetrackertool_ITB]
Esempio n. 4
0
from Configurables import HepMCToEDMConverter
hepmc_converter = HepMCToEDMConverter("Converter")
hepmc_converter.hepmc.Path="hepmc"
hepmc_converter.GenParticles.Path="GenParticles"
ApplicationMgr().TopAlg += [hepmc_converter]


# DD4hep geometry service
from Configurables import GeoSvc
## parse the given xml file
path_to_detectors = os.environ.get("FCCDETECTORS", "")
geoservice = GeoSvc("GeoSvc")
detectors = [ 'Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
              'Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml',
              ]
geoservice.detectors = [ os.path.join(path_to_detectors, d) for d in detectors ]
ApplicationMgr().ExtSvc += [geoservice]

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import  SimG4UserLimitRegion
## create region and a parametrisation model, pass smearing tool
regiontool = SimG4UserLimitRegion("limits")
regiontool.volumeNames = ["TrackerEnvelopeBarrel"]
regiontool.maxStep = 1*mm

from Configurables import SimG4UserLimitPhysicsList
# create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process
physicslisttool = SimG4UserLimitPhysicsList("Physics")
physicslisttool.fullphysics = "SimG4FtfpBert"
Esempio n. 5
0
import os

from GaudiKernel import SystemOfUnits as units

from Gaudi.Configuration import *

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

## create DD4hep geometry
path_to_detector = os.environ.get("FCC_DETECTORS", "")

from Configurables import GeoSvc
geoservice = GeoSvc()
geoservice.detectors = ['file:' + os.path.join(path_to_detector, 'Detector/DetFCChhHCalTile/compact/standalone.xml'),]
geoservice.OutputLevel = INFO

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13], EtaMin=0.0000, EtaMax=0.0000001, PhiMin=0.0, PhiMax=1.57, PtMin=10000, PtMax=10000)

from Configurables import FlatSmearVertex
smeartool = FlatSmearVertex()
smeartool.xVertexMin =  0*units.mm
smeartool.xVertexMax = 0*units.mm
smeartool.yVertexMin = 0*units.mm
  ecalEndcapCellsName,
  ecalFwdCellsName,
  hcalBarrelCellsName,
  hcalExtBarrelCellsName,
  hcalEndcapCellsName,
  hcalFwdCellsName,
]
ApplicationMgr().TopAlg += [podioinput]

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
geoservice.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',
  ]
geoservice.OutputLevel = WARNING
ApplicationMgr().ExtSvc += [geoservice]


#Configure tools for calo cell positions
from Configurables import CellPositionsECalBarrelTool, CellPositionsHCalBarrelNoSegTool, CellPositionsHCalBarrelTool, CellPositionsCaloDiscsTool, CellPositionsTailCatcherTool
from Configurables import CellPositionsECalBarrelTool
ECalBcells = CellPositionsECalBarrelTool("CellPositionsECalBarrel")
ECalBcells.readoutName = ecalBarrelReadoutName
ECalBcells.OutputLevel = INFO
Esempio n. 7
0
# reads HepMC text file and write the HepMC::GenEvent to the data service
readertool = HepMCFileReader()
readertool.Filename = "Test/TestGeometry/data/testHepMCrandom.dat"
reader = GenAlg("Reader")
reader.SignalProvider = readertool
reader.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"

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = ['file:Test/TestGeometry/data/TestBoxCaloSD_segmentation.xml']

from Configurables import SimG4Svc
geantservice = SimG4Svc("SimG4Svc")
geantservice.detector='SimG4DD4hepDetector'
geantservice.physicslist='SimG4TestPhysicsList'
geantservice.actions='SimG4FullSimActions'

from Configurables import SimG4SaveCalHits
savecaltool = SimG4SaveCalHits("saveECalHits")
savecaltool.readoutNames = ["ECalHits"]
savecaltool.positionedCaloHits.Path = "positionedCaloHits"
savecaltool.caloHits.Path = "caloHits"
from Configurables import SimG4Alg
geantsim = SimG4Alg("SimG4Alg")
geantsim.outputs = [
Esempio n. 8
0
import os

from GaudiKernel import SystemOfUnits as units

from Gaudi.Configuration import *

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

## create DD4hep geometry
path_to_detector = os.environ.get("FCC_DETECTORS", "")

from Configurables import GeoSvc
geoservice = GeoSvc()
geoservice.detectors = [
    'file:' + os.path.join(path_to_detector,
                           'Detector/DetFCChhHCalTile/compact/standalone.xml'),
]
geoservice.OutputLevel = INFO

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = False
field.IntegratorStepper = "G4ExactHelixStepper"

from Configurables import ConstPtParticleGun
pgun_tool = ConstPtParticleGun(PdgCodes=[13],
                               EtaMin=0.0000,
                               EtaMax=0.0000001,
                               PhiMin=0.0,
                               PhiMax=1.57,
                               PtMin=10000,
Esempio n. 9
0
app = ApplicationMgr()
app.EvtSel = "NONE"
app.EvtMax = 100
app.ExtSvc = []
app.TopAlg = []
app.OutputLevel = DEBUG


from Configurables import FCCDataSvc
podioevent = FCCDataSvc("EventDataSvc")
app.ExtSvc += [podioevent]

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = [
                         'Detector/DetFCCeeIDEA/compact/FCCee_DectMaster.xml',
                       ] 
geoservice.OutputLevel = INFO
app.ExtSvc +=[geoservice]

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool()
field.FieldOn = True
field.IntegratorStepper = "ClassicalRK4"
field.FieldComponentZ = 2*units.tesla
field.MaximumStep = 10000.0

from Configurables import SimG4UserLimitRegion
regiontool = SimG4UserLimitRegion("limits")
regiontool.volumeNames = ["CDCH"]
regiontool.maxStep = 2*units.mm
Esempio n. 10
0
import os
from Gaudi.Configuration import *

from Configurables import ApplicationMgr
app = ApplicationMgr()
app.TopAlg = []
app.EvtSel = 'NONE'
app.EvtMax = 1
app.ExtSvc = []
app.OutputLevel = DEBUG

# order is important, as GeoSvc is needed by SimG4Svc
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
geoservice.detectors=[
  'file:../Detector/DetSensitive/tests/compact/Box_simpleTrackerSD.xml',
  ]
geoservice.OutputLevel = INFO
app.ExtSvc += [geoservice]

from Configurables import SimG4Svc
geantservice = SimG4Svc("SimG4Svc")
app.ExtSvc += [geantservice]

export_fname = "TestBox.gdml"
# check if file exists and delete it:
if os.path.isfile(export_fname):
    os.remove(export_fname)

from Configurables import GeoToGdmlDumpSvc
geodumpservice = GeoToGdmlDumpSvc()
Esempio n. 11
0
import os

from Gaudi.Configuration import *
path_to_detector = "/usr/local/"

detectors_to_use = [
    path_to_detector +
    'Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
    path_to_detector + 'Detector/DetFCChhTrackerTkLayout/compact/Tracker.xml',
    path_to_detector +
    '/Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml',
    #path_to_detector+'/Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml',
    #path_to_detector+'/Detector/DetFCChhHCalTile/compact/FCChh_HCalExtendedBarrel_TileCal.xml',
    #path_to_detector+'/Detector/DetFCChhCalDiscs/compact/Endcaps_coneCryo.xml',
    #path_to_detector+'/Detector/DetFCChhCalDiscs/compact/Forward_coneCryo.xml',
    #path_to_detector+'/Detector/DetFCChhTailCatcher/compact/FCChh_TailCatcher.xml',
    #path_to_detector+'/Detector/DetFCChhBaseline1/compact/FCChh_Solenoids.xml',
    #path_to_detector+'/Detector/DetFCChhBaseline1/compact/FCChh_Shielding.xml',
]

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = detectors_to_use
geoservice.OutputLevel = WARNING
Esempio n. 12
0
import os
from Gaudi.Configuration import *

# DD4hep geometry service
from Configurables import GeoSvc
## parse the given xml file
path_to_detectors = os.environ.get("FCCDETECTORS", "")
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = [
    os.path.join(path_to_detectors,
                 'Detector/DetFCChhBaseline1/compact/FCChh_DectMaster.xml'),
]
geoservice.OutputLevel = INFO
ApplicationMgr().ExtSvc += [geoservice]

# Set up SaveTools that write

from Configurables import SimG4SaveTrackerHits
savetrackertool = SimG4SaveTrackerHits("saveTrackerHits")
savetrackertool.readoutNames = ["TrackerBarrelReadout", "TrackerEndcapReadout"]
from Configurables import SimG4Alg
SimG4Alg("SimG4Alg").outputs += [savetrackertool]

from Configurables import SimG4SaveCalHits
saveecaltool = SimG4SaveCalHits("saveECalBarrelHits")
saveecaltool.readoutNames = ["ECalBarrelEta"]
saveecaltool.CaloHits.Path = "ECalBarrelHits"
SimG4Alg("SimG4Alg").outputs += [saveecaltool]

from Configurables import SimG4SaveCalHits
saveendcaptool = SimG4SaveCalHits("saveECalEndcapHits")
Esempio n. 13
0
## reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles
hepmc_converter = HepMCToEDMConverter("Converter")
hepmc_converter.hepmc.Path = "hepmc"
hepmc_converter.GenParticles.Path = "GenParticles"
ApplicationMgr().TopAlg += [hepmc_converter]

# DD4hep geometry service
from Configurables import GeoSvc
## parse the given xml file
path_to_detectors = os.environ.get("FCCDETECTORS", "")
geoservice = GeoSvc("GeoSvc")
geoservice.detectors = [
    os.path.join(
        path_to_detectors,
        'Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml'),
    os.path.join(path_to_detectors,
                 'Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml'),
    os.path.join(
        path_to_detectors,
        'Detector/DetFCChhECalSimple/compact/FCChh_ECalBarrel_Gflash.xml'),
]
geoservice.OutputLevel = INFO
ApplicationMgr().ExtSvc += [geoservice]

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4ParticleSmearFormula
## create particle smearing tool, used for smearing in the tracker
smeartool = SimG4ParticleSmearFormula("smear")
smeartool.resolutionMomentum = "0.013"

from Configurables import SimG4FastSimTrackerRegion