testConfig.py 13.4 KB
Newer Older
1
2
test="run2Data"

3
4
import AthenaCommon.AtlasUnixStandardJob

5
6
7
8
9
# Setup logger
from AthenaCommon.Logging import logging
msg = logging.getLogger("testConfig")
msg.setLevel(logging.INFO)

10
11
12
13
#--------------------------------------------------------------
# Thread-specific setup
#--------------------------------------------------------------
from AthenaCommon.ConcurrencyFlags import jobproperties
14
15
numThreads = jobproperties.ConcurrencyFlags.NumThreads()
if numThreads > 0:
16
17
18
19
20
  from AthenaCommon.AlgScheduler import AlgScheduler
  AlgScheduler.CheckDependencies( True )
  AlgScheduler.ShowControlFlow( True )
  AlgScheduler.ShowDataDependencies( True )

21
22
23
24
25
26
27
28
29
30
31
32
33
34
# use auditors
from AthenaCommon.AppMgr import ServiceMgr
from GaudiSvc.GaudiSvcConf import AuditorSvc

ServiceMgr += AuditorSvc()
theAuditorSvc = ServiceMgr.AuditorSvc
theAuditorSvc.Auditors  += [ "ChronoAuditor"]
theAuditorSvc.Auditors  += [ "MemStatAuditor" ]
theApp.AuditAlgorithms=True

#--------------------------------------------------------------
# Load Geometry
#--------------------------------------------------------------
from AthenaCommon.GlobalFlags import globalflags
35
36
37
38
39
40
41
42
43
44
if test=="run1MC":
  globalflags.DetDescrVersion = "ATLAS-R1-2012-03-00-00"
  globalflags.DataSource="geant4"
elif test=="run2MC":
  globalflags.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
  globalflags.DataSource="geant4"
elif test=="run2Data":
  globalflags.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
  globalflags.DataSource="data"

45
46
globalflags.DetGeo="atlas"
globalflags.InputFormat="pool"
47
msg.info(globalflags)
48
49
50
51
52
53
54

#--------------------------------------------------------------
# Set Detector setup
#--------------------------------------------------------------
# --- switch on InnerDetector
from AthenaCommon.DetFlags import DetFlags 
DetFlags.detdescr.SCT_setOn()
55
DetFlags.ID_setOff()
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
DetFlags.Calo_setOff()
DetFlags.Muon_setOff()
DetFlags.Truth_setOff()
DetFlags.LVL1_setOff()
DetFlags.SCT_setOn()

# ---- switch parts of ID off/on as follows
#switch off tasks
DetFlags.pileup.all_setOff()
DetFlags.simulate.all_setOff()
DetFlags.makeRIO.all_setOff()
DetFlags.writeBS.all_setOff()
DetFlags.readRDOBS.all_setOff()
DetFlags.readRIOBS.all_setOff()
DetFlags.readRIOPool.all_setOff()
DetFlags.writeRIOPool.all_setOff()

import AtlasGeoModel.SetGeometryVersion
import AtlasGeoModel.GeoModelInit

76
77
78
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()

79
80
81
# Set up SCT cabling
from AthenaCommon.Include import include
include('InDetRecExample/InDetRecCabling.py')
82

83
84
85
86
87
#--------------------------------------------------------------
# Load IOVDbSvc
#--------------------------------------------------------------
IOVDbSvc = Service("IOVDbSvc")
from IOVDbSvc.CondDB import conddb
88
89
90
91
92
93
94
if (test=='run1MC'):
  IOVDbSvc.GlobalTag='OFLCOND-RUN12-SDR-25'
elif (test=='run2MC'):
  IOVDbSvc.GlobalTag='OFLCOND-RUN12-SDR-25'
elif (test=='run2Data'):
  IOVDbSvc.GlobalTag='CONDBR2-BLKPA-2018-14'

95
IOVDbSvc.OutputLevel = DEBUG
96

97
98
99
100
#
#NOTE: Testing with run2 requires presence of local sqlite file 'configTest.db'
# available from http://sroe.web.cern.ch/sroe/configTest.db
#
101
if (test=='run1MC'):
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  #ToolSvc = ServiceMgr.ToolSvc
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/ROD <tag>SctDaqConfigurationRod-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/MUR <tag>SctDaqConfigurationMur-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/RODMUR <tag>SctDaqConfigurationRodmur-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/Geog <tag>SctDaqConfigurationGeog-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/Chip <tag>SctDaqConfigurationChip-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/Module <tag>SctDaqConfigurationModule-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  '''
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/Chip <tag>SctDaqConfigurationChip-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/Module <tag>SctDaqConfigurationModule-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/MUR <tag>SctDaqConfigurationMur-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/ROD <tag>SctDaqConfigurationRod-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/Geog <tag>SctDaqConfigurationGeog-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Configuration/RODMUR <tag>SctDaqConfigurationRodmur-MC-06</tag> <forceTimestamp>1333597198</forceTimestamp>")
  '''
