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