Exemple #1
0
    def __interpretTag(self, tag):
        # default settings
        channel = 0  # 'ATLAS_PREFERRED' algorithm
        if self.isRun2():
            import sys
            from PyCool import cool
            sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
            try:
                from AtlCoolBKLib import resolveAlias

                cur = resolveAlias.getCurrent()
                # cur = resolveAlias.getNext()
                dbSvc = cool.DatabaseSvcFactory.databaseService()

                db = dbSvc.openDatabase(
                    'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_TRIGGER;dbname=CONDBR2',
                    False)

                fld = db.getFolder('/TRIGGER/OFLLUMI/OflPrefLumi')

                updLumiTag = fld.resolveTag(cur.replace('*', 'ST'))

                condtag = updLumiTag
            except ImportError, ex:
                print "WARNING: ImportError, can not read conditions tag (likely an afs permission issue): ", ex
                condtag = "OflPrefLumi-RUN2-UPD4-04"

            print condtag
Exemple #2
0
def resolveCurrentAlias(tagtype='ST'):
    "Resolve the current BLK tag alias"

    from AtlCoolBKLib import resolveAlias

    # Will raise exception if alias not defined
    alias = resolveAlias.getCurrent()
    return alias.replace('*', tagtype)
Exemple #3
0
    def __interpretTag(self, tag):
        # default settings
        channel = 0  # 'ATLAS_PREFERRED' algorithm
        if self.isRun2():
            import sys
            from PyCool import cool
            sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
            try:
                from AtlCoolBKLib import resolveAlias

                cur = resolveAlias.getCurrent()
                # cur = resolveAlias.getNext()
                dbSvc = cool.DatabaseSvcFactory.databaseService()

                db = dbSvc.openDatabase(
                    'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_TRIGGER;dbname=CONDBR2',
                    False)

                fld = db.getFolder('/TRIGGER/OFLLUMI/OflPrefLumi')

                updLumiTag = fld.resolveTag(cur.replace('*', 'ST'))

                condtag = updLumiTag
            except ImportError as ex:
                print(
                    "WARNING: ImportError, can not read conditions tag (likely an afs permission issue): ",
                    ex)
                condtag = "OflPrefLumi-RUN2-UPD4-04"

            print(condtag)

        else:
            condtag = "OflLumi-UPD2-006"

        l = tag.split()
        if len(l) == 1:
            # format: "luminosity <channel_number>" OR "luminosity <COOL tag>"
            try:
                channel = int(l[0])
            except ValueError:
                condtag = l[0]
        elif len(l) == 2:
            # format: "luminosity <channel_number> <COOL tag>"
            try:
                channel = int(l[0])
            except ValueError:
                channel = 0
            condtag = l[1]
        return channel, condtag
Exemple #4
0
def ResolveTag(folder, tag):
    theTag = tag
    if tag.upper() in ['NEXT', 'CURRENT']:
        from PyCool import cool
        import sys
        if not '/afs/cern.ch/user/a/atlcond/utils/python/' in sys.path:
            sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
        from AtlCoolBKLib import resolveAlias
        if tag.upper() == "NEXT":
            theTag = resolveAlias.getNext()
        else:
            theTag = resolveAlias.getCurrent()
        theTag = theTag.replace('*', 'ST')
        print(tag, "resolves to", theTag)
    folder_tag = folder.resolveTag(theTag)
    if folder_tag != theTag:
        print(theTag, "resolves to", folder_tag)
    return folder_tag
Exemple #5
0
# setup athenaCommonFlags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.EvtMax = EvtMax
athenaCommonFlags.SkipEvents = SkipEvents
athenaCommonFlags.FilesInput = FilesInput
del SkipEvents
del EvtMax
del FilesInput

# setup globalflags
from AthenaCommon.GlobalFlags import globalflags

import sys
sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')  # CERN
from AtlCoolBKLib import resolveAlias
conditionsTag = resolveAlias.getCurrent()
printfunc(conditionsTag)
globalflags.ConditionsTag.set_Value_and_Lock(conditionsTag)

from AthenaCommon.BeamFlags import jobproperties
jobproperties.Beam.beamType.set_Value_and_Lock('cosmics')

