ATLAS Offline Software
Loading...
Searching...
No Matches
python.TriggerAPI.TriggerPeriodData.TriggerPeriodData Class Reference
Collaboration diagram for python.TriggerAPI.TriggerPeriodData.TriggerPeriodData:

Public Member Functions

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

Public Attributes

dict grl = {}

Static Public Attributes

dict periodMap2015
dict periodMap2016
dict periodMap2017
dict periodMap2018
str grlbase = "/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/"
str y2018grlpath = grlbase+"data18_13TeV/20181105/data18_13TeV.periodAllYear_DetStatus-v102-pro22-04_Unknown_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.xml"
str y2017grlpath = grlbase+"data17_13TeV/20180619/data17_13TeV.periodAllYear_DetStatus-v99-pro22-01_Unknown_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.xml"
str y2016grlpath = grlbase+"data16_13TeV/20180129/data16_13TeV.periodAllYear_DetStatus-v89-pro21-01_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml"
str y2015grlpath = grlbase+"data15_13TeV/20170619/data15_13TeV.periodAllYear_DetStatus-v89-pro21-02_Unknown_PHYS_StandardGRL_All_Good_25ns.xml"
str y2017lowmugrlpath = grlbase+"data17_13TeV/20180117/data17_13TeV.periodN_DetStatus-v98-pro21-16_Unknown_PHYS_StandardGRL_All_Good_25ns_ignore_GLOBAL_LOWMU.xml"
str y2018lowmugrlpath = grlbase+"data18_13TeV/20180830/data18_13TeV.periodG4J_MERGED_PHYS_StandardGRL_All_Good_25ns_ignore_GLOBAL_LOWMU.xml"

Detailed Description

Definition at line 11 of file TriggerPeriodData.py.

Constructor & Destructor Documentation

◆ __init__()

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()

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()

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()

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

dict python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.grl = {}

Definition at line 117 of file TriggerPeriodData.py.

◆ grlbase

str python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.grlbase = "/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/"
static

Definition at line 109 of file TriggerPeriodData.py.

◆ periodMap2015

dict python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2015
static
Initial value:
= {
'All' :(276262, 284484, 0)
}

Definition at line 14 of file TriggerPeriodData.py.

◆ periodMap2016

dict python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2016
static
Initial value:
= {
'A' :(296939,300279,0),
'BD3' :(300345,302872,0),
'D4plus' :(302919,311481,0),
}

Definition at line 17 of file TriggerPeriodData.py.

◆ periodMap2017

dict python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2017
static

Definition at line 22 of file TriggerPeriodData.py.

◆ periodMap2018

dict python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.periodMap2018
static
Initial value:
= {
'B':(348885,349533,20836),
'C':(349534,350220,21519),
'D':(350310,352107,20422),
'E':(352123,352137,18296),
'F':(352274,352514,19938),
'G' :(354107,354494,17012),
'G1':(354107,354174,4676 ),
'G2':(354176,354311,61.2 ),
'G3':(354309,354359,17012),
'G4':(354396,354396,11098),
'G5':(354476,354494,8.73 ),
'I':(355261,355273,17318),
'J':(355331,355468,18781),
'K':(355529,356259,19958),
'L':(357050,359171,19935),
'M':(359191,360414,20904),
'N':(361635,361696,9464 ),
'O':(361738,363400,19822),
'Q':(363664,364292,19618),
}

Definition at line 86 of file TriggerPeriodData.py.

◆ y2015grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2015grlpath = grlbase+"data15_13TeV/20170619/data15_13TeV.periodAllYear_DetStatus-v89-pro21-02_Unknown_PHYS_StandardGRL_All_Good_25ns.xml"
static

Definition at line 113 of file TriggerPeriodData.py.

◆ y2016grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2016grlpath = grlbase+"data16_13TeV/20180129/data16_13TeV.periodAllYear_DetStatus-v89-pro21-01_DQDefects-00-02-04_PHYS_StandardGRL_All_Good_25ns.xml"
static

Definition at line 112 of file TriggerPeriodData.py.

◆ y2017grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2017grlpath = grlbase+"data17_13TeV/20180619/data17_13TeV.periodAllYear_DetStatus-v99-pro22-01_Unknown_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.xml"
static

Definition at line 111 of file TriggerPeriodData.py.

◆ y2017lowmugrlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2017lowmugrlpath = grlbase+"data17_13TeV/20180117/data17_13TeV.periodN_DetStatus-v98-pro21-16_Unknown_PHYS_StandardGRL_All_Good_25ns_ignore_GLOBAL_LOWMU.xml"
static

Definition at line 114 of file TriggerPeriodData.py.

◆ y2018grlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2018grlpath = grlbase+"data18_13TeV/20181105/data18_13TeV.periodAllYear_DetStatus-v102-pro22-04_Unknown_PHYS_StandardGRL_All_Good_25ns_Triggerno17e33prim.xml"
static

Definition at line 110 of file TriggerPeriodData.py.

◆ y2018lowmugrlpath

python.TriggerAPI.TriggerPeriodData.TriggerPeriodData.y2018lowmugrlpath = grlbase+"data18_13TeV/20180830/data18_13TeV.periodG4J_MERGED_PHYS_StandardGRL_All_Good_25ns_ignore_GLOBAL_LOWMU.xml"
static

Definition at line 115 of file TriggerPeriodData.py.


The documentation for this class was generated from the following file: