211def filterSelsTranscation(argBarrelSels: list, argMuonSels: list, argBarrelTrackCuts: list, argMuonsCuts: list, configuredCommands: dict):
212 """It checks whether the event filter selections and analysis cuts in the
213 Filter PP task are in the same number and order
214
215 Args:
216 argBarrelSels (CLI Argument): Event filter argument for barrel
217 argMuonSels (CLI Argument): Event filter argument for muons
218 argBarrelTrackCuts (CLI Argument): Analysis cut argument for barrel
219 argMuonsCuts (CLI Argument): Analysis cuts argument for muons
220 configuredCommands (dict): Dictionary of all arguments provided by the CLI
221
222 Raises:
223 MandatoryArgNotFoundError: If the required argument is not found
224 SelsAndCutsNotHaveSameNumberError : If Filter Selections and analysis cuts not in same number and order
225 """
226
227 argMuonSelsClean = []
228 argBarrelSelsClean = []
229
230 if argMuonSels:
231 try:
232 if argMuonsCuts is None:
233 raise MandatoryArgNotFoundError(argMuonsCuts)
234 else:
235 pass
236
237 except MandatoryArgNotFoundError as e:
238 logging.exception(e)
239 logging.error("For configure to cfgMuonSels (For DQ Filter PP Task), you must also configure cfgMuonsCuts!!!")
240 sys.exit()
241
242
243 for i in argMuonSels:
244 i = i[0 : i.index(":")]
245 argMuonSelsClean.append(i)
246
247 try:
248 if argMuonSelsClean == argMuonsCuts:
249 pass
250 else:
251 raise SelsAndCutsNotHaveSameNumberError
252
253 except SelsAndCutsNotHaveSameNumberError as e:
254 logging.exception(e)
255 logging.info(
256 "[INFO] For fixing this issue, you should have the same number of cuts (and in the same order) provided to the cfgMuonsCuts from dq-selection as those provided to the cfgMuonSels in the DQFilterPPTask."
257 )
258 logging.info(
259 "For example, if cfgMuonCuts is muonLowPt,muonHighPt,muonLowPt then the cfgMuonSels has to be something like: muonLowPt::1,muonHighPt::1,muonLowPt:pairNoCut:1"
260 )
261 sys.exit()
262
263 logging.info("Event filter configuration is valid for muons")
264
265 if argBarrelSels:
266
267 try:
268 if argBarrelTrackCuts is None:
269 raise MandatoryArgNotFoundError(argBarrelTrackCuts)
270 else:
271 pass
272
273 except MandatoryArgNotFoundError as e:
274 logging.exception(e)
275 logging.error("For configure to cfgBarrelSels (For DQ Filter PP Task), you must also configure cfgBarrelTrackCuts!!!")
276 sys.exit()
277
278
279 for i in argBarrelSels:
280 i = i[0 : i.index(":")]
281 argBarrelSelsClean.append(i)
282
283 try:
284 if argBarrelSelsClean == argBarrelTrackCuts:
285 pass
286 else:
287 raise SelsAndCutsNotHaveSameNumberError
288
289 except SelsAndCutsNotHaveSameNumberError as e:
290 logging.exception(e)
291 logging.info(
292 "For fixing this issue, you should have the same number of cuts (and in the same order) provided to the cfgBarrelTrackCuts from dq-selection as those provided to the cfgBarrelSels in the DQFilterPPTask."
293 )
294 logging.info(
295 "For example, if cfgBarrelTrackCuts is jpsiO2MCdebugCuts,jpsiO2MCdebugCuts2,jpsiO2MCdebugCuts then the cfgBarrelSels has to be something like: jpsiO2MCdebugCuts::1,jpsiO2MCdebugCuts2::1,jpsiO2MCdebugCuts:pairNoCut:1"
296 )
297 sys.exit()
298
299 logging.info("Event filter configuration is valid for barrel")
300
301
302"""
303def tableReaderDepsChecker(analysisCfg,processCfg,mixingCfg):
304
305 sameEventPairingDeps = {
306 ["JpsiToEE"]: ["trackSelection"],
307 ["JpsiToMuMu"]: ["muonSelection"],
308 ["JpsiToMuMuVertexing"]: ["muonSelection"],
309 ["VnJpsiToEE"]: ["trackSelection"],
310 ["JpsiToMuMu"]: ["muonSelection"],
311 ["ElectronMuon"] : ["trackSelection","muonSelection"],
312 ["All"] : ["trackSelection","muonSelection"]
313 }
314
315 eventMixingDeps = {
316 "Barrel": "trackSelection",
317 "Muon": "muonSelection",
318 "BarrelMuon": ["trackSelection","muonSelection"],
319 "BarrelVn": "trackSelection",
320 "MuonVn": "muonSelection"
321 }
322
323
324 for k,v in sameEventPairingDeps.items():
325 if (k in processCfg) and v not in analysisCfg:
326 raise
327
328 for k,v in eventMixingDeps.items():
329 if (k in mixingCfg) and v not in analysisCfg:
330 raise
331"""