print "runUntil ", runUntil, lbkUntil print "output:",filename print "input: ",inputFile import ROOT import cppyy from PyCool import cool from CaloCondBlobAlgs import CaloCondTools, CaloCondLogger #================================================== #=== #=== Configuration section #=== #================================================== #=== IOV range iovSince = CaloCondTools.iovFromRunLumi(runSince,lbkSince) iovUntil = cool.ValidityKeyMax print " iovUntil max ",iovUntil if int(runUntil) > 0: print " use run number to define iobUntil ", runUntil iovUntil = CaloCondTools.iovFromRunLumi(runUntil,lbkUntil) print " iovSince ", iovSince print " iovUntil ", iovUntil #=== values for the comment channel author = "gunal" comment = "Updated noise values" #================================================== #===
print ("runUntil ", runUntil, lbkUntil) import cppyy from PyCool import cool from CaloCondBlobAlgs import CaloCondTools, CaloCondLogger #================================================== #=== #=== Configuration section #=== #================================================== inputFile_con = sys.argv[5] inputFile_run = sys.argv[6] #=== IOV range iovSince_con = CaloCondTools.iovFromRunLumi(runSince,lbkSince) iovUntil_con = CaloCondTools.iovFromRunLumi(runUntil,lbkUntil) iovMin = cool.ValidityKeyMin iovMax = cool.ValidityKeyMax print (" iovSince_con ", iovSince_con) print (" iovUntil_con ", iovUntil_con) print (" iovMin ", iovMin) print (" iovMax ", iovMax) lbkdown = 0 lbkup = 4294967295 #=== folder tag suffix
if folderPath.startswith( '/TILE') or tag == 'UPD1' or tag == 'UPD4' or 'COND' in tag: folderTag = TileCalibTools.getFolderTag(db, folderPath, tag) elif folderPath.startswith('/CALO/Ofl'): folderTag = 'CaloOflNoiseCellnoise-' + tag elif folderPath.startswith('/CALO'): folderTag = 'CaloNoiseCellnoise-' + tag elif folderPath.startswith('/LAR'): folderTag = 'LARNoiseOflCellNoise-' + tag log.info("Initializing folder %s with tag %s", folderPath, folderTag) folder = db.getFolder(folderPath) #=== get the blob for a given tag and iov iov = CaloCondTools.iovFromRunLumi(run, lumi) obj = folder.findObject(iov, chan, folderTag) blob = obj.payload()[0] #=== create CaloCondBlobFlt blobFlt = cppyy.gbl.CaloCondBlobFlt.getInstance(blob) #=== retrieve data from the blob #cell = 0 # 0..5183 - Tile hash #gain = 0 # 0..3 - four Tile cell gains: -11, -12, -15, -16 #index = 0 # 0..4 - electronic or pile-up noise or 2-G noise parameters ncell = blobFlt.getNChans() ngain = blobFlt.getNGains() nval = blobFlt.getObjSizeUint32()
folderTag2 = TileCalibTools.getFolderTag(db2, folderPath2, tag2) elif folderPath2.startswith('/CALO/Ofl'): folderTag2 = 'CaloOflNoiseCellnoise-' + tag2 elif folderPath2.startswith('/CALO'): folderTag2 = 'CaloNoiseCellnoise-' + tag2 elif folderPath.startswith('/LAR'): folderTag2 = 'LARNoiseOflCellNoise-' + tag2 log.info("Initializing folder %s with tag %s" % (folderPath, folderTag)) log.info("Initializing folder2 %s with tag2 %s" % (folderPath2, folderTag2)) folder = db.getFolder(folderPath) folder2 = db2.getFolder(folderPath2) #=== get the blob for a given tag and iov iov = CaloCondTools.iovFromRunLumi(run, lumi) iov2 = CaloCondTools.iovFromRunLumi(run2, lumi2) obj = folder.findObject(iov, chan, folderTag) obj2 = folder2.findObject(iov2, chan, folderTag2) blob = obj.payload()[0] blob2 = obj2.payload()[0] #=== create CaloCondBlobFlt blobFlt = cppyy.gbl.CaloCondBlobFlt.getInstance(blob) blobFlt2 = cppyy.gbl.CaloCondBlobFlt.getInstance(blob2) #=== retrieve data from the blob #cell = 0 # 0..5183 - Tile hash #gain = 0 # 0..3 - four Tile cell gains: -11, -12, -15, -16
import cppyy from PyCool import cool from CaloCondBlobAlgs import CaloCondTools, CaloCondLogger import six #================================================== #=== #=== Configuration section #=== #================================================== #=== Input files with OFCs inputFile = "/afs/cern.ch/user/g/gunal/scratch0/AtlasOffline-12.0.6/calonoise.txt" #=== IOV range runSince = 0 lbkSince = 0 iovSince = CaloCondTools.iovFromRunLumi(runSince,lbkSince) iovUntil = cool.ValidityKeyMax #=== folder tag suffix tag = "000-00" #=== values for the comment channel author = "ngollub" comment = "Default cell noise values from Guillaume" #================================================== #=== #=== Code starts below here #=== #================================================== #=== set shortcut g = cppyy.gbl