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