from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
ConfigureFromListOfKeys(['everything'])

# database tag
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())

# setup detflags
import DetDescrCnvSvc.DetStoreConfig
Exemple #6
0
    print ' if no options are provided and also resolves leaf tag if'
    print ' folder is provided. By default, if global tag is not specified,'
    print '  globaltag=CURRENT'
    print '  default instance=CONDBR2'
    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
Exemple #7
0
#!/bin/env python

# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

# To know the CURRENT COMCOND tag.

import sys
from PyCool import cool
sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
from AtlCoolBKLib import resolveAlias

currentBLKP = resolveAlias.getCurrent()
print currentBLKP

currentES1P = resolveAlias.getCurrentES()
print currentES1P
Exemple #8
0
    humanReadableOutputs=""

    if process=='reco':
        f = open(inPickleFile, 'rb')
        startingDic = pickle.load(f)
        f.close()

        currentConditionsTag = ''
        if (amiTag.startswith("f") or amiTag.startswith("x")) and updateConditionsTag:
            # ConditionsTag in autoConfiguration is updated/appended
            # if f- or x-tag is made unless this option is disabled.
            sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
            # from PyCool import cool
            from AtlCoolBKLib import resolveAlias
            currentConditionsTag = 'ConditionsTag='
            if(amiTag.startswith("f")): currentConditionsTag += resolveAlias.getCurrent()
            else:                       currentConditionsTag += resolveAlias.getCurrentES()
            # Starting in 2012 all magnetic field configs are in one tag. Don't put this in the autoconfiguration part.
            if '*' not in currentConditionsTag:
                currentConditionsTag = currentConditionsTag[14:]
        else:
            # ConditionsTag in autoConfiguration is not changed.
            updateConditionsTag = False

        #prepare input, output and config dictionaries
        inputDic={}
        outputDic={}
        configDic={}

        print (startingDic)
Exemple #9
0
    if process == 'reco':
        f = open(inPickleFile, 'rb')
        startingDic = pickle.load(f)
        f.close()

        currentConditionsTag = ''
        if (amiTag.startswith("f")
                or amiTag.startswith("x")) and updateConditionsTag:
            # ConditionsTag in autoConfiguration is updated/appended
            # if f- or x-tag is made unless this option is disabled.
            sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
            # from PyCool import cool
            from AtlCoolBKLib import resolveAlias
            currentConditionsTag = 'ConditionsTag='
            if (amiTag.startswith("f")):
                currentConditionsTag += resolveAlias.getCurrent()
            else:
                currentConditionsTag += resolveAlias.getCurrentES()
            # Starting in 2012 all magnetic field configs are in one tag. Don't put this in the autoconfiguration part.
            if '*' not in currentConditionsTag:
                currentConditionsTag = currentConditionsTag[14:]
        else:
            # ConditionsTag in autoConfiguration is not changed.
            updateConditionsTag = False

        #prepare input, output and config dictionaries
        inputDic = {}
        outputDic = {}
        configDic = {}
        from PATJobTransforms.Configuration import ConfigDic
        didConditionsUpdate = False
Exemple #10
0
athenaCommonFlags.EvtMax = EvtMax
athenaCommonFlags.SkipEvents = SkipEvents
athenaCommonFlags.FilesInput = FilesInput
del SkipEvents
del EvtMax
del FilesInput

# setup globalflags
from AthenaCommon.GlobalFlags  import globalflags

#globalflags.ConditionsTag.set_Value_and_Lock("CONDBR2-BLKPA-2015-04")
import sys
sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/') # CERN
#sys.path.append('/home/atdata5/pjwf/atlcond/utils/python') # Brum
from AtlCoolBKLib import resolveAlias
conditionsTag = resolveAlias.getCurrent()
print conditionsTag
globalflags.ConditionsTag.set_Value_and_Lock(conditionsTag)

from AthenaCommon.BeamFlags import jobproperties
jobproperties.Beam.beamType.set_Value_and_Lock('cosmics')

from RecExConfig.AutoConfiguration import ConfigureFromListOfKeys, GetRunNumber
ConfigureFromListOfKeys(['everything'])

# database tag
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())

# setup detflags
import DetDescrCnvSvc.DetStoreConfig