Beispiel #1
0
    def __init__(self, name = "EFCaloHypoNoiseConfig",ef_thr=20*GeV,etaMin=0,etaMax=10):
        super( EFCaloHypoNoiseConfig, self ).__init__( name )

        self.Etcut = ef_thr
        self.BadFEBCut=3
        if 'COMP200' not in conddb.GetInstance() and not conddb.isMC:
           if not hasattr(svcMgr.ToolSvc, "KnownBADFEBsTool"):
              theBadFebTool=LArBadChanTool("KnownBADFEBsTool")
              theBadFebTool.CoolMissingFEBsFolder="/LAR/BadChannels/KnownBADFEBs"
              havefolder=False
              for fld in conddb.iovdbsvc.Folders:
                 if "KnownBADFEBs" in fld: havefolder=True
              pass
              if not havefolder:
                 conddb.addFolder("LAR_ONL","/LAR/BadChannels/KnownBADFEBs")   
              svcMgr.ToolSvc+=theBadFebTool
           else:
              theBadFebTool=svcMgr.ToolSvc.KnownBADFEBsTool
           if not hasattr(svcMgr.ToolSvc, "KnownMNBFEBsTool"):
              theMNBFebTool=LArBadChanTool("KnownMNBFEBsTool")
              theMNBFebTool.CoolMissingFEBsFolder="/LAR/BadChannels/KnownMNBFEBs"
              havefolder=False
              for fld in conddb.iovdbsvc.Folders:
                 if "KnownMNBFEBs" in fld: havefolder=True
              pass
              if not havefolder:
                 conddb.addFolder("LAR_ONL","/LAR/BadChannels/KnownMNBFEBs")   
              svcMgr.ToolSvc+=theMNBFebTool
           else:
              theMNBFebTool=svcMgr.ToolSvc.KnownMNBFEBsTool
           theLArNoisyROTool=LArNoisyROTool(SaturatedCellTightCut=20,MNBLooseCut=5,MNBTightCut=17,KnownBADFEBsTool=theBadFebTool,KnownMNBFEBsTool=theMNBFebTool)
        else:   
           theLArNoisyROTool=LArNoisyROTool(SaturatedCellTightCut=20,MNBLooseCut=5,MNBTightCut=17)
        self.NoiseTool = theLArNoisyROTool
Beispiel #2
0
 def __init__(self):
     from tempfile import mktemp
     self.dbfilename = mktemp('.db', 'hltMenu.')
     from IOVDbSvc.CondDB import conddb
     self.dbname = conddb.GetInstance(
     )  # COMP200 or CONDBR2 (consistent with what is used for reading it back)
     self.dbConnection = "<dbConnection>sqlite://;schema=%s;dbname=%s</dbConnection>" % (
         self.dbfilename, self.dbname)
     self.isWritingNeeded = False
     from RecExConfig.RecFlags import jobproperties as jp
     from TriggerJobOpts.TriggerFlags import jobproperties as jp
     from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
     if jp.Rec.Trigger.readLVL1configFromXML():
         self.lvl1menu = jp.Rec.Trigger.inputLVL1configFile()
     else:
         self.lvl1menu = jp.Rec.Trigger.outputLVL1configFile()
     if jp.Rec.Trigger.readHLTconfigFromXML():
         self.hltmenu = jp.Rec.Trigger.inputHLTconfigFile()
     else:
         self.hltmenu = jp.Rec.Trigger.outputHLTconfigFile()
     self.menusource = 'xml'  # either db or xml
     self.trigdb = ''
     self.smk = 0
     self.l1psk = 0
     self.hltpsk = 0
     self.bgsk = 1
     self.useFrontier = tf.triggerUseFrontier()
