Skip to content
Snippets Groups Projects

Add dipole and update scintillator layers in ACTS tracking geometry and material mapping

Merged Ke Li requested to merge keli/calypso:adddipole into master
10 files
+ 184
73
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -19,41 +19,34 @@ if __name__ == "__main__":
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
from G4FaserAlg.G4FaserAlgConfigNew import G4FaserAlgCfg
from G4FaserAlg.G4FaserAlgConfigNew import G4FaserMaterialStepRecorderAlgCfg
from G4FaserServices.G4FaserServicesConfigNew import G4GeometryNotifierSvcCfg
from G4FaserServices.G4FaserUserActionConfigNew import UserActionMaterialStepRecorderSvcCfg
#
# Set up logging and new style config
#
log.setLevel(VERBOSE)
Configurable.configurableRun3Behavior = True
#
# Input settings (Generator file)
#
# from AthenaConfiguration.TestDefaults import defaultTestFiles
# ConfigFlags.Input.Files = defaultTestFiles.EVNT
#
# Alternatively, these must ALL be explicitly set to run without an input file
# (if missing, it will try to read metadata from a non-existent file and crash)
#
from AthenaConfiguration.Enums import ProductionStep
ConfigFlags.Common.ProductionStep = ProductionStep.Simulation
ConfigFlags.Sim.ReleaseGeoModel = False
ConfigFlags.Input.Files = [""]
ConfigFlags.Input.isMC = True
ConfigFlags.Input.RunNumber = 12345
ConfigFlags.Input.Collections = [""]
ConfigFlags.Input.ProjectName = "mc19"
ConfigFlags.Input.RunNumber = [12345]
ConfigFlags.Input.OverrideRunNumber = True
ConfigFlags.Input.LumiBlockNumber = [1]
Configurable.configurableRun3Behavior = 1
ConfigFlags.Common.isOnline = False
ConfigFlags.Beam.Type = "collisions"
ConfigFlags.Beam.Energy = 7*TeV # Informational, does not affect simulation
ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Always needed
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-01" # Always needed; must match FaserVersion
# Workaround for bug/missing flag; unimportant otherwise
ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Always needed
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion
ConfigFlags.addFlag("Input.InitialTimeStamp", 0)
# Workaround to avoid problematic ISF code
ConfigFlags.GeoModel.Layout = "Development"
#
# Output settings
#
ConfigFlags.Output.HITSFileName = "MaterialStepCollection.root"
ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" # Optional dump of geometry for browsing in vp1light
ConfigFlags.GeoModel.Align.Dynamic = False
#
# Geometry-related settings
# Do not change!
@@ -61,8 +54,6 @@ if __name__ == "__main__":
detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal']
from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList
setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
ConfigFlags.GeoModel.Align.Dynamic = False
ConfigFlags.Sim.ReleaseGeoModel = False
#
# All flags should be set before calling lock
#
@@ -79,9 +70,9 @@ if __name__ == "__main__":
pg.McEventKey = "BeamTruthEvent"
pg.randomSeed = 123456
pg.sampler.pid = 999
pg.sampler.mom = PG.EThetaMPhiSampler(energy=1*TeV, theta=[0, pi/20], phi=[0, 2*pi])
pg.sampler.pos = PG.PosSampler(x=[-5, 5], y=[-5, 5], z=-2100.0, t=0.0)
acc.addEventAlgo(pg, "AthBeginSeq") # to run *before* G4
pg.sampler.mom = PG.EThetaMPhiSampler(energy=1*TeV, theta=[0, pi/200], phi=[0, 2*pi])
pg.sampler.pos = PG.PosSampler(x=[-150, 150], y=[-150, 150], z=-2100.0, t=0.0)
acc.addEventAlgo(pg, "AthBeginSeq", primary = True) # to run *before* G4
#
# Only one of these two should be used in a given job
# (MCEventSelectorCfg for generating events with no input file,
@@ -107,7 +98,8 @@ if __name__ == "__main__":
# Here is the configuration of the Geant4 pieces
#
acc.merge(FaserGeometryCfg(ConfigFlags))
acc.merge(G4FaserMaterialStepRecorderAlgCfg(ConfigFlags))
acc.merge(UserActionMaterialStepRecorderSvcCfg(ConfigFlags))
acc.merge(G4FaserAlgCfg(ConfigFlags))
acc.addService(G4GeometryNotifierSvcCfg(ConfigFlags, ActivateLVNotifier=True))
#
# Verbosity
@@ -125,4 +117,4 @@ if __name__ == "__main__":
#
# Execute and finish
#
sys.exit(int(acc.run(maxEvents=20000).isFailure()))
sys.exit(int(acc.run(maxEvents=1000000).isFailure()))
Loading