Example #1
0
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_writeTileMuIdFromASCII.py
# Lukas Pribyl <*****@*****.**>, 2009-04-29
# change: Yuri Smirnov <*****@*****.**>, 2014-12-24

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import * 
import os

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("writeTileMuId")
import logging
log.setLevel(logging.DEBUG)

#
#________________________________________________________________________
def fillTileMuId(file, since,
               until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):
    
    #=== construct folder path
    folder = TileCalibTools.getTilePrefix(False)+"MUID"

    #=== common TileMuId defaults
    default = cppyy.gbl.std.vector('float')()
    for i in xrange(20):
        default.push_back(150.)
Example #2
0
        pmt = True
    elif o in ("-w", "--warning"):
        warn = -1
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandeled option"

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileBchTools
from TileCalibBlobPython.TileCalibTools import MAXRUN, MAXLBK
from TileCalibBlobObjs.Classes import TileCalibUtils

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("ReadBch")
import logging
logLevel = logging.DEBUG
log.setLevel(logLevel)
log1 = getLogger("TileCalibTools")
log1.setLevel(logLevel)

#=== check parameters
if len(dbname) < 7 and run != 2147483647:
    dbname = 'COMP200' if run < 232000 else 'CONDBR2'

if 'COOLO' not in schema and ':' not in schema and ';' not in schema:
    schema = 'sqlite://;schema=' + schema + ';dbname=' + (dbname if len(dbname)
                                                          else 'CONDBR2')

if 'sqlite:' not in schema and len(dbname):
Example #3
0
    elif o in ("-r", "--run"):
        run = int(a)
    elif o in ("-l", "--lumi"):
        lumi = int(a)
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandeled option"

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger

log = getLogger("ReadOfc")
import logging

log.setLevel(logging.DEBUG)

#=== set database
db = TileCalibTools.openDbConn(schema, 'READONLY')
folderTag = TileCalibTools.getFolderTag(
    schema if 'COMP200' in schema or 'OFLP200' in schema else db, folderPath,
    tag)

#=== required OF2 folder
if len(tag) > 0:
    log.info("Initializing folder %s with tag %s" % (folderPath, folderTag))
else:
    log.info("Initializing folder %s" % (folderPath))
Example #4
0
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_writePedFromASCII.py
# Nils Gollub <*****@*****.**>, 2008-03-03
# modified: Lukas Pribyl <*****@*****.**>, 2008-06-27
# modified: Yuri Smirnov <*****@*****.**>, 2014-12-24

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("writeNoise")
import logging
log.setLevel(logging.DEBUG)


#
#________________________________________________________________________
def fillPed(filePed,
            tag,
            comment,
            since,
            until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):

    #=== construct folder path
    folder = TileCalibTools.getTilePrefix(True, True) + "NOISE/SAMPLE"
Example #5
0
        adc = int(a)
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandeled option"

if not 'COOLONL_TILE' in schema and not 'sqlite' in schema:
    print "This script works on the 'COOLONL_TILE/COMP200' or 'COOLONL_TILE/CONDBR2' schema"
    sys.exit(2)

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("readNoise")
import logging
log.setLevel(logging.DEBUG)

#=== set database
db = TileCalibTools.openDbConn(schema, 'READONLY')

folder1 = "/TILE/ONL01/NOISE/SAMPLE"
folder2 = "/TILE/ONL01/NOISE/OFNI"
if 'COMP200' in schema: folder1 = "/TILE/OFL01/NOISE/SAMPLE"
log.info("Initializing ros %d, drawer %d for run %d, lumiblock %d" %
         (ros, drawer, run, lumi))
for folderPath in [folder1, folder2]:

    folderTag = TileCalibTools.getFolderTag(db, folderPath, tag)
    log.info("Initializing folder %s with tag %s" % (folderPath, folderTag))
Example #6
0
#!/bin/env python

# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# PlotPulseshapeFromCool.py
# Nils Gollub <*****@*****.**>, 2008-06-05

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *
import ROOT

