def CaloCellPedestalCorrDefault(name='CaloCellPedestalCorr'):
    import traceback
    from AthenaCommon.Logging import logging
    mlog = logging.getLogger('CaloCellPedestalCorrDefault')
    from AthenaCommon.AppMgr import ToolSvc
    from AthenaCommon.GlobalFlags import globalflags

    try:
        from CaloCellCorrection.CaloCellCorrectionConf import CaloCellPedestalCorr
        theCaloCellPedestalCorr = CaloCellPedestalCorr("CaloCellPedestalCorr")
    except:
        mlog.error("could not get handle to CaloCellPedestalCorr Quit")
        print traceback.format_exc()
    ToolSvc += theCaloCellPedestalCorr

    try:
        from CaloRec.CaloRecConf import CaloCellContainerCorrectorTool
        from CaloIdentifier import SUBCALO
        thePedestalTool = CaloCellContainerCorrectorTool(
            "PedestalTool",
            CaloNums=[SUBCALO.NSUBCALO],
            CellCorrectionToolNames=[theCaloCellPedestalCorr])
    except:
        mlog.error(
            "could not get handle to CaloCellContainerCorrectorTool Quit")
        print traceback.format_exc()
        return False

    if globalflags.DataSource() == 'data':
        from IOVDbSvc.CondDB import conddb
        if conddb.isOnline:
            folder = '/CALO/Pedestal/CellPedestal'
            conddb.addFolder('CALO_ONL', folder)
        else:
            folder = '/CALO/Ofl/Pedestal/CellPedestal'
            conddb.addFolder('CALO_OFL', folder)
        theCaloCellPedestalCorr.FolderName = folder
        theCaloCellPedestalCorr.isMC = False
    else:
        theCaloCellPedestalCorr.isMC = True

    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    from CaloRec.CaloCellFlags import jobproperties
    if globalflags.DataSource() == 'data' and (
            not jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr()) and (
                not athenaCommonFlags.isOnline()):
        lumiFolder = '/TRIGGER/LUMI/LBLESTONL'
        conddb.addFolder('TRIGGER_ONL', lumiFolder)
        theCaloCellPedestalCorr.Luminosity = -1
        theCaloCellPedestalCorr.LumiFolderName = lumiFolder

    if jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr() and (
            not athenaCommonFlags.isOnline()):
        from CaloTools.CaloLumiBCIDToolDefault import CaloLumiBCIDToolDefault
        theCaloLumiBCIDTool = CaloLumiBCIDToolDefault()
        ToolSvc += theCaloLumiBCIDTool
        theCaloCellPedestalCorr.LumiBCIDTool = theCaloLumiBCIDTool

    return thePedestalTool
    def __init__(self):

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from AthenaCommon.AppMgr import ToolSvc

        from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc

        # Init PixelLorentzAngleSvc
        if hasattr(svcMgr, 'PixelLorentzAngleSvc'):
            pixelLorentzAngleSvc = svcMgr.PixelLorentzAngleSvc
        else:
            pixelLorentzAngleSvc = SiLorentzAngleSvc(
                name="PixelLorentzAngleSvc", DetectorName="Pixel")
            svcMgr += pixelLorentzAngleSvc

        # Init PixelSiliconConditionsSvc
        if hasattr(svcMgr, 'PixelSiliconConditionsSvc'):
            pixelSiliconConditionsSvc = svcMgr.PixelSiliconConditionsSvc
        else:
            from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc
            pixelSiliconConditionsSvc = PixelSiliconConditionsSvc()
            svcMgr += pixelSiliconConditionsSvc

        pixelSiliconConditionsSvc.DepletionVoltage = 10.0

        from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc
        pixelSiPropertiesSvc = SiPropertiesSvc(
            name="PixelSiPropertiesSvc",
            DetectorName="Pixel",
            SiConditionsServices=pixelSiliconConditionsSvc)
        svcMgr += pixelSiPropertiesSvc

        # Pass the silicon conditions services to the Lorentz angle service
        # Also make sure UseMagFieldTool is True as AtlasGeoModel sets this to False
        # if loaded first.
        pixelLorentzAngleSvc.UseMagFieldSvc = True
        pixelLorentzAngleSvc.SiConditionsServices = pixelSiliconConditionsSvc
        pixelLorentzAngleSvc.SiPropertiesSvc = pixelSiPropertiesSvc
        #pixelLorentzAngleSvc.CorrectionFactor = 0.900
        #Load Correction factor from database
        from IOVDbSvc.CondDB import conddb
        #conddb.addFolder("","/PIXEL/LorentzAngleScale<db>sqlite://;schema=PixelLorentzAngle_MC.db;dbname=OFLP200</db><tag>PIXELLorentzAngleScale-Simu-001</tag>")
        #conddb.addFolder("PIXEL_OFL","/PIXEL/LorentzAngleScale")

        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        if athenaCommonFlags.isOnline():
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/LorentzAngleScale",
                                        "/PIXEL/LorentzAngleScale")
        else:
            conddb.addFolder("PIXEL_OFL", "/PIXEL/LorentzAngleScale")
        pixelLorentzAngleSvc.CorrDBFolder = "/PIXEL/LorentzAngleScale"

        self.PixelLorentzAngleSvc = pixelLorentzAngleSvc
        self.pixelSiliconConditionsSvc = pixelSiliconConditionsSvc
        self.PixelSiliconConditionsSvc = pixelSiliconConditionsSvc
        self.pixelSiPropertiesSvc = pixelSiPropertiesSvc
        self.PixelSiPropertiesSvc = pixelSiPropertiesSvc

        self.PixelSiPropertiesSvc.UseConditionsDB = True
Exemplo n.º 3
0
def HLTPrescaleCondAlgCfg(flags):
    log = logging.getLogger('TrigConfigSvcCfg')
    log.info("Setting up HLTPrescaleCondAlg")
    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
    acc = ComponentAccumulator()
    TrigConf__HLTPrescaleCondAlg = CompFactory.getComp(
        "TrigConf::HLTPrescaleCondAlg")
    hltPrescaleCondAlg = TrigConf__HLTPrescaleCondAlg("HLTPrescaleCondAlg")

    tc = getTrigConfigFromFlag(flags)
    hltPrescaleCondAlg.Source = tc["source"]
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.isOnline():
        from IOVDbSvc.IOVDbSvcConfig import addFolders
        acc.merge(
            addFolders(flags,
                       getHLTPrescaleFolderName(),
                       "TRIGGER_ONL",
                       className="AthenaAttributeList"))
        log.info("Adding folder %s to CompAcc", getHLTPrescaleFolderName())
    if tc["source"] == "COOL":
        hltPrescaleCondAlg.TriggerDB = tc["dbconn"]
    elif tc["source"] == "DB":
        hltPrescaleCondAlg.TriggerDB = tc["dbconn"]
        hltPrescaleCondAlg.HLTPsk = tc["hltpsk"]
    elif tc["source"] == "FILE":
        hltPrescaleCondAlg.Filename = getHLTPrescalesSetFileName(flags)
    else:
        raise RuntimeError(
            "trigger configuration flag 'trigConfig' starts with %s, which is not understood"
            % tc["source"])
    acc.addCondAlgo(hltPrescaleCondAlg)
    return acc
Exemplo n.º 4
0
    def initLorentzAngleTool(self, instanceName):
        # Set up Silicon Conditions Tool
        from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup
        sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup()
        sct_SiliconConditionsToolSetup.setDcsTool(self.dcsTool)
        sct_SiliconConditionsToolSetup.setToolName(
            "InDetSCT_SiliconConditionsTool")
        sct_SiliconConditionsToolSetup.setup()
        sctSiliconConditionsTool = sct_SiliconConditionsToolSetup.getTool()
        sctSiliconConditionsTool.CheckGeoModel = False
        sctSiliconConditionsTool.ForceUseGeoModel = False
        if self._print: print(sctSiliconConditionsTool)

        # Set up SCTSiLorentzAngleCondAlg
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")
        if not hasattr(condSeq, "SCTSiLorentzAngleCondAlg"):
            from SiLorentzAngleTool.SiLorentzAngleToolConf import SCTSiLorentzAngleCondAlg
            from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
            condSeq += SCTSiLorentzAngleCondAlg(
                name="SCTSiLorentzAngleCondAlg",
                SiConditionsTool=sctSiliconConditionsTool,
                UseMagFieldCache=True,
                UseMagFieldDcs=(not athenaCommonFlags.isOnline()))
            sctSiLorentzAngleCondAlg = condSeq.SCTSiLorentzAngleCondAlg

        "Inititalize Lorentz angle Tool"
        from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
        SCTLorentzAngleTool = SiLorentzAngleTool(
            name=instanceName,
            DetectorName="SCT",
            SiLorentzAngleCondData="SCTSiLorentzAngleCondData")
        SCTLorentzAngleTool.UseMagFieldCache = True
Exemplo n.º 5
0
def _setup():
    from PyUtils.MetaReader import read_metadata

    from AthenaCommon.Logging import logging
    msg = logging.getLogger('MetaReader')

    global metadata
    global metadata_all_files

    # get input file name
    from RecExConfig.RecoFunctions import InputFileNames

    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.isOnline() and (not InputFileNames() or all(
        [f.strip() == '' for f in InputFileNames()])):
        # set minimal items of inputFileSummary
        metadata = {
            'file_type': 'BS',
            'eventTypes': ['IS_DATA', 'IS_ATLAS', 'IS_PHYSICS'],
            'TagStreamsRef': ''
        }
    else:
        inFiles = InputFileNames()
        if len(inFiles) < 1:
            msg.warning("No input files specified yet! Cannot do anything.")
            return

        metadata_all_files = read_metadata(inFiles,
                                           mode='peeker',
                                           promote=True)

        first_filename = inFiles[0]

        metadata = metadata_all_files[first_filename]
        metadata['file_name'] = first_filename
Exemplo n.º 6
0
def GetProjectName():
    # special option for online running
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.isOnline():
        from RecExOnline.OnlineISConfiguration import GetRunType
        rec.projectName = GetRunType()[2]
    # continue with options for offline running
    if rec.projectName() == "":
        from PyUtils.MetaReaderPeeker import metadata
        whatIsIt = None
        try:
            whatIsIt = metadata['eventTypes'][0]
        except:
            pass
        if whatIsIt == 'IS_SIMULATION':
            project = 'IS_SIMULATION'
        else:
            try:
                project = metadata['project_name']
            except:
                from RecExConfig.GetCool import cool
                project = cool.fileNameTag()
            pass
        #rec.projectName.set_Value_and_Lock(project)
        logAutoConfiguration.info(
            "Success! GetProjectName() found a project named %s" % project)
    else:
        project = rec.projectName()
    if not project in KnownProjects:
        logAutoConfiguration.warning(
            "Project '%s' is not part of the KnownProjects list." % project)
        #print(KnownProjects)

    return project
Exemplo n.º 7
0
def AtlasFieldMapCondAlg(name="AtlasFieldMapCondAlg", **kwargs):
    if athenaCommonFlags.isOnline():
        # For old tests, must update field from defautl jobOpt
        kwargs.setdefault("UseMapsFromCOOL", False)
        # online has the map loaded at start (for the future - uncomment if needed)
        # kwargs.setdefault( "LoadMapOnStart", True )

    return CfgMgr.MagField__AtlasFieldMapCondAlg(name, **kwargs)
Exemplo n.º 8
0
def AtlasFieldSvc(name="AtlasFieldSvc", **kwargs):
    if athenaCommonFlags.isOnline():
        kwargs.setdefault("UseDCS", False)
        kwargs.setdefault("UseSoleCurrent", 7730)
        kwargs.setdefault("UseToroCurrent", 20400)
    else:
        kwargs.setdefault("UseDCS", True)

    return CfgMgr.MagField__AtlasFieldSvc(name, **kwargs)
