ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.AtlCoolTriggerTool.AtlCoolTriggerTool Class Reference
Collaboration diagram for python.AtlCoolTriggerTool.AtlCoolTriggerTool:

Public Member Functions

def __init__ (self, options={})
 
def check_options (self)
 
def MergeRanges (self, listOfRanges)
 
def GetRunRanges (self, runRange)
 
def init (self)
 
def getConfigKeys (self)
 
def printHLTProcessingString (self, runKeys)
 
def printConfigKeys (self, runKeys)
 
def printMenu (self, run)
 
def printStreams (self, run)
 
def execute (self)
 

Public Attributes

 opt
 
 runlist
 
 dbconn
 

Detailed Description

Definition at line 9 of file AtlCoolTriggerTool.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.__init__ (   self,
  options = {} 
)

Definition at line 11 of file AtlCoolTriggerTool.py.

11  def __init__(self, options={}):
12  self.opt = options
13  if not self.check_options():
14  sys.exit(0)
15  self.init()
16 
17 
18 

Member Function Documentation

◆ check_options()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.check_options (   self)

Definition at line 19 of file AtlCoolTriggerTool.py.

19  def check_options(self):
20  opt = self.opt
21  if opt.l1 and not opt.menu:
22  print ("Option l1 requires option 'menu' to be set")
23  return False
24 
25  if opt.l2 and not opt.menu:
26  print ("Option l2 requires option 'menu' to be set")
27  return False
28 
29  if opt.ef and not opt.menu:
30  print ("Option ef requires option 'menu' to be set")
31  return False
32 
33  if opt.processing and opt.processing!='hlt':
34  print ("Option p|processing must be set to 'hlt'")
35  return False
36 
37  if opt.menu and not (opt.l1 or opt.l2 or opt.ef):
38  opt.l1 = opt.l2 = opt.ef = True
39 
40  return True
41 
42 

◆ execute()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.execute (   self)

Definition at line 161 of file AtlCoolTriggerTool.py.

161  def execute(self):
162  (runs, configKeys) = self.getConfigKeys()
163 
164  if self.opt.processing=='hlt':
165  self.printHLTProcessingString(configKeys)
166  return
167  else:
168  self.printConfigKeys(configKeys)
169 
170  self.opt.isSingleRun = len(runs)==1
171 
172  if self.opt.menu and not self.opt.isSingleRun:
173  print ("Error: option 'menu' works only for single run")
174  sys.exit(0)
175 
176  if self.opt.streams and not self.opt.isSingleRun:
177  print ("Error: option 'streams' works only for single run")
178  sys.exit(0)
179 
180  if self.opt.isSingleRun:
181  self.printMenu(runs[0])
182  self.printStreams(runs[0])

◆ getConfigKeys()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.getConfigKeys (   self)

Definition at line 76 of file AtlCoolTriggerTool.py.

76  def getConfigKeys(self):
77  hltkeys = TriggerCoolUtil.getHLTConfigKeys(self.dbconn, self.runlist)
78  hltpskeys = TriggerCoolUtil.getHLTPrescaleKeys(self.dbconn, self.runlist)
79  l1keys = TriggerCoolUtil.getL1ConfigKeys(self.dbconn, self.runlist)
80 
81  runs = list(set(list(hltkeys)+list(hltpskeys)+list(l1keys)))
82  runs.sort()
83  runStartTimes = None
84  if self.opt.time:
85  runStartTimes = TriggerCoolUtil.getRunStartTime(self.dbconn, self.runlist, runs)
86 
87  allkeys = dict([(r,{}) for r in runs])
88  for r in runs:
89  if r in hltkeys: allkeys[r].update(hltkeys[r])
90  if r in hltpskeys: allkeys[r].update(hltpskeys[r])
91  if r in l1keys: allkeys[r].update(l1keys[r])
92  if runStartTimes and r in runStartTimes: allkeys[r].update(runStartTimes[r])
93 
94  return (runs, allkeys)
95 

◆ GetRunRanges()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.GetRunRanges (   self,
  runRange 
)

Definition at line 56 of file AtlCoolTriggerTool.py.

56  def GetRunRanges(self, runRange):
57  listOfRanges = []
58  runRanges = runRange.split(',')
59  for rr in runRanges:
60  startend = rr.split('-')
61  if len(startend)==1: startend += [startend[0]]
62  firstlast = [0, (cool.ValidityKeyMax>>32)-1]
63  if startend[0]: firstlast[0] = int(startend[0])
64  if startend[1]: firstlast[1] = int(startend[1])
65  firstlast.sort()
66  listOfRanges += [firstlast]
67  listOfRanges.sort()
68  return self.MergeRanges(listOfRanges)
69 
70 

◆ init()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.init (   self)

Definition at line 71 of file AtlCoolTriggerTool.py.

71  def init(self):
72  self.runlist = self.GetRunRanges(self.opt.runlist)
73  self.dbconn = TriggerCoolUtil.GetConnection(self.opt.db,self.opt.verbosity)
74 
75 

◆ MergeRanges()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.MergeRanges (   self,
  listOfRanges 
)