pointInTime = (999999999,0)

#=== get a logger
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("ps_readDb")
    
#=== open the database
db = TileCalibTools.openDb('ORACLE', 'CONDBR2', 'READONLY', 'COOLOFL_TILE')

#=== specify folder and tag
folder = "/TILE/OFL02/PULSESHAPE/PHY"
folderTag = TileCalibUtils.getFullTag(folder, "RUN2-HLT-UPD1-00")
#folder = "/TILE/OFL01/PULSESHAPE/LAS"
#folderTag = TileCalibUtils.getFullTag(folder, "RUN2-HLT-UPD1-01")


#=== get a blob reader
print folder
print folderTag
blobReader = TileCalibTools.TileBlobReader(db,folder,folderTag)
Example #7
0
        run = int(a)
    elif o in ("-l","--lumi"):
        lumi = int(a)
    elif o in ("-h","--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandled option"



from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import TileCalibUtils

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("ReadTripsProbs")
import logging
logLevel=logging.DEBUG
log.setLevel(logLevel)
log1 = getLogger("TileCalibTools")
log1.setLevel(logLevel)


#=== set database
db = TileCalibTools.openDbConn(schema, 'READONLY')
folderTag = TileCalibTools.getFolderTag(db, folderPath, tag)
log.info("Initializing folder %s with tag %s", folderPath, folderTag)

blobReader = TileCalibTools.TileBlobReader(db, folderPath, folderTag)

import cppyy
Example #8
0
    print ' usage:'
    print ' testcurrent_tag.py --folder=foldername --globaltag=tagname --instance=instancename'
    sys.exit()

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *
import os, sys, getopt
#------------------------- from Misha
#sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/ [cern.ch]')
sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
from AtlCoolBKLib import resolveAlias
current = resolveAlias.getCurrent()
next = resolveAlias.getNext()
#--------------------------------
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("resolve_Tag")
import logging
log.setLevel(logging.DEBUG)

if instance == 'CONDBR2':
    log.info("alias CURRENT = %s alias NEXT = %s" % (current, next))

if folder == '':
    sys.exit()

#=================================================
connStr = 'COOLOFL_TILE/' + instance

#=== open the database
db = TileCalibTools.openDbConn(connStr, 'READONLY')
Example #9
0
    plotopt = "noline"


import ROOT
from ROOT import TCanvas, TH1D, TH2D, TGraph, TTree
from ROOT import gROOT
from ROOT import kTRUE
from array import array
import numpy as np


from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileCellTools
from TileCalibBlobObjs.Classes import *
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("PlotCalibFromCool")
import logging
logLevel=logging.DEBUG
log.setLevel(logLevel)
log1 = getLogger("PlotCalibFromCool")
log1.setLevel(logLevel)

folderPath=folderPath.split(",")
folderTag=[]
for fp in folderPath:
    ft = TileCalibTools.getFolderTag(schema , fp, tag)
    log.info("Initializing folder %s with tag %s" % (fp, ft))
    folderTag += [ft]
multi=(len(folderPath)>1)

#=== Get list of IOVs for given drawer or for comments record
Example #10
0
# if ADC is bad in offline DB, OnlineGeneralMaskAdc is set in online DB for this ADC
# and in addition IgnoredInHlt is set for both ADCs of a channel

import sys

tag = "UPD1" if len(sys.argv) < 2 else sys.argv[1].rpartition("=")[2]
run = None if len(sys.argv) < 3 else int(sys.argv[2].rpartition("=")[2])

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileBchTools
from TileCalibBlobPython.TileCalibTools import MAXRUN
from TileCalibBlobObjs.Classes import TileCalibUtils, TileBchPrbs, \
     TileBchDecoder

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("SyncOnlWithOfl")
import logging
log.setLevel(logging.DEBUG)

if run is None or run < 0:
    badrun = run
    run = TileCalibTools.getLastRunNumber()
    if badrun is None:
        log.info("Run number was not specified, using current run number %d",
                 run)
    else:
        log.warning("Bad run number %d was set, using current run number %d",
                    badrun, run)
    if run is None or run < 0:
        log.error("Still bad run number")
        sys.exit(2)
Example #11
0
        elif o in ("-i", "--instance"):
            instance = a
        #elif o in ("-s","--schema"):
        #    schema = a
        #elif o in ("-r","--run"):
        #    run = int(a)
        #elif o in ("-l","--lumi"):
        #    lumi = int(a)
        elif o in ("-h", "--help"):
            usage()
            sys.exit(2)
        else:
            assert False, "unhandled option"

    from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
    log = getLogger("BchCleanup")
    import logging
    log.setLevel(logging.INFO)

    ischema = 'sqlite://;schema=bch-input-sqlite.db;dbname=' + instance
    oschema = 'sqlite://;schema=bch-output-sqlite.db;dbname=' + instance
    log.info("ischema=%s" % ischema)
    log.info("oschema=%s" % oschema)

    from TileCalibBlobPython import TileCalibTools
    from TileCalibBlobPython import TileBchTools
    from TileCalibBlobPython.TileCalibTools import MINRUN, MINLBK, MAXRUN, MAXLBK
    from TileCalibBlobObjs.Classes import *

    #=== open databases
    idb = TileCalibTools.openDbConn(ischema, 'READONLY')
Example #12
0
        run = int(a)
    elif o in ("-l", "--lumi"):
        lumi = int(a)
    elif o in ("-w", "--warning"):
        warn = -1
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandeled option"

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import TileCalibUtils

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("ReadBadBits")
import logging
logLevel = logging.DEBUG
log.setLevel(logLevel)
log1 = getLogger("TileCalibTools")
log1.setLevel(logLevel)

#=== check parameters
if len(dbname) < 7 and run != 2147483647:
    dbname = 'COMP200' if run < 232000 else 'CONDBR2'

if 'COOLO' not in schema and ':' not in schema and ';' not in schema:
    schema = 'sqlite://;schema=' + schema + ';dbname=' + (dbname if len(dbname)
                                                          else 'CONDBR2')

if 'sqlite:' not in schema and len(dbname):
Example #13
0
        prefix = a
    elif o in ("-k", "--keep"):
        keep = a.split(",")
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandeled option"

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython.TileCalibTools import MAXRUN, MAXLBK
from TileCalibBlobObjs.Classes import TileCalibUtils

from TileCalibBlobPython.TileCalibLogger import getLogger

log = getLogger("ReadCalibFrCool")
import logging

logLevel = logging.DEBUG
log.setLevel(logLevel)
log1 = getLogger("TileCalibTools")
log1.setLevel(logLevel)

#=== check parameters
if len(dbname) < 7 and run != 2147483647:
    dbname = 'COMP200' if run < 232000 else 'CONDBR2'

if 'COOLO' not in schema and ':' not in schema and ';' not in schema:
    schema = 'sqlite://;schema=' + schema + ';dbname=' + (dbname if len(dbname)
                                                          else 'CONDBR2')
Example #14
0
    sys.exit(2)
if outtag is None:
    outtag = tag

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import TileCalibUtils

if iov and end >= TileCalibTools.MAXRUN:
    end = TileCalibTools.MAXRUN
    lumi2 = TileCalibTools.MAXLBK
until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("WriteCalibToCool")
import logging
if iov:
    log.setLevel(logging.INFO)
else:
    log.setLevel(logging.DEBUG)

#=== set database
dbr = TileCalibTools.openDbConn(inSchema, 'READONLY')
dbw = TileCalibTools.openDbConn(outSchema,
                                ('UPDATE' if update else 'RECREATE'))
if tag == 'UPD5':
    tag = 'UPD4'
    outtag = 'UPD4'
    outfolderPath = folderPath
    folderTag = TileCalibTools.getFolderTag(dbr, folderPath, tag)
Example #15
0
#!/bin/env python

# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_integratorExample
# Nils Gollub <*****@*****.**>, 2008-02-07
# change Yuri Smirnov <*****@*****.**>, 2014-12-24

from __future__ import print_function

import sys, re, os.path

#=== get a logger
from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("int_ascii2db")

#=== process command line arguments
usage = "Usage: integrator_ascii2db.py "
usage += "[-a author] [-c comment] "
usage += "[-from \"yyyy-mm-dd hh:mm:ss\"] "
usage += "file1 [file2 file3 ...]"
author = "noAuthor"
comment = "noComment"
regFrom = -1
fileList = []
if (len(sys.argv) < 2) or ("-h" in sys.argv) or ("--help" in sys.argv):
    print(usage)
    sys.exit(0)
sys.argv.pop(0)
while len(sys.argv) > 0:
    arg = sys.argv.pop(0)
Example #16
0
# provided by the first 2 arguments: ros (=1-4), mod (0-63).  Next
# four arguments are run,lum for IOV's "since", and run,lum for IOV's
# "until", defining the IOV for the masked module.  Last argument is
# the comment to be added.
#
# 2013-09-11 Guilherme Lima - Adapted code received from Tibor

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileBchTools
from TileCalibBlobPython.TileCalibTools import MINRUN, MINLBK, MAXRUN, MAXLBK
from TileCalibBlobObjs.Classes import *
import os

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
import logging
log = getLogger("writeBch")
log.setLevel(logging.DEBUG)

#=== ADC status folder
folder = "/TILE/OFL02/STATUS/ADC"
tag = "clean"
instance="OFLP200"

#.. Parsing arguments 

import sys
ros=int(sys.argv[1])
mod=int(sys.argv[2])
run=int(sys.argv[3])
lum=int(sys.argv[4])
since=(run,lum)
Example #17
0
import sys

#=== process command line arguments
usage = "Usage: integrator_readDb.py [\"yyyy-mm-dd hh:mm:ss\"]"
if (len(sys.argv) > 2) or ("-h" in sys.argv) or ("--help" in sys.argv):
    print(usage)
    sys.exit(0)
sys.argv.pop(0)
pointInTime = -1
if len(sys.argv) > 0:
    pointInTime = sys.argv.pop(0)

#=== get a logger
from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("int_readDb")

#=== open the database
from TileCalibBlobPython import TileCalibTools
db = TileCalibTools.openDb('SQLITE', 'CONDBR2', 'READONLY')

#=== get a blob writer
blobReader = TileCalibTools.TileBlobReader(db, "/TILE/ONL01/INTEGRATOR")

#=== write out the comment
comment = blobReader.getComment(pointInTime)
log.info("Comment: \"%s\"", comment)

#=== write out all values
for ros in range(1, 5):
    for mod in range(64):
Example #18
0
if schema == 'COOLONL_TILE/CONDBR2':
    if not '/TILE/ONL01' in folderPath:
        print "Folder %s doesn't exist in schema %s " % (folderPath, schema)
        sys.exit(2)

if schema == 'COOLOFL_TILE/COMP200' or schema == 'COOLOFL_TILE/CONDBR2':
    if not '/TILE/OFL02' in folderPath:
        print "Folder %s doesn't exist in schema %s " % (folderPath, schema)
        sys.exit(2)

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("ReadFloat")
import logging
log.setLevel(logging.DEBUG)

#=== set database
db = TileCalibTools.openDbConn(schema, 'READONLY')
folderTag = TileCalibTools.getFolderTag(db, folderPath, tag)
log.info("Initializing folder %s with tag %s" % (folderPath, folderTag))

#=== initialize blob reader
blobReader = TileCalibTools.TileBlobReader(db, folderPath, folderTag)
#blobReader.log().setLevel(logging.DEBUG)

#=== get drawer with status at given run
log.info("Initializing ros %d, drawer %d for run %d, lumiblock %d" %
         (ros, drawer, run, lumi))
Example #19
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_writePedFromASCII.py
# Nils Gollub <*****@*****.**>, 2008-03-03
# modified: Lukas Pribyl <*****@*****.**>, 2008-06-27
# modified: Yuri Smirnov <*****@*****.**>, 2014-12-14

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import TileCalibUtils
import os

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("writeAutoCr")
import logging
log.setLevel(logging.DEBUG)


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

    #=== construct folder path
    folder = TileCalibTools.getTilePrefix(True, True) + "NOISE/AUTOCR"

    #=== get full folder tag
Example #20
0
    elif o in ("-f", "--folder"):
        folderPath = "/TILE/%s/STATUS/ADC" % a
    elif o in ("-h", "--help"):
        usage()
        sys.exit(2)
    else:
        assert False, "unhandled option"

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("writeTripsProbs")
import logging
log.setLevel(logging.DEBUG)


#
#________________________________________________________________________
def fillTripsProbs(fileTrips,
                   folderPath,
                   tag,
                   since,
                   until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):

    #=== get full folder tag
    folderTag = TileCalibUtils.getFullTag(folderPath, tag)
Example #21
0
import os, sys

tag1 = "" if len(sys.argv) < 2 else sys.argv[1].rpartition("=")[2]
tag2 = "" if len(sys.argv) < 3 else sys.argv[2].rpartition("=")[2]
opt = "" if len(sys.argv) < 4 else sys.argv[3].rpartition("=")[2]
run1 = None if len(sys.argv) < 5 else int(sys.argv[4].rpartition("=")[2])
run2 = None if len(sys.argv) < 6 else int(sys.argv[5].rpartition("=")[2])

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileBchTools
from TileCalibBlobPython.TileCalibTools import MINRUN, MINLBK, MAXRUN, MAXLBK
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("SyncBch")
import logging
log.setLevel(logging.DEBUG)

log.info("")
if tag1 == "":
    log.error("Please, use non-empty tag as first parameter (e.g. UPD1)")
    sys.exit(2)
if tag2 == "":
    log.error("Please, use non-empty tag as second parameter (e.g. UPD4)")
    sys.exit(2)
if tag1 == tag2:
    log.error(
        "Please, use different tags as first and second parameter (e.g. UPD1 UPD4)"
    )
    sys.exit(2)
Example #22
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_writeIntegratorFromASCII.py
# Lukas Pribyl <*****@*****.**>, 2008-12-05
# change: Yuri Smirnov <*****@*****.**>, 2014-12-24

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import TileCalibUtils
import os

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("writeIntegrator")
import logging
log.setLevel(logging.DEBUG)


#
#________________________________________________________________________
def fillIntegrator(fileInt,
                   tag,
                   since,
                   until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):

    #=== construct folder path
    folder = TileCalibTools.getTilePrefix(True, True) + "INTEGRATOR"

    #=== get full folder tag
Example #23
0
onl = ("/TILE/ONL01" in folderPath)
if onl:
    if inSchema == oraSchema:
        inSchema = inSchema.replace("COOLOFL", "COOLONL")
    oraSchema = oraSchema.replace("COOLOFL", "COOLONL")
if not len(outSchema): outSchema = schema
else: schema = outSchema
if not len(inSchema): inSchema = schema
update = update or (inSchema == outSchema)

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobPython import TileBchTools
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("WriteBchToCool")
import logging
log.setLevel(logging.DEBUG)

dbr = TileCalibTools.openDbConn(inSchema, 'READONLY')
folderTag = TileCalibTools.getFolderTag(dbr, folderPath, tag)

if run < 0: since = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK - 1)
else: since = (run, lumi)
until = (TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)

