Newer
Older
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#!/usr/bin/env python
import sys
from AthenaCommon.Constants import VERBOSE, INFO
from AthenaConfiguration.ComponentFactory import CompFactory
def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs):
# Initialize GeoModel
from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
a = FaserGeometryCfg(flags)
# Initialize field service
from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
a.merge(MagneticFieldSvcCfg(flags))
# Disable the field
cacheAlg = a.getCondAlgo("FaserFieldCacheCondAlg")
cacheAlg.UseDipoScale = 0.0
cacheAlg.UseDCS = False
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Configure the algorithm itself
GeoModelTestAlg = CompFactory.GeoModelTestAlg
a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=0,
LastSCTStation=0,
NumVetoStations=1,
NumVetoPlatesPerStation=2,
NumTriggerStations=0,
**kwargs))
return a
if __name__ == "__main__":
from AthenaCommon.Logging import log#, logging
from AthenaCommon.Configurable import Configurable
from CalypsoConfiguration.AllConfigFlags import ConfigFlags
Configurable.configurableRun3Behavior = True
# Flags for this job
ConfigFlags.Input.isMC = True # Needed to bypass autoconfig
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion
ConfigFlags.GeoModel.FaserVersion = "FASER-TB00" # Default FASER geometry
ConfigFlags.GeoModel.GeoExportFile = "faserTestBeamGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip)
# ConfigFlags.Detector.EnableVeto = True
# ConfigFlags.Detector.EnableTrigger = True
# ConfigFlags.Detector.EnablePreshower= True
# ConfigFlags.Detector.EnableFaserSCT = True
# ConfigFlags.Detector.EnableUpstreamDipole = True
# ConfigFlags.Detector.EnableCentralDipole = True
# ConfigFlags.Detector.EnableDownstreamDipole = True
# ConfigFlags.Detector.EnableEcal = True
ConfigFlags.lock()
# Configure components
from CalypsoConfiguration.MainServicesConfig import MainServicesCfg
acc = MainServicesCfg(ConfigFlags)
# Set up algorithm
acc.merge(GeoModelTestCfg(ConfigFlags))
# Configure verbosity
msgSvc = acc.getService("MessageSvc")
msgSvc.Format = "% F%30W%S%7W%R%T %0W%M"
# ConfigFlags.dump()
# logging.getLogger('forcomps').setLevel(VERBOSE)
acc.foreach_component("*").OutputLevel = VERBOSE
acc.foreach_component("*ClassID*").OutputLevel = INFO
log.setLevel(VERBOSE)
# Execute and finish
sys.exit(int(acc.run(maxEvents=1).isFailure()))