Exemple #1
0
def FillParamsCondAlgDefault():
    log = logging.getLogger('FillParamsCondAlgDefault')
    name = 'FillParamsCondAlg'
    condSeq = AthSequencer('AthCondSeq')

    if hasattr(condSeq, name):
        return getattr(condSeq, name)

    # Should only be used for Run 1.
    from IOVDbSvc.CondDB import conddb
    if conddb.dbdata != 'COMP200':
        return None

    folder = '/TDAQ/OLC/LHC/FILLPARAMS'

    # Mistakenly created as multi-version folder, must specify HEAD
    conddb.addFolderWithTag('TDAQ',
                            folder,
                            'HEAD',
                            className='AthenaAttributeList')
    log.info("FillParamsToolDefault requested %s", folder)

    from CoolLumiUtilities.CoolLumiUtilitiesConf import \
         FillParamsCondAlg

    alg = FillParamsCondAlg(name,
                            FillParamsFolderInputKey=folder,
                            FillParamsOutputKey='FillParamsCondData')
    condSeq += alg

    return alg
Exemple #2
0
def BunchGroupCondAlgDefault():
    name = 'BunchGroupCondAlg'
    condSeq = AthSequencer('AthCondSeq')

    if hasattr(condSeq, name):
        return getattr(condSeq, name)

    folder = ''

    from IOVDbSvc.CondDB import conddb
    if conddb.dbdata == 'COMP200':
        folder = '/TRIGGER/LVL1/BunchGroupContent'

        # Mistakenly created as multi-version folder, must specify HEAD
        from IOVDbSvc.CondDB import conddb
        conddb.addFolderWithTag('TRIGGER',
                                folder,
                                'HEAD',
                                className='AthenaAttributeList')

    from CoolLumiUtilities.CoolLumiUtilitiesConf import \
         BunchGroupCondAlg

    alg = BunchGroupCondAlg(name,
                            BunchGroupFolderInputKey=folder,
                            BunchGroupOutputKey='BunchGroupCondData')
    condSeq += alg

    return alg
Exemple #3
0
def TrigLiveFractionCondAlgDefault(name='TrigLiveFractionCondAlg'):
    condSeq = AthSequencer('AthCondSeq')

    if hasattr(condSeq, name):
        return getattr(condSeq, name)

    from IOVDbSvc.CondDB import conddb

    kwargs = {}
    if conddb.dbdata == "COMP200":
        # Mistakenly created as multi-version folder, must specify HEAD
        conddb.addFolderWithTag('TRIGGER',
                                '/TRIGGER/LUMI/PerBcidDeadtime',
                                'HEAD',
                                className='AthenaAttributeList')
        kwargs['DeadtimeFolderInputKey'] = '/TRIGGER/LUMI/PerBcidDeadtime'
        kwargs['LuminosityInputKey'] = 'LuminosityCondData'

        from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault
        LuminosityCondAlgDefault()

    else:
        kwargs['DeadtimeFolderInputKey'] = ''
        kwargs['LuminosityInputKey'] = ''

    from LumiBlockComps.LumiBlockCompsConf import TrigLiveFractionCondAlg
    alg = TrigLiveFractionCondAlg(
        name, TrigLiveFractionOutputKey='TrigLiveFractionCondData', **kwargs)
    condSeq += alg

    return alg
Exemple #4
0
def BunchCrossingCondAlgDefault():
    name = 'BunchCrossingCondAlgDefault'
    condSeq = AthSequencer('AthCondSeq')

    if hasattr(condSeq, name):
        return getattr(condSeq, name)

    from LumiBlockComps.LumiBlockCompsConf import BunchCrossingCondAlg
    from IOVDbSvc.CondDB import conddb

    isMC = conddb.isMC
    run1 = (conddb.dbdata == 'COMP200')

    if (isMC):
        folder = "/Digitization/Parameters"
        conddb.addFolderWithTag('',
                                folder,
                                'HEAD',
                                className='AthenaAttributeList')
    else:
        folder = '/TDAQ/OLC/LHC/FILLPARAMS'
        # Mistakenly created as multi-version folder, must specify HEAD
        conddb.addFolderWithTag('TDAQ',
                                folder,
                                'HEAD',
                                className='AthenaAttributeList')

    alg = BunchCrossingCondAlg(name,
                               isMC=isMC,
                               Run1=run1,
                               FillParamsFolderKey=folder)

    condSeq += alg

    return alg
Exemple #5
0
def __lblbFolderAccess( c, **kw ):
    __folder = "/TRIGGER/LUMI/LBLB"
    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested( __folder ):
        conddb.addFolderWithTag( "TRIGGER", __folder, "HEAD" )
        pass
    return
Exemple #6
0
def TrigConfBunchCrossingTool():

    # The default name of the tool:
    __defaultToolName = "BunchCrossingTool"

    # Get ourselves a logger:
    from AthenaCommon.Logging import logging
    __logger = logging.getLogger("TrigConfBunchCrossingTool")

    # Check if the tool already exists. If it does, let's just return it without
    # any modifications:
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr(ToolSvc, __defaultToolName):
        __logger.debug("Tool already exists, not configuring it again")
        return getattr(ToolSvc, __defaultToolName)

    # Create a new instance of the tool if it doesn't exist yet:
    from TrigBunchCrossingTool.TrigBunchCrossingToolConf import \
         Trig__TrigConfBunchCrossingTool
    __tool = Trig__TrigConfBunchCrossingTool(__defaultToolName)

    # Create a default configuration for it:
    __logger.info("Set the default values for the TrigConfBunchCrossingTool "
                  "configuration")

    # Check for a TrigConfigSvc:
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    if not hasattr(svcMgr, "TrigConfigSvc"):
        __logger.info(
            "Job has no TrigConfigSvc, falling back to xAODConfigSvc")
        from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODConfigSvc
        from AthenaCommon.AppMgr import ServiceMgr
        cfgsvc = TrigConf__xAODConfigSvc('xAODConfigSvc')
        ServiceMgr += cfgsvc
        __tool.ConfigSvc = cfgsvc
    else:
        # We do have a TrigConfigSvc. Now make sure that DSConfigSvc has access to the BG COOL folders:
        from IOVDbSvc.CondDB import conddb
        __dbConnection = "TRIGGER"
        __folders = [
            "LVL1/BunchGroupKey", "LVL1/BunchGroupDescription",
            "LVL1/BunchGroupContent"
        ]
        for f in __folders:
            if not conddb.folderRequested("/TRIGGER/%s" % f):
                __logger.info("Adding folder to IOVDbSvc: /TRIGGER/%s", f)
                conddb.addFolderWithTag(__dbConnection, "/TRIGGER/%s" % f,
                                        "HEAD")
                pass
            pass

    # Add the tool to ToolSvc and return it to the user:
    ToolSvc += __tool
    return getattr(ToolSvc, __defaultToolName)