if mode == 0:
    if inSchema == outSchema: mode = 1
    else: mode = 2
elif mode != 1 and mode != 2:
    log.error("Bad mode %d" % mode)
Example #24
0
if schema == 'COOLONL_TILE/CONDBR2':
    if not '/TILE/ONL01' in folderPath:
        print "Folder %s doesn't exist in schema %s " % (folderPath, schema)
        sys.exit(2)

if schema == 'COOLOFL_TILE/COMP200' or schema == 'COOLOFL_TILE/CONDBR2':
    if not '/TILE/OFL02' in folderPath:
        print "Folder %s doesn't exist in schema %s " % (folderPath, schema)
        sys.exit(2)

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import *

from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("ReadLUT")
import logging
log.setLevel(logging.DEBUG)

#=== set database
db = TileCalibTools.openDbConn(schema, 'READONLY')
folderTag = TileCalibTools.getFolderTag(db, folderPath, tag)
log.info("Initializing folder %s with tag %s" % (folderPath, folderTag))

#=== initialize blob reader
blobReader = TileCalibTools.TileBlobReader(db, folderPath, folderTag)
#blobReader.log().setLevel(logging.DEBUG)

#=== get drawer with status at given run
log.info("Initializing ros %d, drawer %d for run %d, lumiblock %d" %
         (ros, drawer, run, lumi))