Beispiel #3
0
def LArADC2MeVCondAlgDefault():

    LArOnOffIdMapping()
    condSeq = AthSequencer("AthCondSeq")
    if hasattr(condSeq, "LArADC2MeVCondAlg"):
        return getattr(condSeq, "LArADC2MeVCondAlg")

    theADC2MeVCondAlg = LArADC2MeVCondAlg(LArADC2MeVKey='LArADC2MeV')

    if conddb.isMC:
        from LArConditionsCommon.LArCondFlags import larCondFlags
        if not larCondFlags.hasMphys():
            theADC2MeVCondAlg.LArMphysOverMcalKey = ""  #No MphysOVerMcal
        else:
            theADC2MeVCondAlg.LArMphysOverMcalKey = "LArMphysOverMcalSym"

        if not larCondFlags.hasHVCorr():
            theADC2MeVCondAlg.LArHVScaleCorrKey = ""

        theADC2MeVCondAlg.LAruA2MeVKey = "LAruA2MeVSym"
        theADC2MeVCondAlg.LArDAC2uAKey = "LArDAC2uASym"
        theADC2MeVCondAlg.LArRampKey = "LArRampSym"

        theADC2MeVCondAlg.UseFEBGainTresholds = False
    else:  # not MC:
        from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault
        LArFebConfigCondAlgDefault()
        if 'COMP200' in conddb.GetInstance():  # Run1 case
            theADC2MeVCondAlg.LAruA2MeVKey = "LAruA2MeVSym"
            theADC2MeVCondAlg.LArDAC2uAKey = "LArDAC2uASym"

    condSeq += theADC2MeVCondAlg
    return theADC2MeVCondAlg