Exemple #7
0
    def setupCOOLReading(self,TrigCoolDbConnection):
        log = logging.getLogger( "TriggerConfigGetter.py" )
        log.info( 'DSConfigSvc enabled, will setup IOVDbSvc to access configuration meta data')
        #usePresetConnection = (TrigCoolDbConnection != "")

        ## if we process MC from an XML file the dbConnection needs to
        ## be set to a local SQlite file

        # when reading from the COOL database (either form
        # ORACLE/SQlite) we need an algorithm that triggers the
        # copying
        #
        # In addition for MC the IOV has to be adjusted since in COOL the config data is written with IOV=infinity

        if TrigCoolDbConnection=='':
            log.info("COOL DBConnection: not set, will use default conditions database" )
            TrigCoolDbConnection = 'TRIGGER'
            addNewFolders = TriggerFlags.configForStartup()=="HLTonline" and self.readRDO
        else: # for sqlite COOL: temp (usually /tmp/hltMenu.xxx.db) or predefined (e.g. trigconf.db)
            log.info("COOL DBConnection: " + TrigCoolDbConnection )
            addNewFolders = ( ( TriggerFlags.configForStartup()=="HLToffline"
                                or TriggerFlags.configForStartup()=="HLTonline"
                                or globalflags.DataSource()!='data')
                              and self.readRDO )  # bytestream or MC RDO

        # add folders for reading
        from IOVDbSvc.CondDB import conddb
        folders = []
        if self.hltFolders:
            folders += [ "HLT/Menu", "HLT/HltConfigKeys" ]
        if self.l1Folders:
            folders += [ "LVL1/Lvl1ConfigKey", "LVL1/Menu", "LVL1/Prescales" ]
        if globalflags.DataSource() == 'data':
            if self.l1Folders:
                folders += [ "LVL1/BunchGroupKey", "LVL1/BunchGroupDescription", "LVL1/BunchGroupContent" ]
        if self.hasLBwiseHLTPrescalesAndL1ItemDef:
            if self.hltFolders:
                folders += [ "HLT/Prescales", "HLT/PrescaleKey" ]
            if self.l1Folders:
                folders += [ "LVL1/ItemDef" ]

        log.info("Adding folders to IOVDbSvc")

        if addNewFolders:
            # Need thresholds folders but only for Tier0 BS->ESD
            log.info("Also adding new folders to IOVDbSvc")
            if self.hltFolders:
                folders += [ "HLT/Groups" ]
            if self.l1Folders:
                folders += [ "LVL1/Thresholds" ]

        for f in folders:
            log.info("     /TRIGGER/%s", f)
            conddb.addFolderWithTag(TrigCoolDbConnection, "/TRIGGER/%s" % f, "HEAD")
Exemple #8
0
 def setFolders(self):
     from IOVDbSvc.CondDB import conddb
     if not conddb.folderRequested(self.folder):
         if self.folderDb is None:
             self.folderDb = self.folder
         if self.folderTag is None:
             conddb.addFolder(self.dbInstance,
                              self.folderDb,
                              className="AthenaAttributeList")
         else:
             conddb.addFolderWithTag(self.dbInstance,
                                     self.folderDb,
                                     self.folderTag,
                                     className="AthenaAttributeList")
Exemple #9
0
def TrigConfBunchCrossingTool():

    # The default name of the tool:
    __defaultToolName = "BunchCrossingTool"

    # Get ourselves a logger:
    from AthenaCommon.Logging import logging
    __logger = logging.getLogger( "TrigConfBunchCrossingTool" )

    # Check if the tool already exists. If it does, let's just return it without
    # any modifications:
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr( ToolSvc, __defaultToolName ):
        __logger.debug( "Tool already exists, not configuring it again" )
        return getattr( ToolSvc, __defaultToolName )

    # Create a new instance of the tool if it doesn't exist yet:
    from TrigBunchCrossingTool.TrigBunchCrossingToolConf import \
         Trig__TrigConfBunchCrossingTool
    __tool = Trig__TrigConfBunchCrossingTool( __defaultToolName )

    # Create a default configuration for it:
    __logger.info( "Set the default values for the TrigConfBunchCrossingTool "
                   "configuration" )

    # Set up the trigger configuration service:
#    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
#    if not hasattr( svcMgr, "TrigConfigSvc" ):
#        __logger.error( "You have to make sure that TrigConfigSvc exists to use this "
#                        "tool!" )
#        __logger.error( "Try running in a RecExCommon environment..." )
#        raise NameError( "ServiceMgr.TrigConfigSvc not configured" )
#    __tool.ConfigSvc = svcMgr.TrigConfigSvc

    # Now make sure that DSConfigSvc has access to the BG COOL folders:
    from IOVDbSvc.CondDB import conddb
    __dbConnection = "TRIGGER"
    __folders = [ "LVL1/BunchGroupKey", "LVL1/BunchGroupDescription",
                  "LVL1/BunchGroupContent" ]
    for f in __folders:
        if not conddb.folderRequested( "/TRIGGER/%s" % f ):
            __logger.info( "Adding folder to IOVDbSvc: /TRIGGER/%s" % f ) 
            conddb.addFolderWithTag( __dbConnection, "/TRIGGER/%s" % f, "HEAD" )
            pass
        pass

    # Add the tool to ToolSvc and return it to the user:
    ToolSvc += __tool
    return getattr( ToolSvc, __defaultToolName )
Exemple #10
0
def MCBunchCrossingTool():

    # The default name of the tool:
    __defaultToolName = "BunchCrossingTool"

    # Get ourselves a logger:
    from AthenaCommon.Logging import logging
    __logger = logging.getLogger("MCBunchCrossingTool")

    # Check if the tool already exists. If it does, let's just return it without
    # any modifications:
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr(ToolSvc, __defaultToolName):
        __logger.debug("Tool already exists, not configuring it again")
        return getattr(ToolSvc, __defaultToolName)

    # Create a new instance of the tool if it doesn't exist yet:
    from TrigBunchCrossingTool.TrigBunchCrossingToolConf import \
         Trig__MCBunchCrossingTool
    __tool = Trig__MCBunchCrossingTool(__defaultToolName)

    # Create a default configuration for it:
    __logger.info(
        "Set the default values for the MCBunchCrossingTool configuration")

    # Add the tool to ToolSvc:
    ToolSvc += __tool

    # If this is a BS reading job (it *can* happen) then stop at
    # this point, as the metadata folder will not be available.
    from AthenaCommon.GlobalFlags import globalflags
    if globalflags.InputFormat() != "pool":
        return getattr(ToolSvc, __defaultToolName)

    # Now make sure the tool has access to the metadata folders:
    from IOVDbSvc.CondDB import conddb
    __dbConnection = ""
    __folders = ["/Digitization/Parameters"]
    for f in __folders:
        if not conddb.folderRequested(f):
            __logger.info("Adding folder to IOVDbSvc: %s", f)
            conddb.addFolderWithTag(__dbConnection, f, "HEAD")
            pass
        pass

    # Return the tool to the user:
    return getattr(ToolSvc, __defaultToolName)
