ATLAS Offline Software
Functions
IOVDbTestAlgConfig Namespace Reference

Functions

def IOVDbTestAlgFlags ()
 
def IOVDbTestAlgWriteCfg (flags, registerIOV=False)
 
def IOVDbTestAlgReadCfg (flags, overrideTag=True)
 

Function Documentation

◆ IOVDbTestAlgFlags()

def IOVDbTestAlgConfig.IOVDbTestAlgFlags ( )
Create default set of flags for tests

Definition at line 10 of file IOVDbTestAlgConfig.py.

10 def IOVDbTestAlgFlags():
11  """Create default set of flags for tests"""
12 
13  flags = initConfigFlags()
14  flags.Common.MsgSuppression = False
15  flags.Exec.OutputLevel = DEBUG
16  flags.Input.Files = []
17  flags.Input.isMC = True
18  flags.IOVDb.DBConnection = "sqlite://;schema=mytest.db;dbname=TESTCOOL"
19  flags.IOVDb.DatabaseInstance = ""
20  flags.IOVDb.GlobalTag = ""
21 
22  return flags
23 
24 

◆ IOVDbTestAlgReadCfg()

def IOVDbTestAlgConfig.IOVDbTestAlgReadCfg (   flags,
  overrideTag = True 
)

Definition at line 71 of file IOVDbTestAlgConfig.py.

71 def IOVDbTestAlgReadCfg(flags, overrideTag=True):
72  # Basic services
73  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
74  acc = MainServicesCfg(flags)
75 
76  from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg, addFolders
77  acc.merge( IOVDbSvcCfg(flags) )
78 
79  # Setup input services
80  if len(flags.Input.Files) > 0:
81  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
82  acc.merge( PoolReadCfg(flags) )
83  else:
84  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
85  acc.merge( McEventSelectorCfg(flags,
86  RunNumber = 1,
87  EventsPerRun = 5,
88  FirstEvent = 1,
89  EventsPerLB = 1,
90  FirstLB = 1,
91  InitialTimeStamp = 0,
92  TimeStampInterval = 5) )
93  # Testing algorithm
94  acc.addEventAlgo( CompFactory.IOVDbTestAlg(
95  "IOVDbTestAlg",
96  OutputLevel = DEBUG,
97  WriteCondObjs = False,
98  RegisterIOV = False,
99  ReadWriteCool = True,
100  PrintLB = True) )
101 
102  t = "COOL-TEST-001"
103  acc.merge( addFolders(flags, "/IOVDbTest/IOVDbTestMDTEleMap",
104  tag = f"MDTEleMap_{t}" if overrideTag else None) )
105  acc.merge( addFolders(flags, "/IOVDbTest/IOVDbTestAMDBCorrection",
106  tag = f"AmdbCorrection_{t}" if overrideTag else None) )
107  acc.merge( addFolders(flags, "/IOVDbTest/IOVDbTestAttrList",
108  tag = f"AttrList_{t}" if overrideTag else None) )
109  acc.merge( addFolders(flags, "/IOVDbTest/IOVDbTestAttrListColl",
110  tag = f"AttrListColl_{t}" if overrideTag else None) )
111  acc.merge( addFolders(flags, "/IOVDbTest/IOVDbTestMDTEleMapColl",
112  tag = f"MDTEleMapColl_{t}" if overrideTag else None) )
113 
114  return acc

◆ IOVDbTestAlgWriteCfg()

def IOVDbTestAlgConfig.IOVDbTestAlgWriteCfg (   flags,
  registerIOV = False 
)

Definition at line 25 of file IOVDbTestAlgConfig.py.

25 def IOVDbTestAlgWriteCfg(flags, registerIOV = False):
26  # Basic services
27  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
28  acc = MainServicesCfg(flags)
29 
30  from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
31  acc.merge( IOVDbSvcCfg(flags) )
32 
33  if registerIOV:
34  acc.addService( CompFactory.IOVRegistrationSvc(OutputLevel = DEBUG) )
35 
36  # Setup MC EventSelector and POOL
37  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
38  acc.merge( McEventSelectorCfg(flags,
39  RunNumber = 1,
40  EventsPerRun = 5,
41  FirstEvent = 1,
42  EventsPerLB = 1,
43  FirstLB = 1,
44  InitialTimeStamp = 0,
45  TimeStampInterval = 5) )
46 
47  from AthenaPoolCnvSvc.PoolCommonConfig import AthenaPoolCnvSvcCfg
48  acc.merge( AthenaPoolCnvSvcCfg(flags,
49  PoolContainerPrefix = "CollectionTree",
50  StorageTechnology = "ROOTTREE",
51  TopLevelContainerName = "<type>",
52  SubLevelBranchName = "") )
53 
54  # Testing algorithm
55  acc.addEventAlgo( CompFactory.IOVDbTestAlg(
56  "IOVDbTestAlg",
57  OutputLevel = DEBUG,
58  StreamName = "CondStream2",
59  RegTime = 0, # Set time to register - used for IOVDbTestAmdbCorrection
60  WriteCondObjs = True,
61  RegisterIOV = registerIOV,
62  ReadWriteCool = True,
63  TagID = "COOL-TEST-001",
64  PrintLB = True) )
65 
66  acc.addPublicTool( CompFactory.AthenaOutputStreamTool("CondStream2",
67  OutputFile = "SimplePoolFile.root") )
68  return acc
69 
70 
IOVDbTestAlgConfig.IOVDbTestAlgReadCfg
def IOVDbTestAlgReadCfg(flags, overrideTag=True)
Definition: IOVDbTestAlgConfig.py:71
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:19
python.PoolCommonConfig.AthenaPoolCnvSvcCfg
def AthenaPoolCnvSvcCfg(flags, **kwargs)
Definition: PoolCommonConfig.py:29
IOVDbTestAlgConfig.IOVDbTestAlgFlags
def IOVDbTestAlgFlags()
Definition: IOVDbTestAlgConfig.py:10
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
IOVDbTestAlgConfig.IOVDbTestAlgWriteCfg
def IOVDbTestAlgWriteCfg(flags, registerIOV=False)
Definition: IOVDbTestAlgConfig.py:25