Exemplo n.º 9
0
    def __init__(self, name='TrigCaloDataAccessSvc'):
        super(TrigCaloDataAccessSvc, self).__init__(name)

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from TriggerJobOpts.TriggerFlags import TriggerFlags
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaCommon.Logging import logging
        log = logging.getLogger(name)


        if ( globalflags.DatabaseInstance == "COMP200" and TriggerFlags.doCaloOffsetCorrection() ) :
            log.warning("Not possible to run BCID offset correction with COMP200")
        else:
            if TriggerFlags.doCaloOffsetCorrection():
                if globalflags.DataSource()=='data' and athenaCommonFlags.isOnline():
                    log.info('Enable HLT calo offset correction for data')
                    from IOVDbSvc.CondDB import conddb
                    conddb.addFolder("LAR_ONL","/LAR/ElecCalibFlat/OFC")
                    from LArRecUtils.LArRecUtilsConf import LArFlatConditionSvc
                    svcMgr += LArFlatConditionSvc()
                    svcMgr.LArFlatConditionSvc.OFCInput="/LAR/ElecCalibFlat/OFC"
                    svcMgr.ProxyProviderSvc.ProviderNames += [ "LArFlatConditionSvc" ]

                    from IOVDbSvc.CondDB import conddb
                    conddb.addFolder("LAR_ONL","/LAR/ElecCalibFlat/OFC",className = 'CondAttrListCollection')

                    from AthenaCommon.AlgSequence import AthSequencer
                    condSequence = AthSequencer("AthCondSeq")
                    from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArOFCFlat_ as LArOFCCondAlg
                    condSequence += LArOFCCondAlg (ReadKey="/LAR/ElecCalibFlat/OFC", WriteKey='LArOFC')
                    from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault
                    LuminosityCondAlgOnlineDefault()
                    from CaloRec.CaloBCIDAvgAlgDefault import CaloBCIDAvgAlgDefault
                    CaloBCIDAvgAlgDefault()
                else:
                    log.info('Enable HLT calo offset correction for MC')
                    from CaloRec.CaloBCIDAvgAlgDefault import CaloBCIDAvgAlgDefault
                    CaloBCIDAvgAlgDefault()

                from AthenaCommon.AlgSequence import AlgSequence
                topSequence = AlgSequence()
                if not hasattr(topSequence,"CaloBCIDAvgAlg"):
                    log.info('Cannot use timer for CaloBCIDAvgAlg')
                else:
                    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
                    monTool = GenericMonitoringTool('MonTool')
                    monTool.defineHistogram('TIME_exec', path='EXPERT', type='TH1F', title="CaloBCIDAvgAlg execution time; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=4000)
                    topSequence.CaloBCIDAvgAlg.MonTool = monTool
                    log.info('using timer for CaloBCIDAvgAlg')


            else:
                log.info('Disable HLT calo offset correction')

        return
Exemplo n.º 10
0
def AtlasFieldCacheCondAlg(name="AtlasFieldCacheCondAlg", **kwargs):
    if athenaCommonFlags.isOnline():
        kwargs.setdefault("UseDCS", False)
        # currents for scaling wrt to map currents
        kwargs.setdefault("UseSoleCurrent", 7730)
        kwargs.setdefault("UseToroCurrent", 20400)
        kwargs.setdefault("LockMapCurrents", True)
    else:
        kwargs.setdefault("UseDCS", True)
    return CfgMgr.MagField__AtlasFieldCacheCondAlg(name, **kwargs)
Exemplo n.º 11
0
def _setup():

    global inputFileSummary
    import os
    from RecExConfig.RecFlags import rec
    import AthenaCommon.Logging as L
    from AthenaCommon.Resilience import treatException

    #define a logger
    msg = L.logging.getLogger('inputFilePeeker' )
    msg.info("Executing   inputFilePeeker.py")

    # special setup for online reconstruction so far
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.isOnline():
        # set minimal items of inputFileSummary
        inputFileSummary={'file_type':'bs',
                          'evt_type':['IS_DATA','IS_ATLAS','IS_PHYSICS'],
                          'TagStreamsRef':''}
        return
    
    #get input file name
    from RecExConfig.RecoFunctions import InputFileNames
    inFiles=InputFileNames()
    if len(inFiles) < 1:
        msg.error("No input files specified yet! Cannot do anything.")

    #create and fill inputFileSummary (DC: looping through input files if necessary)
    import PyUtils.AthFile as athFile
    failed_trials = 0
    for inFile in inFiles:
        try:
            fi = athFile.fopen(inFile)
            inputFileSummary = fi.fileinfos
        except Exception,err:
            msg.warning("Unable to open file [%s]"%inFile)
            msg.warning('caught:\n%s',err)
            import traceback
            traceback.print_exc()
            continue

        ## Making sure that stream_names is always defined
        if not inputFileSummary.has_key('stream_names'):
            msg.warning("AthFile didn't find key 'stream_names'. Recovering it but that's unexpected.")
            inputFileSummary['stream_names']=[]
        
        #First try to catch the no entries case
        if inputFileSummary['stream_names'] == []:
            try:
                #print fi.infos['metadata_items'][0][1]
                inputFileSummary['stream_names'] = [fi.infos['metadata_items'][0][1]]
            except Exception, err:
                msg.info("Unable to find stream names in file metadata.")
Exemplo n.º 12
0
    def __init__(self, name='TrigDataAccess'):
        super(TrigDataAccess, self).__init__(name)

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from TriggerJobOpts.TriggerFlags import TriggerFlags
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaCommon.Logging import logging
        log = logging.getLogger(name)

        self.loadFullCollections = (TriggerFlags.doEF()
                                    or TriggerFlags.doHLT())
        self.loadAllSamplings = (TriggerFlags.doLVL2() or TriggerFlags.doHLT())

        if (globalflags.DatabaseInstance == "COMP200"
                and TriggerFlags.doCaloOffsetCorrection()):
            self.ApplyOffsetCorrection = False
            log.warning(
                "Not possible to run BCID offset correction with COMP200")
        else:
            if TriggerFlags.doCaloOffsetCorrection():
                log.info('Enable HLT calo offset correction')
                if globalflags.DataSource(
                ) == 'data' and athenaCommonFlags.isOnline():
                    from IOVDbSvc.CondDB import conddb
                    conddb.addFolder("LAR_ONL", "/LAR/ElecCalibFlat/OFC")
                    from LArRecUtils.LArRecUtilsConf import LArFlatConditionSvc
                    svcMgr += LArFlatConditionSvc()
                    svcMgr.LArFlatConditionSvc.OFCInput = "/LAR/ElecCalibFlat/OFC"
                    svcMgr.ProxyProviderSvc.ProviderNames += [
                        "LArFlatConditionSvc"
                    ]

                from CaloTools.CaloLumiBCIDToolDefault import CaloLumiBCIDToolDefault
                theCaloLumiBCIDTool = CaloLumiBCIDToolDefault()
                svcMgr.ToolSvc += theCaloLumiBCIDTool
                self.CaloLumiBCIDTool = theCaloLumiBCIDTool
                self.ApplyOffsetCorrection = True
            else:
                log.info('Disable HLT calo offset correction')
                self.ApplyOffsetCorrection = False

        from RecExConfig.RecFlags import rec
        transientBS = (rec.readRDO()
                       and not globalflags.InputFormat() == 'bytestream')
        if (transientBS or TriggerFlags.writeBS()):
            if (not hasattr(svcMgr.ToolSvc, 'LArRawDataContByteStreamTool')):
                from LArByteStream.LArByteStreamConfig import LArRawDataContByteStreamToolConfig
                svcMgr.ToolSvc += LArRawDataContByteStreamToolConfig()
            svcMgr.ToolSvc.LArRawDataContByteStreamTool.DSPRunMode = 4
            svcMgr.ToolSvc.LArRawDataContByteStreamTool.RodBlockVersion = 10

        return
Exemplo n.º 13
0
def GetRunNumber():
    runNb = None
    from RecExConfig.RecFlags import rec
    if rec.RunNumber.isDefault():
        from PyUtils.MetaReaderPeeker import metadata
        try:
            runNb = metadata['runNumbers'][0]
        except Exception:
            from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
            if not athenaCommonFlags.isOnline():
                logAutoConfiguration.error("No RunNumber stored in InputFile!")
    else:
        runNb = rec.RunNumber()
    logAutoConfiguration.debug("RunNumber is: %s", runNb)
    return runNb
Exemplo n.º 14
0
def GetRunNumber():
    runNb = None
    from RecExConfig.RecFlags import rec
    if rec.RunNumber.isDefault():
        from RecExConfig.InputFilePeeker import inputFileSummary
        try:
            runNb = inputFileSummary['run_number'][0]
        except Exception:
            from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
            if not athenaCommonFlags.isOnline():
                logAutoConfiguration.error("No RunNumber stored in InputFile!")
    else:
        runNb = rec.RunNumber()
    logAutoConfiguration.debug("RunNumber is: %s", runNb)
    return runNb
Exemplo n.º 15
0
def CscCalibTool(name, **kwargs):
    import MuonCondAlg.CscCondDbAlgConfig  # MT-safe conditions access
    # make tool
    return CfgMgr.CscCalibTool(Slope=0.19,
                               Noise=3.5,
                               Pedestal=2048.0,
                               ReadFromDatabase=True,
                               SlopeFromDatabase=False,
                               integrationNumber=12.0,
                               integrationNumber2=11.66,
                               samplingTime=50.0,
                               signalWidth=14.40922,
                               timeOffset=71.825,
                               IsOnline=athenaCommonFlags.isOnline(),
                               Latency=119)
Exemplo n.º 16
0
def CscCalibTool(name, **kwargs):
    # setup condDB folders
    setupCscCondDB()
    # make tool
    return CfgMgr.CscCalibTool(Slope=0.19,
                               Noise=3.5,
                               Pedestal=2048.0,
                               ReadFromDatabase=True,
                               SlopeFromDatabase=False,
                               integrationNumber=12.0,
                               integrationNumber2=11.66,
                               samplingTime=50.0,
                               signalWidth=14.40922,
                               timeOffset=71.825,
                               IsOnline=athenaCommonFlags.isOnline(),
                               Latency=119)
Exemplo n.º 17
0
def CaloCellPedestalCorrDefault(name='CaloCellPedestalCorr'):
   import traceback
   from AthenaCommon.Logging import logging 
   mlog = logging.getLogger( 'CaloCellPedestalCorrDefault' )
   from AthenaCommon.AppMgr import ToolSvc
   from AthenaCommon.GlobalFlags import globalflags

   try:
        from CaloCellCorrection.CaloCellCorrectionConf import CaloCellPedestalCorr
        theCaloCellPedestalCorr =  CaloCellPedestalCorr("CaloCellPedestalCorr")
   except:
       mlog.error("could not get handle to CaloCellPedestalCorr Quit")
       traceback.print_exc()
   #ToolSvc += theCaloCellPedestalCorr

   if globalflags.DataSource()=='data' :
       from IOVDbSvc.CondDB import conddb
       if conddb.isOnline:
           folder  = '/CALO/Pedestal/CellPedestal'
           conddb.addFolder('CALO_ONL',folder,className="CondAttrListCollection")
       else:
           folder= '/CALO/Ofl/Pedestal/CellPedestal'
           conddb.addFolder('CALO_OFL',folder,className="CondAttrListCollection")
       theCaloCellPedestalCorr.PedestalShiftFolder = folder
       theCaloCellPedestalCorr.isMC=False
   else:
       theCaloCellPedestalCorr.isMC=True

   from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
   from CaloRec.CaloCellFlags import jobproperties
   if globalflags.DataSource()=='data' and (not jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr()) and (not athenaCommonFlags.isOnline()):
      lumiFolder = '/TRIGGER/LUMI/LBLESTONL'
      conddb.addFolder('TRIGGER_ONL',lumiFolder,className="CondAttrListCollection");
      theCaloCellPedestalCorr.Luminosity = -1
      theCaloCellPedestalCorr.LumiFolderName = lumiFolder

   if jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr() and (not athenaCommonFlags.isOnline()):
      from CaloRec.CaloBCIDAvgAlgDefault import CaloBCIDAvgAlgDefault
      CaloBCIDAvgAlgDefault()
      theCaloCellPedestalCorr.CaloBCIDAverageKey="CaloBCIDAverage"
   else:
      theCaloCellPedestalCorr.CaloBCIDAverageKey=""


   return theCaloCellPedestalCorr
Exemplo n.º 18
0
    def setupCOOLDCS(self,
                     defTag="",
                     dbConnection="",
                     useHV=True,
                     useHVSET=False,
                     useSTATUS=True):
        """
        Call this function to read DCS from COOL folder.
        Input parameters:
        - defTag          : Tag to be added to each folder tag (NGO change this to a hierarchical tag!)
        - dbConnection    : The DB connection string to use [default "": auto-initialization by CondDBSetup.py]
        """

        #=== prevent a second initialization
        if self._coolDCSIsConfigured:
            self._msg.info(
                "setupCOOLDCS already called previously, ignoring this repeated call!"
            )
            return
        self._coolDCSIsConfigured = True

        ##     #=== ensure the availability of TileDCSSvc
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        TileUseDCS = (not athenaCommonFlags.isOnline()
                      ) and globalflags.DataSource() == 'data'
        ## get a handle to the ServiceManager
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        if TileUseDCS and not hasattr(svcMgr, "TileDCSSvc"):
            self._msg.info("setting up DCS TileCal conditions data")
            dbConnStr = 'DCS_OFL'
            from IOVDbSvc.CondDB import conddb
            if useHV: conddb.addFolder(dbConnStr, "/TILE/DCS/HV")
            if useHVSET: conddb.addFolder(dbConnStr, "/TILE/DCS/HVSET")
            if useSTATUS: conddb.addFolder(dbConnStr, "/TILE/DCS/STATES")
            self._msg.info("Adding TileDCSSvc to ServiceMgr")
            svcMgr += CfgMgr.TileDCSSvc()

            from IOVDbSvc.CondDB import conddb
            if (conddb.GetInstance() == 'CONDBR2'):
                self._msg.info("setting up TileDCSSvc for RUN2")
                svcMgr.TileDCSSvc.Version = 2
            else:
                self._msg.info("setting up TileDCSSvc for RUN1")
                svcMgr.TileDCSSvc.Version = 1
Exemplo n.º 19
0
    def addArray(self,
                 dimensions,
                 alg,
                 baseName,
                 topPath='',
                 defaultDuration='run'):
        '''Add many groups to an algorithm

        Arguments:
        dimensions -- list holding the size in each dimension [n1,n2,n3,n4,...]
        alg -- algorithm Configurable object
        baseName -- base name of the group. postfixes are added by GMT Array initialize
        topPath -- directory name in the output ROOT file under which histograms will be
                   produced
        duration -- default time between histogram reset for all histograms in group

        Returns:
        array -- a GenericMonitoringToolArray object. This is used to define histograms
                 associated with each group in the array.
        '''
        # Generate the n-dimensional array
        from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringArray
        array = GenericMonitoringArray(baseName, dimensions)
        # Retrieve the THistSvc
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        if not hasattr(svcMgr, 'THistSvc'):
            from GaudiSvc.GaudiSvcConf import THistSvc
            svcMgr += THistSvc()
        # Set the histogram path
        pathToSet = self.dqflags.monManFileKey() + ('/%s' %
                                                    topPath if topPath else '')
        # Detect if online or offline
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        conventionName = 'OFFLINE' if not athenaCommonFlags.isOnline(
        ) else 'ONLINE'

        # Broadcast member values to each element of the array
        array.broadcast('THistSvc', svcMgr.THistSvc)
        array.broadcast('HistPath', pathToSet)
        array.broadcast('convention', conventionName)
        array.broadcast('defaultDuration', defaultDuration)
        alg.GMTools += array.toolList()
        return array
Exemplo n.º 20
0
    def setAlg(self):
        hvFolder = "/PIXEL/DCS/HV"
        tempFolder = "/PIXEL/DCS/TEMPERATURE"
        dbInstance = "DCS_OFL"

        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        if athenaCommonFlags.isOnline():
            hvFolder = "/PIXEL/HLT/DCS/HV"
            tempFolder = "/PIXEL/HLT/DCS/TEMPERATURE"
            dbInstance = "PIXEL_ONL"

        from IOVDbSvc.CondDB import conddb
        if not conddb.folderRequested(hvFolder):
            conddb.addFolder(dbInstance,
                             hvFolder,
                             className="CondAttrListCollection")
        if not conddb.folderRequested(tempFolder):
            conddb.addFolder(dbInstance,
                             tempFolder,
                             className="CondAttrListCollection")

        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")

        if not hasattr(condSeq, "PixelDCSCondHVAlg"):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg
            condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg",
                                         ReadKey=hvFolder)

        if not hasattr(condSeq, "PixelDCSCondTempAlg"):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg
            condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg",
                                           ReadKey=tempFolder)

        from AthenaCommon.AppMgr import ToolSvc
        if not hasattr(condSeq, "PixelSiPropertiesCondAlg"):
            from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
            condSeq += PixelSiPropertiesCondAlg(
                name="PixelSiPropertiesCondAlg")
        self.alg = getattr(condSeq, "PixelSiPropertiesCondAlg")