Exemple #11
0
def initialiseCoolDataBaseFolder():
    if TrkDetFlags.ConfigurationOutputLevel() < 3 :
      print ('[ Configuration : start ] *** FatrasTrackingGeometry ********************************')
      print ('[ TrackingGeometrySvc ]')

    # check whether the material retrieval is ment to be from COOL
    if TrkDetFlags.MaterialSource() == 'COOL' :
        # the tag names
        CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey()
        AtlasMaterialTag = TrkDetFlags.MaterialTagBase()+str(TrkDetFlags.MaterialVersion())+'_'

        if TrkDetFlags.ConfigurationOutputLevel() < 3 :
           print ('[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder)
           print ('[ TrackingGeometrySvc ]     base material tag : ',AtlasMaterialTag)

        # we need the conditions interface
        from IOVDbSvc.CondDB import conddb
        # use a local database
        if TrkDetFlags.MaterialDatabaseLocal():
            # specify the local database
            DataBasePath  = TrkDetFlags.MaterialDatabaseLocalPath()
            DataBaseName  = TrkDetFlags.MaterialDatabaseLocalName()
            MagicTag      = TrkDetFlags.MaterialMagicTag()
            DataBaseConnection = '<dbConnection>sqlite://X;schema='+DataBasePath+DataBaseName+';dbname=OFLP200</dbConnection>'
            conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterial')
            conddb.addFolderWithTag('',DataBaseConnection+CoolDataBaseFolder,AtlasMaterialTag+MagicTag,force=True)
            if TrkDetFlags.ConfigurationOutputLevel() < 3 :
                print ('[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection)
            # make sure that the pool files are in the catalog
            #from PoolSvc.PoolSvcConf import PoolSvc
            #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]
        elif TrkDetFlags.SLHC_Geometry() :
            # set the folder to the SLHC location
            CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
            ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
            cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag)
        else :
            # load the right folders (preparation for calo inclusion)
            cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfolder,cfolder)

    #HACK: CoolDataBaseFolder may not be set at this point! Is this right? -KG
    return CoolDataBaseFolder
Exemple #12
0
def LHCBunchCrossingTool():

    # The default name of the tool:
    __defaultToolName = "BunchCrossingTool"

    # Get ourselves a logger:
    from AthenaCommon.Logging import logging
    __logger = logging.getLogger("LHCBunchCrossingTool")

    # Check if the tool already exists. If it does, let's just return it without
    # any modifications:
    from AthenaCommon.AppMgr import ToolSvc
    if hasattr(ToolSvc, __defaultToolName):
        __logger.debug("Tool already exists, not configuring it again")
        return getattr(ToolSvc, __defaultToolName)

    # Create a new instance of the tool if it doesn't exist yet:
    from TrigBunchCrossingTool.TrigBunchCrossingToolConf import \
         Trig__LHCBunchCrossingTool
    __tool = Trig__LHCBunchCrossingTool(__defaultToolName)

    # Create a default configuration for it:
    __logger.info(
        "Set the default values for the LHCBunchCrossingTool configuration")

    # Now make sure the tool has access to the metadata folders:
    from IOVDbSvc.CondDB import conddb
    __dbConnection = "TDAQ"
    __folders = ["FILLPARAMS", "BUNCHDATA"]
    for f in __folders:
        if not conddb.folderRequested("/TDAQ/OLC/LHC/%s" % f):
            __logger.info("Adding folder to IOVDbSvc: /TDAQ/OLC/LHC/%s", f)
            conddb.addFolderWithTag(__dbConnection, "/TDAQ/OLC/LHC/%s" % f,
                                    "HEAD")
            pass
        pass

    # Add the tool to ToolSvc and return it to the user:
    ToolSvc += __tool
    return getattr(ToolSvc, __defaultToolName)
Exemple #13
0
 def setFolders(self):
     from IOVDbSvc.CondDB import conddb
     if not conddb.folderRequested(self.noiseFolder):
         if self.noiseFolderTag is None:
             conddb.addFolderSplitMC("SCT",
                                     self.noiseFolder,
                                     self.noiseFolder,
                                     className="CondAttrListCollection")
         else:
             conddb.addFolderWithTag("SCT",
                                     self.noiseFolder,
                                     self.noiseFolderTag,
                                     className="CondAttrListCollection")
     if not conddb.folderRequested(self.gainFolder):
         if self.gainFolderTag is None:
             conddb.addFolderSplitMC("SCT",
                                     self.gainFolder,
                                     self.gainFolder,
                                     className="CondAttrListCollection")
         else:
             conddb.addFolderWithTag("SCT",
                                     self.gainFolder,
                                     self.gainFolderTag,
                                     className="CondAttrListCollection")
def BunchGroupToolDefault(name="BunchGroupTool"):
    mlog = logging.getLogger(name)

    if hasattr(svcMgr.ToolSvc, name):
        # re-use previously configured tool
        mlog.info("BunchGroupToolDefault returning existing tool %s", name)
        return getattr(svcMgr.ToolSvc, name)

    # Instantiate new tool, by default configuration will do nothing
    bgTool = BunchGroupTool(name)

    # Now configure based on the environment
    from IOVDbSvc.CondDB import conddb

    # Run1
    if conddb.dbdata == "COMP200":

        folder = '/TRIGGER/LVL1/BunchGroupContent'
        bgTool.BunchGroupFolderName = folder

        # Mistakenly created as multi-version folder, must specify HEAD 
        from IOVDbSvc.CondDB import conddb
        if not conddb.folderRequested( folder ):
            conddb.addFolderWithTag('TRIGGER', folder, 'HEAD')
            mlog.info("BunchGroupToolDefault requested %s", folder)

    # Run2 - do nothing
    elif conddb.dbdata == "CONDBR2":
        pass

    # Unknown, complain and do nothing
    else:
        mlog.warning("BunchGroupToolDefault can't resolve conddb.dbdata = %s, assume Run2!" % conddb.dbdata)
        pass

    return bgTool
