205def ZdcStreamDependentFlagSetting(flags):
206 '''Function that checks on data type from triggerstream tag
207 and sets run-type-and-year-dependent settings
208 Returns: a tuple of the following four values
209 isLED - bool, true if running on LED data
210 isInj - bool, true if running on Inj data
211 isCalib - bool, true if running on Calib data
212 pn - string, project name such as data24_hi
213 '''
214
215 isComm = (flags.Input.ProjectName == "data25_comm" and flags.Input.TriggerStream == "calibration_ZDCCalib")
216 isLED = (flags.Input.TriggerStream == "calibration_ZDCLEDCalib")
217 isInj = (flags.Input.TriggerStream == "calibration_ZDCInjCalib" or isComm)
218 isCalib = (flags.Input.TriggerStream in ["calibration_ZDCCalib","calibration_zdcCalib"] or "physics_" in flags.Input.TriggerStream or flags.Input.TriggerStream == "express_express" and not isComm)
219
220 if flags.Input.TriggerStream == "calibration_DcmDummyProcessor":
221 runInjForStandaloneDataArgValid = False
222
223 if flags.hasFlag("runInjForStandaloneData"):
224 if flags.runInjForStandaloneData.lower() == "inj":
225 isInj = True
226 runInjForStandaloneDataArgValid = True
227 elif flags.runInjForStandaloneData.lower() == "led":
228 isLED = True
229 runInjForStandaloneDataArgValid = True
230
231 if not runInjForStandaloneDataArgValid:
232 log.warning("runInjForStandaloneData is either not a defined flag or has invalid value (value must be Inj / LED, case insensitive).")
233 log.warning("Running nominal reconstruction (injector-pulse) by default for standalone data")
234 log.warning("Could lead to undesired behavior if pulsing LED in standalone mode")
235 isInj = True
236
237 if isLED:
238 log.info('ZdcRecConfig: Running LED data!')
239 if isInj:
240 log.info('ZdcRecConfig: Running Injected pulse data!')
241 if isCalib:
242 log.info('ZdcRecConfig: Running ZDC calibration data!')
243 if flags.Input.isMC:
244 log.info('ZdcRecConfig: Running over MC Samples')
245 flags.Input.ProjectName = "data23_hi"
246 flags.Reco.EnableTrigger = False
247
248
249 pn = flags.Input.ProjectName
250 if not pn:
251 raise ValueError('Unknown project name')
252
253 if isLED or isInj or pn == 'data_test':
254 flags.Trigger.EDMVersion=3
255 flags.GeoModel.Run = LHCPeriod.Run3
256 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
257 else:
258 year = int(pn.split(
'_')[0].
split(
'data')[1])
259 if year < 20:
260 flags.Trigger.EDMVersion=2
261 flags.GeoModel.Run = LHCPeriod.Run2
262 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN2_DATA
263 elif year > 20:
264 flags.Trigger.EDMVersion=3
265 flags.GeoModel.Run = LHCPeriod.Run3
266 flags.IOVDb.GlobalTag=defaultConditionsTags.RUN3_DATA
267
268 if flags.Input.isMC:
269 log.info('ZdcRecConfig: Overriding MC run to be Run 3!')
270 flags.GeoModel.Run = LHCPeriod.Run3
271
272 if (isInj
273 or flags.Input.TriggerStream == "calibration_DcmDummyProcessor"
274 or pn == "data22_13p6TeV"):
275 flags.Detector.EnableZDC_RPD = False
276
277 if flags.Input.TriggerStream == "calibration_DcmDummyProcessor":
278 flags.DQ.useTrigger = False
279 flags.DQ.triggerDataAvailable = False
280
281 flags.GeoModel.AtlasVersion=zdcGeometry(flags)
282
283 return isLED, isInj, isCalib, pn
284
285
std::vector< std::string > split(const std::string &s, const std::string &t=":")