Ejemplo n.º 1
0
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"

#==================================================
#===
Ejemplo n.º 2
0
    iovList.append(iov)
except:
  print "Warning: can not read IOVs from input DB file"
  if run<0:
    raise Exception("Please, provide run number at command line")
  else:
    print "Using IOV starting run run %d" %run
    since = (run, lumi)
    until = (0xFFFFFFFF, 0xFFFFFFFF)
    iov = (since, until)
    iovList.append(iov)
idb.closeDatabase()

#=== Open DB connections
oschema = 'sqlite://;schema='+outFile+';dbname='+dbName
dbr = CaloCondTools.openDbConn(ischema,'READONLY')
#dbw = CaloCondTools.openDbConn(oschema,'RECREATE')
dbw = CaloCondTools.openDbConn(oschema,'UPDATE')
reader = CaloCondTools.CaloBlobReader(dbr,folderPath,inTag)
writer = CaloCondTools.CaloBlobWriter(dbw,folderPath,'Flt',True)

from TileCalibBlobPython.TileCalibTools import MAXRUN, MAXLBK
from math import sqrt

#== read input file
cellData = {}
ival=0
igain=0
icell=[0,0,0,0,0,0,0]
gain=-1
useNames=None
Ejemplo n.º 3
0
    log.info("IOVs: %s", str(iovList))
    log.info("%d IOVs in total, end of last IOV is %s", ie - ib, str(until))

if len(iovList) == 0:
    if run < 0:
        raise Exception("Please, provide run number at command line")
    else:
        log.info("Creating single IOV starting from run,lumi %d,%d", run, lumi)
        since = (run, lumi)
        until = (end, endlumi)
        iovList = [since]
        iovUntil = [until]

#=== Open DB connections
oschema = 'sqlite://;schema=' + outFile + ';dbname=' + dbName
dbr = CaloCondTools.openDbConn(ischema, 'READONLY')
update = update or (inFile == outFile)
dbw = CaloCondTools.openDbConn(oschema, ('UPDATE' if update else 'RECREATE'))
reader = CaloCondTools.CaloBlobReader(dbr, folderPath, inTag)
writer = CaloCondTools.CaloBlobWriter(dbw, folderPath, 'Flt',
                                      (outTag != "" and outTag != "HEAD"))

#== read input file
cellData = {}
ival = 0
igain = 0
icell = [0, 0, 0, 0, 0, 0, 0]
gain = -1
useNames = None
useModuleNames = None
useGain = None
Ejemplo n.º 4
0
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 
Ejemplo n.º 5
0
lbkUntil = sys.argv[4]

print("runUntil ", runUntil, lbkUntil)

import cppyy
from PyCool import cool
from CaloCondBlobAlgs import CaloCondTools, CaloCondLogger

#==================================================
#===
#=== Configuration section
#===
#==================================================
inputFile = "calopedestal.txt"
#=== 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)

#=== folder tag suffix
tag = "CALOOflPedestalCellPedestal-UPD4-00"
#=== values for the comment channel
author = "gunal"
comment = "Updated pedestal shift values"
Ejemplo n.º 6
0
    else:
        schema = 'COOLOFL_TILE/OFLP200'
        folderPath = '/TILE/OFL02/NOISE/CELL'
        if tag == 'UPD4':
            tag = 'IOVDEP-02'  # change default to tag used in DC14

if run < 222222 or 'COMP200' in schema:
    cabling = 'RUN1'
else:
    if ('OFLP200' in schema and run >= 310000) or run >= 343000:
        cabling = 'RUN2a'
    else:
        cabling = 'RUN2'
hashMgr = TileCellTools.TileCellHashMgr(cabling=cabling)

db = CaloCondTools.openDbConn(schema, "READONLY")

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

#=== Read from COOL server 2:

if schema2 == 'ONL':  # shortcut for COOLONL_CALO/COMP200
    schema2 = 'COOLONL_CALO/COMP200'
Ejemplo n.º 7
0
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