Exemple #15
0
TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/BinnedLayerMaterial'
TrkDetFlags.MaterialDatabaseLocalPath = ''
TrkDetFlags.MaterialDatabaseLocalName = 'AtlasLayerMaterial-' + DetDescrVersion + '.db'
TrkDetFlags.MaterialMagicTag = InputMagicTag
print TrkDetFlags

# we need the conditions interface
from IOVDbSvc.CondDB import conddb
# specify the local database
DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath()
DataBaseName = TrkDetFlags.MaterialDatabaseLocalName()
DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>'
conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2')
conddb.addFolderWithTag('',
                        DataBaseConnection +
                        TrkDetFlags.MaterialStoreGateKey(),
                        TrkDetFlags.MaterialMagicTag(),
                        force=True)

# Number of events to be processed
theApp.EvtMax = 1

# Full job is a list of algorithms
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()

# create the Material Converter - just switch the creator for different results
from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CompressedLayerMaterialCreator as LmCreator
#from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CompoundLayerMaterialCreator as LmCreator
LayerMaterialCreator = LmCreator(name='LayerMaterialCreator')
ToolSvc += LayerMaterialCreator
Exemple #16
0
                                          doPedestalPlots=False,
                                          doEtCorrelationPlots=False,
                                          doCaloQualCut=False)
ToolSvc += CfgMgr.LVL1__TrigT1CaloLWHistogramTool("TrigT1CaloLWHistogramTool",
                                                  LVL1ConfigSvc="")

ServiceMgr += CfgMgr.THistSvc()
ServiceMgr.THistSvc.Output = ["AANT DATAFILE='output.root' OPT='RECREATE'"]
ServiceMgr.THistSvc.Output += [
    "RAMPDATA DATAFILE='graphs.root' OPT='RECREATE'"
]
svcMgr.IOVDbSvc.Folders += [
    "<dbConnection>sqlite://;schema=/afs/cern.ch/user/l/l1ccalib/w0/DaemonData/reference/calibReferences.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/References/FineTimeReferences"
]

conddb.addFolderWithTag("TRIGGER",
                        "/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib",
                        "HEAD")

# override timestamp with SOR time of run
# this overcomes strange timestamps stored in the EventInfo
# code taken from CoolConvUtilities/MagFieldUtils.py
from CoolConvUtilities.AtlCoolLib import indirectOpen
foldername_ = '/TDAQ/RunCtrl/SOR' if svcMgr.IOVDbSvc.DBInstance == 'CONDBR2' else '/TDAQ/RunCtrl/SOR_Params'
db_ = indirectOpen('COOLONL_TDAQ/%s' % svcMgr.IOVDbSvc.DBInstance, oracle=True)
if not db_: raise RuntimeError("Couldn't open connection to TDAQ DB")
folder_ = db_.getFolder(foldername_)
obj_ = folder_.findObject(GetRunNumber() << 32, 0)
payload_ = obj_.payload()
svcMgr.IOVDbSvc.forceTimestamp = payload_['SORTime'] / 1000000000
Exemple #17
0
from IOVDbSvc.CondDB import conddb

########################################
#These top ones are MC folders (and other random things) and shouldn't have to change much

#use MC TRT RT functions
conddb.blockFolder("/TRT/Calib/RT")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Calib/RT",
                        "TrtCalibRt-MC09_900GeV-REP-Field-00",
                        force=True,
                        forceMC=True)

#use MC MDT RT functions
conddb.blockFolder("/MDT/RT")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/RT",
                        "MDTRT_Sim-00",
                        force=True,
                        forceMC=True)
conddb.blockFolder("/MDT/RTBLOB")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/RTBLOB",
                        "MDTRT_Sim-00-BLOB",
                        force=True,
                        forceMC=True)

conddb.blockFolder("/PIXEL/HLT/DCS/HV")
conddb.addFolderWithTag("PIXEL_ONL",
                        "/PIXEL/HLT/DCS/HV",
                        "PixDCSHV-UPD1-00",
Exemple #18
0
#conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,forceMC=True)

#from Guillaume
conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/5samples1phase",
                   "LARElecCalibOflShapeRTM5samples1phase-UPD1-04")

conddb.blockFolder("/PIXEL/ReadoutSpeed")
conddb.addFolderSplitMC("PIXEL",
                        "/PIXEL/ReadoutSpeed",
                        "/PIXEL/ReadoutSpeed",
                        force=True)

conddb.blockFolder("/TRT/Cond/DigVers")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Cond/DigVers",
                        "TRTCondDigVers-Collisions-01",
                        force=True,
                        forceMC=True)

###################################################
printfunc("RT OVERRIDE, for CONDBR2-BLKPA-2015-12")
#See https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/rBR_CB_Report.php?CBAction=GlobalTagReport&cbgt=CONDBR2-BLKPA-2015-15#INDET

conddb.blockFolder("/MDT/T0BLOB")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/T0BLOB",
                        "MDTT0-UPD4-13",
                        force=True,
                        forceData=True)

if not "EOJT_alignMC" in globals():
Exemple #19
0
outputLevel = INFO

from IOVDbSvc.CondDB import conddb

IOVDbSvc.dbConnection = "sqlite://X;schema=mycool.db;dbname=OFLP200"
conddb.addFolder(
    "",
    "<dbConnection>sqlite://X;schema=mycool.db;dbname=OFLP200</dbConnection> /MUON/TrkErrorScaling"
    + "<tag>MuonTrkErrorScaling_nominal</tag>",
    force=True)
conddb.addFolderWithTag('mycool.db', '/MUON/TrkErrorScaling',
                        'MuonTrkErrorScaling_nominal')

from MuonErrorScalingTools.MuonErrorScalingToolsConf import Muon__MuonRIO_OnTrackErrorScalingTool, Muon__MuonErrorScaleDbTool

muonErrorScaleDbTool = Muon__MuonErrorScaleDbTool("MuonErrorScaleDbTool",
                                                  OutputLevel=outputLevel)
ToolSvc += muonErrorScaleDbTool
muonErrorScalingTool = Muon__MuonRIO_OnTrackErrorScalingTool(
    "MuonRIO_OnTrackErrorScalingTool",
    OutputLevel=outputLevel,
    ErrorScaleDbTool=muonErrorScaleDbTool)
ToolSvc += muonErrorScalingTool

from MuonRecExample import MuonRecTools

MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool(
    "MdtDriftCircleOnTrackCreator")
