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

Public Member Functions

def __init__ (self, period, customGRL=None)
 
def loadGRL (self, grlpath)
 
def testCustomGRL (cls, grlpath)
 
def skimPeriod (self, period)
 

Public Attributes

 grl
 

Static Public Attributes

 periodMap2015
 
 periodMap2016
 
 periodMap2017
 
 periodMap2018
 
 grlbase
 
 y2018grlpath
 
 y2017grlpath
 
 y2016grlpath
 
 y2015grlpath
 
 y2017lowmugrlpath
 
 y2018lowmugrlpath
 

Detailed Description

Definition at line 11 of file TriggerPeriodData.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.__init__ (   self,
  period,
  customGRL = None 
)

Definition at line 116 of file TriggerPeriodData.py.

116  def __init__(self, period, customGRL=None):
117  self.grl = {}
118  if customGRL:
119  self.loadGRL(customGRL)
120  elif TriggerPeriod.isRunNumber(period) and period != TriggerPeriod.customGRL: #run number assume 2018
121  self.loadGRL(self.y2018grlpath)
122  elif period & TriggerPeriod.y2015:
123  self.loadGRL(self.y2015grlpath)
124  elif period & TriggerPeriod.y2016:
125  self.loadGRL(self.y2016grlpath)
126  elif period & TriggerPeriod.y2017lowmu:
127  self.loadGRL(self.y2017lowmugrlpath)
128  elif period & TriggerPeriod.y2017:
129  self.loadGRL(self.y2017grlpath)
130  elif period & TriggerPeriod.y2018lowmu:
131  self.loadGRL(self.y2018lowmugrlpath)
132  elif period & TriggerPeriod.y2018:
133  self.loadGRL(self.y2018grlpath)
134  if period != TriggerPeriod.customGRL:
135  self.skimPeriod(period)
136 

Member Function Documentation

◆ loadGRL()

def python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.loadGRL (   self,
  grlpath 
)

Definition at line 137 of file TriggerPeriodData.py.

137  def loadGRL(self, grlpath):
138  if type(grlpath)==list:
139  for grl in grlpath: self.loadGRL(grl)
140  else:
141  grlroot = ET.parse(grlpath).getroot()
142  for run in grlroot.findall('NamedLumiRange/LumiBlockCollection'):
143  runNum = int(run.find('Run').text)
144  if runNum not in self.grl:
145  self.grl[runNum] = []
146  self.grl[runNum] += [(int(x.get('Start')), int(x.get('End'))) for x in run.findall('LBRange')]
147 

◆ skimPeriod()

def python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.skimPeriod (   self,
  period 
)

Definition at line 159 of file TriggerPeriodData.py.