Beispiel #4
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
Beispiel #5
0
def LArFEBMonConfigCore(helper,
                        algoinstance,
                        inputFlags,
                        cellDebug=False,
                        dspDebug=False):

    from LArMonitoring.GlobalVariables import lArDQGlobals

    larFEBMonAlg = helper.addAlgorithm(algoinstance, 'larFEBMonAlg')

    GroupName = "FEBMon"
    nslots = []
    for i in range(0, len(lArDQGlobals.FEB_Slot)):
        nslots.append(lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[i]][1])

    larFEBMonAlg.MonGroup = GroupName
    larFEBMonAlg.PartitionNames = lArDQGlobals.Partitions
    larFEBMonAlg.SubDetNames = lArDQGlobals.SubDet
    larFEBMonAlg.Streams = lArDQGlobals.defaultStreamNames

    isCOMP200 = False
    from AthenaConfiguration.ComponentFactory import isRun3Cfg
    if isRun3Cfg():
        if "COMP200" in inputFlags.IOVDb.DatabaseInstance:
            isCOMP200 = True
    else:
        from IOVDbSvc.CondDB import conddb
        if conddb.GetInstance() == 'COMP200':
            isCOMP200 = True

    if not isCOMP200:
        dbString = "<db>COOLONL_LAR/CONDBR2</db>"
        persClass = "AthenaAttributeList"
        fld = "/LAR/Configuration/DSPThresholdFlat/Thresholds"
        if isRun3Cfg():
            iovDbSvc = helper.resobj.getService("IOVDbSvc")
            condLoader = helper.resobj.getCondAlgo("CondInputLoader")
        else:
            from AthenaCommon import CfgGetter
            iovDbSvc = CfgGetter.getService("IOVDbSvc")
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            condLoader = condSeq.CondInputLoader

        iovDbSvc.Folders.append(fld + dbString)
        condLoader.Load.append((persClass, fld))
        larFEBMonAlg.Run2DSPThresholdsKey = fld
    else:
        fld = '/LAR/Configuration/DSPThreshold/Thresholds'
        db = 'LAR_ONL'
        obj = 'LArDSPThresholdsComplete'
        if isRun3Cfg():
            helper.resobj.addFolderList(inputFlags, [(fld, db, obj)])
        else:
            conddb.addFolder(db, fld, className=obj)
        larFEBMonAlg.Run1DSPThresholdsKey = 'LArDSPThresholds'

    # adding LArFebErrorSummary algo
    if isRun3Cfg():
        from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
        acc = LArFebErrorSummaryMakerCfg(inputFlags)
        helper.resobj.merge(acc)
    else:
        #put here what to do else
        pass
    Group = helper.addGroup(larFEBMonAlg, GroupName,
                            '/LAr/' + GroupName + 'NewAlg/')

    #Summary histos
    summary_hist_path = 'Summary/'

    #-- TTree for corrupted events timestamp
    Group.defineTree(
        'timestamp,time_ns,febHwId,febError;LArCorrupted',
        path=summary_hist_path,
        title='Timestamps of corrupted LAr events',
        treedef=
        'timestamp/i:time_ns/i:febHwId/vector<int>:febErrorType/vector<int>')

    Group.defineHistogram('nbFEB;NbOfReadoutFEBGlobal',
                          title='# of readout FEB/DSP header',
                          type='TH1I',
                          path=summary_hist_path,
                          xbins=lArDQGlobals.N_FEB + 11,
                          xmin=-0.5,
                          xmax=lArDQGlobals.N_FEB + 10 + 0.5)
    Group.defineHistogram(
        'nbFEBpart,part;NbOfEvts2d',
        title='# of readout FEB/DSP header:Num. FEBs:Partition',
        type='TH2I',
        path=summary_hist_path,
        xbins=lArDQGlobals.N_FEB_Parttions_Max,
        xmin=-0.5,
        xmax=lArDQGlobals.N_FEB_Parttions_Max - 0.5,
        ybins=lArDQGlobals.N_Partitions,
        ymin=-0.5,
        ymax=lArDQGlobals.N_Partitions - 0.5,
        ylabels=lArDQGlobals.Partitions)
    Group.defineHistogram('febError,part;NbOfLArFEBMonErrors_dE',
                          title='# of data corruption errors',
                          type='TH2I',
                          path=summary_hist_path,
                          xbins=lArDQGlobals.N_FEBErrors,
                          xmin=0.5,
                          xmax=lArDQGlobals.N_FEBErrors + 0.5,
                          ybins=lArDQGlobals.N_Partitions,
                          ymin=-0.5,
                          ymax=lArDQGlobals.N_Partitions - 0.5,
                          xlabels=lArDQGlobals.FEBErrors,
                          ylabels=lArDQGlobals.Partitions)
    Group.defineHistogram(
        'dspThrADC;dspThresholdsADC',
        title=
        'DSP thresholds to readout samples:Number of cells:Cell threshold in ADC counts',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.DSPThr_Bins + 1,
        xmin=-0.5,
        xmax=lArDQGlobals.DSPThr_Bins + 0.5)
    Group.defineHistogram(
        'dspThrQT;dspThresholds_qfactortime',
        title=
        'DSP thresholds to readout (qfactor+time):Number of cells:Cell threshold in ADC counts',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.DSPThr_Bins + 1,
        xmin=-0.5,
        xmax=lArDQGlobals.DSPThr_Bins + 0.5)
    Group.defineHistogram('EvtType;Eventtype',
                          title='Event type (1st readout FEB)',
                          type='TH1I',
                          path=summary_hist_path,
                          xbins=lArDQGlobals.Evt_Bins,
                          xmin=lArDQGlobals.Evt_Min,
                          xmax=lArDQGlobals.Evt_Max,
                          xlabels=lArDQGlobals.Evt_labels)
    Group.defineHistogram(
        'LVL1Trig;TriggerWord',
        title='Number of Events per L1 trigger word (8 bits):L1 trigger word',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.L1Trig_Bins,
        xmin=lArDQGlobals.L1Trig_Min,
        xmax=lArDQGlobals.L1Trig_Max)
    Group.defineHistogram(
        'LVL1TrigAllDSP;TriggerWordAllDSP',
        title='Number of L1 trigger word per DSP (8 bits):L1 trigger word',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.L1Trig_Bins,
        xmin=lArDQGlobals.L1Trig_Min,
        xmax=lArDQGlobals.L1Trig_Max)
    Group.defineHistogram('EvtRej;EventsRejected',
                          title='Nb of events rejected (at least one error)',
                          type='TH1I',
                          path=summary_hist_path,
                          xbins=lArDQGlobals.EvtRej_Bins,
                          xmin=lArDQGlobals.EvtRej_Min,
                          xmax=lArDQGlobals.EvtRej_Max,
                          xlabels=lArDQGlobals.EvtRej_labels)
    Group.defineHistogram(
        'EvtRej,EvtRejYield1D;EventsRejectedYield',
        title='Data corruption yield:Corruption type:Yield(%)',
        type='TProfile',
        path=summary_hist_path,
        xbins=lArDQGlobals.EvtRej_Bins - 1,
        xmin=lArDQGlobals.EvtRej_Min,
        xmax=lArDQGlobals.EvtRej_Max - 1,
        xlabels=lArDQGlobals.EvtRejYield_labels)
    Group.defineHistogram(
        'LB0,EvtRejYield;YieldOfRejectedEventsVsLB',
        title=
        'Yield of corrupted events (DATACORRUPTED):Luminosity Block:Yield(%)',
        type='TProfile',
        path=summary_hist_path,
        xbins=lArDQGlobals.LB_Bins,
        xmin=lArDQGlobals.LB_Min,
        xmax=lArDQGlobals.LB_Max)
    Group.defineHistogram(
        'LB0,EvtRejYieldOut;YieldOfRejectedEventsVsLBout',
        title=
        'Yield of corrupted events (DATACORRUPTED) not vetoed by time window:Luminosity Block:Yield(%)',
        type='TProfile',
        path=summary_hist_path,
        xbins=lArDQGlobals.LB_Bins,
        xmin=lArDQGlobals.LB_Min,
        xmax=lArDQGlobals.LB_Max)
    Group.defineHistogram(
        'rejBits;rejectionBits',
        title=
        'Errors at the origin of event rejection:Bits:Number of (rejected) events',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.rejBits_Bins,
        xmin=-0.5,
        xmax=lArDQGlobals.rejBits_Bins - 0.5)
    Group.defineHistogram('LB0;NbOfEventsVsLB',
                          title='Nb of events per LB:Luminosity Block',
                          type='TH1I',
                          path=summary_hist_path,
                          xbins=lArDQGlobals.LB_Bins,
                          xmin=lArDQGlobals.LB_Min,
                          xmax=lArDQGlobals.LB_Max)
    Group.defineHistogram(
        'NbOfSweet2;NbOfSw2',
        title=
        '# of cells with samples readout:Number of cells:Number of events',
        type='TH1I',
        path=summary_hist_path,
        xbins=int(lArDQGlobals.N_Cells / 10),
        xmin=-1000,
        xmax=lArDQGlobals.N_Cells - 1000)
    Group.defineHistogram(
        'LB0,LArEvSize;eventSizeVsLB',
        title='LAr event size (w/o ROS headers):Luminosity Block:Megabytes',
        type='TProfile',
        path=summary_hist_path,
        xbins=lArDQGlobals.LB_Bins,
        xmin=lArDQGlobals.LB_Min,
        xmax=lArDQGlobals.LB_Max)
    Group.defineHistogram(
        'NbOfSamp;NbOfSamples',
        title='# of samples (1st readout FEB):Samples:Number of events',
        type='TH1I',
        path=summary_hist_path,
        xbins=lArDQGlobals.Samples_Bins,
        xmin=lArDQGlobals.Samples_Min,
        xmax=lArDQGlobals.Samples_Max)

    isOnline = False
    if isRun3Cfg():
        if inputFlags.DQ.Environment == 'online':
            isOnline = True
    else:
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        if athenaCommonFlags.isOnline:
            isOnline = True

    if isOnline:
        Group.defineHistogram(
            'LBf,EvtRejYield;EventsRejectedLB',
            titile='% of events rejected in current LB (online only)',
            type='TProfile',
            path=summary_hist_path,
            xbins=1,
            xmin=0,
            xmax=1,
            xlabels=['% of events'])
        Group.defineHistogram(
            'LB,streamBin,LArEvSizePart;eventSizeStreamVsLB',
            titile='LAr event size per stream per LB (w/o ROS headers)',
            type='TProfile2D',
            path=summary_hist_path,
            xbins=lArDQGlobals.LB_Bins,
            xmin=lArDQGlobals.LB_Min,
            xmax=lArDQGlobals.LB_Max,
            ybins=len(larFEBMonAlg.Streams),
            ymin=-0.5,
            ymax=len(larFEBMonAlg.Streams) - 0.5,
            ylabels=larFEBMonAlg.Streams)

    # Now per partition histograms
    for subdet in range(0, lArDQGlobals.N_SubDet):
        hist_path = '/LAr/' + GroupName + 'NewAlg/' + lArDQGlobals.SubDet[
            subdet] + '/'
        slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet *
                                                                 2]][0] - 0.5
        slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet *
                                                                2]][1] + 0.5
        slot_n = int(slot_up - slot_low)
        ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[
            subdet * 2]][0] - 0.5
        ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[
            subdet * 2]][1] + 0.5
        ft_n = int(ft_up - ft_low)

        darray = helper.addArray(
            [lArDQGlobals.Partitions[2 * subdet:2 * subdet + 2]], larFEBMonAlg,
            lArDQGlobals.SubDet[subdet])

        darray.defineHistogram('slotPar,FTPar;Parity',
                               title='Parity error:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram(
            'slotBcid,FTBcid;BCID',
            title='BCID mismatch betw. 2 halves of FEB:Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotRadd,FTRadd;RADD',
            title='Sample header mismatch betw. 2 halves of FEB:Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotEvtid,FTEvtid;EVTID',
            title='EVTID mismatch betw. 2 halves of FEB:Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotScac,FTScac;SCACStatus',
            title='Wrong SCAC status in one half of a FEB:Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram('slotscout,FTscout;scaOutOfRange',
                               title='Sca out of range:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram(
            'slotgain,FTgain;gainMismatch',
            title='Gain mismatch within time samples:Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram('slottype,FTtype;typeMismatch',
                               title='Event type mismatch:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram('slotsmp,FTsmp;badNbOfSamp',
                               title='Non uniform number of samples:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram('slotzero,FTzero;zeroSamp',
                               title='Empty FEB data blocks:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram('slotsum,FTsum;checkSum',
                               title='Checksum / DSP block size:Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram('slotmis,FTmis;missingHeader',
                               title='Missing header :Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram('slotgain,FTgain;badGain',
                               title='Bad gain :Slot:FT',
                               type='TH2I',
                               path=hist_path,
                               xbins=slot_n,
                               xmin=slot_low,
                               xmax=slot_up,
                               ybins=ft_n,
                               ymin=ft_low,
                               ymax=ft_up)

        darray.defineHistogram(
            'slotabs,FTabs;LArFEBMonErrorsAbsolute',
            title='Nb of events with at least one error :Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotmist,FTmist;missingTriggerType',
            title=
            'LVL1 trigger type missing or different from event type :Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotnb,FTnb;nbOfEvts',
            title='Nb of events (DSP header check only) :Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotnb,FTnb,weightsweet1;NbOfSweet1PerFEB',
            title='Average # of cells with (qfactor+time) readout :Slot:FT',
            type='TProfile2D',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'slotnb,FTnb,weightsweet2;NbOfSweet2PerFEB',
            title='Average # of cells with samples readout :Slot:FT',
            type='TProfile2D',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'nbFEBpart;nbOfFebBlocks',
            title='# of readout FEBs (DSP header check only) :Slot:FT',
            type='TH1I',
            path=hist_path,
            xbins=lArDQGlobals.N_FEB_Parttions_Max,
            xmin=-0.5,
            xmax=lArDQGlobals.N_FEB_Parttions_Max - 0.5)

        darray.defineHistogram(
            'slotMasked,FTMasked;knownFaultyFEB',
            title='FEB with known errors (1:err. ignored 2:FEB masked):Slot:FT',
            type='TH2I',
            path=hist_path,
            xbins=slot_n,
            xmin=slot_low,
            xmax=slot_up,
            ybins=ft_n,
            ymin=ft_low,
            ymax=ft_up)

        darray.defineHistogram(
            'LB,LArEvSizePart;eventSizeVsLB',
            title='LAr event size per LB (w/o ROS headers):Luminosity Block',
            type='TProfile',
            path=hist_path,
            xbins=lArDQGlobals.LB_Bins,
            xmin=lArDQGlobals.LB_Min,
            xmax=lArDQGlobals.LB_Max)

        if isOnline:
            darray.defineHistogram(
                'LBf,erronl;EventsRejectedLB',
                titile='% of events rejected in current LB (online only)',
                type='TProfile',
                path=hist_path,
                xbins=1,
                xmin=0,
                xmax=1,
                xlabels=['% of events'])
            darray.defineHistogram(
                'LB,streamBin,LArEvSizePart;eventSizeStreamVsLB',
                titile='LAr event size per stream per LB (w/o ROS headers)',
                type='TProfile2D',
                path=hist_path,
                xbins=lArDQGlobals.LB_Bins,
                xmin=lArDQGlobals.LB_Min,
                xmax=lArDQGlobals.LB_Max,
                ybins=len(larFEBMonAlg.Streams),
                ymin=-0.5,
                ymax=len(larFEBMonAlg.Streams) - 0.5,
                ylabels=larFEBMonAlg.Streams)
        pass
