ATLAS Offline Software
Functions
python.TPCnvTestConfig Namespace Reference

Functions

def TPCnvTest (infile, keys, useGeoModelSvc=False, useIOVDbSvc=False, doPixel=False, doSCT=False, doTRT=False, doLAr=False, doTile=False, doMuon=False, doTracks=False, configOnly=False, adjustMessageSvc=True)
 

Function Documentation

◆ TPCnvTest()

def python.TPCnvTestConfig.TPCnvTest (   infile,
  keys,
  useGeoModelSvc = False,
  useIOVDbSvc = False,
  doPixel = False,
  doSCT = False,
  doTRT = False,
  doLAr = False,
  doTile = False,
  doMuon = False,
  doTracks = False,
  configOnly = False,
  adjustMessageSvc = True 
)

Definition at line 13 of file TPCnvTestConfig.py.

13 def TPCnvTest(infile, keys, useGeoModelSvc=False, useIOVDbSvc=False, doPixel=False, doSCT=False, doTRT=False, doLAr=False, doTile=False, doMuon=False, doTracks=False, configOnly=False, adjustMessageSvc=True):
14 
15  # Needed to prevent spurious root errors about streams in CreateRealData.
16  import ROOT
17  ROOT.GaudiPython.CallbackStreamBuf
18 
19  # Make sure we don't have a stale file catalog.
20  if os.path.exists ('PoolFileCatalog.xml'):
21  os.remove ('PoolFileCatalog.xml')
22 
23  if ('ATLAS_REFERENCE_TAG' not in globals() and
24  'ATLAS_REFERENCE_TAG' in os.environ):
25  ATLAS_REFERENCE_TAG = os.environ['ATLAS_REFERENCE_TAG'] # noqa: F841
26 
27  refpaths = [os.environ.get ('ATLAS_REFERENCE_DATA', None),
28  '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art',
29  '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs',
30  '/afs/cern.ch/atlas/maxidisk/d33/referencefiles']
31 
32  if infile.startswith ('rtt:'):
33  infile = infile[4:]
34  infile = find_file (infile, refpaths)
35 
36  # Provide MC input
37  flags = initConfigFlags()
38  flags.Input.Files = [infile]
39  flags.GeoModel.Run = LHCPeriod.Run1
40  from AthenaConfiguration.TestDefaults import defaultGeometryTags
41  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN1_2012
42  if useGeoModelSvc:
43  flags.GeoModel.Align.Dynamic = False
44  flags.Detector.GeometryPixel = doPixel
45  flags.Detector.GeometrySCT = doSCT
46  flags.Detector.GeometryTRT = doTRT
47  flags.Detector.GeometryLAr = doLAr
48  flags.Detector.GeometryTile = doTile
49  flags.Detector.GeometryMuon = doMuon
50  flags.fillFromArgs()
51  flags.lock()
52 
53  # Construct ComponentAccumulator
54  acc = MainServicesCfg(flags)
55  acc.setAppProperty('PrintAlgsSequence', False, overwrite=True)
56  acc.merge(PoolReadCfg(flags))
57  if useIOVDbSvc:
58  acc.merge(IOVDbSvcCfg(flags))
59  EventCnvSuperTool = None
60  if useGeoModelSvc:
61  if flags.Detector.GeometryPixel:
62  from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
63  acc.merge(PixelReadoutGeometryCfg(flags))
64  if flags.Detector.GeometrySCT:
65  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
66  acc.merge(SCT_ReadoutGeometryCfg(flags))
67  if flags.Detector.GeometryTRT:
68  from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
69  acc.merge(TRT_ReadoutGeometryCfg(flags))
70  if flags.Detector.GeometryITkPixel:
71  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
72  acc.merge(ITkPixelReadoutGeometryCfg(flags))
73  if flags.Detector.GeometryITkStrip:
74  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
75  acc.merge(ITkStripReadoutGeometryCfg(flags))
76  if flags.Detector.GeometryLAr:
77  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
78  acc.merge(LArGMCfg(flags))
79  if flags.Detector.GeometryTile:
80  from TileGeoModel.TileGMConfig import TileGMCfg
81  acc.merge(TileGMCfg(flags))
82  if flags.Detector.GeometryMuon:
83  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
84  acc.merge(MuonGeoModelCfg(flags))
85  #acc.merge(ForDetGeometryCfg(flags))
86  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
87  acc.merge(GeoModelCfg(flags))
88  acc.getService("GeoModelSvc").IgnoreTagDifference = True
89  if doTracks:
90  # Doing this here as Trk.EventCnvSuperTool isn't part of all projects
91  Trk_EventCnvSuperTool=CompFactory.Trk.EventCnvSuperTool
92  EventCnvSuperTool = Trk_EventCnvSuperTool('EventCnvSuperTool', MaxErrorCount=10)
93  acc.addEventAlgo(Dumper ('dumper', flags.Input.Files[0], keys, refpaths), 'AthAlgSeq')
94  if adjustMessageSvc:
95  acc.getService("MessageSvc").enableSuppression = True
96  acc.getService("MessageSvc").Format = "% F%18W%S%7W%R%T %0W%M"
97  if EventCnvSuperTool is not None:
98  acc.addPublicTool(EventCnvSuperTool)
99  if configOnly:
100  f = open('new.pkl', 'wb')
101  acc.store(f)
102  f.close()
103  return
104  return acc.run(maxEvents=10)
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:59
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
ITkPixelGeoModelConfig.ITkPixelReadoutGeometryCfg
def ITkPixelReadoutGeometryCfg(flags)
Definition: ITkPixelGeoModelConfig.py:39
python.TPCnvTestConfig.TPCnvTest
def TPCnvTest(infile, keys, useGeoModelSvc=False, useIOVDbSvc=False, doPixel=False, doSCT=False, doTRT=False, doLAr=False, doTile=False, doMuon=False, doTracks=False, configOnly=False, adjustMessageSvc=True)
Definition: TPCnvTestConfig.py:13
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:51
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:19
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
PixelGeoModelConfig.PixelReadoutGeometryCfg
def PixelReadoutGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:52
Trk::open
@ open
Definition: BinningType.h:40
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.GeoModelConfig.GeoModelCfg
def GeoModelCfg(flags)
Definition: GeoModelConfig.py:16
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7