ATLAS Offline Software
Functions | Variables
TileCalibBlobPython_writeTileMuIdFromASCII Namespace Reference

Functions

def fillTileMuId (file, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
 

Variables

 log
 
 db
 
 runfrom
 

Function Documentation

◆ fillTileMuId()

def TileCalibBlobPython_writeTileMuIdFromASCII.fillTileMuId (   file,
  since,
  until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK) 
)

Definition at line 22 of file TileCalibBlobPython_writeTileMuIdFromASCII.py.

22 def fillTileMuId(file, since,
23  until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
24 
25  #=== construct folder path
26  folder = TileCalibTools.getTilePrefix(False)+"MUID"
27 
28  #=== common TileMuId defaults
29  default = cppyy.gbl.std.vector('float')()
30  for i in range(20):
31  default.push_back(150.)
32  default.push_back(5000.)
33  defVec = cppyy.gbl.std.vector('std::vector<float>')()
34  defVec.push_back(default)
35  defVec.push_back(default)
36 
37  #=====================================================
38  #=== fill
39  #=====================================================
40  writer = TileCalibTools.TileBlobWriter(db,folder,'Flt',False)
41  writer.setComment(os.getlogin(),"Arantxa's values, april 2009.")
42  parser = TileCalibTools.TileASCIIParser(file,"TileMuId")
43 
44  #=== initialize all channels and write global default
45  util = cppyy.gbl.TileCalibUtils()
46  for ros in range(util.max_ros()):
47  for drawer in range(util.getMaxDrawer(ros)):
48  writer.zeroBlob(ros,drawer)
49  calibDrawer = writer.getDrawer(0,0)
50  calibDrawer.init(defVec,1,1)
51 
52  #=== loop over whole detector
53  for ros in range(1,5):
54  for mod in range(64):
55  #=== need to invalidate previous blob in DB when reading from ASCII file
56  writer.zeroBlob(ros,mod)
57  #=== we write 40 numbers (thresholds for 20 cells) only to channel 0 in each drawer
58  chn = 0
59  values = parser.getData(ros,mod,chn)
60  if not len(values):
61  log.warning("%i/%2i/%2i/x: No value found in file", ros,mod,chn)
62  continue
63  #=== init drawer with defaults for first entry
64  calibDrawer = writer.getDrawer(ros,mod)
65  if not calibDrawer.getNObjs():
66  log.info("Initializing drawer %i/%2i\t%i", ros,mod,calibDrawer.getNObjs())
67  calibDrawer.init(defVec,48,1)
68  #=== fill in realistic values (just for the low gain index, store 40 values)
69  adc = 0
70  line = "%i/%2i/%2i/%i: " % (ros,mod,chn,adc)
71  for i in range(40):
72  value = float(values[i])
73  calibDrawer.setData(chn,adc,i,value)
74  line += "%f " % (value,)
75 
76  log.debug(line)
77 
78  #=== register in DB
79  writer.register(since, until, "")
80 
81 #===================================================================
82 #====================== FILL DB BELOW ==============================
83 #===================================================================
84 
85 #=== open the database

Variable Documentation

◆ db

TileCalibBlobPython_writeTileMuIdFromASCII.db

◆ log

TileCalibBlobPython_writeTileMuIdFromASCII.log

◆ runfrom

TileCalibBlobPython_writeTileMuIdFromASCII.runfrom
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
readCCLHist.float
float
Definition: readCCLHist.py:83
TileCalibBlobPython_writeTileMuIdFromASCII.fillTileMuId
def fillTileMuId(file, since, until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK))
Definition: TileCalibBlobPython_writeTileMuIdFromASCII.py:22