ATLAS Offline Software
Loading...
Searching...
No Matches
python.TriggerAnalysisSFConfig Namespace Reference

Classes

class  TriggerAnalysisSFBlock

Functions

bool is_mc_from (ConfigAccumulator config, Union[Campaign, Iterable[Campaign]] campaign_list)
bool is_data_from (config, Union[int, Iterable[int]] data_year_list)
list get_year_data (dict dictionary, int|str year)
list[int] get_input_years (ConfigAccumulator config)
 trigger_set (config, triggerChainsPerYear, includeAllYearsPerRun)

Function Documentation

◆ get_input_years()

list[int] python.TriggerAnalysisSFConfig.get_input_years ( ConfigAccumulator config)
Utility function to get the list of years that the input corresponds to

Definition at line 35 of file TriggerAnalysisSFConfig.py.

35def get_input_years(config: ConfigAccumulator) -> list[int]:
36 """
37 Utility function to get the list of years that the input corresponds to
38 """
39 years = []
40 if config.campaign() is Campaign.MC20a:
41 years = [2015, 2016]
42 elif is_data_from(config, 2015):
43 years = [2015]
44 elif is_data_from(config, 2016):
45 years = [2016]
46 elif config.campaign() is Campaign.MC20d or is_data_from(config, 2017):
47 years = [2017]
48 elif config.campaign() is Campaign.MC20e or is_data_from(config, 2018):
49 years = [2018]
50 elif config.campaign() is Campaign.MC23a or is_data_from(config, 2022):
51 years = [2022]
52 elif config.campaign() is Campaign.MC23d or is_data_from(config, 2023):
53 years = [2023]
54 elif config.campaign() is Campaign.MC23e or is_data_from(config, 2024):
55 years = [2024]
56 elif config.campaign() is Campaign.MC23g or is_data_from(config, 2025):
57 years = [2025]
58 else:
59 raise ValueError('TriggerAnalysisConfig: unable to deduce data taking year for input file')
60
61 return years
62
63

◆ get_year_data()

list python.TriggerAnalysisSFConfig.get_year_data ( dict dictionary,
int | str year )
Utility function to get the data for a specific year from a dictionary

Definition at line 28 of file TriggerAnalysisSFConfig.py.

28def get_year_data(dictionary: dict, year: int | str) -> list:
29 """
30 Utility function to get the data for a specific year from a dictionary
31 """
32 return dictionary.get(int(year), dictionary.get(str(year), []))
33
34

◆ is_data_from()

bool python.TriggerAnalysisSFConfig.is_data_from ( config,
Union[int, Iterable[int]] data_year_list )
Utility function to check whether the data type is data and whether the year is in desired list of years

Definition at line 20 of file TriggerAnalysisSFConfig.py.

20def is_data_from(config, data_year_list: Union[int, Iterable[int]]) -> bool:
21 """
22 Utility function to check whether the data type is data and whether the year is in desired list of years
23 """
24 data_year_list = [data_year_list] if isinstance(data_year_list, int) else data_year_list
25 return config.dataType() is DataType.Data and config.dataYear() in data_year_list
26
27

◆ is_mc_from()

bool python.TriggerAnalysisSFConfig.is_mc_from ( ConfigAccumulator config,
Union[Campaign, Iterable[Campaign]] campaign_list )
Utility function to check whether the data type is mc and whether the campaign is in desired list of campaigns
without causing an invalid FlugEnum comparison

Definition at line 11 of file TriggerAnalysisSFConfig.py.

11def is_mc_from(config: ConfigAccumulator, campaign_list: Union[Campaign, Iterable[Campaign]]) -> bool:
12 """
13 Utility function to check whether the data type is mc and whether the campaign is in desired list of campaigns
14 without causing an invalid FlugEnum comparison
15 """
16 campaign_list = [campaign_list] if isinstance(campaign_list, Campaign) else campaign_list
17 return config.dataType() is not DataType.Data and config.campaign() in campaign_list
18
19

◆ trigger_set()

python.TriggerAnalysisSFConfig.trigger_set ( config,
triggerChainsPerYear,
includeAllYearsPerRun )

Definition at line 64 of file TriggerAnalysisSFConfig.py.

64def trigger_set(config, triggerChainsPerYear, includeAllYearsPerRun):
65 triggers = set()
66 if includeAllYearsPerRun:
67 for year in triggerChainsPerYear:
68 if not is_year_in_current_period(config, year):
69 continue
70 triggers.update(get_year_data(triggerChainsPerYear, year))
71 else:
72 for year in get_input_years(config):
73 triggers.update(get_year_data(triggerChainsPerYear, year))
74 return triggers
75
76
STL class.