Exemplo n.º 21
0
#from LArCellRec.LArNoisyROFlags import larNoisyROFlags

# --- for athena online running ---
if 'EventBlockSize' not in dir():
    EventBlockSize = 0

#Run is Online or Offline:
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
OnlineMode = athenaCommonFlags.isOnline()

#some FEBs to be monitored (updated 04 may 2018)
MiniNoiseBurstFlagging_FEBs = [
    "barrelAft09slot02", "barrelAft09slot14", "barrelAft10slot10",
    "barrelAft10slot14", "barrelAft31slot14", "barrelCft08slot14",
    "barrelCft22slot07", "barrelCft27slot05", "barrelCft27slot14"
]
NewlyNoisy_FEBs = [
    "barrelCft02slot14", "barrelCft01slot14", "barrelCft07slot09",
    "barrelCft07slot11", "barrelCft06slot14"
]
NoisyRegionsInOuterWheel_FEBs = [
    "endcapCft21slot04", "endcapCft21slot02", "endcapCft02slot04",
    "endcapCft02slot02", "endcapCft09slot02", "endcapCft09slot03",
    "endcapAft21slot04", "endcapAft21slot02", "endcapAft21slot03"
]
NotNoisyRegionForComparison_FEBs = ["endcapAft02slot04"]
FEBs_from_DQ_run_350440 = [
    "endcapAft19slot12", "endcapAft19slot09", "endcapAft20slot09"
]

