ATLAS Offline Software
Functions | Variables
TileCalibBlobPython_writeAutoCrFromASCII Namespace Reference

Functions

def fillAutoCr (filePed, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
 

Variables

 log
 
 db
 
 tag
 
 runfrom
 

Function Documentation

◆ fillAutoCr()

def TileCalibBlobPython_writeAutoCrFromASCII.fillAutoCr (   filePed,
  tag,
  since,
  until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) 
)

Definition at line 24 of file TileCalibBlobPython_writeAutoCrFromASCII.py.

24 def fillAutoCr(filePed, tag, since,
25  until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
26 
27  #=== construct folder path
28  folder = TileCalibTools.getTilePrefix(True,True)+"NOISE/AUTOCR"
29 
30  #=== get full folder tag
31  folderTag = TileCalibUtils.getFullTag(folder, tag)
32 
33  #=== common noise autocr defaults (no correlation)
34  default = cppyy.gbl.std.vector('float')()
35  for i in range(6):
36  default.push_back(0.)
37  defVec = cppyy.gbl.std.vector('std::vector<float>')()
38  defVec.push_back(default)
39  defVec.push_back(default)
40 
41  #=====================================================
42  #=== fill
43  #=====================================================
44  writer = TileCalibTools.TileBlobWriter(db,folder,'Flt')
45  writer.setComment(os.getlogin(),"Giulio's file for LBC test n.0, 2009-02-27")
46  parser = TileCalibTools.TileASCIIParser(filePed,"AutoCr")
47 
48  #=== initialize all channels and write global default
49  util = cppyy.gbl.TileCalibUtils()
50  for ros in range(util.max_ros()):
51  for drawer in range(util.getMaxDrawer(ros)):
52  writer.zeroBlob(ros,drawer)
53  calibDrawer = writer.getDrawer(0,0)
54  calibDrawer.init(defVec,1,1)
55 
56  #=== loop over whole detector
57  for ros in range(1,5):
58  for mod in range(64):
59  #=== need to invalidate previous blob in DB when reading from ASCII file
60  writer.zeroBlob(ros,mod)
61  for chn in range(48):
62  values = parser.getData(ros,mod,chn)
63  if not len(values):
64  log.warning("%i/%2i/%2i/x: No value found in file", ros,mod,chn)
65  continue
66  #=== init drawer with defaults for first entry
67  calibDrawer = writer.getDrawer(ros,mod)
68  if not calibDrawer.getNObjs():
69  log.info("Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
70  calibDrawer.init(defVec,48,1)
71  #=== fill in realistic values
72  for adc in range(2):
73  line = "%i/%2i/%2i/%i: " % (ros,mod,chn,adc)
74  for i in range(6):
75  value = float(values[adc*6+i])
76  calibDrawer.setData(chn,adc,i,value)
77  line += "%f " % (value,)
78 
79  log.debug(line)
80  #=== register in DB
81  writer.register(since, until, folderTag)
82 
83 #===================================================================
84 #====================== FILL DB BELOW ==============================
85 #===================================================================
86 
87 #=== open the database

Variable Documentation

◆ db

TileCalibBlobPython_writeAutoCrFromASCII.db

Definition at line 88 of file TileCalibBlobPython_writeAutoCrFromASCII.py.

◆ log

TileCalibBlobPython_writeAutoCrFromASCII.log

Definition at line 18 of file TileCalibBlobPython_writeAutoCrFromASCII.py.

◆ runfrom

TileCalibBlobPython_writeAutoCrFromASCII.runfrom

Definition at line 92 of file TileCalibBlobPython_writeAutoCrFromASCII.py.

◆ tag

TileCalibBlobPython_writeAutoCrFromASCII.tag

Definition at line 89 of file TileCalibBlobPython_writeAutoCrFromASCII.py.

plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
TileCalibBlobPython_writeAutoCrFromASCII.fillAutoCr
def fillAutoCr(filePed, tag, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
Definition: TileCalibBlobPython_writeAutoCrFromASCII.py:24
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