ATLAS Offline Software
TileCalibDefaultWriter.py
Go to the documentation of this file.
1 #!/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 # TileCalibDefaultWriter.py
5 # Nils Gollub <nils.gollub@cern.ch>, 2007-11-23
6 #
7 # Lukas Pribyl <lukas.pribyl@cern.ch>, 2008-07-09
8 # Guilherme Lima <jlima@cernNOSPAM.ch>, 2013-07-30 - changes to default Cs conditions
9 # Yuri Smirnov <iouri.smirnov@cern.ch>, 2014-12-24 - PyCintex->cppyy for ROOT6
10 
11 """
12 Python helper module for initializing db with default values
13 Note the COOL channels for default values:
14 - global default = channel 0
15 - default for LBA = channel 4
16 - default for LBC = channel 8
17 - default for EBA = channel 12
18 - default for EBA = channel 16
19 
20 All offline constants are written to OFL02 folder
21 In the COOLONL_TILE schema and COMP200 DB
22 some constants exist also in OFL01 folder
23 To write constants to this folder special prefix can be used:
24 
25 self.__tilePrefixOfl1
26 
27 """
28 
29 import cppyy
30 
31 from TileCalibBlobPython import TileCalibTools
32 from TileCalibBlobPython.TileCalibTools import MINRUN, MINLBK, MAXRUN, MAXLBK, LASPARTCHAN
33 from TileCalibBlobPython.TileCalibLogger import TileCalibLogger
34 from TileCalibBlobObjs.Classes import TileCalibUtils, TileBchDecoder
35 import os
36 
37 #=== path to files with default values
38 pathDef = "/afs/cern.ch/atlas/software/builds/AtlasConditions/latest/TileCalorimeter/TileConditions/share/"
39 
40 #
41 #______________________________________________________________________
42 class TileCalibDefaultWriter(TileCalibLogger):
43  """
44  This class provides methods to write default values for the various
45  TileCal COOL folders.
46  """
47  __slots__ = ["__author","__db","__tilePrefixOfl1","__tilePrefixOfl","__tilePrefixOnl"]
48 
49  #____________________________________________________________________
50  def __init__(self, db):
51  """
52  Input:
53  - db : db should be an open database connection
54  - globalTag: A tag used if nothing is specified in specialized functions
55  """
56  TileCalibLogger.__init__(self,"DefaultWriter")
57  self.__author = os.getlogin()
58  try:
59  if not db.isOpen():
60  raise Exception ("DB not open: ", db.databaseName())
61  else:
62  self.__db = db
63  self.__tilePrefixOfl1 = TileCalibTools.getTilePrefix(True,False)
64  #--- splitOnlineFolders in offline schema
65  self.__tilePrefixOfl = TileCalibTools.getTilePrefix(True,True)
66  self.__tilePrefixOnl = TileCalibTools.getTilePrefix(False)
67  #=== force the creation of template classes
68  except Exception as e:
69  self.log().critical( e )
70 
71 
72  #____________________________________________________________________
73  def writeCis(self, tag="", loGainDef=(1023./800.), hiGainDef=(64.*1023./800.)):
74 
75  self.log().info( "*** Writing CIS with defaults loGain=%f, hiGain=%f and tag %s",
76  loGainDef,hiGainDef,tag )
77 
78  #=== fill LIN (linear) folders first
79  loGainDefVec = cppyy.gbl.std.vector('float')()
80  loGainDefVec.push_back(loGainDef)
81  hiGainDefVec = cppyy.gbl.std.vector('float')()
82  hiGainDefVec.push_back(hiGainDef)
83  defVec = cppyy.gbl.std.vector('std::vector<float>')()
84  defVec.push_back(loGainDefVec)
85  defVec.push_back(hiGainDefVec)
86 
87  #=== folders
88  # folders = [self.__tilePrefixOfl+"CALIB/CIS/FIT/",
89  # self.__tilePrefixOfl+"CALIB/CIS/OF1/",
90  # self.__tilePrefixOfl+"CALIB/CIS/OF2/",
91  # self.__tilePrefixOfl+"CALIB/CIS/FMA/",
92  # self.__tilePrefixOfl+"CALIB/CIS/FLT/"]
93  folders = [self.__tilePrefixOfl+"CALIB/CIS/LIN",
94  self.__tilePrefixOnl+"CALIB/CIS/LIN"]
95 
96  for folder in folders:
97  multiVers=('OFL' in folder)
98  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
99 
100  #=== initialize all channels
101  util = cppyy.gbl.TileCalibUtils()
102  for ros in range(util.max_ros()):
103  for drawer in range(util.getMaxDrawer(ros)):
104  flt = blobWriter.zeroBlob(ros,drawer)
105  #=== only write to global defaul drawer ROS=0/drawer=0
106  flt = blobWriter.getDrawer(0,0)
107  flt.init(defVec,1,1)
108  blobWriter.setComment(self.__author,"CIS defaults")
109  #=== register
110  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
111  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
112 
113  #=== fill NLN (non-linear) folders with unit corretion
114  #=== Note: first insert all x values, then all y values
115  #=== LUT for all channels and gains must have the same length
116  lut = cppyy.gbl.std.vector('float')()
117  lut.push_back(0.) # x1
118  lut.push_back(1.) # y1
119  defVec.clear()
120  defVec.push_back(lut) # one default LUT for lo & hi gain
121 
122  folders = [self.__tilePrefixOfl+"CALIB/CIS/NLN",
123  self.__tilePrefixOnl+"CALIB/CIS/NLN"]
124 
125  for folder in folders:
126  multiVers=('OFL' in folder)
127  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
128 
129  #=== initialize all channels
130  for ros in range(util.max_ros()):
131  for drawer in range(util.getMaxDrawer(ros)):
132  flt = blobWriter.zeroBlob(ros,drawer)
133  #=== only write to global defaul drawer ROS=0/drawer=0
134  flt = blobWriter.getDrawer(0,0)
135  flt.init(defVec,1,100)
136  blobWriter.setComment(self.__author,"non-linear CIS defaults")
137  #=== register
138  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
139  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
140 
141 
142  #____________________________________________________________________
143  def writeLas(self, tag=""):
144 
145  self.log().info( "*** Writing Las default (1.) with tag %s", tag )
146 
147  #=== write linear (LIN) folders online and offline
148  lasDef = cppyy.gbl.std.vector('float')()
149  lasDef.push_back(1.)
150  defVec = cppyy.gbl.std.vector('std::vector<float>')()
151  defVec.push_back(lasDef)
152 
153  #=== write both to offline and online folders
154 
155  folders = [self.__tilePrefixOfl+"CALIB/LAS/LIN",
156  self.__tilePrefixOnl+"CALIB/LAS/LIN"]
157 
158  for folder in folders:
159  multiVers=('OFL' in folder)
160  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
161 
162  #=== initialize all channels
163  util = cppyy.gbl.TileCalibUtils()
164  for ros in range(util.max_ros()):
165  for drawer in range(util.getMaxDrawer(ros)):
166  flt = blobWriter.zeroBlob(ros,drawer)
167  #=== only write to global defaul drawer ROS=0/drawer=0
168  flt = blobWriter.getDrawer(0,0)
169  flt.init(defVec,1,1)
170  blobWriter.setComment(self.__author,"LAS default")
171  #=== register
172  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
173  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
174 
175  #=== fill NLN (non-linear) folders with unit corretion
176  lut = cppyy.gbl.std.vector('float')()
177  lut.push_back(0.) # x1
178  lut.push_back(1.) # y1
179  defVec.clear()
180  defVec.push_back(lut)
181 
182  #=== write both to offline and online folders
183  folders = [self.__tilePrefixOfl+"CALIB/LAS/NLN",
184  self.__tilePrefixOnl+"CALIB/LAS/NLN"]
185 
186  for folder in folders:
187  multiVers=('OFL' in folder)
188  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
189 
190  #=== initialize all channels
191  util = cppyy.gbl.TileCalibUtils()
192  for ros in range(util.max_ros()):
193  for drawer in range(util.getMaxDrawer(ros)):
194  flt = blobWriter.zeroBlob(ros,drawer)
195  #=== only write to global defaul drawer ROS=0/drawer=0
196  flt = blobWriter.getDrawer(0,0)
197  flt.init(defVec,1,100)
198  blobWriter.setComment(self.__author,"non-linear LAS default")
199  #=== register
200  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
201  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
202 
203 
204  #____________________________________________________________________
205  def writeLasFiber(self, tag=""):
206 
207  self.log().info( "*** Writing Las fiber and partition defaults (1.) with tag %s", tag )
208 
209  fibFolder = self.__tilePrefixOfl+"CALIB/LAS/FIBER"
210  #=== write fiber folder
211  lasDef = cppyy.gbl.std.vector('float')()
212  lasDef.push_back(1.)
213  defVec = cppyy.gbl.std.vector('std::vector<float>')()
214  defVec.push_back(lasDef)
215  blobWriter = TileCalibTools.TileBlobWriter(self.__db,fibFolder,'Flt')
216  #=== initialize all channels
217  util = cppyy.gbl.TileCalibUtils()
218  for ros in range(util.max_ros()):
219  for drawer in range(util.getMaxDrawer(ros)):
220  blobWriter.zeroBlob(ros,drawer)
221  #=== fiber variation: only write to global defaul drawer ROS=0/drawer=0
222  fltDrawer = blobWriter.getDrawer(0,0)
223  fltDrawer.init(defVec,1,1)
224 
225  #=== partition variation: write to the 1st drawer of each partition into an empty channel 43 (LASPARTCHAN)
226  adc = 0
227  idx = 0
228  val = 1.0
229  for ros in range(1,util.max_ros()):
230  fltDrawer = blobWriter.getDrawer(ros,0)
231  fltDrawer.init(defVec,48,1)
232  fltDrawer.setData(LASPARTCHAN,adc,idx,val)
233 
234  blobWriter.setComment(self.__author,"LAS fiber and partition default")
235  folderTag = TileCalibUtils.getFullTag(fibFolder, tag)
236  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
237 
238 
239  #____________________________________________________________________
240  def writeCes(self, tag="", Simulation=True, MBTSflag="7TeV", dCellWeight=1.2, eCellWeight=1.5, since=(MINRUN,MINLBK), until=(MAXRUN, MAXLBK), mode='DEFAULT'):
241  """
242  Write default drawer/mod=0/0 only for LBA and LBC.
243  EBA & EBC setup is messy and so each drawer is stored individually.
244  These values with dCellWeight = 1.0 correspond to real M7 ones.
245  These values with dCellWeight = 1.2 correspond to real M8 ones.
246  Mode = 'DEFAULT' means standard settings, any other mode means put 1 everywhere
247  and ignore weight for D-sampling.
248  """
249 
250  self.log().info( "*** Writing Ces with tag %s", tag )
251 
252  #=== special values != 1
253  #=== some info available here: https://twiki.cern.ch/twiki/bin/view/Atlas/SpecialModules
254  special = {}
255  #=== D-cells in LB
256  for ros in range(1,3):
257  for mod in range(64):
258  special[(ros,mod, 0)] = dCellWeight
259  special[(ros,mod,13)] = dCellWeight
260  special[(ros,mod,14)] = dCellWeight
261  special[(ros,mod,24)] = dCellWeight
262  special[(ros,mod,25)] = dCellWeight
263  special[(ros,mod,41)] = dCellWeight
264  special[(ros,mod,44)] = dCellWeight
265  #=== D-cells in EB
266  for ros in range(3,5):
267  for mod in range(64):
268  special[(ros,mod, 2)] = dCellWeight
269  special[(ros,mod, 3)] = dCellWeight
270  special[(ros,mod, 4)] = dCellWeight
271  special[(ros,mod, 5)] = dCellWeight
272  #=== E-cells in EB
273  for ros in range(3,5):
274  for mod in range(64):
275  special[(ros,mod, 0)] = eCellWeight
276  special[(ros,mod, 1)] = eCellWeight
277  special[(ros,mod,12)] = eCellWeight
278  special[(ros,mod,13)] = eCellWeight
279  special[(ros,mod,18)] = 1.0
280  special[(ros,mod,19)] = 1.0
281  #=== module type 11 anomalies (PMT 1,2,3,4 missing)
282  #=== EBA15 & EBC18
283  #----- PMT 1-4 not connected
284  special[(3,14, 0)] = 1.0
285  special[(3,14, 1)] = 1.0
286  special[(3,14, 2)] = 1.0
287  special[(3,14, 3)] = 1.0
288  special[(4,17, 0)] = 1.0
289  special[(4,17, 1)] = 1.0
290  special[(4,17, 2)] = 1.0
291  special[(4,17, 3)] = 1.0
292  #----- D4 & D5 merged, readout through D5 PMTs 17 & 18
293  special[(3,14,16)] = 1.0
294  special[(3,14,17)] = 1.0
295  special[(4,17,16)] = 1.0
296  special[(4,17,17)] = 1.0
297  #----- E3, E4 are routed to PMTs 19 & 20
298  special[(3,14,18)] = eCellWeight
299  special[(3,14,19)] = eCellWeight
300  special[(4,17,18)] = eCellWeight
301  special[(4,17,19)] = eCellWeight
302 
303  #=== Modules with connected to MBTS scintillator in RUN2
304  #=== Index starts with 0, so e.g. 0 for EBA indicates module EBA01 for example.
305  mbts_inner = [38,39,40,41,54,55,56,57] #E6 in channel 4 PMT05
306  mbts_outer = [ 7,23,42,53] #E5 in channel 12 PMT13
307 
308  #=== Modules with PMT1 connected to MBTS scintillator
309  #=== Index starts with 0, so e.g. 0 for EBA indicates module EBA01 for example.
310  eba_mbts_inner = [ 3,12,23,30,35,43,52,60] #E6
311  eba_mbts_outer = [ 2,11,22,29,34,44,53,59] #E5
312  ebc_mbts_inner = [ 4,12,19,27,36,44,54,61] #E6
313  ebc_mbts_outer = [ 3,11,18,26,35,43,53,60] #E5
314 
315  #=== Mean value of beta used for PMTs whose beta was not measured
316  betaMean = 7.07
317 
318  #=== Nominal HV and beta (must specify as floats for division later)
319  nomHV_EBA_inner = [ 694., 692.3, 697., 698., 695., 697., 696., 695.3 ]
320  beta_EBA_inner = [ 7.099, 7., 7.188, 6.995, 6.917, 7.217, 6.863, 6.97 ]
321 
322  nomHV_EBA_outer = [ 687., 695., 697.7, 692., 695., 696., 694., 696. ]
323  beta_EBA_outer = [ 6.903, 7.01, betaMean, betaMean, 6.918, betaMean, 7.072, betaMean ]
324 
325  nomHV_EBC_inner = [ 696., 697., 696., 693., 694., 698., 695., 690. ]
326  beta_EBC_inner = [ betaMean, 7.26, 7.281, 6.98, 7.002, 6.845, 6.955, 7.167 ]
327 
328  nomHV_EBC_outer = [ 697., 695., 695., 696., 696., 695., 696., 697. ]
329  beta_EBC_outer = [ 7.209, 7.084, 7.272, 7.093, 7.207, 7.02, 7.298, betaMean ]
330 
331  RUN=0
332  NEW="new"
333  if Simulation:
334  #=== Old cesium constants
335  corrFactor = 0.85
336  mev2pcb = 1.050/1000.
337  ces_mbts_inner = 2.5751/mev2pcb * corrFactor
338  ces_mbts_outer = 1.8438/mev2pcb * corrFactor
339 
340  #=== MIP values, inner counters from 900 GeV data
341  mbtsMipInnerC=[]
342  mbtsMipInnerA=[]
343 
344  #=== For inner counters, just scale mean outer peak by relative N_pe
345  for i in range(8):
346  mbtsMipInnerC.append(0.155 * 8.2/5.9)
347  mbtsMipInnerA.append(0.155 * 8.2/5.9)
348 
349  #=== MIP values, outer counters from 900 GeV data
350  mbtsMipOuterC = [ 0.16, 0.14, 0.155, 0.165, 0.14, 0.15, 0.185, 0.145 ]
351  mbtsMipOuterA = [ 0.15, 0.165, 0.135, 0.155, 0.13, 0.155, 0.165, 0.18 ]
352 
353  #=== New 900 GeV cesium constants
354  newCesMbtsOuterC=[]
355  newCesMbtsOuterA=[]
356  newCesMbtsInnerC=[]
357  newCesMbtsInnerA=[]
358  for i in range(8):
359  newCesMbtsOuterC.append( mbtsMipOuterC[i]/(10. * 5.9/8.2) * ces_mbts_outer )
360  newCesMbtsOuterA.append( mbtsMipOuterA[i]/(10. * 5.9/8.2) * ces_mbts_outer )
361  newCesMbtsInnerC.append( mbtsMipInnerC[i]/10. * ces_mbts_inner )
362  newCesMbtsInnerA.append( mbtsMipInnerA[i]/10. * ces_mbts_inner )
363 
364  #=== Further tune 900 GeV cesium constants
365  newCesMbtsOuterC[0] *= 1.15
366 
367  if not MBTSflag=="13TeV" and not MBTSflag=="8TeV" and not MBTSflag=="7TeV" and not MBTSflag=="900GeV":
368  print ("MBTS flag",MBTSflag,"is not recognized, assuming 7TeV")
369  MBTSflag="7TeV"
370  else:
371  print ("setting MBTS weights for",MBTSflag)
372 
373  if MBTSflag=="13TeV" :
374  RUN=2
375  print ("RUN2 configuration for MC")
376 
377  # Cesium constants to have pC afer deposited energy is multiplied by EMS(0.0105) and CES
378  ces_mbts_inner = 157.5/1.05 # connected to PMT5 of special C10
379  ces_mbts_outer = 157.5/1.05 # connected instead of E1
380  chan_mbts_inner = 5-1 # connected to PMT5 of special C10
381  chan_mbts_outer = 13-1 # connected instead of E1
382  NEW="150.0 as"
383 
384  #----- EBA inner
385  for i,mod in enumerate(mbts_inner):
386  special[(3,mod,chan_mbts_inner)] = ces_mbts_inner
387  print ("EBA",mod+1,"ch",chan_mbts_inner," inner MBTS = ",special[(3,mod,chan_mbts_inner)] )
388  #----- EBA outer
389  for i,mod in enumerate(mbts_outer):
390  special[(3,mod,chan_mbts_outer)] = ces_mbts_outer
391  print ("EBA",mod+1,"ch",chan_mbts_outer," outer MBTS = ",special[(3,mod,chan_mbts_outer)] )
392  #----- EBC inner
393  for i,mod in enumerate(mbts_inner):
394  special[(4,mod,chan_mbts_inner)] = ces_mbts_inner
395  print ("EBC",mod+1,"ch",chan_mbts_inner," inner MBTS = ",special[(4,mod,chan_mbts_inner)] )
396  #----- EBC outer
397  for i,mod in enumerate(mbts_outer):
398  special[(4,mod,chan_mbts_outer)] = ces_mbts_outer
399  print ("EBC",mod+1,"ch",chan_mbts_outer," outer MBTS = ",special[(4,mod,chan_mbts_outer)] )
400 
401  else:
402  RUN=1
403  print ("RUN1 configuration for MC")
404 
405  #=== Changes for 7 TeV ======================================================
406  if MBTSflag=="7TeV" or MBTSflag=="8TeV" :
407 
408  #=== PMT HV was increased from nominal to 850V (must specify as float for later division)
409  newHV = 850.
410  for i in range(8):
411  newCesMbtsOuterC[i] *= pow( newHV/nomHV_EBC_outer[i], beta_EBC_outer[i] )
412  newCesMbtsOuterA[i] *= pow( newHV/nomHV_EBA_outer[i], beta_EBA_outer[i] )
413  newCesMbtsInnerC[i] *= pow( newHV/nomHV_EBC_inner[i], beta_EBC_inner[i] )
414  newCesMbtsInnerA[i] *= pow( newHV/nomHV_EBA_inner[i], beta_EBA_inner[i] )
415 
416  #=== EBA03 and EBA12 have HV = 820V instead of 850V; so rescale back down
417  for i in [0, 1]:
418  newCesMbtsOuterA[i] *= pow( 820./newHV, beta_EBA_outer[i] )
419 
420  #=== EBC05 is dead, so set calibration constant to 0 (disable by hand)
421  if MBTSflag=="7TeV" :
422  newCesMbtsInnerC[0] = 1.0e-20
423 
424  #=========================================================================
425 
426  #----- EBA inner
427  for i,mod in enumerate(eba_mbts_inner):
428  special[(3,mod,0)] = newCesMbtsInnerA[i]
429  print ("EBA",mod+1," inner MBTS = ",special[(3,mod,0)] )
430  #----- EBA outer
431  for i,mod in enumerate(eba_mbts_outer):
432  special[(3,mod,0)] = newCesMbtsOuterA[i]
433  print ("EBA",mod+1," outer MBTS = ",special[(3,mod,0)] )
434  #----- EBC inner
435  for i,mod in enumerate(ebc_mbts_inner):
436  special[(4,mod,0)] = newCesMbtsInnerC[i]
437  print ("EBC",mod+1," inner MBTS = ",special[(4,mod,0)] )
438  #----- EBC outer
439  for i,mod in enumerate(ebc_mbts_outer):
440  special[(4,mod,0)] = newCesMbtsOuterC[i]
441  print ("EBC",mod+1, " outer MBTS = ",special[(4,mod,0)] )
442 
443  else:
444 
445  if MBTSflag=="13TeV" :
446  RUN=2
447  print ("RUN2 configuration for DATA")
448 
449  # Cesium constants to have fC in BS file for MBTS
450  ces_mbts_inner = (1.036 * 0.987)/1.05 # connected to PMT5 of special C10
451  ces_mbts_outer = 1.0/1.05 # connected instead of E1
452  chan_mbts_inner = 5-1 # connected to PMT5 of special C10
453  chan_mbts_outer = 13-1 # connected instead of E1
454 
455  #----- EBA inner
456  for i,mod in enumerate(mbts_inner):
457  special[(3,mod,chan_mbts_inner)] = ces_mbts_inner
458  print ("EBA",mod+1,"ch",chan_mbts_inner," inner MBTS = ",special[(3,mod,chan_mbts_inner)] )
459  #----- EBA outer
460  for i,mod in enumerate(mbts_outer):
461  special[(3,mod,chan_mbts_outer)] = ces_mbts_outer
462  print ("EBA",mod+1,"ch",chan_mbts_outer," outer MBTS = ",special[(3,mod,chan_mbts_outer)] )
463  #----- EBC inner
464  for i,mod in enumerate(mbts_inner):
465  special[(4,mod,chan_mbts_inner)] = ces_mbts_inner
466  print ("EBC",mod+1,"ch",chan_mbts_inner," inner MBTS = ",special[(4,mod,chan_mbts_inner)] )
467  #----- EBC outer
468  for i,mod in enumerate(mbts_outer):
469  special[(4,mod,chan_mbts_outer)] = ces_mbts_outer
470  print ("EBC",mod+1,"ch",chan_mbts_outer," outer MBTS = ",special[(4,mod,chan_mbts_outer)] )
471 
472  else:
473  RUN=1
474  print ("RUN1 configuration for DATA")
475 
476  # Cesium constants to have fC in BS file for MBTS
477  ces_mbts_inner = 1.0/1.05
478  ces_mbts_outer = 1.0/1.05
479 
480  #----- EBA inner
481  for mod in eba_mbts_inner:
482  special[(3,mod,0)] = ces_mbts_inner
483  print ("EBA",mod+1," inner MBTS = ",special[(3,mod,0)] )
484  #----- EBA outer
485  for mod in eba_mbts_outer:
486  special[(3,mod,0)] = ces_mbts_outer
487  print ("EBA",mod+1," outer MBTS = ",special[(3,mod,0)] )
488  #----- EBC inner
489  for mod in ebc_mbts_inner:
490  special[(4,mod,0)] = ces_mbts_inner
491  print ("EBC",mod+1," inner MBTS = ",special[(4,mod,0)] )
492  #----- EBC outer
493  for mod in ebc_mbts_outer:
494  special[(4,mod,0)] = ces_mbts_outer
495  print ("EBC",mod+1, " outer MBTS = ",special[(4,mod,0)] )
496 
497  #=== store 4 values per channel
498  default = cppyy.gbl.std.vector('float')()
499  if Simulation:
500  default.push_back( 1.) # cesium constant
501  default.push_back( 1.) # laser slope
502  default.push_back(700.) # reference HV
503  default.push_back( 20.) # reference temperature (same for all channels)
504  else:
505  default.push_back( 1.) # cesium constant
506  default.push_back( -1.) # laser slope
507  default.push_back( 0.) # reference HV
508  default.push_back( 20.) # reference temperature (same for all channels)
509  defVec = cppyy.gbl.std.vector('std::vector<float>')()
510  defVec.push_back(default)
511 
512  #=== write both to offline and online folders
513  folders = [self.__tilePrefixOfl+"CALIB/CES",
514  self.__tilePrefixOnl+"CALIB/CES"]
515 
516  for folder in folders:
517  multiVers=('OFL' in folder)
518  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
519 
520  #=== initialize all channels
521  util = cppyy.gbl.TileCalibUtils()
522  for ros in range(util.max_ros()):
523  for drawer in range(util.getMaxDrawer(ros)):
524  flt = blobWriter.zeroBlob(ros,drawer)
525 
526  #=== global detector default
527  det = blobWriter.getDrawer(0,0)
528  det.init(defVec,48,1)
529 
530  #=== default settings (including all special cases)
531  if mode=='DEFAULT':
532  self.log().info( "*** Writing Ces defaults with dCellWeight = %.1f eCellWeight = %.1f", dCellWeight,eCellWeight )
533  #=== defaults for LBA & LBC
534  lba = blobWriter.getDrawer(0,4)
535  lba.init(defVec,48,1)
536  lbc = blobWriter.getDrawer(0,8)
537  lbc.init(defVec,48,1)
538  for chan in range(48):
539  key = (1,0,chan)
540  ces = special.get(key,1.)
541  lba.setData(chan,0,0,ces)
542  lbc.setData(chan,0,0,ces)
543 
544  #=== defaults for EBA & EBC
545  eba = blobWriter.getDrawer(0,12)
546  eba.init(defVec,48,1)
547  ebc = blobWriter.getDrawer(0,16)
548  ebc.init(defVec,48,1)
549  for chan in range(48):
550  key = (3,0,chan)
551  ces = special.get(key,1.)
552  eba.setData(chan,0,0,ces)
553  ebc.setData(chan,0,0,ces)
554 
555  #=== defaults for EBA & EBC
556  #=== store each drawer individually
557  for ros in range(3,5):
558  for mod in range(64):
559  flt = blobWriter.getDrawer(ros,mod)
560  flt.init(defVec,48,1)
561  for chan in range(48):
562  key = (ros,mod,chan)
563  ces = special.get(key,1.)
564  flt.setData(chan,0,0,ces)
565 
566  #=== set comment
567  blobWriter.setComment(self.__author,"default cesium constants for Run %d and %s MBTS weights for %s" % (RUN,NEW,MBTSflag))
568 
569  #=== special case: write cesium = 1 everywhere
570  else: # (mode != 'DEFAULT')
571  self.log().info( "*** Writing Ces = 1 everywhere" )
572  #=== set comment
573  blobWriter.setComment(self.__author,"cesium constants = 1 everywhere")
574 
575  #=== register
576  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
577  blobWriter.register(since,until,folderTag)
578 
579 
580  #____________________________________________________________________
581  def writeOldCes(self, tag="", dCellWeight=1.2, eCellWeight=1.5, since=(MINRUN,MINLBK), until=(MAXRUN, MAXLBK)):
582  """
583  Write default drawer/mod=0/0 only for LBA and LBC.
584  EBA & EBC setup is messy and so each drawer is stored individually.
585  MBTS in EBs connected in channel 47. No module type 11 anomaly.
586  These values with dCellWeight = 1.2 correspond to simulation with CSC and FDR global tags.
587  """
588 
589  self.log().info( "*** Writing Ces with tag %s", tag )
590 
591  #=== special values != 1
592  special = {}
593  #=== D-cells in LB
594  for ros in range(1,3):
595  for mod in range(64):
596  special[(ros,mod, 0)] = dCellWeight
597  special[(ros,mod,13)] = dCellWeight
598  special[(ros,mod,14)] = dCellWeight
599  special[(ros,mod,24)] = dCellWeight
600  special[(ros,mod,25)] = dCellWeight
601  special[(ros,mod,41)] = dCellWeight
602  special[(ros,mod,44)] = dCellWeight
603  #=== D-cells in EB
604  for ros in range(3,5):
605  for mod in range(64):
606  special[(ros,mod, 2)] = dCellWeight
607  special[(ros,mod, 3)] = dCellWeight
608  special[(ros,mod, 4)] = dCellWeight
609  special[(ros,mod, 5)] = dCellWeight
610  #=== E-cells in EB
611  for ros in range(3,5):
612  for mod in range(64):
613  special[(ros,mod, 0)] = eCellWeight
614  special[(ros,mod, 1)] = eCellWeight
615  special[(ros,mod,12)] = eCellWeight
616  special[(ros,mod,13)] = eCellWeight
617  #=== EB modules with channel 47 connected to MBTS scintillator
618  #mev2pcb = 1.050/1000.
619  #ces_mbts_inner = 2.5751/mev2pcb
620  #ces_mbts_outer = 1.8438/mev2pcb
621  ces_mbts_inner = 1.0/1.05
622  ces_mbts_outer = 1.0/1.05
623  eb_mbts_inner = [ 0, 1, 2, 3,
624  8, 9,10,11,
625  16,17,18,19,
626  24,25,26,27,
627  32,33,34,35,
628  40,41,42,43,
629  48,49,50,51,
630  56,57,58,59
631  ] #E6
632  eb_mbts_outer = [ 4, 5, 6, 7,
633  12,13,14,15,
634  20,21,22,23,
635  28,29,30,31,
636  36,37,38,39,
637  44,45,46,47,
638  52,53,54,55,
639  60,61,62,63] #E5
640  #----- EBA and EBC inner
641  for mod in eb_mbts_inner:
642  special[(3,mod,47)] = ces_mbts_inner
643  special[(4,mod,47)] = ces_mbts_inner
644  #----- EBA and EBC outer
645  for mod in eb_mbts_outer:
646  special[(3,mod,47)] = ces_mbts_outer
647  special[(4,mod,47)] = ces_mbts_outer
648 
649  #=== store 4 values per channel
650  default = cppyy.gbl.std.vector('float')()
651  default.push_back( 1.) # cesium constant
652  default.push_back( 1.) # laser slope
653  default.push_back(700.) # reference HV
654  default.push_back( 20.) # reference temperature (same for all channels)
655  defVec = cppyy.gbl.std.vector('std::vector<float>')()
656  defVec.push_back(default)
657 
658  #=== write both to offline and online folders
659  folderOfl = self.__tilePrefixOfl+"CALIB/CES"
660  folderOnl = self.__tilePrefixOnl+"CALIB/CES"
661  blobWriterOfl = TileCalibTools.TileBlobWriter(self.__db,folderOfl,'Flt' )
662  blobWriterOnl = TileCalibTools.TileBlobWriter(self.__db,folderOnl,'Flt',False)
663 
664  #=== initialize all channels
665  util = cppyy.gbl.TileCalibUtils()
666  for ros in range(util.max_ros()):
667  for drawer in range(util.getMaxDrawer(ros)):
668  fltOfl = blobWriterOfl.zeroBlob(ros,drawer)
669  fltOnl = blobWriterOnl.zeroBlob(ros,drawer)
670 
671  #=== global detector default
672  detOfl = blobWriterOfl.getDrawer(0,0)
673  detOfl.init(defVec,48,1)
674  detOnl = blobWriterOnl.getDrawer(0,0)
675  detOnl.init(defVec,48,1)
676 
677  #=== default settings (including all special cases)
678  self.log().info( "*** Writing Ces defaults with dCellWeight = %.1f eCellWeight = %.1f", dCellWeight,eCellWeight )
679  #=== defaults for LBA & LBC
680  lbaOfl = blobWriterOfl.getDrawer(0,4)
681  lbaOfl.init(defVec,48,1)
682  lbaOnl = blobWriterOnl.getDrawer(0,4)
683  lbaOnl.init(defVec,48,1)
684  lbcOfl = blobWriterOfl.getDrawer(0,8)
685  lbcOfl.init(defVec,48,1)
686  lbcOnl = blobWriterOnl.getDrawer(0,8)
687  lbcOnl.init(defVec,48,1)
688  for chan in range(48):
689  key = (1,0,chan)
690  ces = special.get(key,1.)
691  lbaOfl.setData(chan,0,0,ces)
692  lbaOnl.setData(chan,0,0,ces)
693  lbcOfl.setData(chan,0,0,ces)
694  lbcOnl.setData(chan,0,0,ces)
695 
696  #=== defaults for EBA & EBC
697  #=== store each drawer individually
698  for ros in range(3,5):
699  for mod in range(64):
700  fltOfl = blobWriterOfl.getDrawer(ros,mod)
701  fltOfl.init(defVec,48,1)
702  fltOnl = blobWriterOnl.getDrawer(ros,mod)
703  fltOnl.init(defVec,48,1)
704  for chan in range(48):
705  key = (ros,mod,chan)
706  ces = special.get(key,1.)
707  fltOfl.setData(chan,0,0,ces)
708  fltOnl.setData(chan,0,0,ces)
709 
710  #=== set comment
711  blobWriterOfl.setComment(self.__author,"default old cesium constants (CSC,FDR) with dCellWeight=%.1f" % dCellWeight)
712  blobWriterOnl.setComment(self.__author,"default old cesium constants (CSC,FDR) with dCellWeight=%.1f" % dCellWeight)
713 
714  #=== register
715  folderTag = TileCalibUtils.getFullTag(folderOfl, tag)
716  blobWriterOfl.register(since,until,folderTag)
717  blobWriterOnl.register(since,until, "")
718 
719 
720  #____________________________________________________________________
721  def writeEmscale(self, tag="", since=(MINRUN,MINLBK), until=(MAXRUN, MAXLBK)):
722 
723  #=== EM scale constants as described in ATLAS Note "Calibration of
724  #=== ATLAS Tile Calorimeter at Electromagnetic Scale"
725  #--- A-sampling base pC/MeV factor
726  emscale=(1.05/1000.)
727  #--- additional particle/Cs factors for corresponding channels
728  #--- we insert emscale/(p/Cs) as we must increase the MeV denominator
729  #--- long barrel modules
730  #--- additional factors came from presentation by A.Solodkov
731  #--- at TileCal Calibration meeting on 16-Nov-2009
732  #--- correction because of slightly wrong normalization Integral2008/Amplitude2001
733  flbA = 1.000
734  flbB = 1.025 * 1.011
735  flbB9= 1.014 * 1.015 # tilerows B4-6
736  flbD = 1.088 * 0.978
737  clbA = [1, 4, 5, 8, 9, 10, 15, 18, 19, 20, 23, 26, 29, 32, 35, 36, 37, 38, 45, 46]
738  clbB = [2, 3, 6, 7, 11, 12, 16, 17, 21, 22, 27, 28, 33, 34, 39, 40]
739  clbB9= [42, 47]
740  clbD = [0, 13, 14, 24, 25, 41, 44]
741 
742  #--- extended barrel modules
743  febA = 1.000
744  febB = 1.009 * 1.012
745  febD = 1.055 * 0.992
746  cebA = [6, 7, 10, 11, 20, 21, 31, 32, 40, 41]
747  cebB = [8, 9, 14, 15, 22, 23, 30, 35, 36, 39]
748  cebD = [16, 17, 37, 38]
749 
750  #--- ITC cells
751  fC10 = 1.036 * 0.987 # tilerows BC7-9
752  fD4 = flbD # composed of the same tilerows as barrel D-sampling
753  cC10 = [4, 5]
754  cD4 = [2, 3]
755 
756  self.log().info( "*** Writing Emscale with particle/Cesium factors with tag %s" , tag )
757 
758  #=== write linear (LIN) folder
759  emsDef = cppyy.gbl.std.vector('float')()
760  emsDef.push_back(emscale)
761  defVec = cppyy.gbl.std.vector('std::vector<float>')()
762  defVec.push_back(emsDef)
763 
764  folders = [ self.__tilePrefixOfl+"CALIB/EMS",
765  self.__tilePrefixOnl+"CALIB/EMS" ]
766 
767  for folder in folders:
768  multiVers=('OFL' in folder)
769  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
770 
771  #=== initialize all channels
772  util = cppyy.gbl.TileCalibUtils()
773  for ros in range(util.max_ros()):
774  for drawer in range(util.getMaxDrawer(ros)):
775  flt = blobWriter.zeroBlob(ros,drawer)
776 
777  #=== write EM scale as global default and explicitly too
778  flt = blobWriter.getDrawer(0,0)
779  flt.init(defVec,1,1)
780 
781  #=== LB values
782  for ros in range(1,3):
783  for mod in range(64):
784  flt = blobWriter.getDrawer(ros,mod)
785  flt.init(defVec,48,1)
786  for chan in clbA:
787  flt.setData(chan,0,0,emscale/flbA)
788  for chan in clbB:
789  flt.setData(chan,0,0,emscale/flbB)
790  for chan in clbB9:
791  flt.setData(chan,0,0,emscale/flbB9)
792  for chan in clbD:
793  flt.setData(chan,0,0,emscale/flbD)
794 
795  #=== EB and ITC values
796  for ros in range(3,5):
797  for mod in range(64):
798  flt = blobWriter.getDrawer(ros,mod)
799  flt.init(defVec,48,1)
800  for chan in cebA:
801  flt.setData(chan,0,0,emscale/febA)
802  for chan in cebB:
803  flt.setData(chan,0,0,emscale/febB)
804  for chan in cebD:
805  flt.setData(chan,0,0,emscale/febD)
806  for chan in cC10:
807  flt.setData(chan,0,0,emscale/fC10)
808  for chan in cD4:
809  flt.setData(chan,0,0,emscale/fD4)
810 
811  blobWriter.setComment(self.__author,"EMS with particle/Cesium factors (pC/MeV)")
812  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
813  blobWriter.register(since,until,folderTag)
814 
815 
816  #____________________________________________________________________
817  def writeEmscaleMC(self, tag="", emscale=(1.05/1000.), since=(MINRUN,MINLBK), until=(MAXRUN, MAXLBK)):
818 
819  self.log().info( "*** Writing Emscale default (%.2f) with tag %s", (emscale * 1000.),tag )
820 
821  #=== write linear (LIN) folder
822  emsDef = cppyy.gbl.std.vector('float')()
823  emsDef.push_back(emscale)
824  defVec = cppyy.gbl.std.vector('std::vector<float>')()
825  defVec.push_back(emsDef)
826 
827  folders = [ self.__tilePrefixOfl+"CALIB/EMS",
828  self.__tilePrefixOnl+"CALIB/EMS" ]
829 
830  for folder in folders:
831  multiVers=('OFL' in folder)
832  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
833  #=== initialize all channels
834  util = cppyy.gbl.TileCalibUtils()
835  for ros in range(util.max_ros()):
836  for drawer in range(util.getMaxDrawer(ros)):
837  flt = blobWriter.zeroBlob(ros,drawer)
838  #=== only write to global defaul drawer ROS=0/drawer=0
839  flt = blobWriter.getDrawer(0,0)
840  flt.init(defVec,1,1)
841  blobWriter.setComment(self.__author,"EMS default: %.2f/1000 pC/MeV" % (emscale * 1000.))
842  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
843  blobWriter.register(since,until,folderTag)
844 
845 
846  #________________________________________________________________________
847  def writeIntegrator(self, tag=""):
848 
849  #=== construct folder path
850  folder = self.__tilePrefixOfl+"INTEGRATOR"
851 
852  #=== get full folder tag
853  folderTag = TileCalibUtils.getFullTag(folder, tag)
854 
855  #=== create default values for each of the six gains 1 to 6
856  # for each gain there is:
857  # gain, error of the gain, chi2 of the fit, pedestal
858  # DAC for pedestal, sigma of pedestal distribution
859  # RMS of pedestal distribution, sigma of the RMS
860 
861  dv = []
862  dv.append(( 2.814, 0.023, -1, -1, 80, -1, -1, -1))
863  dv.append(( 26.010, 0.230, -1, -1, 80, -1, -1, -1))
864  dv.append(( 28.810, 0.240, -1, -1, 80, -1, -1, -1))
865  dv.append(( 54.810, 0.480, -1, -1, 70, -1, -1, -1))
866  dv.append(( 75.790, 0.677, -1, -1, 70, -1, -1, -1))
867  dv.append((101.800, 0.900, -1, -1, 70, -1, -1, -1))
868 
869  #=== number of integrator gains and value per gain
870  ngain = 6
871 
872  defVec = cppyy.gbl.std.vector('std::vector<float>')()
873 
874  for i in range(ngain):
875  defaultGain = cppyy.gbl.std.vector('float')()
876  for v in dv[i]:
877  defaultGain.push_back(v)
878  defVec.push_back(defaultGain)
879 
880  #=====================================================
881  #=== fill
882  #=====================================================
883  writer = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
884  writer.setComment(self.__author,"Integrator gain defaults")
885  #=== initialize all channels and write global default
886  util = cppyy.gbl.TileCalibUtils()
887  for ros in range(util.max_ros()):
888  for drawer in range(util.getMaxDrawer(ros)):
889  writer.zeroBlob(ros,drawer)
890  calibDrawer = writer.getDrawer(0,0)
891  calibDrawer.init(defVec,1,1)
892 
893  #=== register in DB
894  writer.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
895 
896 
897  #____________________________________________________________________
898  def writeTcfib(self, tag=""):
899 
900 
901  # NGO need to implement cell fiber length for special type 11 (?) modules!
902  self.log().info( "*** Writing Tcfib defaults using tag %s", tag )
903 
904  parser = TileCalibTools.TileASCIIParser(pathDef+"TileTcfib.dat","Tfib")
905  folder = self.__tilePrefixOfl+"TIME/CELLFIBERLENGTH"
906  default = cppyy.gbl.std.vector('float')()
907  default.push_back(0.)
908  defVec = cppyy.gbl.std.vector('std::vector<float>')()
909  defVec.push_back(default)
910  try:
911  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
912  #=== initialize all channels
913  util = cppyy.gbl.TileCalibUtils()
914  for ros in range(util.max_ros()):
915  for drawer in range(util.getMaxDrawer(ros)):
916  blobWriter.zeroBlob(ros,drawer)
917 
918  #=== default for detector
919  det = blobWriter.getDrawer(0, 0)
920  det.init(defVec,48,0)
921  #=== default for LBA
922  lba = blobWriter.getDrawer(0, 4)
923  lba.init(defVec,48,0)
924  #=== default for LBC
925  lbc = blobWriter.getDrawer(0, 8)
926  lbc.init(defVec,48,0)
927  #=== default for EBA
928  eba = blobWriter.getDrawer(0,12)
929  eba.init(defVec,48,0)
930  #=== default for EBC
931  ebc = blobWriter.getDrawer(0,16)
932  ebc.init(defVec,48,0)
933  for chan in range(48):
934  valLba = float(parser.getData(1,0,chan)[0])
935  valLbc = float(parser.getData(2,0,chan)[0])
936  valEba = float(parser.getData(3,0,chan)[0])
937  valEbc = float(parser.getData(4,0,chan)[0])
938  lba.setData(chan,0,0,valLba)
939  lbc.setData(chan,0,0,valLbc)
940  eba.setData(chan,0,0,valEba)
941  ebc.setData(chan,0,0,valEbc)
942  blobWriter.setComment(self.__author,"channel (laser) clear fiber length")
943  folderTag = TileCalibUtils.getFullTag(folder, tag)
944  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
945  except Exception as e:
946  self.log().critical( e )
947 
948 
949  #____________________________________________________________________
950  def writeTclas(self, tag=""):
951 
952  self.log().info( "*** Writing Tclas defaults using tag %s", tag )
953 
954  folder = self.__tilePrefixOfl+"TIME/CHANNELOFFSET/LAS"
955  default = cppyy.gbl.std.vector('float')()
956  default.push_back(0.)
957  defVec = cppyy.gbl.std.vector('std::vector<float>')()
958  defVec.push_back(default)
959  try:
960  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
961  #=== initialize all channels
962  util = cppyy.gbl.TileCalibUtils()
963  for ros in range(util.max_ros()):
964  for drawer in range(util.getMaxDrawer(ros)):
965  flt = blobWriter.zeroBlob(ros,drawer)
966  flt = blobWriter.getDrawer(0, 0)
967  flt.init(defVec,1,0)
968  blobWriter.setComment(self.__author,"no channel timing offset by default")
969  folderTag = TileCalibUtils.getFullTag(folder, tag)
970  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
971  except Exception as e:
972  self.log().critical( e )
973 
974 
975  #____________________________________________________________________
976  def writeTdlas(self, tag=""):
977 
978  self.log().info( "*** Writing Tdlas defaults using tag %s", tag )
979 
980  folder = self.__tilePrefixOfl+"TIME/DRAWEROFFSET/LAS"
981  default = cppyy.gbl.std.vector('float')()
982  default.push_back(0.)
983  defVec = cppyy.gbl.std.vector('std::vector<float>')()
984  defVec.push_back(default)
985  try:
986  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
987  #=== initialize only one channel per drawer
988  util = cppyy.gbl.TileCalibUtils()
989  for ros in range(util.max_ros()):
990  for drawer in range(util.getMaxDrawer(ros)):
991  flt = blobWriter.zeroBlob(ros,drawer)
992  flt = blobWriter.getDrawer(0, 0)
993  flt.init(defVec,1,0)
994  blobWriter.setComment(self.__author,"no drawer timing offset by default")
995  folderTag = TileCalibUtils.getFullTag(folder, tag)
996  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
997  except Exception as e:
998  self.log().critical( e )
999 
1000 
1001  #____________________________________________________________________
1002  def writeTof(self, tag=""):
1003 
1004  self.log().info( "*** Writing Tof defaults using tag %s", tag )
1005 
1006  parser = TileCalibTools.TileASCIIParser(pathDef+"Tile.tctof","Tctof")
1007  folder = self.__tilePrefixOfl+"TIME/TIMEOFFLIGHT"
1008  default = cppyy.gbl.std.vector('float')()
1009  default.push_back(0.)
1010  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1011  defVec.push_back(default)
1012  try:
1013  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
1014  #=== initialize all channels and write global default
1015  util = cppyy.gbl.TileCalibUtils()
1016  for ros in range(util.max_ros()):
1017  for drawer in range(util.getMaxDrawer(ros)):
1018  blobWriter.zeroBlob(ros,drawer)
1019  calibDrawer = blobWriter.getDrawer(0,0)
1020  calibDrawer.init(defVec,1,1)
1021 
1022  #=== loop over the partitions
1023  ros = 0
1024  for mod in (4, 8, 12, 16):
1025  #=== need to invalidate previous blob in DB when reading from ASCII file
1026  blobWriter.zeroBlob(ros,mod)
1027  for chn in range(48):
1028  value = parser.getData(ros,mod,chn)
1029  if not len(value):
1030  self.log().warning("%i/%2i/%2i/x: No value found in file", ros,mod,chn)
1031  continue
1032  #=== init drawer with defaults for first entry
1033  calibDrawer = blobWriter.getDrawer(ros,mod)
1034  if not calibDrawer.getNObjs():
1035  self.log().info("Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
1036  calibDrawer.init(defVec,48,1)
1037 
1038  #=== set the data
1039  adc = 0
1040  line = "%i/%2i/%2i/%i: " % (ros,mod,chn,adc)
1041  val = float(value[0])
1042  calibDrawer.setData(chn,adc,0,val)
1043  line += "%f " % (val,)
1044  self.log().debug(line)
1045 
1046  blobWriter.setComment("jose maneira","time-of-flight default values")
1047  folderTag = TileCalibUtils.getFullTag(folder, tag)
1048  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1049  except Exception as e:
1050  self.log().critical( e )
1051 
1052 
1053  #____________________________________________________________________
1054  def writeNoiseFit(self, tag="", loGainDef=0.8, hiGainDef=1.6):
1055 
1056  self.log().info( "*** Writing Fit Method Noise with defaults (ADC counts) loGain=%f, hiGain=%f and tag %s" ,
1057  loGainDef,hiGainDef,tag )
1058 
1059  #=== fill folders
1060  loGainDefVec = cppyy.gbl.std.vector('float')()
1061  loGainDefVec.push_back(loGainDef)
1062  hiGainDefVec = cppyy.gbl.std.vector('float')()
1063  hiGainDefVec.push_back(hiGainDef)
1064  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1065  defVec.push_back(loGainDefVec)
1066  defVec.push_back(hiGainDefVec)
1067 
1068  #=== folders
1069  folders = [self.__tilePrefixOfl+"NOISE/FIT",
1070  self.__tilePrefixOfl+"NOISE/OF1",
1071  self.__tilePrefixOfl+"NOISE/OF2"]
1072 
1073  for folder in folders:
1074  try:
1075  multiVers=('OFL' in folder)
1076  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
1077  #=== initialize all channels
1078  util = cppyy.gbl.TileCalibUtils()
1079  for ros in range(util.max_ros()):
1080  for drawer in range(util.getMaxDrawer(ros)):
1081  flt = blobWriter.zeroBlob(ros,drawer)
1082  #=== only write to global defaul drawer ROS=0/drawer=0
1083  flt = blobWriter.getDrawer(0,0)
1084  flt.init(defVec,1,1)
1085  blobWriter.setComment(self.__author,"Fit Method Noise defaults (ADC)")
1086  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1087  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1088  except Exception as e:
1089  self.log().critical( e )
1090 
1091 
1092  #____________________________________________________________________
1093  def writeNoiseSample(self, tag="", loGainDef=0.8, hiGainDef=1.6):
1094 
1095  self.log().info( "*** Writing sample noise (lo=%f, hi=%f) defaults using tag %s",
1096  loGainDef,hiGainDef,tag )
1097 
1098  #=== common noise defaults
1099  defaultLo = cppyy.gbl.std.vector('float')()
1100  defaultLo.push_back( 40.) # pedestal value
1101  defaultLo.push_back(loGainDef) # pedestal rms (high frequency noise)
1102  defaultLo.push_back( 0.) # (low frequency noise)
1103  defaultLo.push_back(loGainDef) # sigma 1 of HFN
1104  defaultLo.push_back( 0.) # sigma 2 of HFN
1105  defaultLo.push_back( 0.) # HFN2/HFN1 ratio
1106  defaultHi = cppyy.gbl.std.vector('float')()
1107  defaultHi.push_back( 40.) # pedestal value
1108  defaultHi.push_back(hiGainDef) # pedestal rms (high frequency noise)
1109  defaultHi.push_back( 0.) # (low frequency noise)
1110  defaultHi.push_back(hiGainDef) # sigma 1 of HFN
1111  defaultHi.push_back( 0.) # sigma 2 of HFN
1112  defaultHi.push_back( 0.) # HFN2/HFN1 ratio
1113  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1114  defVec.push_back(defaultLo)
1115  defVec.push_back(defaultHi)
1116 
1117  folders = [self.__tilePrefixOfl+"NOISE/SAMPLE",
1118  self.__tilePrefixOnl+"NOISE/SAMPLE"]
1119 
1120  for folder in folders:
1121  try:
1122  multiVers=('OFL' in folder)
1123  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
1124  #=== initialize all channels
1125  util = cppyy.gbl.TileCalibUtils()
1126  for ros in range(util.max_ros()):
1127  for drawer in range(util.getMaxDrawer(ros)):
1128  flt = blobWriter.zeroBlob(ros,drawer)
1129  flt = blobWriter.getDrawer(0, 0)
1130  flt.init(defVec,1,0)
1131  blobWriter.setComment(self.__author,"default noise")
1132  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1133  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1134  except Exception as e:
1135  self.log().critical( e )
1136 
1137 
1138  #____________________________________________________________________
1139  def writeRODmap(self, tag=""):
1140 
1141  self.log().info( "*** Writing dummy RODmap using tag %s",tag)
1142 
1143  default = cppyy.gbl.std.vector('int')()
1144  default.push_back(0x0) # offline drawer ID
1145  default.push_back(0x500000) # ROB ID for given drawer
1146  default.push_back(0x0) # bytestream frag ID
1147  default.push_back(0) # drawer type (0=legacy, 1=upgrade)
1148  defVec = cppyy.gbl.std.vector('std::vector<int>')()
1149  defVec.push_back(default)
1150  defVec.push_back(default)
1151 
1152  folders = [self.__tilePrefixOfl+"STATUS/ROD",
1153  self.__tilePrefixOnl+"STATUS/ROD"]
1154 
1155  for folder in folders:
1156  try:
1157  multiVers=('OFL' in folder)
1158  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Int',multiVers)
1159  #=== initialize all channels
1160  util = cppyy.gbl.TileCalibUtils()
1161  for ros in range(util.max_ros()):
1162  for drawer in range(util.getMaxDrawer(ros)):
1163  flt = blobWriter.zeroBlob(ros,drawer)
1164  flt = blobWriter.getDrawer(0, 0)
1165  flt.init(defVec,1,0)
1166  blobWriter.setComment(self.__author,"dummy ROD map")
1167  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1168  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1169  except Exception as e:
1170  self.log().critical( e )
1171 
1172 
1173  #____________________________________________________________________
1174  def writeNoiseOnl(self, tag="", loGainDef=0.8, hiGainDef=1.6):
1175 
1176  self.log().info( "*** Writing 1-g noise(ADC counts)+pileup(MeV) defaults loGain=%f, hiGain=%f and tag %s",
1177  loGainDef,hiGainDef,tag )
1178 
1179  #=== common noise defaults
1180  defaultLo = cppyy.gbl.std.vector('float')()
1181  defaultLo.push_back(loGainDef) # el. noise
1182  defaultLo.push_back(0.) # pileup noise
1183  defaultHi = cppyy.gbl.std.vector('float')()
1184  defaultHi.push_back(hiGainDef) # el. noise
1185  defaultHi.push_back(0.) # pileup noise
1186 
1187  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1188  defVec.push_back(defaultLo)
1189  defVec.push_back(defaultHi)
1190 
1191  folders = [self.__tilePrefixOfl+"NOISE/OFNI",
1192  self.__tilePrefixOnl+"NOISE/OFNI"]
1193 
1194  for folder in folders:
1195  try:
1196  multiVers=('OFL' in folder)
1197  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
1198  #=== initialize all channels
1199  util = cppyy.gbl.TileCalibUtils()
1200  for ros in range(util.max_ros()):
1201  for drawer in range(util.getMaxDrawer(ros)):
1202  flt = blobWriter.zeroBlob(ros,drawer)
1203  #
1204  flt = blobWriter.getDrawer(0, 0)
1205  flt.init(defVec,48,1)
1206  #
1207  blobWriter.setComment(self.__author,"default noise for DSP reco")
1208  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1209  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1210  except Exception as e:
1211  self.log().critical( e )
1212 
1213 
1214  #____________________________________________________________________
1215  def writeNoiseSampleMC(self, tag="", loGainDef=0.8, hiGainDef=1.6):
1216  """
1217  To be compatible with previous defaults for MC, the low and high
1218  gain pedestals are set to ped+(channel+1)/48. with
1219  ped = 30 and 50 ADC counts respecively
1220  """
1221 
1222  self.log().info( "*** Writing sample noise MC defaults (lo=%f, hi=%f) using tag %s",
1223  loGainDef,hiGainDef,tag )
1224 
1225  folders = [self.__tilePrefixOfl+"NOISE/SAMPLE",
1226  self.__tilePrefixOnl+"NOISE/SAMPLE"]
1227 
1228  for folder in folders:
1229  try:
1230  multiVers=('OFL' in folder)
1231  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',multiVers)
1232  #=== initialize all channels
1233  util = cppyy.gbl.TileCalibUtils()
1234  for ros in range(util.max_ros()):
1235  for drawer in range(util.getMaxDrawer(ros)):
1236  flt = blobWriter.zeroBlob(ros,drawer)
1237  flt = blobWriter.getDrawer(0, 0)
1238 
1239  #=== initialize all channels in the drawer
1240 
1241  defaultLo = cppyy.gbl.std.vector('float')()
1242  defaultLo.push_back(0.) # pedestal value
1243  defaultLo.push_back(0.) # pedestal rms (high frequency noise)
1244  defaultLo.push_back(0.) # (low frequency noise)
1245  defaultLo.push_back(0.) # sigma1 of high frequency noise
1246  defaultLo.push_back(0.) # sigma2 of high frequency noise
1247  defaultLo.push_back(0.) # HFN2/HFN1 normalization
1248 
1249  defaultHi = cppyy.gbl.std.vector('float')()
1250  defaultHi.push_back(0.) # pedestal value
1251  defaultHi.push_back(0.) # pedestal rms (high frequency noise)
1252  defaultHi.push_back(0.) # (low frequency noise)
1253  defaultHi.push_back(0.) # sigma1 of high frequency noise
1254  defaultHi.push_back(0.) # sigma2 of high frequency noise)
1255  defaultHi.push_back(0.) # HFN2/HFN1 normalization
1256 
1257  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1258  defVec.push_back(defaultLo)
1259  defVec.push_back(defaultHi)
1260 
1261  flt.init(defVec,48,0)
1262 
1263  #=== set common noise defaults per channel
1264  for chan in range(48):
1265 
1266  loPedDef = 30.+(chan+1)/48.
1267  hiPedDef = 50.+(chan+1)/48.
1268 
1269  #=== low gain defaults
1270  flt.setData(chan, 0, 0, loPedDef)
1271  flt.setData(chan, 0, 1, loGainDef)
1272  flt.setData(chan, 0, 2, 0.)
1273  flt.setData(chan, 0, 3, loGainDef)
1274  flt.setData(chan, 0, 4, 0.)
1275  flt.setData(chan, 0, 5, 0.)
1276  #=== hi gain defaults
1277  flt.setData(chan, 1, 0, hiPedDef)
1278  flt.setData(chan, 1, 1, hiGainDef)
1279  flt.setData(chan, 1, 2, 0.)
1280  flt.setData(chan, 1, 3, hiGainDef)
1281  flt.setData(chan, 1, 4, 0.)
1282  flt.setData(chan, 1, 5, 0.)
1283 
1284  blobWriter.setComment(self.__author,"default noise")
1285  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1286  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1287  except Exception as e:
1288  self.log().critical( e )
1289 
1290 
1291  #____________________________________________________________________
1292  def writeNoiseAutoCr(self, tag=""):
1293 
1294  self.log().info( "*** Writing default sample auto correlation using tag %s", tag)
1295  folder = self.__tilePrefixOfl+"NOISE/AUTOCR"
1296 
1297  #=== common noise defaults
1298  default = cppyy.gbl.std.vector('float')()
1299  for i in range(6):
1300  default.push_back(0.)
1301  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1302  defVec.push_back(default)
1303 
1304  try:
1305  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
1306  #=== initialize all channels
1307  util = cppyy.gbl.TileCalibUtils()
1308  for ros in range(util.max_ros()):
1309  for drawer in range(util.getMaxDrawer(ros)):
1310  flt = blobWriter.zeroBlob(ros,drawer)
1311  flt = blobWriter.getDrawer(0, 0)
1312  flt.init(defVec,1,0)
1313  blobWriter.setComment(self.__author,"default auto correlation (unit matrix)")
1314  folderTag = TileCalibUtils.getFullTag(folder, tag)
1315  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1316  except Exception as e:
1317  self.log().critical( e )
1318 
1319 
1320  #____________________________________________________________________
1321  def writeBadChannels(self, tag=""):
1322 
1323  self.log().info( "*** Writing BadChannel defaults using tag %s", tag )
1324 
1325  default = cppyy.gbl.std.vector('unsigned int')()
1326  default.push_back(0)
1327  defVec = cppyy.gbl.std.vector('std::vector<unsigned int>')()
1328  defVec.push_back(default)
1329 
1330  #=== fill offline folder
1331  folders = [self.__tilePrefixOfl+"STATUS/ADC",
1332  self.__tilePrefixOnl+"STATUS/ADC"]
1333 
1334  for folder in folders:
1335  try:
1336  multiVers=('OFL' in folder)
1337  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Bch',multiVers)
1338  #=== initialize all channels
1339  util = cppyy.gbl.TileCalibUtils()
1340  for ros in range(util.max_ros()):
1341  for drawer in range(util.getMaxDrawer(ros)):
1342  bch = blobWriter.zeroBlob(ros,drawer)
1343  bch = blobWriter.getDrawer(0, 0)
1344  bch.init(defVec,1,cppyy.gbl.TileBchDecoder.BitPat_ofl01 if multiVers else TileBchDecoder.BitPat_onl01)
1345 
1346  blobWriter.setComment(self.__author,"no bad channels")
1347  folderTag = TileCalibUtils.getFullTag(folder, tag) if multiVers else ""
1348  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1349  except Exception as e:
1350  self.log().critical( e )
1351 
1352 
1353  #____________________________________________________________________
1354  def writePulseShape(self, tag=""):
1355 
1356  self.log().info( "*** Writing default pulse shapes with tag %s", tag)
1357 
1358 
1359  sources = {'PHY' : ( 'pulselo_physics.dat', 'pulsehi_physics.dat', 'TileDefault.plsPhy' ),
1360  'LAS' : ( 'pulselo_laserMax1.dat', 'pulsehi_laserMax1.dat', 'TileDefault.plsLas' ),
1361  'CIS/PULSE100' : ( 'pulselo_cis_100.dat', 'pulsehi_cis_100.dat', 'TileDefault.plsCisPulse100'),
1362  'CIS/PULSE5P2' : ( 'pulselo.0230055.12.cap.5.2.dat', 'pulsehi.0230055.12.cap.5.2.dat', 'TileDefault.plsCisPulse5p2'),
1363  'CIS/LEAK100' : ( 'leaklo_100.dat', 'leakhi_100.dat', 'TileDefault.plsCisLeak100'),
1364  'CIS/LEAK5P2' : ( 'leaklo.0230055.12.cap.5.2.dat', 'leakhi.0230055.12.cap.5.2.dat', 'TileDefault.plsCisLeak5p2')
1365  }
1366 
1367 
1368  for source, info in list(sources.items()):
1369 
1370  path = pathDef
1371 
1372  #=== read in low gain pulse shape
1373  xlo = []
1374  ylo = []
1375  lines = open(path+info[0],"r").readlines()
1376  for line in lines:
1377  fields = line.strip().split()
1378  #=== ignore empty and comment lines
1379  if not len(fields) :
1380  continue
1381  if fields[0].startswith("#"):
1382  continue
1383  if fields[0].startswith("*"):
1384  continue
1385  if len(fields) != 2 :
1386  continue
1387 
1388  xlo.append(float(fields[0]))
1389  ylo.append(float(fields[1]))
1390 
1391  #=== read in high gain pulse shape
1392  xhi = []
1393  yhi = []
1394  lines = open(path+info[1],"r").readlines()
1395  for line in lines:
1396  fields = line.strip().split()
1397  #=== ignore empty and comment lines
1398  if not len(fields) :
1399  continue
1400  if fields[0].startswith("#"):
1401  continue
1402  if fields[0].startswith("*"):
1403  continue
1404  if len(fields) != 2 :
1405  continue
1406 
1407  xhi.append(float(fields[0]))
1408  yhi.append(float(fields[1]))
1409 
1410  #=== create default ascii file
1411  fileStr = "OBJVERSION 200"
1412  fileStr+= "\n0x000\t0\t0\t"
1413  for x in xlo:
1414  fileStr += "%f " % x
1415  for y in ylo:
1416  fileStr += "%f " % y
1417  fileStr+= "\n0x000\t0\t1\t"
1418  for x in xhi:
1419  fileStr += "%f " % x
1420  for y in yhi:
1421  fileStr += "%f " % y
1422  fileStr+="\n"
1423  defFile = open(info[2],"w")
1424  defFile.write(fileStr)
1425  defFile.close()
1426 
1427  #=== build default pulseshape vectors for db
1428  defaultLo = cppyy.gbl.std.vector('float')()
1429  for x in xlo:
1430  defaultLo.push_back(x)
1431  for y in ylo:
1432  defaultLo.push_back(y)
1433  defaultHi = cppyy.gbl.std.vector('float')()
1434  for x in xhi:
1435  defaultHi.push_back(x)
1436  for y in yhi:
1437  defaultHi.push_back(y)
1438  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1439  defVec.push_back(defaultLo)
1440  defVec.push_back(defaultHi)
1441  try:
1442  folder = self.__tilePrefixOfl+"PULSESHAPE/"+source
1443  blobWriter = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt')
1444  #=== initialize all channels
1445  util = cppyy.gbl.TileCalibUtils()
1446  for ros in range(util.max_ros()):
1447  for drawer in range(util.getMaxDrawer(ros)):
1448  blobWriter.zeroBlob(ros,drawer)
1449 
1450  #=== default for detector
1451  det = blobWriter.getDrawer(0, 0)
1452  det.init(defVec,1,200)
1453 
1454  blobWriter.setComment(self.__author,"default pulse shapes")
1455  folderTag = TileCalibUtils.getFullTag(folder, tag)
1456  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1457 
1458  except Exception as e:
1459  self.log().critical( e )
1460 
1461 
1462  #____________________________________________________________________
1463  def writeMuonReceiverPulseShape(self, tag = ""):
1464 
1465  self.log().info( "*** Writing default pulse shapes for TileMuonReceiver board with tag %s", tag)
1466 
1467  folder_name = 'MURCV'
1468  source_file = 'pulse_adder_muonRcv_physics.dat'
1469  output_file = 'TileDefault.plsMuRcv'
1470 
1471  path = pathDef
1472 
1473  #=== read pulse shape
1474  phases = []
1475  amplitudes = []
1476  lines = open(path + source_file,"r").readlines()
1477  for line in lines:
1478  fields = line.strip().split()
1479  #=== ignore empty and comment lines
1480  if not len(fields) :
1481  continue
1482  if fields[0].startswith("#"):
1483  continue
1484  if fields[0].startswith("*"):
1485  continue
1486  if len(fields) != 2 :
1487  continue
1488 
1489  phases.append(float(fields[0]))
1490  amplitudes.append(float(fields[1]))
1491 
1492  #=== create default ascii file
1493  fileStr = "OBJVERSION 200"
1494  fileStr += "\n0x000\t0\t0\t"
1495  for phase in phases:
1496  fileStr += "%f " % phase
1497  for amplitude in amplitudes:
1498  fileStr += "%f " % amplitude
1499  fileStr += "\n"
1500  defFile = open(output_file,"w")
1501  defFile.write(fileStr)
1502  defFile.close()
1503 
1504  #=== build default pulseshape vectors for db
1505  defaultPls = cppyy.gbl.std.vector('float')()
1506  for phase in phases:
1507  defaultPls.push_back(phase)
1508  for amplitude in amplitudes:
1509  defaultPls.push_back(amplitude)
1510  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1511  defVec.push_back(defaultPls)
1512  try:
1513  folder = self.__tilePrefixOfl + "PULSESHAPE/" + folder_name
1514  blobWriter = TileCalibTools.TileBlobWriter(self.__db, folder, 'Flt')
1515  #=== initialize all channels
1516  util = cppyy.gbl.TileCalibUtils()
1517  for ros in range(util.max_ros()):
1518  for drawer in range(util.getMaxDrawer(ros)):
1519  blobWriter.zeroBlob(ros,drawer)
1520 
1521  #=== default for detector
1522  det = blobWriter.getDrawer(0, 0)
1523  det.init(defVec,1,200)
1524 
1525  blobWriter.setComment(self.__author, "default pulse shape for tile muon receiver board")
1526  folderTag = TileCalibUtils.getFullTag(folder, tag)
1527  blobWriter.register((MINRUN,MINLBK),(MAXRUN,MAXLBK),folderTag)
1528 
1529  except Exception as e:
1530  self.log().critical( e )
1531 
1532 
1533  #____________________________________________________________________
1534  def writeMuid(self):
1535 
1536  self.log().info( "*** Writing default Muid thresholds" )
1537 
1538  """
1539  The TileMuId algorythm runs in DSPs and requires up to 40 energy cuts
1540  per module (in barrel, in extended barrel it is less). These 40 numbers
1541  are 20 pairs of lower ad upper energy cuts for 20 cells in the module.
1542  The values are stored as a vector of 40 numbers at channel 0 of every module.
1543  """
1544 
1545  #=== construct folder path
1546  folder = self.__tilePrefixOnl+"MUID"
1547 
1548  #=== common TileMuId defaults
1549  default = cppyy.gbl.std.vector('float')()
1550  for i in range(20):
1551  default.push_back(150.)
1552  default.push_back(5000.)
1553  defVec = cppyy.gbl.std.vector('std::vector<float>')()
1554  defVec.push_back(default)
1555  defVec.push_back(default)
1556 
1557  #=== get a writer
1558  writer = TileCalibTools.TileBlobWriter(self.__db,folder,'Flt',False)
1559  writer.setComment(self.__author,"TileMuId default values")
1560 
1561  #=== initialize all channels and write global default
1562  util = cppyy.gbl.TileCalibUtils()
1563  for ros in range(util.max_ros()):
1564  for drawer in range(util.getMaxDrawer(ros)):
1565  writer.zeroBlob(ros,drawer)
1566  calibDrawer = writer.getDrawer(0,0)
1567  calibDrawer.init(defVec,1,1)
1568 
1569  #=== register in DB
1570  writer.register((MINRUN,MINLBK),(MAXRUN,MAXLBK), "")
grepfile.info
info
Definition: grepfile.py:38
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeEmscaleMC
def writeEmscaleMC(self, tag="", emscale=(1.05/1000.), since=(MINRUN, MINLBK), until=(MAXRUN, MAXLBK))
Definition: TileCalibDefaultWriter.py:817
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeNoiseSample
def writeNoiseSample(self, tag="", loGainDef=0.8, hiGainDef=1.6)
Definition: TileCalibDefaultWriter.py:1093
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeCes
def writeCes(self, tag="", Simulation=True, MBTSflag="7TeV", dCellWeight=1.2, eCellWeight=1.5, since=(MINRUN, MINLBK), until=(MAXRUN, MAXLBK), mode='DEFAULT')
Definition: TileCalibDefaultWriter.py:240
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__tilePrefixOfl
__tilePrefixOfl
Definition: TileCalibDefaultWriter.py:65
python.TileCalibTools.TileASCIIParser
Definition: TileCalibTools.py:1096
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeNoiseAutoCr
def writeNoiseAutoCr(self, tag="")
Definition: TileCalibDefaultWriter.py:1292
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeTdlas
def writeTdlas(self, tag="")
Definition: TileCalibDefaultWriter.py:976
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeTcfib
def writeTcfib(self, tag="")
Definition: TileCalibDefaultWriter.py:898
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writePulseShape
def writePulseShape(self, tag="")
Definition: TileCalibDefaultWriter.py:1354
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeNoiseOnl
def writeNoiseOnl(self, tag="", loGainDef=0.8, hiGainDef=1.6)
Definition: TileCalibDefaultWriter.py:1174
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__tilePrefixOnl
__tilePrefixOnl
Definition: TileCalibDefaultWriter.py:66
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeBadChannels
def writeBadChannels(self, tag="")
Definition: TileCalibDefaultWriter.py:1321
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__tilePrefixOfl1
__tilePrefixOfl1
Definition: TileCalibDefaultWriter.py:63
python.TileCalibTools.TileBlobWriter
Definition: TileCalibTools.py:481
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeOldCes
def writeOldCes(self, tag="", dCellWeight=1.2, eCellWeight=1.5, since=(MINRUN, MINLBK), until=(MAXRUN, MAXLBK))
Definition: TileCalibDefaultWriter.py:581
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeNoiseFit
def writeNoiseFit(self, tag="", loGainDef=0.8, hiGainDef=1.6)
Definition: TileCalibDefaultWriter.py:1054
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__init__
def __init__(self, db)
Definition: TileCalibDefaultWriter.py:50
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeLasFiber
def writeLasFiber(self, tag="")
Definition: TileCalibDefaultWriter.py:205
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeMuonReceiverPulseShape
def writeMuonReceiverPulseShape(self, tag="")
Definition: TileCalibDefaultWriter.py:1463
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeEmscale
def writeEmscale(self, tag="", since=(MINRUN, MINLBK), until=(MAXRUN, MAXLBK))
Definition: TileCalibDefaultWriter.py:721
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeNoiseSampleMC
def writeNoiseSampleMC(self, tag="", loGainDef=0.8, hiGainDef=1.6)
Definition: TileCalibDefaultWriter.py:1215
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeCis
def writeCis(self, tag="", loGainDef=(1023./800.), hiGainDef=(64.*1023./800.))
Definition: TileCalibDefaultWriter.py:73
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__db
__db
Definition: TileCalibDefaultWriter.py:62
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeLas
def writeLas(self, tag="")
Definition: TileCalibDefaultWriter.py:143
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeTof
def writeTof(self, tag="")
Definition: TileCalibDefaultWriter.py:1002
Trk::open
@ open
Definition: BinningType.h:40
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeTclas
def writeTclas(self, tag="")
Definition: TileCalibDefaultWriter.py:950
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeMuid
def writeMuid(self)
Definition: TileCalibDefaultWriter.py:1534
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeRODmap
def writeRODmap(self, tag="")
Definition: TileCalibDefaultWriter.py:1139
python.TileCalibDefaultWriter.TileCalibDefaultWriter.writeIntegrator
def writeIntegrator(self, tag="")
Definition: TileCalibDefaultWriter.py:847
python.TileCalibDefaultWriter.TileCalibDefaultWriter
Definition: TileCalibDefaultWriter.py:42
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
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
python.TileCalibDefaultWriter.TileCalibDefaultWriter.__author
__author
Definition: TileCalibDefaultWriter.py:57