ATLAS Offline Software
TileCalibCrest.py
Go to the documentation of this file.
1 #!/bin/env python
2 
3 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4 # TileCalibCrest.py
5 # Sanya Solodkov <Sanya.Solodkov@cern.ch>, 2025-02-04
6 # Laura Sargsyan <Laura.Sargsyan@cern.ch>, 2025-09-16
7 # Siarhei Harkusha <Siarhei.Harkusha@cern.ch>, 2025-05-19
8 
9 """
10 Python helper module for managing CREST DB connections and TileCalibBlobs.
11 """
12 
13 import os, cppyy, base64, json, time, datetime
14 
15 from PyCool import cool # noqa: F401
16 Blob = cppyy.gbl.coral.Blob
17 
18 from pycrest.api.crest_api import CrestApi
19 
20 from TileCalibBlobObjs.Classes import TileCalibUtils, TileCalibDrawerCmt, \
21  TileCalibDrawerInt, TileCalibDrawerOfc, TileCalibDrawerBch, \
22  TileCalibDrawerFlt, TileCalibType
23 from TileCalibBlobPython import TileCalibTools
24 
25 #=== get a logger
26 from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
27 log = getLogger("TileCalibCrest")
28 
29 
30 #======================================================================
31 #===
32 #=== Global helper functions
33 #===
34 #======================================================================
35 
36 #
37 #______________________________________________________________________
38 #=== useful constants
39 MINRUN = 0
40 MINLBK = 0
41 MAXRUN = (1<<31)-1
42 MAXLBK = (1<<32)-1
43 MAXRUNLUMI = (MAXRUN<<32)+MAXLBK
44 # empty Tile channel for storing laser partition variation. DO NOT CHANGE.
45 LASPARTCHAN = 43
46 
47 
48 class TileBlobReaderCrest(TileCalibLogger):
49  """
50  TileCalibBlobReader is a helper class, managing the details of CREST interactions for
51  the user of TileCalibBlobs.
52  """
53 
54  #____________________________________________________________________
55  def __init__(self, db, folder='', tag='', run=None, lumi=0, modmin=0, modmax=275, copyBlob=False):
56  """
57  Input:
58  - db : server connection string or file name
59  - folder: full folder path
60  - tag : The folder tag, e.g. \"UPD4-24\" or full tag
61  - run : Run number (if known)
62  - lumi : Lumi block number
63  - modmin: Minimal module (COOL channel number)
64  - modmax: Maximal module (COOL channel number)
65  - copyBlob: save payload from CREST (Default:False, True to copy payload to json file)
66  """
67  #=== initialize base class
68  TileCalibLogger.__init__(self,"TileBlobReader")
69  self.payload = {}
70  self.__db = db
71  self.__folder = folder
72  self.__tag = tag
73  self.__copyBlob = copyBlob
74 
75  self.__iovList = []
76  self.__iov = (-1,0)
77  self.__commentBlob = None
78  self.__drawerBlob = [None]*276
79  self.__comment = None
80  self.__drawer = [None]*276
81  self.__modmin = modmin
82  self.__modmax = modmax+1
83 
84  #=== try to open db
85  self.__remote = (("http://" in db) or ("https://" in db) or ("CREST" in db))
86  if self.__remote:
87  if 'http' not in self.__db:
88  self.__db = os.getenv(db,os.getenv('CREST_HOST',os.getenv('CREST_SERVER_PATH','http://crest-j23.cern.ch:8080/api-v5.0')))
89  self.log().info('Host %s' , (self.__db))
90  self.__api_instance = CrestApi(host=self.__db)
91  socks = os.getenv('CREST_SOCKS', 'False')
92  if socks == 'True': self.__api_instance.socks()
93  self.__tag = self.getFolderTag(folder,None,tag)
94  if run is not None and lumi is not None:
95  log.info("Initializing for run %d, lumiblock %d", run,lumi)
96  self.__getIov((run,lumi),True)
97  else:
98  self.log().info('File %s' , (self.__db))
99  self.__iovList.append(((MINRUN,MINLBK),(MAXRUN, MAXLBK)))
100  self.__iov = self.__runlumi2iov(self.__iovList[-1])
101  try:
102  with open(self.__db, 'r') as the_file:
103  jdata = json.load(the_file)
104  for chan in range(self.__modmin,self.__modmax):
105  self.__create_drawer(jdata[str(chan)][0],chan)
106  self.__create_comment(jdata['1000'][0])
107  except Exception as e:
108  self.log().critical( e )
109  raise
110 
111  #____________________________________________________________________
112  def getFolderTag(self, folder, prefix, globalTag):
113  if globalTag=='CURRENT' or globalTag=='UPD4' or globalTag=='':
114  globalTag=TileCalibTools.getAliasFromFile('Current')
115  log.info("Resolved CURRENT globalTag to \'%s\'", globalTag)
116  elif globalTag=='CURRENTES' or globalTag=='UPD1':
117  globalTag=TileCalibTools.getAliasFromFile('CurrentES')
118  log.info("Resolved CURRENT ES globalTag to \'%s\'", globalTag)
119  elif globalTag=='NEXT':
120  globalTag=TileCalibTools.getAliasFromFile('Next')
121  log.info("Resolved NEXT globalTag to \'%s\'", globalTag)
122  elif globalTag=='NEXTES':
123  globalTag=TileCalibTools.getAliasFromFile('NextES')
124  log.info("Resolved NEXT ES globalTag to \'%s\'", globalTag)
125  globalTag=globalTag.replace('*','')
126  if prefix is None:
127  prefix = ''
128  for f in folder.split('/'):
129  prefix+=f.capitalize()
130  else:
131  prefix=prefix.strip('-').split('-')[0]
132  if prefix.startswith('Calo'):
133  prefix='CALO'+prefix[4:]
134  if 'UPD1' in globalTag or 'UPD4' in globalTag or 'COND' not in globalTag:
135  if prefix != '':
136  tag=prefix+'-'+globalTag
137  self.log().info("Resolved localTag \'%s\' to folderTag \'%s\'", globalTag,tag)
138  elif folder!='' and not (globalTag.startswith('Tile') or globalTag.startswith('CALO')):
139  tag = TileCalibUtils.getFullTag(folder, globalTag)
140  if tag.startswith('Calo'):
141  tag='CALO'+tag[4:]
142  self.log().info("Resolved localTag \'%s\' to folderTag \'%s\'", globalTag,tag)
143  else:
144  tag=globalTag
145  self.log().info("Use localTag \'%s\' as is", tag)
146  else:
147  tag=None
148  tags=self.__api_instance.find_global_tag_map(globalTag)
149  if tags['size']==0:
150  raise Exception( "globalTag %s not found" % (globalTag) )
151  else:
152  for i in range(tags['size']):
153  t=tags['resources'][i]['tag_name']
154  l=tags['resources'][i]['label']
155  if (prefix!='' and t.startswith(prefix)) or l==folder:
156  tag=t
157  self.log().info("Resolved globalTag \'%s\' to folderTag \'%s\'", globalTag,tag)
158  #taginfo = self.__api_instance.find_tag(name=tag)
159  #print(taginfo)
160  return tag
161 
162  #____________________________________________________________________
163  def getIovs(self,since,until):
164  run_lumi1=str((since[0]<<32)+since[1]+1)
165  run_lumi2=str((until[0]<<32)+until[1]+1)
166  MAXRUNLUMI1=str(MAXRUNLUMI+1)
167  iovs1=self.__api_instance.select_iovs(self.__tag,"0",run_lumi1,sort='id.since:DESC,id.insertionTime:DESC',size=1,snapshot=0)
168  iovs2=self.__api_instance.select_iovs(self.__tag,run_lumi2,MAXRUNLUMI1,sort='id.since:ASC,id.insertionTime:DESC',size=1,snapshot=0)
169  since1=0 if iovs1['size']==0 else iovs1['resources'][0]['since']
170  until1=MAXRUNLUMI if iovs2['size']==0 else iovs2['resources'][0]['since']
171  iovs=self.__api_instance.select_iovs(self.__tag,str(since1),str(until1),sort='id.since:ASC,id.insertionTime:DESC',size=999999,snapshot=0)
172  iovList=[]
173  if iovs['size']==0:
174  raise Exception( "IOV for tag %s IOV [%s,%s] - (%s,%s) not found" % (self.__tag,since[0],since[1],until[0],until[1]) )
175  else:
176  for i in range(iovs['size']):
177  iov=iovs['resources'][i]
178  since=int(iov['since'])
179  runS=since>>32
180  lumiS=since&0xFFFFFFFF
181  iovList.append((runS,lumiS))
182  return iovList
183 
184  #____________________________________________________________________
185  def __getIov(self,runlumi,dbg=False):
186  run_lumi1=str((runlumi[0]<<32)+runlumi[1]+1)
187  MAXRUNLUMI1=str(MAXRUNLUMI+1)
188  iovs1=self.__api_instance.select_iovs(self.__tag,"0",run_lumi1,sort='id.since:DESC,id.insertionTime:DESC',size=1,snapshot=0)
189  iovs2=self.__api_instance.select_iovs(self.__tag,run_lumi1,MAXRUNLUMI1,sort='id.since:ASC,id.insertionTime:DESC',size=1,snapshot=0)
190  if iovs1['size']==0:
191  raise Exception( "IOV for tag %s run,lumi (%s,%s) not found" % (self.__tag,runlumi[0],runlumi[1]) )
192  else:
193  iov=iovs1['resources'][0]
194  since=int(iov['since'])
195  runS=since>>32
196  lumiS=since&0xFFFFFFFF
197  until=MAXRUNLUMI if iovs2['size']==0 else iovs2['resources'][0]['since']
198  runU=until>>32
199  lumiU=until&0xFFFFFFFF
200  hash=iov['payload_hash']
201  if dbg:
202  #self.log().info('Run,Lumi (%d,%d)' , runlumi)
203  self.log().info('IOV [%d,%d] - (%d,%d)' , runS,lumiS,runU,lumiU)
204  self.log().info('Insertion time %s' , iov['insertion_time'])
205  self.log().info('Hash %s' , hash)
206  payload = self.__api_instance.get_payload(hash=hash).decode('utf-8')
207  jdata=json.loads(payload)
208  #with open("payload.json", 'w') as the_file:
209  # the_file.write(payload)
210  # the_file.write('\n')
211  if self.__copyBlob:
212  self.payload = jdata
213  return
214  self.__iovList.append(((runS,lumiS),(runU, lumiU)))
215  self.__iov = self.__runlumi2iov(self.__iovList[-1])
216  for chan in range(self.__modmin,self.__modmax):
217  try:
218  blob=jdata[str(chan)][0]
219  except Exception:
220  blob=None
221  self.__create_drawer(blob,chan)
222  try:
223  blob=jdata['1000'][0]
224  except Exception:
225  blob=None
226  self.__create_comment(blob)
227  return
228 
229  #____________________________________________________________________
230  def __runlumi2iov(self,runlumi):
231  since = (runlumi[0][0]<<32) + runlumi[0][1]
232  until = (runlumi[1][0]<<32) + runlumi[1][1]
233  return (since,until)
234 
235  #____________________________________________________________________
236  def __checkIov(self,runlumi):
237  point = (runlumi[0]<<32) + runlumi[1]
238  inrange = point>=self.__iov[0] and point<self.__iov[1]
239  return inrange
240 
241  #____________________________________________________________________
242  def __make_blob(self,string):
243  b = Blob()
244  b.write(string)
245  b.seek(0)
246  return b
247 
248  #____________________________________________________________________
249  def __create_comment(self,b64string):
250  if b64string is None or len(b64string)==0:
251  self.__commentBlob = None
252  self.__comment = None
253  else:
254  blob1 = base64.decodebytes(bytes(b64string,'ascii'))
255  self.__commentBlob = self.__make_blob(blob1)
257  return
258 
259  #____________________________________________________________________
260  def __create_drawer(self,b64string,chan):
261  if b64string is None or len(b64string)==0:
262  self.__drawerBlob[chan] = None
263  self.__drawer[chan] = None
264  return
265  blob1 = base64.decodebytes(bytes(b64string,'ascii'))
266  self.__drawerBlob[chan] = self.__make_blob(blob1)
268  typeName = TileCalibType.getClassName(cmt.getObjType())
269  del cmt
270  #=== create calibDrawer depending on type
271  if typeName=='TileCalibDrawerFlt':
272  self.__drawer[chan] = TileCalibDrawerFlt.getInstance(self.__drawerBlob[chan])
273  self.log().debug( "typeName = Flt " )
274  elif typeName=='TileCalibDrawerInt':
275  self.__drawer[chan] = TileCalibDrawerInt.getInstance(self.__drawerBlob[chan])
276  self.log().debug( "typeName = Int " )
277  elif typeName=='TileCalibDrawerBch':
278  self.__drawer[chan] = TileCalibDrawerBch.getInstance(self.__drawerBlob[chan])
279  self.log().debug( "typeName = Bch " )
280  elif typeName=='TileCalibDrawerOfc':
281  self.__drawer[chan] = TileCalibDrawerOfc.getInstance(self.__drawerBlob[chan])
282  self.log().debug( "typeName = Ofc " )
283  else:
284  raise Exception( "Invalid blob type requested: %s" % typeName )
285  return
286 
287  #____________________________________________________________________
288  def getDrawer(self,ros, mod, runlumi=None, dbg=False, useDefault=True):
289 
290  if self.__remote and runlumi is not None and not self.__checkIov(runlumi):
291  self.__getIov(runlumi,dbg)
292 
293  if ros<0:
294  chanNum = mod
295  else:
296  chanNum = TileCalibUtils.getDrawerIdx(ros,mod)
297 
298  if (chanNum>=0 and chanNum<len(self.__drawer)):
299  drawer=self.__drawer[chanNum]
300  if not useDefault and drawer is None:
301  return 0
302  while drawer is None:
303  #=== no default at all?
304  if ros==0 and drawer==0:
305  raise Exception('No default available')
306  #=== follow default policy
307  ros,drawer = self.getDefault(ros,drawer)
308  chanNum = TileCalibUtils.getDrawerIdx(ros,drawer)
309  drawer=self.__drawer[chanNum]
310  return drawer
311  elif (chanNum == 1000):
312  return self.__comment
313  else:
314  raise Exception( "Invalid drawer requested: %s %s" % (ros,mod) )
315 
316  #____________________________________________________________________
317  def getComment(self,runlumi=None):
318 
319  if self.__remote and runlumi is not None and not self.__checkIov(runlumi):
320  self.__getIov(runlumi)
321  if self.__comment is not None:
322  return self.__comment.getFullComment()
323  else:
324  return "<no comment found>"
325 
326  #____________________________________________________________________
327  def getDefault(self, ros, drawer):
328  """
329  Returns a default drawer number (among first 20 COOL channels) for any drawer in any partition
330  """
331  if ros==0:
332  if drawer<=4 or drawer==12 or drawer>=20:
333  drawer1=0
334  elif drawer<12:
335  drawer1=4
336  else:
337  drawer1=12
338  elif ros==1 or ros==2:
339  drawer1=4
340  elif ros==3:
341  OffsetEBA = [ 0, 0, 0, 0, 0, 0, 3, 2, #// Merged E+1: EBA07; Outer MBTS: EBA08
342  0, 0, 0, 0, 7, 6, 5, 7, #// D+4: EBA13, EBA16; Special D+4: EBA14; Special D+40: EBA15
343  7, 6, 6, 7, 0, 0, 0, 2, #// D+4: EBA17, EBA20; Special D+4: EBA18, EBA19; Outer MBTS: EBA24
344  3, 0, 0, 0, 0, 0, 0, 0, #// Merged E+1: EBA25
345  0, 0, 0, 0, 0, 0, 1, 1, #// Inner MBTS + special C+10: EBA39, EBA40
346  1, 1, 2, 3, 0, 0, 0, 0, #// Inner MBTS + special C+10: EBA41, EBA42; Outer MBTS: EBA43; Merged E+1: EBA44
347  0, 0, 0, 0, 3, 2, 1, 1, #// Merged E+1: EBA53; Outer MBTS: EBA54; Inner MBTS + special C+10: EBA55, EBA56
348  1, 1, 0, 0, 0, 0, 0, 0] #// Inner MBTS + special C+10: EBA57, EBA58
349  drawer1 = 12 + OffsetEBA[drawer]
350  elif ros==4:
351  OffsetEBC = [ 0, 0, 0, 0, 0, 0, 3, 2, #// Merged E-1: EBC07; Outer MBTS: EBC08
352  0, 0, 0, 0, 7, 6, 6, 7, # // D-4: EBC13, EBC16; Special D-4: EBC14, EBC15;
353  7, 5, 6, 7, 0, 0, 0, 2, #// D-4: EBC17, EBC20; Special D-40 EBC18; Special D-4: EBC19; Outer MBTS: EBC24
354  3, 0, 0, 3, 4, 0, 3, 4, #// Merged E-1: EBC25, EBC28, EBC31; E-4': EBC29, EBC32
355  0, 4, 3, 0, 4, 3, 1, 1, #// E-4': EBC34, EBC37; Merged E-1: EBC35, EBC38; Inner MBTS + special C-10: EBC39, EBC40
356  1, 1, 2, 3, 0, 0, 0, 0, #// Inner MBTS + special C-10: EBC41, EBC42; Outer MBTS: EBC43; Merged E-1: EBC44
357  0, 0, 0, 0, 3, 2, 1, 1, #// Merged E-1: EBC53; Outer MBTS: EBC54; Inner MBTS + special C-10: EBC55, EBC56
358  1, 1, 0, 0, 0, 0, 0, 0] #// Inner MBTS + special C-10: EBC57, EBC58
359  drawer1 = 12 + OffsetEBC[drawer]
360  else:
361  drawer1=0
362 
363  return (0,drawer1)
364 
365 class TileBlobWriterCrest(TileCalibLogger):
366  """
367  TileBlobWriterCrest is a helper class, managing the details of
368  CREST interactions for the user of TileCalibBlobs.
369  """
370 
371  #____________________________________________________________________
372  def __init__(self, db, folderPath, calibDrawerType, isMultiVersionFolder=True):
373  """
374  Input:
375  - db : db should be a database connection
376  - folderPath: full folder path to create or update
377  """
378 
379  #=== initialize base class
380  TileCalibLogger.__init__(self, "TileBlobWriter")
381 
382  #=== store db
383  self.__db = db
384  self.__folderPath = folderPath
385 
386  #=== create default vectors based on calibDrawerType
387  self.__calibDrawerType = calibDrawerType
388  if calibDrawerType in ['TileCalibDrawerFlt', 'Flt']:
389  self.__TileCalibDrawer = TileCalibDrawerFlt
390  self.__defVec = cppyy.gbl.std.vector('std::vector<float>')()
391  elif calibDrawerType in ['TileCalibDrawerBch', 'Bch']:
392  self.__TileCalibDrawer = TileCalibDrawerBch
393  self.__defVec = cppyy.gbl.std.vector('std::vector<unsigned int>')()
394  elif calibDrawerType in ['TileCalibDrawerInt', 'Int']:
395  self.__TileCalibDrawer = TileCalibDrawerInt
396  self.__defVec = cppyy.gbl.std.vector('std::vector<unsigned int>')()
397  else:
398  raise Exception("Unknown calibDrawerType: %s" % calibDrawerType)
399 
400  # Always all drawers should be written
401  self.__drawerBlob = {drawerIdx:Blob() for drawerIdx in range(0, TileCalibUtils.max_draweridx())}
402  self.__drawer = {}
403  #____________________________________________________________________
404  def register(self, since=(MINRUN,MINLBK), tag=""):
405  """
406  Registers the folder in the database.
407  - since: lower limit of IOV
408  - tag : The tag to write to
409 
410  The interpretation of the 'since' inputs depends on their type:
411  - tuple(int,int) : run and lbk number
412  """
413 
414  jdata = {}
415  for drawerIdx,blob in self.__drawerBlob.items():
416  b64string = str(base64.b64encode(blob.read()), 'ascii')
417  jdata[drawerIdx] = [b64string]
418 
419  (sinceRun, sinceLumi) = since
420 
421  if not self.__db or (self.__db and self.__db.endswith('.json')):
422  # Writting into the json file
423  fullTag = tag
424  if self.__folderPath and not (tag.startswith('Tile') or tag.startswith('Calo')):
425  fullTag = TileCalibUtils.getFullTag(self.__folderPath, tag)
426  fileName = f"{fullTag}.{sinceRun}.{sinceLumi}.json"
427  if self.__db:
428  fileName = f'{self.__db[:-5]}.{fileName}'
429 
430  with open(fileName, 'w') as the_file:
431  json.dump(jdata, the_file)
432  the_file.write('\n')
433 
434  #=== print info
435  self.log().info( 'Writting tag "%s"', fullTag)
436  self.log().info( '... since : [%s,%s]' , sinceRun, sinceLumi)
437  self.log().info( '... with comment field: "%s"', self.getComment())
438  self.log().info( '... into file : %s' , fileName)
439 
440  #____________________________________________________________________
441  def setComment(self, author, comment=None):
442  """
443  Sets a general comment in the comment channel.
444  """
446  commentBlob = self.__drawer.get(drawerIdx, None)
447  if not commentBlob:
448  commentBlob = Blob()
449  self.__drawerBlob[drawerIdx] = commentBlob
450 
451  if isinstance(author, tuple) and len(author) == 3:
452  tm = time.mktime(datetime.datetime.strptime(author[2], "%a %b %d %H:%M:%S %Y").timetuple())
453  self.__drawer[drawerIdx] = TileCalibDrawerCmt.getInstance(commentBlob, author[0], author[1], int(tm))
454  else:
455  self.__drawer[drawerIdx] = TileCalibDrawerCmt.getInstance(commentBlob, author, comment)
456 
457  #____________________________________________________________________
458  def getComment(self, split=False):
459  """
460  Returns the general comment (default if none is set)
461  """
463  comment = self.__drawer.get(drawerIdx, None)
464  if comment:
465  if split:
466  return (comment.getAuthor(), self.__comment.getComment(), self.__comment.getDate())
467  else:
468  return comment.getFullComment()
469  else:
470  return "<No general comment!>"
471 
472  #____________________________________________________________________
473  def getDrawer(self, ros, drawer, calibDrawerTemplate=None):
474  """
475  Returns a TileCalibDrawer object of requested type
476  for the given ROS and drawer.
477  """
478 
479  try:
480  drawerIdx = TileCalibUtils.getDrawerIdx(ros, drawer)
481  calibDrawer = self.__drawer.get(drawerIdx, None)
482 
483  if not calibDrawer:
484  calibDrawer = self.__TileCalibDrawer.getInstance(self.__drawerBlob[drawerIdx], self.__defVec,0,0)
485  self.__drawer[drawerIdx] = calibDrawer
486 
487  #=== clone if requested
488  if calibDrawerTemplate:
489  calibDrawer.clone(calibDrawerTemplate)
490 
491  return calibDrawer
492 
493  except Exception as e:
494  self.log().critical( e )
495  return None
496 
497  #____________________________________________________________________
498  def zeroBlob(self, ros, drawer):
499  """
500  Resets blob size to zero
501  """
502  try:
503  drawerIdx = TileCalibUtils.getDrawerIdx(ros, drawer)
504  blob = self.__drawerBlob[drawerIdx]
505  blob.resize(0)
506  except Exception as e:
507  self.log().critical( e )
508  return None
AtlasMcWeight::decode
double decode(number_type binnedWeight)
Convert weight from unsigned to double.
Definition: AtlasMcWeight.cxx:32
python.TileCalibCrest.TileBlobReaderCrest.__checkIov
def __checkIov(self, runlumi)
Definition: TileCalibCrest.py:236
python.TileCalibCrest.TileBlobWriterCrest.register
def register(self, since=(MINRUN, MINLBK), tag="")
Definition: TileCalibCrest.py:404
TileCalibDrawerBch::getInstance
static const TileCalibDrawerBch * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerBch.
Definition: TileCalibDrawerBch.cxx:28
python.TileCalibCrest.TileBlobWriterCrest.setComment
def setComment(self, author, comment=None)
Definition: TileCalibCrest.py:441
python.TileCalibCrest.TileBlobWriterCrest.__defVec
__defVec
Definition: TileCalibCrest.py:390
python.TileCalibCrest.TileBlobReaderCrest.getDefault
def getDefault(self, ros, drawer)
Definition: TileCalibCrest.py:327
python.TileCalibCrest.TileBlobWriterCrest.__TileCalibDrawer
__TileCalibDrawer
Definition: TileCalibCrest.py:389
TileCalibType::getClassName
static std::string getClassName(TileCalibType::TYPE type)
Returns the class name.
Definition: TileCalibType.cxx:10
python.TileCalibCrest.TileBlobReaderCrest.getComment
def getComment(self, runlumi=None)
Definition: TileCalibCrest.py:317
python.TileCalibCrest.TileBlobWriterCrest.__drawerBlob
__drawerBlob
Definition: TileCalibCrest.py:401
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.TileCalibCrest.TileBlobWriterCrest.getDrawer
def getDrawer(self, ros, drawer, calibDrawerTemplate=None)
Definition: TileCalibCrest.py:473
python.TileCalibCrest.TileBlobWriterCrest.__init__
def __init__(self, db, folderPath, calibDrawerType, isMultiVersionFolder=True)
Definition: TileCalibCrest.py:372
python.TileCalibCrest.TileBlobReaderCrest.payload
payload
Definition: TileCalibCrest.py:69
python.TileCalibCrest.TileBlobReaderCrest.__iovList
__iovList
Definition: TileCalibCrest.py:75
python.TileCalibCrest.TileBlobReaderCrest.__db
__db
Definition: TileCalibCrest.py:70
python.TileCalibCrest.TileBlobReaderCrest.__tag
__tag
Definition: TileCalibCrest.py:72
python.TileCalibCrest.TileBlobReaderCrest.__copyBlob
__copyBlob
Definition: TileCalibCrest.py:73
python.TileCalibCrest.TileBlobWriterCrest.__drawer
__drawer
Definition: TileCalibCrest.py:402
python.TileCalibCrest.TileBlobWriterCrest.getComment
def getComment(self, split=False)
Definition: TileCalibCrest.py:458
TileCalibDrawerInt::getInstance
static const TileCalibDrawerInt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerBch.
Definition: TileCalibDrawerInt.cxx:27
TileCalibDrawerFlt::getInstance
static const TileCalibDrawerFlt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerFlt.
Definition: TileCalibDrawerFlt.cxx:13
python.TileCalibCrest.TileBlobReaderCrest.__comment
__comment
Definition: TileCalibCrest.py:79
python.TileCalibCrest.TileBlobReaderCrest.__drawerBlob
__drawerBlob
Definition: TileCalibCrest.py:78
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.TileCalibCrest.TileBlobReaderCrest.__modmin
__modmin
Definition: TileCalibCrest.py:81
python.TileCalibCrest.TileBlobReaderCrest.__create_comment
def __create_comment(self, b64string)
Definition: TileCalibCrest.py:249
python.TileCalibCrest.TileBlobReaderCrest.__drawer
__drawer
Definition: TileCalibCrest.py:80
python.TileCalibCrest.TileBlobWriterCrest.__calibDrawerType
__calibDrawerType
Definition: TileCalibCrest.py:387
python.TileCalibCrest.TileBlobWriterCrest.zeroBlob
def zeroBlob(self, ros, drawer)
Definition: TileCalibCrest.py:498
python.TileCalibCrest.TileBlobReaderCrest.__init__
def __init__(self, db, folder='', tag='', run=None, lumi=0, modmin=0, modmax=275, copyBlob=False)
Definition: TileCalibCrest.py:55
python.TileCalibCrest.TileBlobReaderCrest.__modmax
__modmax
Definition: TileCalibCrest.py:82
python.TileCalibCrest.TileBlobReaderCrest.__getIov
def __getIov(self, runlumi, dbg=False)
Definition: TileCalibCrest.py:185
TileCalibUtils::getCommentChannel
static unsigned int getCommentChannel()
Returns the COOL channel number for the comment channel.
Definition: TileCalibUtils.h:82
python.TileCalibCrest.TileBlobReaderCrest.getIovs
def getIovs(self, since, until)
Definition: TileCalibCrest.py:163
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
TileCalibUtils::max_draweridx
static unsigned int max_draweridx()
Python compatibility function.
Definition: TileCalibUtils.h:116
python.TileCalibCrest.TileBlobReaderCrest.__iov
__iov
Definition: TileCalibCrest.py:76
python.TileCalibCrest.TileBlobReaderCrest.__commentBlob
__commentBlob
Definition: TileCalibCrest.py:77
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
python.TileCalibCrest.TileBlobReaderCrest.__api_instance
__api_instance
Definition: TileCalibCrest.py:90
python.TileCalibCrest.TileBlobReaderCrest.__runlumi2iov
def __runlumi2iov(self, runlumi)
Definition: TileCalibCrest.py:230
Trk::open
@ open
Definition: BinningType.h:40
python.TileCalibCrest.TileBlobReaderCrest.__remote
__remote
Definition: TileCalibCrest.py:85
python.TileCalibCrest.TileBlobWriterCrest.__folderPath
__folderPath
Definition: TileCalibCrest.py:384
python.TileCalibCrest.TileBlobReaderCrest.__make_blob
def __make_blob(self, string)
Definition: TileCalibCrest.py:242
TileCalibDrawerOfc::getInstance
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.
Definition: TileCalibDrawerOfc.cxx:14
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.TileCalibCrest.TileBlobWriterCrest.__db
__db
Definition: TileCalibCrest.py:383
python.TileCalibCrest.TileBlobReaderCrest.getDrawer
def getDrawer(self, ros, mod, runlumi=None, dbg=False, useDefault=True)
Definition: TileCalibCrest.py:288
python.TileCalibCrest.TileBlobWriterCrest
Definition: TileCalibCrest.py:365
TileCalibDrawerCmt::getInstance
static const TileCalibDrawerCmt * getInstance(const coral::Blob &blob)
Returns a pointer to a const TileCalibDrawerCmt.
Definition: TileCalibDrawerCmt.cxx:24
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.TileCalibCrest.TileBlobReaderCrest.__folder
__folder
Definition: TileCalibCrest.py:71
python.TileCalibCrest.Blob
Blob
Definition: TileCalibCrest.py:16
str
Definition: BTagTrackIpAccessor.cxx:11
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
python.TileCalibCrest.TileBlobReaderCrest.__create_drawer
def __create_drawer(self, b64string, chan)
Definition: TileCalibCrest.py:260
python.TileCalibCrest.TileBlobReaderCrest
Definition: TileCalibCrest.py:48
python.TileCalibCrest.TileBlobReaderCrest.getFolderTag
def getFolderTag(self, folder, prefix, globalTag)
Definition: TileCalibCrest.py:112
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.CaloCondLogger.getLogger
def getLogger(name="CaloCond")
Definition: CaloCondLogger.py:16
TileCalibUtils::getFullTag
static std::string getFullTag(const std::string &folder, const std::string &tag)
Returns the full tag string, composed of camelized folder name and tag part.
Definition: TileCalibUtils.cxx:33