117
elif (test=='run2MC'):
118
119
120
121
122
123
124
125
126
127
128
129
130
131
  '''
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-MC-06</tag><forceRunNumber>20</forceRunNumber>")
  
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=/tmp/sroe/mycool7.db;dbname=OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
132
  
133
134
135
136
137
138
139
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-MC-06</tag><forceRunNumber>200805</forceRunNumber>")
  
140
141
142
143
144
145
146
147
  #test 'perfect' local db
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  conddb.addFolder("","<db>sqlite://none;schema=output.db;dbname=CONDBR2</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-Oct2016_00</tag><forceRunNumber>20</forceRunNumber>")
  '''
148

149
  #test perfect DB on server
150
151
152
  # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec")
  # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec")
  # conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>", className="CondAttrListVec")
153
154
155
156
157
158
  if not conddb.folderRequested("/SCT/DAQ/Config/ROD"):
    conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/ROD <tag>SctDaqConfigRod-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
  if not conddb.folderRequested("/SCT/DAQ/Config/Geog"):
    conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Geog <tag>SctDaqConfigGeog-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
  if not conddb.folderRequested("/SCT/DAQ/Config/RODMUR"):
    conddb.addFolder("","<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/RODMUR <tag>SctDaqConfigRodmur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
159
  
160

161
162
from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup
sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup()
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

if (test=='run1MC'):
  sct_ConfigurationConditionsToolSetup.setChannelFolderDb("<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/Chip <tag>SctDaqConfigurationChip-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  sct_ConfigurationConditionsToolSetup.setModuleFolderDb("<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/Module <tag>SctDaqConfigurationModule-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  sct_ConfigurationConditionsToolSetup.setMurFolderDb("<db>sqlite://none;schema=/tmp/sroe/mycool.db;dbname=LOCAL</db> /SCT/DAQ/Configuration/MUR <tag>SctDaqConfigurationMur-MC-06</tag><forceTimestamp>1333597198</forceTimestamp>")
  sct_ConfigurationConditionsToolSetup.setDbInstance("")
elif (test=='run2MC'):
  sct_ConfigurationConditionsToolSetup.setChannelFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Chip <tag>SctDaqConfigChip-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
  sct_ConfigurationConditionsToolSetup.setModuleFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/Module <tag>SctDaqConfigModule-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
  sct_ConfigurationConditionsToolSetup.setMurFolderDb("<db>COOLOFL_SCT/OFLP200</db> /SCT/DAQ/Config/MUR <tag>SctDaqConfigMur-PERFECT-Oct2016_00</tag><forceRunNumber>200805</forceRunNumber>")
  sct_ConfigurationConditionsToolSetup.setDbInstance("")
elif (test=='run2Data'):
  sct_ConfigurationConditionsToolSetup.setChannelFolderDb("/SCT/DAQ/Config/Chip")
  sct_ConfigurationConditionsToolSetup.setModuleFolderDb("/SCT/DAQ/Config/Module")
  sct_ConfigurationConditionsToolSetup.setMurFolderDb("/SCT/DAQ/Config/MUR")

179
sct_ConfigurationConditionsToolSetup.setup()
180

181
from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_ConfigurationConditionsTestAlg
182
MyConfigTestAlg = SCT_ConfigurationConditionsTestAlg("MyConfigTestAlg")
183
MyConfigTestAlg.SCT_ConfigurationConditionsTool = sct_ConfigurationConditionsToolSetup.getTool()
184
185
job += MyConfigTestAlg

186
187
188
189
190
if numThreads >= 2:
  from SCT_ConditionsAlgorithms.SCTCondAlgCardinality import sctCondAlgCardinality
  sctCondAlgCardinality.set(numThreads)
  MyConfigTestAlg.Cardinality = numThreads

191
import AthenaCommon.AtlasUnixGeneratorJob
192
193
194
195
196
197
if (test=='run1MC') or (test=='run2MC'):
  ServiceMgr.EventSelector.RunNumber=200805
  ServiceMgr.EventSelector.InitialTimeStamp=1333597198
elif (test=='run2Data'):
  ServiceMgr.EventSelector.RunNumber=364214
  ServiceMgr.EventSelector.InitialTimeStamp=1540243090 # 2018-10-22T23:18:10+02:00, Run 364214, LB 51
198
theApp.EvtMax = 20
199
200

ServiceMgr.MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M"
201
ServiceMgr.MessageSvc.OutputLevel = DEBUG