MdtDriftCircleOnTrackCreator.DoErrorScaling = True
MdtDriftCircleOnTrackCreator.ScaleErrorsManually = False
MdtDriftCircleOnTrackCreator.OutputLevel = outputLevel
Exemple #20
0
    if inputFileSummary.has_key('eventdata_items') and 'xAOD::TrigDecision' \
            in [ x[0] for x in inputFileSummary['eventdata_items'] ]:
        job.pool2ei.HaveXHlt = True
    if inputFileSummary.has_key('metadata_items') and 'xAOD::TriggerMenuContainer' \
            in [ x[0] for x in inputFileSummary['metadata_items'] ]:
        job.pool2ei.HaveXHlt = True

    from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
    trigcfg = TriggerConfigGetter("ReadPool")

    # ensure that /TRIGGER/HLT/PrescaleKey is always loaded
    # it is not loaded by TriggerConfigGetter when trigger metadata is missing
    # but it should have been loaded. We need LB-wise HLT prescale key
    if trigcfg.hasLBwiseHLTPrescalesAndL1ItemDef is False and inputFileSummary['evt_type'][0] == "IS_DATA":
        from IOVDbSvc.CondDB import conddb
        conddb.addFolderWithTag("TRIGGER", "/TRIGGER/HLT/PrescaleKey", "HEAD")
        conddb.addFolderWithTag("TRIGGER", "/TRIGGER/HLT/Prescales", "HEAD")
        conddb.addFolderWithTag("TRIGGER", "/TRIGGER/LVL1/ItemDef", "HEAD")

    from AthenaCommon.AppMgr import ToolSvc
    from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
    if job.pool2ei.HaveXHlt:
        tdt = Trig__TrigDecisionTool(name="TrigDecisionTool", 
                                     TrigConfigSvc="TrigConf::TrigConfigSvc/TrigConfigSvc")
        tdt.TrigDecisionKey = 'xTrigDecision'
        tdt.UseAODDecision = False
    else:
        # use old decision
        tdt = Trig__TrigDecisionTool(name="TrigDecisionTool", 
                                     TrigConfigSvc="TrigConf::TrigConfigSvc/TrigConfigSvc")
        tdt.TrigDecisionKey = 'TrigDecision'
Exemple #21
0
MuonDetectorTool.EnableFineClashFixing = 0 #this should be on for g4?
#printfunc (MuonDetectorTool)
#printfunc (GeoModelSvc)
#printfunc (ToolSvc)

#Now use MC T0 for TRT during overlay digi, but MC or data T0/Rt during reco, depending on where digit came from... so this stuff is just for reco:
#conddb.blockFolder("/TRT/Calib/MCRT")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCRT" + "<tag> TrtCalibMCRt-13TeV_ArgonScenario1_00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCT0")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCT0" + "<tag> TrtCalibMCT0-13TeV_ArgonScenario1_00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCRT")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection>/TRT/Calib/MCRT" + "<tag> TrtCalibMCRt-13TeV_ArgonScenario1_00-00</tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCT0")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection>/TRT/Calib/MCT0" + "<tag> TrtCalibMCT0-13TeV_ArgonScenario1_00-00</tag>" , force=True)
conddb.blockFolder("/TRT/Calib/MC/RT")
conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/MC/RT","TrtCalibRt-R2-MC-run2-scenario1_04-03",force=True,forceData=True, className="TRTCond::RtRelationMultChanContainer")
conddb.blockFolder("/TRT/Calib/MC/T0")
conddb.addFolderWithTag("TRT_OFL","/TRT/Calib/MC/T0","TrtCalibT0-R2-MC-run2-scenario1_04-03",force=True,forceData=True, className="TRTCond::StrawT0MultChanContainer")
#conddb.blockFolder("/TRT/Calib/MCerrors2d")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCerrors2d" + "<tag> TrtCalibMCErrors2d-IOVdep-2Dfit-00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCslopes")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCslopes" + "<tag> TrtCalibMCSlopes-mc_25ns-2Dfit-00-00 </tag>" , force=True)
from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
TRTMCCalibDBTool=TRT_CalDbTool(name="TRTMCCalibDBTool",RtFolderName="/TRT/Calib/MC/RT",T0FolderName="/TRT/Calib/MC/T0")
#TRTMCCalibDBSvc=TRT_CalDbSvc(name="TRTMCCalibDBSvc",RtFolderName="/TRT/Calib/MC/RT",T0FolderName="/TRT/Calib/MC/T0",ErrorFolderName="/TRT/Calib/MCerrors2d") #,ErrorSlopeFolderName="/TRT/Calib/MCslopes"

#This would add another trtdriftfuntiontool, using the new trtcaldb:
#from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
#InDetTRT_MCDriftFunctionTool = TRT_DriftFunctionTool(name="InDetTRT_MCDriftFunctionTool",TRTCalDbTool=TRTMCCalibDBSvc)
#ToolSvc += InDetTRT_MCDriftFunctionTool
#but instead we'll just add the new trtcaldb to the existing trtdriftfunctiontool:
Exemple #22
0
##SCT####################################################################################
pass
##TRT####################################################################################
pass
##LAr####################################################################################
#preopts
#conddb.addFolderWithTag('LAR_OFL','/LAR/BadChannelsOfl/BadChannels','LArBadChannelsOflBadChannels-IOVDEP-00',forceData=True)
#conddb.addFolderWithTag('LAR_OFL','/LAR/BadChannelsOfl/MissingFEBs','LArBadChannelsOflMissingFEBs-IOVDEP-00',forceData=True)
#if not hasattr (ServiceMgr.ToolSvc, 'LArBadChanTool'):
#    from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool
#    ServiceMgr.ToolSvc += LArBadChanTool()
#    ServiceMgr.ToolSvc.LArBadChanTool.CoolFolder="/LAR/BadChannelsOfl/BadChannels"
#    ServiceMgr.ToolSvc.LArBadChanTool.CoolMissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
conddb.blockFolder('/LAR/BadChannels/BadChannels')
conddb.addFolderWithTag('LAR_OFL',
                        '/LAR/BadChannels/BadChannels',
                        'LArBadChannelsBadChannels-IOVDEP-01',
                        force=True)
conddb.blockFolder('/LAR/BadChannels/MissingFEBs')
conddb.addFolderWithTag('LAR_OFL',
                        '/LAR/BadChannels/MissingFEBs',
                        'LArBadChannelsMissingFEBs-IOVDEP-01',
                        force=True)
if not hasattr(ServiceMgr.ToolSvc, 'LArBadChanTool'):
    from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool
    ServiceMgr.ToolSvc += LArBadChanTool()
    ServiceMgr.ToolSvc.LArBadChanTool.CoolFolder = "/LAR/BadChannels/BadChannels"
    ServiceMgr.ToolSvc.LArBadChanTool.CoolMissingFEBsFolder = "/LAR/BadChannels/MissingFEBs"
##Tile####################################################################################
pass
##Muons###################################################################################
#from MDT_Digitization.MDT_DigitizationConf import MdtDigitizationTool as mdt
Exemple #23
0
from IOVDbSvc.CondDB import conddb

