ATLAS Offline Software
Loading...
Searching...
No Matches
CDIHelpers Namespace Reference

Functions

 map_mc_campaign (MCCampaign)
 check_CDI_campaign (MCCampaign, CDIFile)

Function Documentation

◆ check_CDI_campaign()

CDIHelpers.check_CDI_campaign ( MCCampaign,
CDIFile )
Check if the right CDI file is use for a given MC Campaign 

Definition at line 14 of file CDIHelpers.py.

14def 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.lower():
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.lower():
25 raise ValueError("Mismatch of MC Campaign and CDI file. CDI file %s being used for %s campaign" % (CDIFile, MCCampaign))
26

◆ map_mc_campaign()

CDIHelpers.map_mc_campaign ( MCCampaign)

Definition at line 3 of file CDIHelpers.py.

3def 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