#Online applications read from COOLONL_LAR/COMP200, folder /LAR/BadChannels/BadChannels
#Offline applications read from COOLOFL_LAR/COMP200, folder /LAR/BadChannelsOfl/BadChannels
#But SG key(=Folder name) is expected to be the same in both cases (default set in LArBadChanTool.cxx)
#Solution: Re-key the object when reading from offline DB

rekeyBC = "<key>/LAR/BadChannels/BadChannels</key>"
rekeyMF = "<key>/LAR/BadChannels/MissingFEBs</key>"
conddb.addFolderSplitOnline(
    "LAR", "/LAR/BadChannels/BadChannels",
    "/LAR/BadChannelsOfl/BadChannels" + forceRN + rekeyBC)
conddb.addFolderSplitOnline(
    "LAR", "/LAR/BadChannels/MissingFEBs",
    "/LAR/BadChannelsOfl/MissingFEBs" + forceRN + rekeyMF)
# and the same for Known Noisy and MNB FEBs
if (rec.doESD() or rec.doRDOTrigger()) and ('COMP200'
                                            not in conddb.GetInstance()):
    rekeyBADF = "<key>/LAR/BadChannels/KnownBADFEBs</key>"
    rekeyMNBF = "<key>/LAR/BadChannels/KnownMNBFEBs</key>"
    conddb.addFolderSplitOnline(
        "LAR", "/LAR/BadChannels/KnownBADFEBs",
        "/LAR/BadChannelsOfl/KnownBADFEBs" + forceRN + rekeyBADF)
    conddb.addFolderSplitOnline(
        "LAR", "/LAR/BadChannels/KnownMNBFEBs",
        "/LAR/BadChannelsOfl/KnownMNBFEBs" + forceRN + rekeyMNBF)