#use MC TRT RT functions
conddb.blockFolder("/TRT/Calib/RT")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Calib/RT",
                        "TrtCalibRt-MCnewDigi_ToTon_7TeV_00-00",
                        force=True,
                        forceMC=True)

#use MC MDT RT functions
conddb.blockFolder("/MDT/RT")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/RT",
                        "MDTRT_Sim-00",
                        force=True,
                        forceMC=True)
conddb.blockFolder("/MDT/RTBLOB")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/RTBLOB",
                        "MDTRT_Sim-00-BLOB",
                        force=True,
                        forceMC=True)

conddb.blockFolder("/PIXEL/HLT/DCS/HV")
conddb.addFolderWithTag("PIXEL_ONL",
                        "/PIXEL/HLT/DCS/HV",
                        "PixDCSHV-UPD1-00",
                        force=True,
                        forceData=True)
conddb.blockFolder("/PIXEL/HLT/DCS/TEMPERATURE")
Exemple #24
0
            #======================================================================
            from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__MistimedStreamMon

            from AthenaCommon.JobProperties import jobproperties
            L1MistimedStreamTool = LVL1__MistimedStreamMon(
                name="L1MistimedStreamTool",
                #OnlineTest = True,
                #OutputLevel = DEBUG
            )
            # ToolSvc += L1MistimedStreamTool
            L1CaloMan.AthenaMonTools += [L1MistimedStreamTool]

            from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc
            ServiceMgr += L1CaloCondSvc()
            from IOVDbSvc.CondDB import conddb
            conddb.addFolderWithTag("TRIGGER","/TRIGGER/L1Calo/V1/Conditions/RunParameters","HEAD")
            conddb.addFolderWithTag("TRIGGER","/TRIGGER/L1Calo/V2/Configuration/ReadoutConfig","HEAD")

        if isData:

            from TrigT1CaloMonitoring.TrigT1CaloMonitoringConf import LVL1__PPMSimBSMon
            PPMSimBSMonTool = LVL1__PPMSimBSMon("PPMSimBSMonTool")
            #ToolSvc += PPMSimBSMonTool
            L1CaloMan.AthenaMonTools += [PPMSimBSMonTool]
            from TrigT1CaloTools.TrigT1CaloToolsConf import LVL1__L1TriggerTowerTool
            L1TriggerTowerTool = LVL1__L1TriggerTowerTool("L1TriggerTowerTool")
            ToolSvc += L1TriggerTowerTool
            from TrigT1CaloCondSvc.TrigT1CaloCondSvcConf import L1CaloCondSvc
            ServiceMgr += L1CaloCondSvc()
            from IOVDbSvc.CondDB import conddb
            conddb.addFolderWithTag("TRIGGER","/TRIGGER/L1Calo/V1/Conditions/RunParameters","HEAD")
# example from Monica Verducci
from MuonCondSvc.MuonCondSvcConf import MuonAlignmentErrorDbSvc
MuonAlignmentErrorDbSvc.OutputLevel = INFO
svcMgr += MuonAlignmentErrorDbSvc()

from MuonCondTool.MuonCondToolConf import MuonAlignmentErrorDbTool
MuonAlignmentErrorDbTool = MuonAlignmentErrorDbTool("MuonAlignmentErrorDbTool")
MuonAlignmentErrorDbTool.OutputLevel = INFO

toolSvc += MuonAlignmentErrorDbTool
#dbConn="sqlite://;schema=test.sqlite;dbname=COMP200" # LOCAL VERSION

svcMgr.IOVDbSvc.OutputLevel = INFO
folder = "/MUONALIGN/ERRS"
tag = 'MuonAlignErrs-RUN1-NOGLOBERRS-02'
conddb.addFolderWithTag('MUONALIGN_OFL', folder, tag)
# LOCAL SQL LIGHT
#svcMgr.IOVDbSvc.dbConnection=dbConn
#svcMgr.IOVDbSvc.Folders+=[folder+" <tag>MuonAlignErrors-TEST-00</tag> <dbConnection>"+dbConn+"</dbConnection>"]
# RUN 1
#svcMgr.IOVDbSvc.Folders+=[folder+" <tag>MuonAlignErrs-RUN1-02</tag>"]
#svcMgr.IOVDbSvc.Folders+=[folder+" <tag>MuonAlignErrs-RUN1-NOGLOBERRS-02</tag>"]
# RUN 2
#svcMgr.IOVDbSvc.Folders+=[folder+" <tag>MuonAlignErrs-RUN1-01</tag>"]
#svcMgr.IOVDbSvc.Folders+=[folder+" <tag>MuonAlignErrs-RUN1-NOGLOBERRS-01</tag>"]

from MuonAlignErrorTool.MuonAlignErrorToolConf import MuonAlign__AlignmentErrorTool
MuonAlignmentErrorTool = MuonAlign__AlignmentErrorTool(
    "MuonAlignmentErrorTool")