Example #25
0
elif tag:
    folderTag = TileCalibUtils.getFullTag(folderPath, tag)
else:
    folderTag = ""

if tag2.startswith('TileO'):
    folderTag2 = tag2
elif tag2:
    folderTag2 = TileCalibUtils.getFullTag(folderPath2, tag2)
else:
    folderTag2 = ""

#==================================================

from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("readFromCool")
import logging
log.setLevel(logging.DEBUG)
f = open('output.ascii', 'w')
if run2 != run and tag2 == tag and folderPath2 == folderPath and folderPath.startswith(
        "/TILE/OFL02/TIME"):
    fd = open('from_%d_to_%d.dif' % (run2, run), 'w')
    writedif = True
else:
    writedif = False

log.info("Initializing folder %s with tag %s", folderPath, folderTag)
log.info("Initializing folder %s with tag %s", folderPath2, folderTag2)

blobReader = TileCalibTools.TileBlobReader(db, folderPath, folderTag)
blobReader2 = TileCalibTools.TileBlobReader(db2, folderPath2, folderTag2)
Example #26
0
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
#
# TileCalibBlobPython_writeTimingFromASCII.py
# Nils Gollub <*****@*****.**>, 2007-11-26
# change: Yuri Smirnov <*****@*****.**>, 2014-12-24