defaultFEBs = NotNoisyRegionForComparison_FEBs + NoisyRegionsInOuterWheel_FEBs + NewlyNoisy_FEBs + MiniNoiseBurstFlagging_FEBs + FEBs_from_DQ_run_350440
Exemplo n.º 22
0
if TilePedRun:
    TileRunType = 4
    TileBiGainRun = True

if not 'TileCisRun' in dir():
    TileCisRun = False

if TileCisRun:
    TileRunType = 8
    TileBiGainRun = True



from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
if not 'TileSummaryUpdateFrequency' in dir():
    if athenaCommonFlags.isOnline():
        TileSummaryUpdateFrequency = 100
    else:
        TileSummaryUpdateFrequency = 0

def FindFile(path, runinput):

    run = str(runinput)

    while len(run) < 7:
        run = '0' + run
        
    files = []
    fullname = []

    if path.startswith("/castor") :
Exemplo n.º 23
0
if DQMonFlags.monManEnvironment() == 'tier0Raw':
    tileRawMon=True
    tileESDMon=False
elif DQMonFlags.monManEnvironment() == 'tier0ESD':
    tileRawMon=False
    tileESDMon=True
else: # it should be 'tier0'
    tileRawMon=True
    tileESDMon=True

if tileESDMon:

    TileCellMon = CfgMgr.TileCellMonTool(name                 = 'TileCellMon'
                                         , OutputLevel        = INFO
                                         , doOnline           = athenaCommonFlags.isOnline()
                                         , cellsContainerName = "AllCalo"
                                         , FillHistogramsForL1Triggers = []
                                         , FillChannelTimePerSampleHistograms = False
                                         , FillCellTimeAndEnergyDifferenceHistograms = False
                                         , FillDigitizerEnergyVsLBHistograms = False
                                         , histoPathBase      = "/Tile/Cell")

    if (jobproperties.Beam.beamType() == 'cosmics' or jobproperties.Beam.beamType() == 'singlebeam'):
        TileCellMon.FillTimeHistograms = True
        TileCellMon.energyThresholdForTime = 150.0
        
    ToolSvc += TileCellMon;    
    ManagedAthenaTileMon.AthenaMonTools += [ TileCellMon ];