if not larCondFlags.LoadElecCalib.is_locked():
    larCondFlags.LoadElecCalib.set_Value(rec.readRDO())

#For run 2 we use cool-inline storage in online database COOLONL_LAR/CONDBR2:
haveElecCalibInline = (conddb.dbdata == "CONDBR2")
    def configure(self):
        from AthenaCommon.Logging import logging
        mlog = logging.getLogger('LArNoisyROSummaryGetter::configure:')
        mlog.info('entering')

        # get handle to upstream CaloCell object
        import traceback
        try:
            from CaloRec.CaloCellGetter import CaloCellGetter
            theCaloCellGetter = CaloCellGetter()
        except:
            mlog.error("could not get handle to CaloCell Quit")
            print traceback.format_exc()
            return False
        if not theCaloCellGetter.usable():
            if not self.ignoreConfigError():
                mlog.error("CaloCellGetter unusable. Quit.")
                return False
            else:
                mlog.error("CaloCellGetter unusable. Continue nevertheless")

        # now configure the algorithm
        # cannot have same name
        try:
            from LArCellRec.LArCellRecConf import LArNoisyROAlg, LArNoisyROTool
        except:
            mlog.error("could not import LArNoisyROAlg or LArNoisyROTool")
            print traceback.format_exc()
            return False

        from AthenaCommon.AppMgr import ToolSvc
        # Noise and MNB Febs from COOL only for data
        from AthenaCommon.GlobalFlags import globalflags
        from IOVDbSvc.CondDB import conddb
        if globalflags.DataSource.get_Value() != 'geant4' and (
                'COMP200' not in conddb.GetInstance()):
            from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool
            theBadFebTool = LArBadChanTool("KnownBADFEBsTool")
            theBadFebTool.CoolMissingFEBsFolder = "/LAR/BadChannels/KnownBADFEBs"
            ToolSvc += theBadFebTool
            theMNBFebTool = LArBadChanTool("KnownMNBFEBsTool")
            theMNBFebTool.CoolMissingFEBsFolder = "/LAR/BadChannels/KnownMNBFEBs"
            ToolSvc += theMNBFebTool
            theLArNoisyROTool = LArNoisyROTool(
                PrintSummary=True,
                CellQualityCut=larNoisyROFlags.CellQualityCut(),
                BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(),
                BadFEBCut=larNoisyROFlags.BadFEBCut(),
                MNBLooseCut=larNoisyROFlags.MNBLooseCut(),
                MNBTightCut=larNoisyROFlags.MNBTightCut(),
                MNBTight_PsVetoCut=larNoisyROFlags.MNBTight_PsVetoCut(),
                KnownBADFEBsTool=theBadFebTool,
                KnownMNBFEBsTool=theMNBFebTool)
        else:
            theLArNoisyROTool = LArNoisyROTool(
                PrintSummary=True,
                CellQualityCut=larNoisyROFlags.CellQualityCut(),
                BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(),
                BadFEBCut=larNoisyROFlags.BadFEBCut(),
            )
        pass

        theLArNoisyROAlg = LArNoisyROAlg()
        theLArNoisyROAlg.Tool = theLArNoisyROTool

        self._LArNoisyROMakerHandle = theLArNoisyROAlg
        theLArNoisyROAlg.OutputKey = self.outputKey()

        # register output in objKeyStore
        from RecExConfig.ObjKeyStore import objKeyStore
        objKeyStore.addStreamESD(self.outputType(), self.outputKey())

        # now add algorithm to topSequence
        # this should always come at the end

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        topSequence += theLArNoisyROAlg

        return True
