ATLAS Offline Software
Functions | Variables
TileCalibBlobPython_writeTimingFromASCII Namespace Reference

Functions

def fillTimingTc (fileTclas, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
 
def fillTimingTd (fileTdlas, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
 

Variables

 log
 
 timingDict
 
 db
 
 tag
 
 since
 
 fileTclas
 

Function Documentation

◆ fillTimingTc()

def TileCalibBlobPython_writeTimingFromASCII.fillTimingTc (   fileTclas,
  tag,
  since,
  until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) 
)

Definition at line 23 of file TileCalibBlobPython_writeTimingFromASCII.py.

23 def fillTimingTc(fileTclas, tag, since,
24  until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
25 
26  #=== construct folder path
27  folderTclas = TileCalibTools.getTilePrefix(True,True)+"TIME/CHANNELOFFSET/LAS"
28 
29  #=== create default: one number
30  #--- per ADC for Tclas
31  default = cppyy.gbl.std.vector('float')()
32  default.push_back(0.)
33 
34  #=====================================================
35  #=== fill Tclas
36  #=====================================================
37  tclasWriter = TileCalibTools.TileBlobWriter(db,folderTclas,'Flt')
38  tclasWriter.setComment(os.getlogin(),fileTclas)
39  parserTclas = TileCalibTools.TileASCIIParser(fileTclas,"Tclas")
40  defTclas = cppyy.gbl.std.vector('std::vector<float>')()
41  defTclas.push_back(default) # low gain
42  defTclas.push_back(default) # high gain
43  #=== initialize defaults
44  ros = 0
45  for mod in range(20):
46  flt = tclasWriter.zeroBlob(ros,mod)
47  flt = tclasWriter.getDrawer(0, 0)
48  flt.init(defTclas,1,0)
49  #=== loop over whole detector
50  for ros in range(1,5):
51  for mod in range(64):
52  #=== need to invalidate previous blob in DB when reading from ASCII file
53  tclasWriter.zeroBlob(ros,mod)
54  for chn in range(48):
55  tclas = parserTclas.getData(ros,mod,chn)
56  if not len(tclas):
57  log.warning("%i/%2i/%2i/x: No value found in file", ros,mod,chn)
58  continue
59  #=== init drawer for first entry
60  calibDrawer = tclasWriter.getDrawer(ros,mod)
61  if not calibDrawer.getNObjs():
62  log.info("Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
63  calibDrawer.init(defTclas,48,0)
64  #=== loop over gainsa
65  for adc in range(2):
66  val = float(tclas[adc])
67  log.debug("%i/%2i/%2i/%i: tclas = %f", ros,mod,chn,adc, val)
68  calibDrawer.setData(chn,adc,0,val)
69 
70  folderTag = TileCalibUtils.getFullTag(folderTclas, tag)
71  tclasWriter.setComment(os.getlogin(),"Timing update for all partitions")
72  tclasWriter.register(since, until, folderTag)
73 
74 
75 #
76 #________________________________________________________________________

◆ fillTimingTd()

def TileCalibBlobPython_writeTimingFromASCII.fillTimingTd (   fileTdlas,
  tag,
  since,
  until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) 
)

Definition at line 77 of file TileCalibBlobPython_writeTimingFromASCII.py.

77 def fillTimingTd(fileTdlas, tag, since,
78  until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
79 
80  #=== construct folder path
81  folderTdlas = TileCalibTools.getTilePrefix(True,True)+"TIME/DRAWEROFFSET/LAS"
82 
83  #=== create default: one number
84  #--- per drawer for Tdlas
85  default = cppyy.gbl.std.vector('float')()
86  default.push_back(0.)
87 
88  #=====================================================
89  #=== fill Tdlas
90  #=====================================================
91  tdlasWriter = TileCalibTools.TileBlobWriter(db,folderTdlas,'Flt')
92  tdlasWriter.setComment(os.getlogin(),fileTdlas)
93  parserTdlas = TileCalibTools.TileASCIIParser(fileTdlas,"Tdlas")
94  defTdlas = cppyy.gbl.std.vector('std::vector<float>')()
95  defTdlas.push_back(default)
96  #=== initialize defaults
97  ros = 0
98  for mod in range(20):
99  flt = tdlasWriter.zeroBlob(ros,mod)
100  flt = tdlasWriter.getDrawer(0, 0)
101  flt.init(defTdlas,1,0)
102  #=== loop over whole detector
103  for ros in range(1,5):
104  for mod in range(64):
105  #=== need to invalidate previous blob in DB when reading from ASCII file
106  tdlasWriter.zeroBlob(ros,mod)
107  tdlas = parserTdlas.getData(ros,mod,0)
108  if not len(tdlas):
109  log.warning("(ros,mod)=(%i,%2i): No value found in file", ros,mod)
110  continue
111  defTdlas[0][0] = float(tdlas[0])
112  log.debug("(ros,mod)=(%i,%2i): tdlas = %f", ros,mod,defTdlas[0][0])
113  calibDrawer = tdlasWriter.getDrawer(ros,mod)
114  calibDrawer.init(defTdlas,1,0)
115 
116  folderTag = TileCalibUtils.getFullTag(folderTdlas, tag)
117  tdlasWriter.setComment(os.getlogin(),"Timing update for all partitions")
118  tdlasWriter.register(since, until, folderTag)
119 
120 
121 #===================================================================
122 #====================== FILL DB BELOW ==============================
123 #===================================================================
124 

Variable Documentation

◆ db

TileCalibBlobPython_writeTimingFromASCII.db

Definition at line 133 of file TileCalibBlobPython_writeTimingFromASCII.py.

◆ fileTclas

TileCalibBlobPython_writeTimingFromASCII.fileTclas

Definition at line 138 of file TileCalibBlobPython_writeTimingFromASCII.py.

◆ log

TileCalibBlobPython_writeTimingFromASCII.log

Definition at line 17 of file TileCalibBlobPython_writeTimingFromASCII.py.

◆ since

TileCalibBlobPython_writeTimingFromASCII.since

Definition at line 137 of file TileCalibBlobPython_writeTimingFromASCII.py.

◆ tag

TileCalibBlobPython_writeTimingFromASCII.tag

Definition at line 135 of file TileCalibBlobPython_writeTimingFromASCII.py.

◆ timingDict

TileCalibBlobPython_writeTimingFromASCII.timingDict

Definition at line 125 of file TileCalibBlobPython_writeTimingFromASCII.py.

plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
TileCalibBlobPython_writeTimingFromASCII.fillTimingTc
def fillTimingTc(fileTclas, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
Definition: TileCalibBlobPython_writeTimingFromASCII.py:23
TileCalibBlobPython_writeTimingFromASCII.fillTimingTd
def fillTimingTd(fileTdlas, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
Definition: TileCalibBlobPython_writeTimingFromASCII.py:77
readCCLHist.float
float
Definition: readCCLHist.py:83
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