Exemplo n.º 24
0
tileInfoConfigurator.setupCOOLINTEGRATOR()
tileInfoConfigurator.setupCOOLMUID()
tileInfoConfigurator.setupCOOLPHYPULSE()
tileInfoConfigurator.setupCOOLAutoCr()

#============================================================
#=== configure TileInfoDump
#============================================================
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
topSequence += xAODMaker__EventInfoCnvAlg()
from TileCalibAlgs.TileCalibAlgsConf import TileInfoDump
tileInfoDump = TileInfoDump()
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
tileInfoDump.AthenaIsOnline = athenaCommonFlags.isOnline()

#=== add private fit method noise tool
from TileConditions.TileCondToolConf import getTileCondToolNoiseRawChn
tileInfoDump.TileCondToolNoiseRawChn = getTileCondToolNoiseRawChn('COOL')

#=== switch section printout on/off
tileInfoDump.PrintEmscale = True
tileInfoDump.PrintEmscaleOnl = True
tileInfoDump.PrintLaser = True
tileInfoDump.PrintIntegrator = True
tileInfoDump.PrintPedestals = True
tileInfoDump.PrintTimingCorrections = True  # set also run type below
tileInfoDump.PrintBadChannels = True
tileInfoDump.PrintPulseShapes = True  # set also run type below
tileInfoDump.PrintOfcsCool = True  # set also run type below
Exemplo n.º 25
0
    globalflags.InputFormat.set_Value_and_Lock('pool')
    athenaCommonFlags.PoolRDOInput.set_Value_and_Lock( runArgs.inputRDOFile )

    #include("RecExCommon/RecExCommon_topOptions.py")
    ServiceMgr.EventSelector.InputCollections = runArgs.inputRDOFile
    # ConditionsTag
    from IOVDbSvc.CondDB import conddb
    if len(globalflags.ConditionsTag())!=0:
        conddb.setGlobalTag(globalflags.ConditionsTag())
    include("RecExCond/AllDet_detDescr.py")
    # Particle Property
    protectedInclude( "PartPropSvc/PartPropSvc.py" )
    include.block( "PartPropSvc/PartPropSvc.py" )

    # Detector Status
    if rec.doDetStatus() and not athenaCommonFlags.isOnline():
        try:
            include("DetectorStatus/DetStatusSvc_CondDB.py")
        except Exception:
            treatException("Could not load DetStatusSvc_CondDb !")
        rec.doFileMetaData=False
else:
    raise RuntimeError('No FTK inputs given. A TXT_FTKIP, NTUP_FTKIP or RDO file is mandatory.')

# Set output file
if hasattr(runArgs,'outputNTUP_FTKTMPFile'):
    FTKTrackFitter.TrackFileName = runArgs.outputNTUP_FTKTMPFile
else:
    ftkLog.warning('FTK Sim output filename was unset')

#check if we want to save 1st stage tracks
Exemplo n.º 26
0
 DistanceToStraw              = 0.4,
 LongToTCut                   = 9.375,
 is_TRT_only_tracks           = True, # obsolete
 is_zero_mag_field            = True, # obsolete
 #Histogram Switches
 doAside                      = True, # obsolete
 doCside                      = True, # obsolete
 doStraws                     = True,
 doChips                      = True,
 doShift                      = True,
 doDiagnostic                 = True, # obsolete
 EventBurstCut                = eventBurstCut, # default = 200
 DoRDOsMon                    = True,
 DoGeoMon                     = False,
 DoTracksMon                  = True,
 doExpert                     = athenaCommonFlags.isOnline(),
 IsCosmics                    = InDetFlags.doCosmics(),
 InDetTRT_DAQ_ConditionsSvc   = InDetTRT_DAQ_ConditionsSvc,
 doEfficiency                 = False, # ME: turn off TRT hole search, it fails Tier-0
 every_xth_track              = 25,
 whatdatatype                 = DQMonFlags.monManDataType(),
 MinTRTHitCut                 = 10,
 max_abs_d0                   = 10  * Units.mm,
 max_abs_z0                   = 300 * Units.mm,
 max_abs_eta                  = 2.5,
 MinTrackP                    = 0.0 * Units.GeV,
 min_pT                       = minTrkPtCut, # default = 0.5 GeV
 min_si_hits                  = minSiHitCut, # default = 1
 min_pixel_hits               = 0,
 min_sct_hits                 = 0,
 min_trt_hits                 = 10