Beispiel #8
0
def AddTileOfcCoolSource(ofcType, runType='PHY', splitOnline=False):
    ofcSource = GetTileOfcCoolSource(ofcType, runType)
    ofcFullType = ofcType.upper() + '/' + runType.upper()
    ofcFolder = '/TILE/ONL01/FILTER/' + ofcFullType
    if splitOnline:
        ofcOfflineFolder = '/TILE/OFL02/FILTER/' + ofcFullType
        tileCoolMgr.addSource(ofcSource, ofcFolder, defConnStr, "",
                              ofcOfflineFolder, 'SplitOnline')
    else:
        tileCoolMgr.addSource(ofcSource, ofcFolder, defConnStr, "", ofcFolder,
                              'SplitMC')


from IOVDbSvc.CondDB import conddb
if conddb.GetInstance() == 'CONDBR2':

    #--- OFCs
    tileCoolMgr.addSource('OfcOf2Phy', '/TILE/ONL01/FILTER/OF2/PHY',
                          defConnStr, "", '/TILE/OFL02/FILTER/OF2/PHY',
                          'SplitOnline')
    tileCoolMgr.addSource('OfcOf1Phy', '/TILE/ONL01/FILTER/OF1/PHY',
                          defConnStr, "", '/TILE/OFL02/FILTER/OF1/PHY',
                          'SplitOnline')

    #--- energy calibration
    tileCoolMgr.addSource('oflCisFitLin', '/TILE/ONL01/CALIB/CIS/LIN',
                          defConnStr, "", '/TILE/OFL02/CALIB/CIS/LIN',
                          'SplitOnline')
    tileCoolMgr.addSource('oflCisFitNln', '/TILE/ONL01/CALIB/CIS/NLN',
                          defConnStr, "", '/TILE/OFL02/CALIB/CIS/NLN',
Beispiel #9
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

#file: TileCondToolConf.py
#author: [email protected]

import string

from TileConditions.TileCondProxyConf import *
from AthenaCommon.Constants import INFO

#=== check Athena running mode
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
isOnline = athenaCommonFlags.isOnline()

from IOVDbSvc.CondDB import conddb
isUsedDataBaseRun2 = (conddb.GetInstance() == 'CONDBR2')

validRunTypes = [
    'PHY', 'LAS', 'GAPLAS', 'CIS', 'PED', 'CISPULSE100', 'CISPULSE5P2',
    'CISLEAK100', 'CISLEAK5P2'
]
validSources = ['COOL', 'FILE']


#
#____________________________________________________________________________
def getTileCondToolEmscale(source='FILE',
                           name='TileCondToolEmscale',
                           **kwargs):

    if not source in validSources:
Beispiel #10
0
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

#file: TileCoolMgr.py
#author: [email protected]
#modifications: [email protected]

from TileConditions.TileCoolMgrClass import TileCoolMgr
from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from IOVDbSvc.CondDB import conddb

import string

tileCoolMgr = TileCoolMgr(isMC=(globalflags.DataSource() != 'data'),
                          isOnline=athenaCommonFlags.isOnline(),
                          dbInstance=conddb.GetInstance())

defConnStr = 'TILE'


def GetTileOfcCoolSource(ofcType, runType='PHY'):
    return 'Ofc' + string.capwords(ofcType, '/').replace(
        '/', '') + runType.lower().capitalize()


def AddTileOfcCoolSource(ofcType, runType='PHY', splitOnline=False):
    ofcSource = GetTileOfcCoolSource(ofcType, runType)
    ofcFullType = ofcType.upper() + '/' + runType.upper()
    ofcFolder = '/TILE/ONL01/FILTER/' + ofcFullType
    if splitOnline:
        ofcOfflineFolder = '/TILE/OFL02/FILTER/' + ofcFullType
Beispiel #11
0
                            "/LAR/BadChannelsOfl/BadChannels" + forceRN +
                            rekeyBC,
                            className="CondAttrListCollection")