MuonAlignmentErrorTool.read_local_file = 0
MuonAlignmentErrorTool.local_input_filename = "./AlignmentUncertaintiesStart2015.txt"
Exemple #26
0
    def __init__(self, name='AtlasTrackingGeometrySvc'):

        if TrkDetFlags.ConfigurationOutputLevel() < 3:
            print('[ Configuration : start ] *** ' + name +
                  ' ********************************')
            print('[ TrackingGeometrySvc ]')

        from AthenaCommon.AppMgr import ToolSvc

        #################################################################################
        # The Geometry Builder
        #################################################################################

        # the name to register the Geometry
        AtlasTrackingGeometryName = 'AtlasTrackingGeometry'

        # the geometry builder alg tool
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder
        AtlasGeometryBuilder = Trk__GeometryBuilder(
            name='AtlasGeometryBuilder')
        # switch the building outputlevel on
        AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
        )

        # the envelope definition service
        from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\
           getService,getServiceClone,getAlgorithm,getAlgorithmClone
        AtlasEnvelopeSvc = getService('AtlasGeometry_EnvelopeDefSvc')

        # (ID)
        if DetFlags.ID_on():
            # get hand on the ID Tracking Geometry Builder
            if TrkDetFlags.ISF_FatrasCustomGeometry():
                if hasattr(ToolSvc,
                           TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()):
                    InDetTrackingGeometryBuilder = getattr(
                        ToolSvc,
                        TrkDetFlags.ISF_FatrasCustomGeometryBuilderName())
            elif TrkDetFlags.XMLFastCustomGeometry():
                if hasattr(ToolSvc,
                           TrkDetFlags.InDetTrackingGeometryBuilderName()):
                    InDetTrackingGeometryBuilder = getattr(
                        ToolSvc,
                        TrkDetFlags.InDetTrackingGeometryBuilderName())
            else:
                if not TrkDetFlags.SLHC_Geometry(
                ) and not TrkDetFlags.InDetStagedGeometryBuilder():
                    from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
                elif not TrkDetFlags.SLHC_Geometry():
                    from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
                else:
                    from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
                InDetTrackingGeometryBuilder = IDGeometryBuilder(
                    name='InDetTrackingGeometryBuilder')

            InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
            )
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder
            #
        # (Calo)
        if DetFlags.Calo_on():
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
            CaloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator")
            CaloVolumeCreator.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel(
            )
            ToolSvc += CaloVolumeCreator

            from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo
            CaloTrackingGeometryBuilder = ConfiguredCaloGeo(
                name='CaloTrackingGeometryBuilder')
            CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator
            CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel(
            )
            CaloTrackingGeometryBuilder.GeometryName = 'Calo'
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder

        # (Muon)
        if DetFlags.Muon_on():
            from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder
            MuonTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder

        # processors
        AtlasGeometryProcessors = []

        # check whether the material retrieval is ment to be from COOL
        if TrkDetFlags.MaterialSource() is 'COOL':
            # the material provider
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider as LayerMaterialProvider
            AtlasMaterialProvider = LayerMaterialProvider(
                'AtlasMaterialProvider')
            AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )
            AtlasMaterialProvider.LayerMaterialMapName = TrkDetFlags.MaterialStoreGateKey(
            )

            AtlasGeometryProcessors += [AtlasMaterialProvider]

            # the tag names
            CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey()
            AtlasMaterialTag = TrkDetFlags.MaterialTagBase() + str(
                TrkDetFlags.MaterialVersion(
                )) + TrkDetFlags.MaterialSubVersion() + '_'

            if TrkDetFlags.ConfigurationOutputLevel() < 3:
                print('[ TrackingGeometrySvc ] Associating DB folder : ',
                      CoolDataBaseFolder)

            # we need the conditions interface
            from IOVDbSvc.CondDB import conddb
            # use a local database
            if TrkDetFlags.MaterialDatabaseLocal():
                # specify the local database
                DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath()
                DataBaseName = TrkDetFlags.MaterialDatabaseLocalName()
                MagicTag = TrkDetFlags.MaterialMagicTag()
                DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>'
                conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2')
                conddb.addFolderWithTag('',
                                        DataBaseConnection +
                                        CoolDataBaseFolder,
                                        AtlasMaterialTag + MagicTag,
                                        force=True)
                if TrkDetFlags.ConfigurationOutputLevel() < 3:
                    print('[ TrackingGeometrySvc ] Using Local Database: ' +
                          DataBaseConnection)
                # make sure that the pool files are in the catalog
            elif TrkDetFlags.SLHC_Geometry():
                # set the folder to the SLHC location
                CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK'
                ctag = AtlasMaterialTag + TrkDetFlags.MaterialMagicTag()
                cfoldertag = CoolDataBaseFolder + ' <tag>' + ctag + '</tag>'
                conddb.addFolderSplitMC('GLOBAL', cfoldertag, cfoldertag)
            else:
                print('[ TrackingGeometrySvc ]     base material tag : ',
                      AtlasMaterialTag)
                cfolder = CoolDataBaseFolder + '<tag>TagInfoMajor/' + AtlasMaterialTag + '/GeoAtlas</tag>'
                print('[ TrackingGeometrySvc ]     translated to COOL: ',
                      cfolder)
                # load the right folders (preparation for calo inclusion)
                conddb.addFolderSplitMC('GLOBAL', cfolder, cfolder)

        elif TrkDetFlags.MaterialSource() is 'Input':
            # the material provider
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__InputLayerMaterialProvider
            AtlasMaterialProvider = Trk__InputLayerMaterialProvider(
                'AtlasMaterialProvider')
            AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )
            AtlasGeometryProcessors += [AtlasMaterialProvider]

        # material validation
        if TrkDetFlags.MaterialValidation():
            # load the material inspector
            from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector
            AtlasLayerMaterialInspector = Trk__LayerMaterialInspector(
                'AtlasLayerMaterialInspector')
            AtlasLayerMaterialInspector.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )

            AtlasGeometryProcessors += [AtlasLayerMaterialInspector]

        # call the base class constructor : sets the tools
        Trk__TrackingGeometrySvc.__init__(self,name,\
                                          GeometryBuilder = AtlasGeometryBuilder,\
                                          TrackingGeometryName = AtlasTrackingGeometryName,\
                                          GeometryProcessors = AtlasGeometryProcessors, \
                                          BuildGeometryFromTagInfo = True,\
                                          OutputLevel = TrkDetFlags.ConfigurationOutputLevel())

        # screen output of the configuration
        if TrkDetFlags.ConfigurationOutputLevel() < 3:
            print(self)
            print('* [ GeometryBuilder       ]')
            print(AtlasGeometryBuilder)
            print('* [ Configuration : end   ] ***' + name +
                  '********************************')
Exemple #27
0
topSequence += CfgMgr.L1CaloPprMonitoring("L1CaloPprMonitoring",
                                          lumiBlockMax = 2,
                                          ppmADCMinValue = 80,
                                          ppmADCMaxValue = 963,
                                          doFineTimePlots = True,
                                          doPedestalPlots = False,
                                          doEtCorrelationPlots = False,
                                          doCaloQualCut = False
                                      )
ToolSvc += CfgMgr.LVL1__TrigT1CaloLWHistogramTool("TrigT1CaloLWHistogramTool", LVL1ConfigSvc = "")

ServiceMgr += CfgMgr.THistSvc()
ServiceMgr.THistSvc.Output = ["AANT DATAFILE='output.root' OPT='RECREATE'"]
ServiceMgr.THistSvc.Output += ["RAMPDATA DATAFILE='graphs.root' OPT='RECREATE'"]
svcMgr.IOVDbSvc.Folders += ["<dbConnection>sqlite://;schema=/afs/cern.ch/user/l/l1ccalib/w0/DaemonData/reference/calibReferences.sqlite;dbname=L1CALO</dbConnection>/TRIGGER/L1Calo/V1/References/FineTimeReferences"]
conddb.addFolderWithTag("TRIGGER", "/TRIGGER/L1Calo/V2/Calibration/Calib1/PprChanCalib", "HEAD")


