ATLAS Offline Software
CDIHelpers.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 def map_mc_campaign(MCCampaign):
4  MCCampaign = MCCampaign.value
5  if MCCampaign.lower().startswith("mc20"):
6  return "MC20"
7  elif MCCampaign.lower().startswith("mc21"):
8  return "MC21"
9  elif MCCampaign.lower().startswith("mc23"):
10  return "MC23"
11  else:
12  return "MCUnknown"
13 
14 def check_CDI_campaign(MCCampaign, CDIFile):
15  """ Check if the right CDI file is use for a given MC Campaign """
16  MCCampaign = map_mc_campaign(MCCampaign)
17  if MCCampaign == "MCUnknown":
18  raise ValueError("The MC Campaign is not recognized. Currently we only have CDI file for MC20, MC21 and MC23.")
19 
20  run3_campaigns = ["MC21", "MC23"]
21  if MCCampaign == "MC20":
22  if MCCampaign not in CDIFile and "noSF" not in CDIFile:
23  raise ValueError("Mismatch of MC Campaign and CDI file. CDI file %s being used for %s campaign" % (CDIFile, MCCampaign))
24  elif not any (campaign in CDIFile for campaign in run3_campaigns) and "noSF" not in CDIFile:
25  raise ValueError("Mismatch of MC Campaign and CDI file. CDI file %s being used for %s campaign" % (CDIFile, MCCampaign))
26 
CDIHelpers.map_mc_campaign
def map_mc_campaign(MCCampaign)
Definition: CDIHelpers.py:3
CDIHelpers.check_CDI_campaign
def check_CDI_campaign(MCCampaign, CDIFile)
Definition: CDIHelpers.py:14