import cppyy

from TileCalibBlobPython import TileCalibTools
from TileCalibBlobObjs.Classes import * 
import os

#=== some preparation
from TileCalibBlobPython.TileCalibLogger import TileCalibLogger, getLogger
log = getLogger("writeTiming")
import logging
log.setLevel(logging.DEBUG)

#
#________________________________________________________________________
def fillTimingTc(fileTclas, tag, since,
               until=(TileCalibTools.MAXRUN, TileCalibTools.MAXLBK)):

    #=== construct folder path
    folderTclas = TileCalibTools.getTilePrefix(True,True)+"TIME/CHANNELOFFSET/LAS"

    #=== create default: one number
    #--- per ADC    for Tclas
    default = cppyy.gbl.std.vector('float')()
    default.push_back(0.)
Example #27
0
    print("    if both are specified, globaltag is ignored and ")
    print("    association of localtag to all global tags is printed")
    print(" EXAMPLES: ")
    print(
        "CheckTagAssociation.py --folder=/TILE/OFL02/CALIB/CES --localtag=TileOfl02CalibCes-RUN2-HLT-UPD1-01"
    )
    print("CheckTagAssociation.py --folder=/TILE/OFL02/CALIB/CES")
    sys.exit()

from TileCalibBlobPython import TileCalibTools
from AtlCoolBKLib import resolveAlias
current = resolveAlias.getCurrent()
nexttag = resolveAlias.getNext()
#--------------------------------
from TileCalibBlobPython.TileCalibLogger import getLogger
log = getLogger("TileCalibTools")
import logging
log.setLevel(logging.WARNING)

#if instance == 'CONDBR2' :
print("alias CURRENT = %s alias NEXT = %s" % (current, nexttag))

if folder == '':
    sys.exit()

#=================================================
connStr = schema + '/' + instance

#=== open the database
db = TileCalibTools.openDbConn(connStr, 'READONLY')