# override timestamp with SOR time of run
# this overcomes strange timestamps stored in the EventInfo
# code taken from CoolConvUtilities/MagFieldUtils.py
# as soon as the timestamps are fixed this should be skipped
# if 220000 < GetRunNumber() < XXX:
from CoolConvUtilities.AtlCoolLib import indirectOpen
foldername_ = '/TDAQ/RunCtrl/SOR' if svcMgr.IOVDbSvc.DBInstance == 'CONDBR2' else '/TDAQ/RunCtrl/SOR_Params'
db_ = indirectOpen('COOLONL_TDAQ/%s' % svcMgr.IOVDbSvc.DBInstance, oracle=True)
if not db_: raise RuntimeError("Couldn't open connection to TDAQ DB")
folder_ = db_.getFolder(foldername_)
obj_ = folder_.findObject(GetRunNumber() << 32, 0)
payload_ = obj_.payload()
svcMgr.IOVDbSvc.forceTimestamp = payload_['SORTime'] / 1000000000L
Exemple #28
0
from IOVDbSvc.CondDB import conddb
from AthenaCommon.DetFlags import DetFlags
from RecExConfig.RecAlgsFlags import recAlgs
########################################

#use MC MDT RT functions
#conddb.blockFolder("/MDT/RT")
#conddb.addFolderWithTag("MDT_OFL","/MDT/RT","MDTRT_Sim-04",force=True,forceMC=True)
conddb.blockFolder("/MDT/RTBLOB")
conddb.addFolderWithTag("MDT_OFL",
                        "/MDT/RTBLOB",
                        "MDTRT_Sim-04-BLOB",
                        force=True,
                        forceMC=True)

#from Guillaume
conddb.blockFolder("/LAR/LArCellPositionShift")
conddb.addFolderWithTag("LAR_OFL",
                        "/LAR/LArCellPositionShift",
                        "LArCellPositionShift-ideal",
                        force=True,
                        forceMC=True)
conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase",
                   "LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase",
                   "LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
svcMgr.PoolSvc.ReadCatalog += [
    "xmlcatalog_file:" +
    "/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"
]
Exemple #29
0
    #selectEvtNumber.EventList = "goodEvts.txt"

if 'errorScaleDb' in dir() and errorScaleDb != '':

    errScaleDbName = errorScaleDb
    errScaleDbNameSplit = errScaleDbName.rsplit("/", 1)
    if len(errScaleDbNameSplit) > 1:
        errScaleDbName = errScaleDbNameSplit[1]
    from IOVDbSvc.CondDB import conddb
    IOVDbSvc.dbConnection = "sqlite://X;schema=mycool.db;dbname=OFLP200"
    conddb.addFolder(
        "",
        "<dbConnection>sqlite://X;schema=mycool.db;dbname=OFLP200</dbConnection> /MUON/TrkErrorScaling"
        + "<tag>MuonTrkErrorScaling_nominal</tag>",
        force=True)
    conddb.addFolderWithTag(errScaleDbName, '/MUON/TrkErrorScaling',
                            'MuonTrkErrorScaling_nominal')

    from MuonErrorScalingTools.MuonErrorScalingToolsConf import Muon__MuonRIO_OnTrackErrorScalingTool, Muon__MuonErrorScaleDbTool
    muonErrorScaleDbTool = Muon__MuonErrorScaleDbTool(
        "MuonErrorScaleDbTool", OutputLevel=align.OutputLevel())
    ToolSvc += muonErrorScaleDbTool
    muonErrorScalingTool = Muon__MuonRIO_OnTrackErrorScalingTool(
        "MuonRIO_OnTrackErrorScalingTool",
        OutputLevel=align.OutputLevel(),
        ErrorScaleDbTool=muonErrorScaleDbTool)
    ToolSvc += muonErrorScalingTool

    from MuonRecExample import MuonRecTools
    MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool(
        "MdtDriftCircleOnTrackCreator")
    MdtDriftCircleOnTrackCreator.DoErrorScaling = True
#print GeoModelSvc
#print ToolSvc

#Now use MC T0 for TRT during overlay digi, but MC or data T0/Rt during reco, depending on where digit came from... so this stuff is just for reco:
#conddb.blockFolder("/TRT/Calib/MCRT")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCRT" + "<tag> TrtCalibMCRt-13TeV_ArgonScenario1_00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCT0")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCT0" + "<tag> TrtCalibMCT0-13TeV_ArgonScenario1_00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCRT")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection>/TRT/Calib/MCRT" + "<tag> TrtCalibMCRt-13TeV_ArgonScenario1_00-00</tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCT0")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection>/TRT/Calib/MCT0" + "<tag> TrtCalibMCT0-13TeV_ArgonScenario1_00-00</tag>" , force=True)
conddb.blockFolder("/TRT/Calib/MC/RT")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Calib/MC/RT",
                        "TrtCalibRt-R2-MC-run2-scenario1_03-00",
                        force=True,
                        forceData=True)
conddb.addMarkup("/TRT/Calib/MC/RT", "<forceRunNumber>295000</forceRunNumber>")
conddb.blockFolder("/TRT/Calib/MC/T0")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Calib/MC/T0",
                        "TrtCalibT0-R2-MC-run2-scenario1_03-00",
                        force=True,
                        forceData=True)
conddb.addMarkup("/TRT/Calib/MC/T0", "<forceRunNumber>295000</forceRunNumber>")
#conddb.blockFolder("/TRT/Calib/MCerrors2d")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCerrors2d" + "<tag> TrtCalibMCErrors2d-IOVdep-2Dfit-00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCslopes")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCslopes" + "<tag> TrtCalibMCSlopes-mc_25ns-2Dfit-00-00 </tag>" , force=True)
from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
Exemple #31
0
include.block("TrigT1CaloCalibConditions/L1CaloCalibConditions_Overlay.py")

## Overlay DB
from IOVDbSvc.CondDB import conddb

## Add signal MC database, with forceMC=True
conddb.addFolderWithTag(
    "TRIGGER_OFL",
    "<key>/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib</key> /TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib",
    "V2-PHYSICS-CHANCALIB-00-00",
    force=True,
    forceMC=True)
conddb.addFolderWithTag(
    "TRIGGER_OFL",
    "<key>/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults</key> /TRIGGER/L1Calo/V2/Configuration/PprChanDefaults",
    "V2-CHANDEFAULTS-00-00",
    force=True,
    forceMC=True)
conddb.addFolderWithTag(
    "TRIGGER_OFL",
    "<key>/TRIGGER/L1Calo/V2/Conditions/DisabledTowers</key> /TRIGGER/L1Calo/V2/Conditions/DisabledTowers",
    "V2-DISABLEDTOWERS-00-00",
    force=True,
    forceMC=True)
conddb.addFolderWithTag(
    "TRIGGER_OFL",
    "<key>/TRIGGER/L1Calo/V2/Calibration/PpmDeadChannels</key> /TRIGGER/L1Calo/V2/Calibration/PpmDeadChannels",
    "V2-DEADCHANNELS-00-00",
    force=True,
    forceMC=True)