podioevent = FCCDataSvc("EventDataSvc", input="output_ecalSim_e50GeV_1events.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"] ecalFieldValues = [5, 1, 1, 1]
collections=[ "GenParticles", "GenVertices", ecalBarrelCellsName, ecalEndcapCellsName, ecalFwdCellsName, hcalBarrelCellsName, hcalExtBarrelCellsName, hcalEndcapCellsName, hcalFwdCellsName ], OutputLevel=DEBUG) from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', # Tracker disabled to save cpu time #'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=INFO) # additionally for HCal from Configurables import RewriteBitfield # Use Phi-Eta segmentation in Hcal barrel rewriteHcal = RewriteBitfield( "RewriteHCal", # old bitfield (readout) oldReadoutName="HCalBarrelReadout", # specify which fields are going to be deleted
## Data service podioevent = FCCDataSvc("EventDataSvc") 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")
reader = HepMCReader( "Reader", Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat") ## reads HepMC text file and write the HepMC::GenEvent to the data service 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" # DD4hep geometry service from Configurables import GeoSvc ## parse the given xml file geoservice = GeoSvc("GeoSvc", detectors=['file:..//data/Barrel_testCaloSD_rphiz.xml']) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4GflashHomoCalo, SimG4FastSimCalorimeterRegion ## create parametrisation of the calorimeter gflash = SimG4GflashHomoCalo("gflash", material="G4_PbWO4") regiontoolcalo = SimG4FastSimCalorimeterRegion("modelCalo", volumeNames=["BarrelECal"], parametrisation=gflash) ## create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4FastSimPhysicsList("Physics", fullphysics="SimG4FtfpBert") ## attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", physicslist=physicslisttool,
from Gaudi.Configuration import * from Configurables import ApplicationMgr, Geant4Test, GeoSvc #geant4 = Geant4GeoConverterTool("Geant4GeoConverterTool") #detservice = DD4HepDetDesSvc("DD4HepDetDesSvc", OutputLevel = VERBOSE) detservice = GeoSvc("GeoSvc", OutputLevel = VERBOSE) test = Geant4Test("Geant4Test") ApplicationMgr(EvtSel='NONE', EvtMax=1, ExtSvc = [detservice], TopAlg=[test])
gen.hepmc.Path = "hepmc" # 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 = "allGenParticles" hepmc_converter.genvertices.Path = "allGenVertices" # DD4hep geometry service # Parses the given xml file from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhBaseline1/compact/FCChh_TrackerAir.xml' ], OutputLevel=INFO) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4UserLimitPhysicsList, SimG4UserLimitRegion from GaudiKernel.SystemOfUnits import mm ## create region and a parametrisation model, pass smearing tool regiontool = SimG4UserLimitRegion("limits", volumeNames=["TrackerEnvelopeBarrel"], maxStep=1 * mm) # create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4UserLimitPhysicsList("Physics", fullphysics="SimG4FtfpBert")
from Gaudi.Configuration import * from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput # v01 production - min. bias events podioevent = FCCDataSvc("EventDataSvc", input=input_name) from Configurables import PodioInput podioinput = PodioInput("in", collections = [prefix+"ECalBarrelCells", prefix+"HCalBarrelCells"]) from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors = [ path_to_detector+'/Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', path_to_detector+'/Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml', path_to_detector+'/Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml', ], OutputLevel = WARNING) # Pileup in ECal Barrel # readout name ecalBarrelReadoutNamePhiEta = "ECalBarrelPhiEta" hcalBarrelReadoutName = "HCalBarrelReadout" hcalBarrelReadoutNamePhiEta = "BarHCal_Readout_phieta" # active material identifier name hcalIdentifierName = ["module", "row", "layer"] # active material volume name hcalVolumeName = ["moduleVolume", "wedgeVolume", "layerVolume"] # ECAL bitfield names & values hcalFieldNames=["system"] hcalFieldValues=[8]
import os from Gaudi.Configuration import * from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:Detector/DetCommon/compact/Box.xml'], OutputLevel = DEBUG) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") 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("GeoDump", gdml=export_fname) from Configurables import ApplicationMgr ApplicationMgr( TopAlg = [], EvtSel = 'NONE', EvtMax = 1, # order is important, as GeoSvc is needed by SimG4Svc ExtSvc = [geoservice, geantservice, geodumpservice], OutputLevel=DEBUG )
num_events = 1 magnetic_field = 0 particleType = "pi-" from Gaudi.Configuration import * from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput podioevent = FCCDataSvc("EventDataSvc") from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.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' ], OutputLevel=INFO) # 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.g4PostInitCommands += ["/run/setCut 0.1 mm"]
# Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") # from Configurables import HepMCReader from Configurables import HepEVTReader reader = HepEVTReader("Reader", Filename=my_input) reader.genparticles.Path="allGenParticles" reader.genvertices.Path="allGenVertices" # DD4hep geometry service # Parses the given xml file from Configurables import GeoSvc, SimG4SingleParticleGeneratorTool geoservice = GeoSvc("GeoSvc", detectors=[ 'Detector/DetFCCeeCLD/compact/FCCee_DectMaster.xml', ]) from Configurables import SimG4ConstantMagneticFieldTool field = SimG4ConstantMagneticFieldTool("SimG4ConstantMagneticFieldTool", FieldOn=True, FieldComponentZ=0.002, IntegratorStepper="ClassicalRK4") # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FullSimActions, SimG4UserLimitPhysicsList, SimG4UserLimitRegion from GaudiKernel.SystemOfUnits import mm regiontool = SimG4UserLimitRegion("limits", volumeNames=["world"], maxStep = 2*mm) physicslisttool = SimG4UserLimitPhysicsList("Physics", fullphysics="SimG4FtfpBert")
"ParticlePropertySvc", ParticlePropertiesFile="../../../Generation/data/ParticleTable.txt") 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 HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.DataInputs.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:compact/Box_simpleTrackerSD.xml'], OutputLevel=DEBUG) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4PrimariesFromEdmTool savetrackertool = SimG4SaveTrackerHits("SimG4SaveTrackerHits", readoutNames=["TrackerSiliconHits"]) savetrackertool.DataOutputs.trackClusters.Path = "clusters" savetrackertool.DataOutputs.trackHits.Path = "hits" savetrackertool.DataOutputs.trackHitsClusters.Path = "hitClusterAssociation"
# Parses the given xml file from Configurables import GeoSvc # WJF edits pathToXML = 'file:Detector/DetFCChhTrackerTkLayout/compact/' myFile = "FCChh_triplet_layer2_4cm.xml" myFile = "FCCtriplet_4barrel35mm.xml" myFile = "FCCtriplet_1barrel30mm.xml" myFilePath = pathToXML myFilePath = 'file:' + args.geo geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', myFilePath ], OutputLevel=DEBUG) from Configurables import HepMCToEDMConverter ## 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 = "allGenParticles" hepmc_converter.genvertices.Path = "allGenVertices" # 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
# geometry_option = "CepC_v4-onlyTracker.xml" geometry_option = "det.xml" if not os.getenv("DETDRIFTCHAMBERROOT"): print("Can't find the geometry. Please setup envvar DETCEPCV4ROOT.") sys.exit(-1) geometry_path = os.path.join(os.getenv("DETDRIFTCHAMBERROOT"), "compact", geometry_option) if not os.path.exists(geometry_path): print("Can't find the compact geometry file: %s" % geometry_path) sys.exit(-1) from Configurables import GeoSvc geosvc = GeoSvc("GeoSvc") geosvc.compact = geometry_path ############################################################################## # Physics Generator ############################################################################## from Configurables import GenAlgo from Configurables import GtGunTool from Configurables import StdHepRdr from Configurables import SLCIORdr from Configurables import HepMCRdr from Configurables import GenPrinter gun = GtGunTool("GtGunTool") # gun.Particles = ["pi+"] # gun.EnergyMins = [100.] # GeV
from Gaudi.Configuration import * from Configurables import ApplicationMgr, GeoSvc, ClassicalRecoGeoSvc, RecoGeoTest, SmearingTool, RecoGeoWrite, GaussDigitizer, PrintHits #services detservice = GeoSvc( "GeoSvc", detector= "file:DetectorDescription/Detectors/compact/TestTracker_sameMat.xml", OutputLevel=VERBOSE) recoservice = ClassicalRecoGeoSvc("ClassicalRecoGeoSvc", OutputLevel=VERBOSE) #tools smeartool = SmearingTool("SmearingTool", OutputLevel=VERBOSE) gausssmear = GaussDigitizer("GaussDigitizer", OutputLevel=VERBOSE) printhits = PrintHits("PrintHis", OutputLevel=VERBOSE) #smeartool.DataInputs.trackHits.Path = "trackHits" das geht nicht #algorithms test = RecoGeoTest("RecoGeoTest") #test.DataOutputs.particles.Path = "particles" #test.DataInputs.trackHits.Path = "trackHits" write = RecoGeoWrite("RecoGeoWrite") #write.DataInputs.particles.Path = "particles" ApplicationMgr(EvtSel='NONE', EvtMax=1, ExtSvc=[recoservice, detservice], TopAlg=[test, write])
gen.hepmc.Path = "hepmc" ApplicationMgr().TopAlg += [gen] # 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" 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
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/DetFCChhBaseline1/compact/FCChh_Solenoids.xml', path_to_detector + '/Detector/DetFCChhBaseline1/compact/FCChh_Shielding.xml' ] from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=detectors_to_use) # ECAL readouts ecalBarrelReadoutName = "ECalBarrelEta" ecalBarrelReadoutNamePhiEta = "ECalBarrelPhiEta" ecalEndcapReadoutName = "EMECPhiEtaReco" ecalFwdReadoutName = "EMFwdPhiEta" ecalBarrelNoisePath = "/afs/cern.ch/user/a/azaborow/public/FCCSW/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth_noise.root" ecalEndcapNoisePath = "/afs/cern.ch/user/n/novaj/public/elecNoise_emec_6layers.root" ecalBarrelPileupNoisePath = "/afs/cern.ch/user/a/azaborow/public/FCCSW/elecNoise_pileup_cluster.root" ecalBarrelNoiseHistName = "h_elecNoise_fcc_" ecalBarrelPileupHistName = "h_pileup_layer" ecalEndcapNoiseHistName = "h_elecNoise_fcc_" # HCAL readouts hcalBarrelReadoutName = "HCalBarrelReadout" hcalExtBarrelReadoutName = "HCalExtBarrelReadout"
"Reader", Filename="/eos/project/f/fccsw-web/testsamples/testHepMCborders.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 HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.DataInputs.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:../data/TestBoxCaloSD_segmentation.xml']) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist='SimG4TestPhysicsList', actions='SimG4FullSimActions') from Configurables import SimG4Alg, SimG4SaveCalHits savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames=["ECalHits"]) savecaltool.DataOutputs.positionedCaloHits.Path = "positionedCaloHits" savecaltool.DataOutputs.caloHits.Path = "caloHits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"]) from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc")
"ParticlePropertySvc", ParticlePropertiesFile="../../../Generation/data/ParticleTable.txt") 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 HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.DataInputs.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:compact/Box_dd4hepCaloSD.xml'], OutputLevel=DEBUG) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', 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"
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 HepMCDumper hepmc_dump = HepMCDumper("hepmc") hepmc_dump.hepmc.Path = "hepmc" from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=['file:Test/TestGeometry/data/TestBoxCaloSD_volumes.xml']) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist='SimG4TestPhysicsList', actions='SimG4FullSimActions') from Configurables import SimG4Alg, SimG4SaveCalHits savecaltool = SimG4SaveCalHits("saveECalHits", readoutNames=["ECalHits"]) savecaltool.positionedCaloHits.Path = "positionedCaloHits" savecaltool.caloHits.Path = "caloHits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"])
# reads HepMC text file and write the HepMC::GenEvent to the data service from Configurables import HepMCReader reader = HepMCReader("Reader", Filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/FCC_minbias_100TeV.dat") reader.DataOutputs.hepmc.Path = "hepmc" # reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles 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" # DD4hep geometry service # Parses the given xml file from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetCommon/compact/TrackerAir.xml']) # Geant4 service # Configures the Geant simulation: geometry, physics list and user actions from Configurables import SimG4Svc, SimG4FastSimPhysicsList, SimG4FastSimActions, SimG4ParticleSmearRootFile from GaudiKernel.SystemOfUnits import GeV # create particle smearing tool, used for smearing in the tracker smeartool = SimG4ParticleSmearRootFile("Smear", detectorNames=["TrackerEnvelopeBarrel"], filename="/afs/cern.ch/exp/fcc/sw/0.7/testsamples/tkLayout_example_resolutions.root", minP = 5*GeV, maxP = 1000*GeV, maxEta=6) # create actions initialization tool actionstool = SimG4FastSimActions("Actions", smearing=smeartool) # create overlay on top of FTFP_BERT physics list, attaching fast sim/parametrization process physicslisttool = SimG4FastSimPhysicsList("Physics", fullphysics="SimG4FtfpBert") # attach those tools to the G4 service geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist=physicslisttool, actions=actionstool) # Geant4 algorithm
from Gaudi.Configuration import * # Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") # DD4hep geometry service from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectEmptyMaster.xml', 'file:Detector/DetFCCeeECalInclined/compact/FCCee_ECalBarrel_calibration.xml', ], OutputLevel=INFO) # 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") geantservice.g4PostInitCommands += ["/run/setCut 0.1 mm"] # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools # and a tool that saves the calorimeter hits from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4SingleParticleGeneratorTool saveecaltool = SimG4SaveCalHits("saveECalBarrelHits", readoutNames=["ECalBarrelEta"])
from Gaudi.Configuration import * from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput podioevent = FCCDataSvc("EventDataSvc") from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml', 'file:Detector/DetFCChhCalDiscs/compact/Endcaps_coneCryo.xml' ], OutputLevel=INFO) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") geantservice.g4PostInitCommands += ["/run/setCut 0.1 mm"] from Configurables import SimG4Alg, SimG4SaveCalHits, SimG4SingleParticleGeneratorTool saveecaltool = SimG4SaveCalHits("saveECalBarrelHits", readoutNames=["ECalBarrelEta"]) saveecaltool.positionedCaloHits.Path = "ECalBarrelPositionedHits" saveecaltool.caloHits.Path = "ECalBarrelHits" savecalendcaptool = SimG4SaveCalHits("saveECalEndcapHits", readoutNames=["EMECPhiEta"]) savecalendcaptool.positionedCaloHits.Path = "ECalEndcapPositionedHits" savecalendcaptool.caloHits.Path = "ECalEndcapHits" from Configurables import SimG4SingleParticleGeneratorTool pgun = SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool",
from Gaudi.Configuration import * # Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") # DD4hep geometry service from Configurables import GeoSvc geoservice = GeoSvc( "GeoSvc", detectors=[ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_calibration.xml' ], OutputLevel=INFO) # 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") geantservice.g4PostInitCommands += ["/run/setCut 0.1 mm"] # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools # and a tool that saves the calorimeter hits
pgun.ThetaMax = thetaMax * _pi / 180. from Configurables import GenAlg genalg_pgun = GenAlg() genalg_pgun.SignalProvider = pgun genalg_pgun.hepmc.Path = "hepmc" 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
from Configurables import HepMCFileReader, GenAlg readertool = HepMCFileReader( "ReaderTool", Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.dat") reader = GenAlg("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", detectors=['file:Test/TestGeometry/data/Barrel_testCaloSD_phieta.xml'], 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",
reader = HepMCReader( "Reader", Filename="/eos/project/f/fccsw-web/testsamples/FCC_minbias_100TeV.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", detectors=[ 'file:../../../Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:../../../Detector/DetFCChhTrackerSimple/compact/Tracker.xml' ], OutputLevel=DEBUG) from Configurables import SimG4Svc geantservice = SimG4Svc( "SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions", ) from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4PrimariesFromEdmTool savetrackertool = SimG4SaveTrackerHits( "SimG4SaveTrackerHits",
#reads HepMC text file and write the HepMC::GenEvent to the data service from Configurables import PodioInput podioinput = PodioInput("PodioReader", collections=[ "ECalBarrelCells", "HCalBarrelCells", "HCalExtBarrelCells", "GenParticles", "GenVertices" ], OutputLevel=DEBUG) from Configurables import GeoSvc detectors_to_use = [ 'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml', 'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml' ] geoservice = GeoSvc("GeoSvc", detectors=detectors_to_use, OutputLevel=INFO) #Configure tools for calo reconstruction from Configurables import ConstNoiseTool noiseTool = ConstNoiseTool("ConstNoiseTool") #Configure tools for calo cell positions from Configurables import CellPositionsECalBarrelTool, CellPositionsHCalBarrelNoSegTool, CellPositionsCaloDiscsTool ECalBcells = CellPositionsECalBarrelTool("CellPositionsECalBarrel", readoutName=ecalBarrelReadoutName, OutputLevel=INFO) EMECcells = CellPositionsCaloDiscsTool("CellPositionsEMEC", readoutName=ecalEndcapReadoutName, OutputLevel=INFO) ECalFwdcells = CellPositionsCaloDiscsTool("CellPositionsECalFwd", readoutName=ecalFwdReadoutName,
from Configurables import HepMCFileReader, GenAlg readertool = HepMCFileReader("ReaderTool", Filename="Test/TestGeometry/data/testHepMCrandom.dat") reader = GenAlg("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" dumper = HepMCDumper("Dumper") dumper.hepmc.Path="hepmc" from Configurables import GeoSvc geoservice = GeoSvc("GeoSvc", detectors=['file:Test/TestGeometry/data/TestBoxCaloSD_3readouts.xml'], OutputLevel = INFO) from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc", physicslist='SimG4TestPhysicsList') 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 RedoSegmentation resegment = RedoSegmentation("ReSegmentation", # old bitfield (readout) oldReadoutName = "ECalHits",
# list of possible particles is defined in ParticlePropertiesFile ppservice = Gaudi__ParticlePropertySvc("ParticlePropertySvc", ParticlePropertiesFile="Generation/data/ParticleTable.txt") from Configurables import HepMCConverter ## Reads an HepMC::GenEvent from the data service and writes a collection of EDM Particles 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 ## DD4hep geometry service # Parses the given xml file geoservice = GeoSvc("GeoSvc", detectors=['file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml', 'file:Detector/DetFCChhTrackerSimple/compact/Tracker.xml', 'file:Detector/DetFCChhECalSimple/compact/FCChh_ECalBarrel_Mockup.xml', 'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml'], OutputLevel = DEBUG) from Configurables import SimG4Svc ## Geant4 service # Configures the Geant simulation: geometry, physics list and user actions geantservice = SimG4Svc("SimG4Svc", detector='SimG4DD4hepDetector', physicslist="SimG4FtfpBert", actions="SimG4FullSimActions") from Configurables import SimG4Alg, SimG4SaveTrackerHits, SimG4SaveCalHits, SimG4PrimariesFromEdmTool ## Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools # 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")
energy = 50000 magnetic_field = 0 num_events = 1 from Gaudi.Configuration import * # Data service from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") # DD4hep geometry service 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) # 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") # Magnetic field from Configurables import SimG4ConstantMagneticFieldTool if magnetic_field == 1:
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