from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg
condSeq += LArBadChannelCondAlg(ReadKey="/LAR/BadChannels/BadChannels")

conddb.addFolderSplitOnline("LAR",
                            "/LAR/BadChannels/MissingFEBs",
                            "/LAR/BadChannelsOfl/MissingFEBs" + forceRN +
                            rekeyMF,
                            className='AthenaAttributeList')
from LArBadChannelTool.LArBadChannelToolConf import LArBadFebCondAlg
condSeq += LArBadFebCondAlg(ReadKey="/LAR/BadChannels/MissingFEBs")

if (rec.doESD() or rec.doRDOTrigger()):
    if 'COMP200' not in conddb.GetInstance():
        rekeyBADF = "<key>/LAR/BadChannels/KnownBADFEBs</key>"
        rekeyMNBF = "<key>/LAR/BadChannels/KnownMNBFEBs</key>"
        conddb.addFolderSplitOnline(
            "LAR", "/LAR/BadChannels/KnownBADFEBs",
            "/LAR/BadChannelsOfl/KnownBADFEBs" + forceRN + rekeyBADF, False,
            False, False, "AthenaAttributeList")
        inkeyBad = "/LAR/BadChannels/KnownBADFEBs"
        conddb.addFolderSplitOnline(
            "LAR", "/LAR/BadChannels/KnownMNBFEBs",
            "/LAR/BadChannelsOfl/KnownMNBFEBs" + forceRN + rekeyMNBF, False,
            False, False, "AthenaAttributeList")
        inkeyMNB = "/LAR/BadChannels/KnownMNBFEBs"
    else:
        inkeyBad = ""
        inkeyMNB = ""