ATLAS Offline Software
Classes | Functions
python.TriggerListsHelper Namespace Reference

Classes

class  TriggerListsHelper
 

Functions

def read_trig_list_file (fname)
 
def read_trig_list_flags (flags)
 
def getTapisSession (flags)
 

Function Documentation

◆ getTapisSession()

def python.TriggerListsHelper.getTapisSession (   flags)

Definition at line 32 of file TriggerListsHelper.py.

32 def getTapisSession(flags):
33  from Campaigns.Utils import Campaign
34  from AthenaConfiguration.Enums import Format
35  yearStr = str(flags.Input.DataYear) if not flags.Input.isMC else ""
36  if flags.Input.isMC:
37  if flags.Input.MCCampaign == Campaign.MC16a or flags.Input.MCCampaign == Campaign.MC20a:
38  yearStr = "2015_2016"
39  elif flags.Input.MCCampaign == Campaign.MC16d or flags.Input.MCCampaign == Campaign.MC20d:
40  yearStr = "2017"
41  elif flags.Input.MCCampaign == Campaign.MC16e or flags.Input.MCCampaign == Campaign.MC20e:
42  yearStr = "2018"
43  elif flags.Input.MCCampaign == Campaign.MC23a or flags.Input.MCCampaign == Campaign.MC21a:
44  yearStr = "2022"
45  elif flags.Input.MCCampaign == Campaign.MC23c or flags.Input.MCCampaign == Campaign.MC23d:
46  yearStr = "2023"
47  elif flags.Input.MCCampaign == Campaign.MC23e:
48  yearStr = "2024"
49 
50  session_files = {
51  "2015": "TriggerAPISessions/tapis_data15_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns.json",
52  "2016": "TriggerAPISessions/tapis_data16_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns_WITH_IGNORES.json",
53  "2015_2016": "TriggerAPISessions/tapis_data15_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns_data16_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns_WITH_IGNORES.json",
54  "2017": "TriggerAPISessions/tapis_data17_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.json",
55  "2018": "TriggerAPISessions/tapis_data18_13TeV_20190708_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.json",
56  "2022": "TriggerAPISessions/tapis_data22_13p6TeV_20230207_PHYS_StandardGRL_All_Good_25ns.json",
57  "2023": "TriggerAPISessions/tapis_data23_13p6TeV_20230828_PHYS_StandardGRL_All_Good_25ns.json",
58  "2024": "TriggerAPISessions/tapis_data24_13p6TeV_20241118_PHYS_StandardGRL_All_Good_25ns.json",
59  }
60 
61  if yearStr in session_files:
62  return TriggerAPISession(json=session_files[yearStr])
63 
64  # Otherwise: data24, MC23e, phase-II. Base this on the menu from the AOD.
65  if flags.Input.Format == Format.POOL:
66  return TriggerAPISession(file=flags.Input.Files[0])
67 
68  from AthenaCommon.Logging import logging
69  logging.getLogger('TriggerListHelper::GetTriggerLists::getTapisSession').error('Failed to obtain a session.')
70  return None
71 
72 

◆ read_trig_list_file()

def python.TriggerListsHelper.read_trig_list_file (   fname)
Read a text file containing a list of triggers
Returns the list of triggers held in the file

Definition at line 9 of file TriggerListsHelper.py.

9 def read_trig_list_file(fname):
10  """Read a text file containing a list of triggers
11  Returns the list of triggers held in the file
12  """
13  triggers = []
14  with open(PathResolver.FindCalibFile(fname)) as fp:
15  for line in fp:
16  line = line.strip()
17  if line == "" or line.startswith("#"):
18  continue
19  triggers.append(line)
20  return triggers
21 

◆ read_trig_list_flags()

def python.TriggerListsHelper.read_trig_list_flags (   flags)

Definition at line 22 of file TriggerListsHelper.py.

22 def read_trig_list_flags(flags):
23  trigger_names_notau = []
24  trigger_names_tau = []
25  for chain_name in flags.Trigger.derivationsExtraChains:
26  if "tau" in chain_name:
27  trigger_names_tau.append(chain_name)
28  else:
29  trigger_names_notau.append(chain_name)
30  return (trigger_names_notau, trigger_names_tau)
31 
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:108
python.TriggerListsHelper.read_trig_list_flags
def read_trig_list_flags(flags)
Definition: TriggerListsHelper.py:22
python.TriggerListsHelper.read_trig_list_file
def read_trig_list_file(fname)
Definition: TriggerListsHelper.py:9
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
python.TriggerListsHelper.getTapisSession
def getTapisSession(flags)
Definition: TriggerListsHelper.py:32
error
Definition: IImpactPoint3dEstimator.h:70