Definition at line 43 of file AtlCoolTriggerTool.py.

43  def MergeRanges(self, listOfRanges):
44  newRR=[]
45  for rr in listOfRanges:
46  if len(newRR)==0:
47  newRR.append(copy.deepcopy(rr))
48  else:
49  if rr[0]-1<=newRR[-1][1]:
50  newRR[-1][1] = max(rr[1],newRR[-1][1])
51  else:
52  newRR.append(copy.deepcopy(rr))
53  return newRR
54 
55 

◆ printConfigKeys()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.printConfigKeys (   self,
  runKeys 
)

Definition at line 105 of file AtlCoolTriggerTool.py.

105  def printConfigKeys(self, runKeys):
106  #t = string.Template('run $RUN ($STARTTIME) release %10')
107  runs = list(runKeys)
108  runs.sort()
109 
110  for r in runs:
111  keys = runKeys[r]
112  timestr=""
113  if self.opt.time:
114  try: timestr = "(%s) " % keys["STARTTIME"]
115  except KeyError: timestr = "(--------unknown---------) "
116  try:
117  rel = keys["REL"]
118  smk = keys["SMK"]
119  hltpsk = "%4i (1-)" % keys["HLTPSK"]
120  except KeyError:
121  rel = "unknown"
122  smk = "0"
123  hltpsk = "unknown"
124 
125  hltpsknew = hltpsk
126  if r > 127453:
127  hltpsknew = ""
128  if "HLTPSK2" in keys:
129  for x in keys["HLTPSK2"]:
130  if x[2]<0: hltpsknew += "%4i (%i-)" % (x[0],x[1])
131  elif x[2]==x[1]: hltpsknew += "%4i (%i) " % (x[0],x[1])
132  else: hltpsknew += "%4i (%i-%i) " % (x[0],x[1],x[2])
133  if not hltpsknew: hltpsknew = "unknown"
134 
135  lvl1psk = ""
136  if "LVL1PSK" in keys:
137  for x in keys["LVL1PSK"]:
138  if x[2]<0: lvl1psk += "%4i (%i-)" % (x[0],x[1])
139  elif x[2]==x[1]: lvl1psk += "%4i (%i) " % (x[0],x[1])
140  else: lvl1psk += "%4i (%i-%i) " % (x[0],x[1],x[2])
141  if not lvl1psk: lvl1psk = "unknown"
142 
143  print ("run %6i %srelease %9s smk %4s hltps %s lvl1ps %s" % (r, timestr, rel, smk, hltpsknew, lvl1psk),)
144 
145  if r > 127453 and "HLTPSK2" in keys and "HLTPSK" in keys and keys["HLTPSK"] != keys["HLTPSK2"][0][0]:
146  msg = "WARNING: Menu folder shows different HLT prescale for SOR: %i" % keys["HLTPSK"]
147  print (msg)
148  else: print()
149 

◆ printHLTProcessingString()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.printHLTProcessingString (   self,
  runKeys 
)

Definition at line 96 of file AtlCoolTriggerTool.py.

96  def printHLTProcessingString(self,runKeys):
97  runs = runKeys.keys()
98  runs.sort()
99 
100 
101  for r in runs:
102  keys = runKeys[r]
103  print ('c'.join(["%su%s" % (x[1],x[0]) for x in keys["HLTPSK2"]]))
104 

◆ printMenu()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.printMenu (   self,
  run 
)

Definition at line 150 of file AtlCoolTriggerTool.py.

150  def printMenu(self, run):
151  if not self.opt.menu: return
152  if self.opt.l1:
153  TriggerCoolUtil.printL1Menu(self.dbconn, run, self.opt.verbosity)
154  if self.opt.l2 or self.opt.ef:
155  TriggerCoolUtil.printHLTMenu(self.dbconn, run, self.opt.verbosity, printL2=self.opt.l2, printEF=self.opt.ef)
156 

◆ printStreams()

def python.AtlCoolTriggerTool.AtlCoolTriggerTool.printStreams (   self,
  run 
)

Definition at line 157 of file AtlCoolTriggerTool.py.

157  def printStreams(self,run):
158  if not self.opt.streams: return
159  TriggerCoolUtil.printStreams(self.dbconn,run,self.opt.verbosity)
160 

Member Data Documentation

◆ dbconn

python.AtlCoolTriggerTool.AtlCoolTriggerTool.dbconn

Definition at line 73 of file AtlCoolTriggerTool.py.

◆ opt

python.AtlCoolTriggerTool.AtlCoolTriggerTool.opt

Definition at line 12 of file AtlCoolTriggerTool.py.

◆ runlist

python.AtlCoolTriggerTool.AtlCoolTriggerTool.runlist

Definition at line 72 of file AtlCoolTriggerTool.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
python.utils.AtlRunQueryUtils.MergeRanges
def MergeRanges(listOfRanges)
Definition: AtlRunQueryUtils.py:217
RunEBWeightsComputation.getConfigKeys
def getConfigKeys(inputFile)
Definition: RunEBWeightsComputation.py:26
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67