Exemplo n.º 27
0
    def __init__(self,doOldStyleConfig=False):
        "Setup conditions DB - IOVDbSvc and connections according to GlobalFlags"
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from AthenaCommon.Logging import logging
        self.msg = logging.getLogger( 'IOVDbSvc.CondDB' )
        self.msg.debug("Loading basic services for CondDBSetup...")
    
        # AthenaPool and IOVDbSvc configuration
        from AthenaPoolCnvSvc import AthenaPool  # noqa: F401
        from IOVDbSvc import IOVDb               # noqa: F401
        # local access to IOVDbSvc parameters
        self.iovdbsvc=svcMgr.IOVDbSvc

        # initialise list of allowed DBs
        self.dblist={}
        # and list of blocked folders
        self.blocklist=[]
        
        # decide which instance to setup
        # default database
        self.dbname=''
        # names for MC and data database in case forceMC/forceData are used
        self.dbmc=''
        self.dbdata=''
        self.poolcats=[]
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        self.isOnline=athenaCommonFlags.isOnline()
        self.isMC=not globalflags.DataSource()=='data'
        if (globalflags.DetGeo() in ['atlas','commis']):
            # ATLAS full or commissioning geometry
            self.dbmc='OFLP200'
            self.dbdata=globalflags.DatabaseInstance() #could be 'auto'
            if self.isMC:
                # Monte Carlo
                self.dbname=self.dbmc
                self.poolcats=['oflcond']
            else:
                # real data
                if (self.dbdata=='auto'):
                    from RecExConfig.RecFlags import rec
                    self.dbdata=self._InstanceFromProjectName(rec.projectName())
                    self.msg.info("Configuring database instance %s based on project tag %s", self.dbdata, rec.projectName())
                self.dbname=self.dbdata
                self.poolcats=['comcond','oflcond']
        elif (globalflags.DetGeo() in ['ctbh8','ctbh6']):
            self.dbmc='TMCP200'
            self.dbdata='TBDP200'
            if self.isMC:
                # 2004 combined testbeam, Monte Carlo
                self.dbname=self.dbmc
                self.poolcats=['tbcond','oflcond']
            else:
                # 2004 combined testbeam, real data
                self.dbname=self.dbdata
                self.poolcats=['tbcond','oflcond']
        else:
            raise RuntimeError("Unknown globalflags.DetGeo: %s" % globalflags.DetGeo())
        if (self.dbname!=''):
            self.msg.info('Setting up conditions DB access to instance %s', self.dbname)
            # set up all access options - online schemas
            self._SetAcc('INDET','COOLONL_INDET')
            self._SetAcc('INDET_ONL','COOLONL_INDET')
            self._SetAcc('PIXEL','COOLONL_PIXEL')
            self._SetAcc('PIXEL_ONL','COOLONL_PIXEL')
            self._SetAcc('SCT','COOLONL_SCT')
            self._SetAcc('SCT_ONL','COOLONL_SCT')
            self._SetAcc('TRT','COOLONL_TRT')
            self._SetAcc('TRT_ONL','COOLONL_TRT')
            self._SetAcc('LAR','COOLONL_LAR')
            self._SetAcc('LAR_ONL','COOLONL_LAR')
            self._SetAcc('TILE','COOLONL_TILE')
            self._SetAcc('TILE_ONL','COOLONL_TILE')
            self._SetAcc('MUON','COOLONL_MUON')
            self._SetAcc('MUON_ONL','COOLONL_MUON')
            self._SetAcc('MUONALIGN','COOLONL_MUONALIGN')
            self._SetAcc('MUONALIGN_ONL','COOLONL_MUONALIGN')
            self._SetAcc('MDT','COOLONL_MDT')
            self._SetAcc('MDT_ONL','COOLONL_MDT')
            self._SetAcc('RPC','COOLONL_RPC')
            self._SetAcc('RPC_ONL','COOLONL_RPC')
            self._SetAcc('TGC','COOLONL_TGC')
            self._SetAcc('TGC_ONL','COOLONL_TGC')
            self._SetAcc('CSC','COOLONL_CSC')
            self._SetAcc('CSC_ONL','COOLONL_CSC')
            self._SetAcc('TDAQ','COOLONL_TDAQ')
            self._SetAcc('TDAQ_ONL','COOLONL_TDAQ')
            self._SetAcc('GLOBAL','COOLONL_GLOBAL')
            self._SetAcc('GLOBAL_ONL','COOLONL_GLOBAL')
            self._SetAcc('TRIGGER','COOLONL_TRIGGER')
            self._SetAcc('TRIGGER_ONL','COOLONL_TRIGGER')
            self._SetAcc('CALO','COOLONL_CALO')
            self._SetAcc('CALO_ONL','COOLONL_CALO')
            self._SetAcc('FWD','COOLONL_FWD')
            self._SetAcc('FWD_ONL','COOLONL_FWD')            
            # set up all access options - offline schemas
            # only do this if isOnline flag is NOT set
            # or MC flag is set, to allow HLT testing using MC database
            if (self.isMC or not self.isOnline):
                self._SetAcc('INDET_OFL','COOLOFL_INDET')
                self._SetAcc('PIXEL_OFL','COOLOFL_PIXEL')
                self._SetAcc('SCT_OFL','COOLOFL_SCT')
                self._SetAcc('TRT_OFL','COOLOFL_TRT')
                self._SetAcc('LAR_OFL','COOLOFL_LAR')
                self._SetAcc('TILE_OFL','COOLOFL_TILE')
                self._SetAcc('MUON_OFL','COOLOFL_MUON')
                self._SetAcc('MUONALIGN_OFL','COOLOFL_MUONALIGN')
                self._SetAcc('MDT_OFL','COOLOFL_MDT')
                self._SetAcc('RPC_OFL','COOLOFL_RPC')
                self._SetAcc('TGC_OFL','COOLOFL_TGC')
                self._SetAcc('CSC_OFL','COOLOFL_CSC')
                self._SetAcc('TDAQ_OFL','COOLOFL_TDAQ')
                self._SetAcc('DCS_OFL','COOLOFL_DCS')
                self._SetAcc('GLOBAL_OFL','COOLOFL_GLOBAL')
                self._SetAcc('TRIGGER_OFL','COOLOFL_TRIGGER')
                self._SetAcc('CALO_OFL','COOLOFL_CALO')
                self._SetAcc('FWD_OFL','COOLOFL_FWD')
            else:
                self.msg.info('Running in online mode - no access to COOLOFL schemas')
                self.iovdbsvc.OnlineMode=True
                
            # setup default connection to localfile, and put in LOCAL symbol
            localfile="sqlite://;schema=mycool.db;dbname="
            self.dblist['LOCAL']=localfile
            self.iovdbsvc.dbConnection=localfile+self.dbname

            # setup knowledge of dbinstance in IOVDbSvc, for global tag x-check
            self.iovdbsvc.DBInstance=self.dbname


            # setup DBReplicaSvc to veto DBRelease SQLite files if real data
            if not self.isMC:
                from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc
                svcMgr+=DBReplicaSvc(COOLSQLiteVetoPattern="/DBRelease/")

            # enable Frontier cache alignment if it looks like Frontier will
            # be used (via FRONTIER_SERVER variable)
            if 'FRONTIER_SERVER' in os.environ.keys() and os.environ['FRONTIER_SERVER']!="":
                self.iovdbsvc.CacheAlign=3
            # setup PoolSvc catalogues
            from PoolSvc.PoolSvcConf import PoolSvc
            if not hasattr (svcMgr, 'PoolSvc'):
                svcMgr+=PoolSvc()
            # add the standard catalogues
            for i in self.poolcats:
                svcMgr.PoolSvc.ReadCatalog+=["prfile:poolcond/PoolCat_%s.xml" % i]
            # also add entries which will be resolved using ATLAS_POOLCOND_PATH
            # (if set) - the actual resolution is done inside PoolSvc C++
            for i in self.poolcats:
                svcMgr.PoolSvc.ReadCatalog+=["apcfile:poolcond/PoolCat_%s.xml" % i]
            svcMgr.PoolSvc.ReadCatalog+=["apcfile:poolcond/PoolFileCatalog.xml"]
        else:
            raise RuntimeError('Not enough configuration information to setup ConditionsDB access (are GlobalFlags being used?)')
        self.msg.debug("Loading basic services for CondDBSetup... [DONE]")