159  def skimPeriod(self, period):
160  if TriggerPeriod.isRunNumber(period):
161  if period in self.grl:
162  blocks = self.grl[period]
163  self.grl = {}
164  self.grl[period] = blocks
165  else:
166  self.grl = {}
167  self.grl[period] = [(0,9999)]
168  else:
169  ranges = []
170  if period & TriggerPeriod.y2015 :
171  ranges.append( self.periodMap2015['All'] )
172  if period & TriggerPeriod.y2016periodA:
173  ranges.append( self.periodMap2016['A'] )
174  if period & TriggerPeriod.y2016periodBD3:
175  ranges.append( self.periodMap2016['BD3'] )
176  if period & TriggerPeriod.y2016periodD4plus:
177  ranges.append( self.periodMap2016['D4plus'] )
178  if period & TriggerPeriod.y2017periodB1:
179  ranges.append( self.periodMap2017['B1'] )
180  if period & TriggerPeriod.y2017periodB2B4:
181  for i in range(2,4+1): ranges.append( self.periodMap2017['B%d' %i] )
182  if period & TriggerPeriod.y2017periodB5B7:
183  for i in range(5,7+1): ranges.append( self.periodMap2017['B%d' %i] )
184  if period & TriggerPeriod.y2017periodB8 :
185  ranges.append( self.periodMap2017['B8'] )
186  if period & TriggerPeriod.y2017periodC :
187  for i in range(1,8+1): ranges.append( self.periodMap2017['C%d' %i] )
188  if period & TriggerPeriod.y2017periodD1D5:
189  for i in range(1,5+1): ranges.append( self.periodMap2017['D%d' %i] )
190  if period & TriggerPeriod.y2017periodD6 :
191  ranges.append( self.periodMap2017['D6'] )
192  if period & TriggerPeriod.y2017periodEF :
193  ranges.append( self.periodMap2017['E'] )
194  ranges.append( self.periodMap2017['F'] )
195  if period & TriggerPeriod.y2017periodGHIK :
196  ranges.append( self.periodMap2017['G'] )
197  ranges.append( self.periodMap2017['H'] )
198  ranges.append( self.periodMap2017['I'] )
199  ranges.append( self.periodMap2017['K'] )
200  if period & TriggerPeriod.y2017lowmu :
201  ranges.append( self.periodMap2017['N'] )
202  if period & TriggerPeriod.y2018periodBE :
203  ranges.append( self.periodMap2018['B'] )
204  ranges.append( self.periodMap2018['C'] )
205  ranges.append( self.periodMap2018['D'] )
206  ranges.append( self.periodMap2018['E'] )
207  if period & TriggerPeriod.y2018periodFI :
208  ranges.append( self.periodMap2018['F'] )
209  ranges.append( self.periodMap2018['G1'] )
210  ranges.append( self.periodMap2018['G2'] )
211  ranges.append( self.periodMap2018['G3'] )
212  ranges.append( self.periodMap2018['I'] )
213  if period & TriggerPeriod.y2018lowmu :
214  ranges.append( self.periodMap2018['G4'] )
215  ranges.append( self.periodMap2018['J'] )
216  if period & TriggerPeriod.y2018periodKQ :
217  ranges.append( self.periodMap2018['K'] )
218  ranges.append( self.periodMap2018['L'] )
219  ranges.append( self.periodMap2018['M'] )
220  ranges.append( self.periodMap2018['N'] )
221  ranges.append( self.periodMap2018['O'] )
222  ranges.append( self.periodMap2018['Q'] )
223  for run in list(self.grl.keys()):
224  if not any([run >= x[0] and run <= x[1] for x in ranges]): self.grl.pop(run)
225 

◆ testCustomGRL()

def python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.testCustomGRL (   cls,
  grlpath 
)

Definition at line 149 of file TriggerPeriodData.py.

149  def testCustomGRL(cls, grlpath):
150  try:
151  grlroot = ET.parse(grlpath).getroot()
152  testgrl = {}
153  for run in grlroot.findall('NamedLumiRange/LumiBlockCollection'):
154  testgrl[ int(run.find('Run').text)] = [(int(x.get('Start')), int(x.get('End'))) for x in run.findall('LBRange')]
155  return any(len(lb)!=0 for lb in testgrl.values())
156  except Exception:
157  return False
158 

Member Data Documentation

◆ grl

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.grl

Definition at line 117 of file TriggerPeriodData.py.

◆ grlbase

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.grlbase
static

Definition at line 109 of file TriggerPeriodData.py.

◆ periodMap2015

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2015
static

Definition at line 14 of file TriggerPeriodData.py.

◆ periodMap2016

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2016
static

Definition at line 17 of file TriggerPeriodData.py.

◆ periodMap2017

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2017
static

Definition at line 22 of file TriggerPeriodData.py.

◆ periodMap2018

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2018
static

Definition at line 86 of file TriggerPeriodData.py.

◆ y2015grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2015grlpath
static

Definition at line 113 of file TriggerPeriodData.py.

◆ y2016grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2016grlpath
static

Definition at line 112 of file TriggerPeriodData.py.

◆ y2017grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2017grlpath
static

Definition at line 111 of file TriggerPeriodData.py.

◆ y2017lowmugrlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2017lowmugrlpath
static

Definition at line 114 of file TriggerPeriodData.py.

◆ y2018grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2018grlpath
static

Definition at line 110 of file TriggerPeriodData.py.

◆ y2018lowmugrlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2018lowmugrlpath
static

Definition at line 115 of file TriggerPeriodData.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798