Exemplo n.º 28
0
 DistanceToStraw              = 0.4,
 LongToTCut                   = 9.375,
 is_TRT_only_tracks           = True, # obsolete
 is_zero_mag_field            = True, # obsolete
 #Histogram Switches
 doAside                      = True, # obsolete
 doCside                      = True, # obsolete
 doStraws                     = True,
 doChips                      = True,
 doShift                      = True,
 doDiagnostic                 = True, # obsolete
 EventBurstCut                = eventBurstCut, # default = 200
 DoRDOsMon                    = True,
 DoGeoMon                     = False,
 DoTracksMon                  = True,
 doExpert                     = athenaCommonFlags.isOnline(),
 IsCosmics                    = InDetFlags.doCosmics(),
 InDetTRT_DAQ_ConditionsSvc   = InDetTRT_DAQ_ConditionsSvc,
 doEfficiency                 = False, # ME: turn off TRT hole search, it fails Tier-0
 every_xth_track              = 25,
 whatdatatype                 = DQMonFlags.monManDataType(),
 MinTRTHitCut                 = 10,
 max_abs_d0                   = 10  * Units.mm,
 max_abs_z0                   = 300 * Units.mm,
 max_abs_eta                  = 2.5,
 MinTrackP                    = 0.0 * Units.GeV,
 min_pT                       = minTrkPtCut, # default = 0.5 GeV
 min_si_hits                  = minSiHitCut, # default = 3
 min_pixel_hits               = minPixHitCut, # default = 1
 min_sct_hits                 = 0,
 min_trt_hits                 = 10
Exemplo n.º 29
0
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

# MagFieldServices
#--------------------------------------------------------------

from AthenaCommon.Logging import logging
logging.getLogger().info("Importing %s", __name__)

from AthenaCommon.AthenaCommonFlags import athenaCommonFlags

# initialise required conditions DB folders
from IOVDbSvc.CondDB import conddb
conddb.addFolderSplitMC('GLOBAL',
                        '/GLOBAL/BField/Maps <noover/>',
                        '/GLOBAL/BField/Maps <noover/>',
                        className="CondAttrListCollection")
if not athenaCommonFlags.isOnline():
    conddb.addFolder('DCS_OFL',
                     '/EXT/DCS/MAGNETS/SENSORDATA',
                     className="CondAttrListCollection")

# import the field service and conditions algs (service is 'to be removed')
# (it is MagFieldServices.MagFieldServicesConfig which takes care of configuration)
from AthenaCommon.CfgGetter import getService, getAlgorithm
getService('AtlasFieldSvc')

from AthenaCommon.AlgSequence import AthSequencer
condSequence = AthSequencer("AthCondSeq")
condSequence += getAlgorithm("AtlasFieldMapCondAlg")
condSequence += getAlgorithm("AtlasFieldCacheCondAlg")
Exemplo n.º 30
0
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
if athenaCommonFlags.isOnline():
  BTaggingFlags.CalibrationFolderRoot="/GLOBAL/Onl/BTagCalib/"
  connSchema="GLOBAL"
  print "#BTAG# running online -> btag calib root folder is /GLOBAL/Onl/BTagCalib/"
else:
  BTaggingFlags.CalibrationFolderRoot="/GLOBAL/BTagCalib/"
  connSchema="GLOBAL_OFL"
  print "#BTAG# running offline -> btag calib root folder is /GLOBAL/BTagCalib/"

theFolders = []
if BTaggingFlags.IP1D:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'IP1D')
if BTaggingFlags.IP2D:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'IP2D')
if BTaggingFlags.IP3D:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'IP3D')
if BTaggingFlags.SV1:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'SV1')
if BTaggingFlags.SV2:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'SV2')
if BTaggingFlags.SoftMu:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'SoftMu')
if BTaggingFlags.SoftEl:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'SoftEl')
if BTaggingFlags.JetFitterTag|BTaggingFlags.JetFitterNN: 
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'JetFitter')
if BTaggingFlags.JetProb:
  theFolders.append(BTaggingFlags.CalibrationFolderRoot+'JetProb')
if BTaggingFlags.MV1 | BTaggingFlags.MV1Flip:
Exemplo n.º 31
0
#printfunc ('\n*************************************************************************************************\n')
#printfunc ("   ******** Welcome to the Offline ESD MuonRawDataMonitoring/MdtRawDataMonitoring package. ******** "  )
#printfunc ("   ******** Documentation may be found at:******** "  )
#printfunc ("   **** https://twiki.cern.ch/twiki/bin/view/Atlas/MDTOfflineMonitoringPlots ***** "  )

from AthenaCommon.AthenaCommonFlags import athenaCommonFlags

isTier0Flag = not athenaCommonFlags.isOnline()

#
#if not isTier0Flag :
#    printfunc ("   **** Running Online ****")
#else :
#    printfunc ("   **** Running at Tier0 ****")
#
#printfunc ('\n*************************************************************************************************\n')

if not 'MuonDQAFlags' in dir():
    printfunc(
        "MuonDQAFlags.py: MuonDQAFlags not yet imported - I import them now")
    from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags

from AthenaMonitoring.AtlasReadyFilterTool import GetAtlasReadyFilterTool

mdtRawMonMan = AthenaMonManager(name="MdtRawMonManager",
                                FileKey=DQMonFlags.monManFileKey(),
                                Environment=DQMonFlags.monManEnvironment(),
                                OutputLevel=muonOutputLevel)

############# MDTRawDataValAlg #############
from MdtRawDataMonitoring.MdtRawDataMonitoringConf import MdtRawDataValAlg