コード例 #1
0
def configureMoni(expert,withMC):
    # Set up monitoring (i.e. not using MC truth)
    moniSeq = ["CALO","RICH","MUON","VELO","Tr","ST"]
    ProcessPhase("Moni").DetectorList += moniSeq

    # Histograms filled both in real and simulated data cases
    if "CALO" in moniSeq :
        importOptions('$CALOMONIDSTOPTS/CaloMonitor.opts')
    else :
        # Hack for units options, normally included by CaloMonitor.opts
        importOptions('$STDOPTS/PreloadUnits.opts')

    if "VELO" in moniSeq :
        importOptions('$VELORECMONITORSROOT/options/BrunelMoni_Velo.py')

    if "Tr" in moniSeq :
        from TrackMonitors.ConfiguredTrackMonitors import ConfiguredTrackMonitorSequence
        ConfiguredTrackMonitorSequence(Name='MoniTrSeq')

    if "MUON" in moniSeq :
        importOptions("$MUONPIDCHECKERROOT/options/MuonPIDMonitor.py")

    if "ST" in moniSeq :
        from Configurables import ST__STClusterMonitor, GaudiSequencer
        GaudiSequencer( "MoniSTSeq" ).Members += [ ST__STClusterMonitor("TTClusterMonitor"),
                                                   ST__STClusterMonitor("ITClusterMonitor")]
        ST__STClusterMonitor("TTClusterMonitor").DetType = "TT" ## default anyway 
        ST__STClusterMonitor("ITClusterMonitor").DetType = "IT" 

    # Histograms filled only in real data case
    if not withMC:
        from Configurables import RichRecQCConf
        if "RICH" in moniSeq :
            from Configurables import GaudiSequencer
            RichRecQCConf().DataType = "MDF"
            RichRecQCConf().setProp("MoniSequencer", GaudiSequencer("MoniRICHSeq"))
コード例 #2
0
def doMyAlignChanges():
    from Configurables import TESCheck
    TESCheck().Stop = False
    TESCheck().Enable = False

    TweakFitter('FitDownstream')
    TweakFitter('FitMatch')
    TweakFitter('FitSeed')
    TweakFitter('RefitSeed')
    TweakFitter('FitForward')
    TweakFitter('FitVelo')
    TweakFitter('FitVeloTT')
    TweakFitter('FitBest')
    TweakFitter('TrackRefitter')

    TrackEventFitter('TrackRefitter').Fitter.UpdateTransport = True

    ApplicationMgr().ExtSvc += ["DataOnDemandSvc", "ANNDispatchSvc"]

    # insert a filter get only dimuons
    from Configurables import LoKi__HDRFilter as HDRFilter
    hltfilter = HDRFilter(
        'HLT2JPsi',
        Code="HLT_PASS_RE( 'Hlt2.*Muon.*JPsi.*Decision' )"
        #Code = "HLT_PASS_RE( '.*Decision' )"
        #Code = "HLT_PASS_RE('Hlt2.*Decision')"
        #Code ="HLT_PASS('Hlt2ExpressHLT1PhysicsDecision')"
    )
    hltfilter.Preambulo += ["from LoKiCore.functions import *"]

    from Configurables import HltDecReportsDecoder
    DataOnDemandSvc().AlgMap["Hlt/DecReports"] = HltDecReportsDecoder(
        OutputLevel=4)
    GaudiSequencer('EscherSequencer').Members.insert(1, hltfilter)
    #from Configurables import DecReportDumper
    #GaudiSequencer('EscherSequencer').Members.insert(2,DecReportDumper())

    #from Configurables import LoKi__VoidFilter as LokiFilter
    #stripfilter = LokiFilter ( 'JPsiMuMuFilter' ,
    #                           Code = "0 < CONTAINS ( '/Event/Dimuon/Phys/FullDSTDiMuonJpsi2MuMuLine/Particles' )"
    #                           #,Preambulo = [ "from LoKiTrigger.decorators import *" ]
    #                           )
    #GaudiSequencer('EscherSequencer').Members.insert(2,stripfilter)

    # add a filter on Velo tracks
    from Configurables import TrackListFilter
    GaudiSequencer("RecoVELOSeq").Members += [
        TrackListFilter("VeloFilter", inputLocation="Rec/Track/Velo")
    ]

    from Configurables import TrackMultiplicityFilter
    GaudiSequencer("RecoDecodingSeq").Members += [
        TrackMultiplicityFilter("MultFilter", MaxNumITHits=600)
    ]

    from Configurables import TrackDiMuonMonitor
    TrackDiMuonMonitor().MaxTwoProngVertexChi2 = 4

    from Configurables import TrackHitMapMonitor
    GaudiSequencer("MoniTrSeq").Members.append(TrackHitMapMonitor())

    #from Configurables import STOfflinePosition
    #itClusterPosition = STOfflinePosition('ToolSvc.ITClusterPosition')
    #itClusterPosition.ErrorVec = [0.28, 0.22, 0.35, 0.35]
    #itClusterPosition.APE = 0.1

    from Configurables import ST__STClusterMonitor
    ST__STClusterMonitor('ITClusterMonitor').HitMaps = True
コード例 #3
0
def doMyAlignChanges():
    from Configurables import TESCheck
    TESCheck().Stop = False
    TESCheck().Enable = False

    TweakFitter('FitDownstream')
    TweakFitter('FitMatch')
    TweakFitter('FitSeed')
    TweakFitter('RefitSeed')
    TweakFitter('FitForward')
    TweakFitter('FitVelo')
    TweakFitter('FitVeloTT')
    TweakFitter('FitBest')
    TweakFitter('TrackRefitter')

    TrackEventFitter('TrackRefitter').Fitter.UpdateTransport = True

    # add a filter on Velo tracks
    from Configurables import TrackListFilter
    GaudiSequencer("RecoVELOSeq").Members += [
        TrackListFilter("VeloFilter", inputLocation="Rec/Track/Velo")
    ]

    from Configurables import TrackMultiplicityFilter
    GaudiSequencer("RecoDecodingSeq").Members += [
        TrackMultiplicityFilter("MultFilter", MaxNumITHits=200)
    ]

    from Configurables import PatSeeding, PatSeedingTool
    ps = PatSeeding('PatSeeding')
    ps.PatSeedingTool.CurveTol = 10
    ps.PatSeedingTool.TolCollectIT = 5
    ps.PatSeedingTool.QualityWeights = [0, -0.2]
    ps.PatSeedingTool.MaxRangeIT = 100
    ps.PatSeedingTool.MaxChi2HitIT = 60
    ps.PatSeedingTool.MinXPlanes = 4
    ps.PatSeedingTool.MinTotalPlanes = 8
    ps.PatSeedingTool.MaxMisses = 2
    ps.PatSeedingTool.MaxHoles = 2
    ps.PatSeedingTool.MaxTrackChi2 = 30
    ps.PatSeedingTool.MaxFinalChi2 = 40
    ps.PatSeedingTool.MaxFinalTrackChi2 = 30

    from Configurables import PatForward, PatForwardTool
    pf = PatForward('PatForward')
    pf.PatForwardTool.MinXPlanes = 4
    pf.PatForwardTool.MinPlanes = 7
    pf.PatForwardTool.MaxSpreadX = 2
    pf.PatForwardTool.MinHits = 8

    from Configurables import Tf__Tsa__Seed, Tf__Tsa__SeedAddHits
    tsaSeed = Tf__Tsa__Seed("TsaSeed")
    tsaSeed.addTool(Tf__Tsa__SeedAddHits(), name="SeedAddHits")
    # tolerance if inside box mm
    tsaSeed.SeedAddHits.tol = 3
    # tolerance window make bigger mmm
    tsaSeed.SeedAddHits.dCut = 2.5
    # chi-sq cut
    tsaSeed.SeedAddHits.outlierCutParabola = 5

    from Configurables import TrackHitMapMonitor
    GaudiSequencer("MoniTrSeq").Members.append(TrackHitMapMonitor())

    from Configurables import STOfflinePosition
    itClusterPosition = STOfflinePosition('ToolSvc.ITClusterPosition')
    itClusterPosition.ErrorVec = [0.28, 0.22, 0.35, 0.35]
    itClusterPosition.APE = 0.1

    from Configurables import ST__STClusterMonitor
    ST__STClusterMonitor('ITClusterMonitor').HitMaps = True
コード例 #4
0
    def applyConf(self):
        # Build list of existing detectors
        dets = []
        for det in self.getProp("Detectors"):
            dets.append(det.upper())
        # general monitoring
        for det in self.KnownMoniGeneral:
            dets.append(det)
        # For compatibility reasons
        if [det for det in ['IT', 'TT'] if det in dets]:
            dets.append("ST")
        if [det for det in ['SPD', 'PRS', 'ECAL', 'HCAL'] if det in dets]:
            dets.append("CALO")
        if [det for det in ['RICH1', 'RICH2'] if det in dets]:
            dets.append("RICH")
            
        # Set up monitoring (i.e. not using MC truth)
        moniSeq = []
        if not self.isPropertySet("MoniSequence"):
            # Build default monitoring
            if self.expertHistos():
                moniDets = self.KnownExpertMoniSubdets
            else:
                moniDets = self.KnownMoniSubdets
            # create overlap
            for det in moniDets:
                if det in dets:
                    moniSeq.append(det)
            self.MoniSequence = moniSeq
        else:
            for seq in self.getProp("MoniSequence"):
                if self.expertHistos():
                    if seq not in self.KnownExpertMoniSubdets:
                        log.warning("Unknown subdet '%s' in MoniSequence"%seq)
                    if seq not in dets:
                        log.warning("Detector unknown '%s'"%seq)    
                else:
                    if seq not in self.KnownMoniSubdets:
                        log.warning("Unknown subdet '%s' in MoniSequence"%seq)
                    if seq not in dets:
                        log.warning("Detector unknown '%s'"%seq)    
            moniSeq = self.getProp("MoniSequence")

        if self.getProp("SkipTracking"):
            for det in ['VELO','IT','TT','ST','OT']:
                if det in moniSeq:
                    moniSeq.remove(det)        
        from Configurables import ProcessPhase
        ProcessPhase("Moni").DetectorList += moniSeq

        # Histograms filled both in real and simulated data cases
        if "GENERAL" in moniSeq :

            # Enable ChronoAuditor
            chronoAuditor = "ChronoAuditor"
            if chronoAuditor not in AuditorSvc().Auditors :
                AuditorSvc().Auditors += [ chronoAuditor ]
            ChronoAuditor().Enable = True
            # Turn off most output
            ChronoStatSvc().ChronoPrintOutTable = False
            ChronoStatSvc().PrintUserTime       = False
            ChronoStatSvc().PrintSystemTime     = False
            
            from Configurables import GaudiSequencer, RecProcessingTimeMoni
            seq = GaudiSequencer( "MoniGENERALSeq")

            # Overall time
            overallTime = RecProcessingTimeMoni("OverallEventProcTime")
            overallTime.Algorithms = ["PhysicsSeq"]
            seq.Members += [overallTime]

            # Tracking
            trackTime = RecProcessingTimeMoni("TrackEventProcTime")
            trackTime.Algorithms = ["RecoTrSeq","RecoVELOSeq","RecoDecodingSeq"]
            seq.Members += [trackTime]

            # Vertex
            vertTime = RecProcessingTimeMoni("VertexEventProcTime")
            vertTime.Algorithms = ["RecoVertexSeq"]
            seq.Members += [vertTime]

            # RICH
            richTime = RecProcessingTimeMoni("RichEventProcTime")
            richTime.Algorithms = ["RecoRICHSeq"]
            seq.Members += [richTime]

            # CALO
            caloTime = RecProcessingTimeMoni("CaloEventProcTime")
            caloTime.Algorithms = ["RecoCALOSeq"]
            seq.Members += [caloTime]

            # MUON
            muonTime = RecProcessingTimeMoni("MuonEventProcTime")
            muonTime.Algorithms = ["RecoMUONSeq"]
            seq.Members += [muonTime]

            # PROTO
            protoTime = RecProcessingTimeMoni("ProtoEventProcTime")
            protoTime.Algorithms = ["RecoPROTOSeq"]
            seq.Members += [protoTime]

            # ProcStat Abort rates
            from Configurables import ProcStatAbortMoni
            seq.Members += [ProcStatAbortMoni()]
        
        if "CALO" in moniSeq :
            import GaudiKernel.ProcessJobOptions
            GaudiKernel.ProcessJobOptions.PrintOn()
            from Configurables import GaudiSequencer
            seq = GaudiSequencer( "MoniCALOSeq")
            noSPDPRS = True
            if [det for det in ['SPD','PRS'] if det in dets]:
                noSPDPRS = False
            caloMoni = CaloMoniDstConf( MonitorSequence    = seq,
                                        OutputLevel = self.getProp('OutputLevel'),
                                        Context = 'Offline',
                                        NoSpdPrs = noSPDPRS)
            caloMoni.printConf()
            self.setOtherProps(caloMoni,["Histograms"])
            GaudiKernel.ProcessJobOptions.PrintOff()

        if "VELO" in moniSeq :
            from Configurables import GaudiSequencer
            self.setOtherProps(VeloRecMonitors(),["Histograms","OutputLevel"])
            VeloRecMonitors().setProp("MoniSequence", GaudiSequencer("MoniVELOSeq"))
            #importOptions('$VELORECMONITORSROOT/options/BrunelMoni_Velo.py')   
        if "OT" in moniSeq :
            from TrackMonitors.ConfiguredTrackMonitors import ConfiguredOTMonitorSequence
            ConfiguredOTMonitorSequence(Name='MoniOTSeq')

        if "MUON" in moniSeq :
            from MuonPIDChecker import ConfigureMuonPIDChecker as mmuon
            mydata =  self.getProp("DataType")
            mymonitconf = mmuon.ConfigureMuonPIDChecker(data = mydata)
            mymonitconf.configure(UseMC = False, HistosLevel = self.getProp("Histograms")) 

            mymtmconf = MuonTrackMonitorConf()
            self.setOtherProps(mymtmconf,["Histograms","OutputLevel","DataType"])
            mymtmconf.setProp("Sequencer", GaudiSequencer("MoniMUONSeq"))

        if "ST" in moniSeq :
            from Configurables import ST__STClusterMonitor, GaudiSequencer
            GaudiSequencer( "MoniSTSeq" ).Members += [ ST__STClusterMonitor("TTClusterMonitor")]
            ST__STClusterMonitor("TTClusterMonitor").DetType = "TT" ## default anyway 
            GaudiSequencer( "MoniSTSeq" ).Members += [ ST__STClusterMonitor("ITClusterMonitor")]
            ST__STClusterMonitor("ITClusterMonitor").DetType = "IT"

        if "Tr" in moniSeq :
            from TrackMonitors.ConfiguredTrackMonitors import ConfiguredTrackMonitorSequence
            ConfiguredTrackMonitorSequence(Name='MoniTrSeq')


        if "PROTO" in moniSeq :
            from Configurables import ( ChargedProtoParticleMoni, GaudiSequencer,
                                        ANNGlobalPID__ChargedProtoANNPIDMoni )
            seq = GaudiSequencer( "MoniPROTOSeq" )
            seq.Members += [ ChargedProtoParticleMoni("ChargedProtoPMoni"),
                             ANNGlobalPID__ChargedProtoANNPIDMoni("ChargedProtoANNPIDMoni") ]
            if self.expertHistos() and not self.getProp("CheckEnabled") :
                exSeq = GaudiSequencer("ExpertProtoMoni")
                seq.Members += [exSeq]
                GlobalRecoChecks().Sequencer = exSeq

        # If checking is enabled, all Rich histograms are booked in check sequence
        if "RICH" in moniSeq and not self.getProp("CheckEnabled"):
            from Configurables import GaudiSequencer
            conf = RichRecQCConf(self.richMoniConfName)
            self.setOtherProps(conf,["Histograms","Context","OutputLevel",
                                     "DataType","Simulation","OnlineMode"])
            conf.setProp("MoniSequencer", GaudiSequencer("MoniRICHSeq"))
            conf.setProp("WithMC", False)
            conf.RichPIDLocation = "Rec/Rich/PIDs"
            import GaudiKernel.ProcessJobOptions
            GaudiKernel.ProcessJobOptions.PrintOn()
            log.debug(conf)
            GaudiKernel.ProcessJobOptions.PrintOff()
        
        if "Hlt" in moniSeq :
            # Do not run Hlt monitoring on DataTypes without HltDecReports 
            if self.getProp("DataType") not in ["2008","DC06","MC09"] and not self.getProp("Simulation") :
                from HltMonitors.ConfiguredHltMonitors import ConfiguredHltMonitorSequence
                ConfiguredHltMonitorSequence(Name='MoniHltSeq')

        # Expert histograms
        if self.expertHistos():
            if "TT" in moniSeq :
                from Configurables import ST__STClusterMonitor
                clusMoni = ST__STClusterMonitor("TTClusterMonitor")
                clusMoni.FullDetail = True
                GaudiSequencer("MoniTTSeq").Members += [clusMoni]
            if "IT" in moniSeq :
                from Configurables import ST__STClusterMonitor
                clusMoni = ST__STClusterMonitor("ITClusterMonitor")
                clusMoni.FullDetail = True
                clusMoni.DetType = "IT"
                GaudiSequencer("MoniITSeq").Members += [clusMoni]
コード例 #5
0
from Gaudi.Configuration import *
# Job options to configure the data on demand service for decoding the RawEvent

MoniITSeq = GaudiSequencer( 'MoniITSeq' )
MoniITSeq.MeasureTime = True
#ApplicationMgr().TopAlg.append( MoniITSeq )

from Configurables import ( ST__STClusterMonitor )
        
itClusterMonitorCentral = ST__STClusterMonitor("ITClusterMonitorCentral")
itClusterMonitorCentral.DetType = "IT"
itClusterMonitorCentral.ClusterLocation = "Raw/IT/Clusters"
itClusterMonitorCentral.HitMaps = True
itClusterMonitorCentral.ByDetectorRegion = False
itClusterMonitorCentral.ByServiceBox = True
itClusterMonitorCentral.ByPort = True;
itClusterMonitorCentral.FullDetail = False
itClusterMonitorCentral.OutputLevel = 3

itClusterMonitorPrev7 = ST__STClusterMonitor("ITClusterMonitorPrev7")
itClusterMonitorPrev7.DetType = "IT"
itClusterMonitorPrev7.ClusterLocation = "Prev7/Raw/IT/Clusters"
itClusterMonitorPrev7.HitMaps = False
itClusterMonitorPrev7.ByDetectorRegion = False
itClusterMonitorPrev7.ByServiceBox = True
itClusterMonitorPrev7.ByPort = True;
itClusterMonitorPrev7.FullDetail = False
itClusterMonitorPrev7.OutputLevel = 3

itClusterMonitorPrev6 = ST__STClusterMonitor("ITClusterMonitorPrev6")
itClusterMonitorPrev6.DetType = "IT"
コード例 #6
0
    def configureMoni(self, moniDets):
        # Set up monitoring
        histOpt = self.getProp("Histograms").capitalize()
        if histOpt not in self.KnownHistOptions:
            raise RuntimeError("Unknown Histograms option '%s'" % histOpt)

        from Configurables import BooleInit, MemoryTool
        booleInit = BooleInit()
        booleInit.addTool(MemoryTool(), name="BooleMemory")
        booleInit.BooleMemory.HistoTopDir = "Boole/"
        booleInit.BooleMemory.HistoDir = "MemoryTool"

        if "Velo" in moniDets:
            from Configurables import VeloSimMoni, VeloDigit2MCHitLinker, VeloDigiMoni, VeloRawClustersMoni
            GaudiSequencer("MoniVeloSeq").Members += [
                VeloSimMoni(),
                VeloDigit2MCHitLinker(),
                VeloDigiMoni(),
                VeloRawClustersMoni()
            ]
            if self.getProp("DataType") == "Upgrade":
                from Configurables import VeloMonitorSpilloverSubtr
                GaudiSequencer("MoniVeloSeq").Members += [
                    VeloMonitorSpilloverSubtr()
                ]
            if True == self.getProp("VeloTell1Processing"):
                GaudiSequencer("MoniVeloSeq").Members.remove(
                    VeloDigit2MCHitLinker())
                GaudiSequencer("MoniVeloSeq").Members.remove(VeloDigiMoni())

        if "IT" in moniDets or "TT" in moniDets:
            from Configurables import (MCSTDepositMonitor, MCSTDigitMonitor,
                                       STDigitMonitor, ST__STClusterMonitor,
                                       STEffChecker, MCParticle2MCHitAlg,
                                       MCParticleSelector)
            from GaudiKernel.SystemOfUnits import GeV

        if "IT" in moniDets:
            mcDepMoni = MCSTDepositMonitor("MCITDepositMonitor", DetType="IT")
            mcDigitMoni = MCSTDigitMonitor("MCITDigitMonitor", DetType="IT")
            digitMoni = STDigitMonitor("ITDigitMonitor", DetType="IT")
            clusMoni = ST__STClusterMonitor("ITClusterMonitor", DetType="IT")
            mcp2MCHit = MCParticle2MCHitAlg(
                "MCP2ITMCHitAlg",
                MCHitPath="MC/IT/Hits",
                OutputData="/Event/MC/Particles2MCITHits")
            effCheck = STEffChecker("ITEffChecker", DetType="IT")
            effCheck.addTool(MCParticleSelector)
            effCheck.MCParticleSelector.zOrigin = 50.0
            effCheck.MCParticleSelector.pMin = 1.0 * GeV
            effCheck.MCParticleSelector.betaGammaMin = 1.0
            GaudiSequencer("MoniITSeq").Members += [
                mcDepMoni, mcDigitMoni, digitMoni, clusMoni, mcp2MCHit,
                effCheck
            ]
            if self.getProp("DataType") == "Upgrade":
                from Configurables import STSpilloverSubtrMonitor
                GaudiSequencer("MoniITSeq").Members += [
                    STSpilloverSubtrMonitor("ITSpilloverSubtrMonitor",
                                            DetType="IT")
                ]
            if histOpt == "Expert":
                mcDepMoni.FullDetail = True
                mcDigitMoni.FullDetail = True
                clusMoni.FullDetail = True
                effCheck.FullDetail = True

        if "TT" in moniDets:
            mcDepMoni = MCSTDepositMonitor("MCTTDepositMonitor")
            mcDigitMoni = MCSTDigitMonitor("MCTTDigitMonitor")
            digitMoni = STDigitMonitor("TTDigitMonitor")
            clusMoni = ST__STClusterMonitor("TTClusterMonitor")
            mcp2MCHit = MCParticle2MCHitAlg(
                "MCP2TTMCHitAlg",
                MCHitPath="MC/TT/Hits",
                OutputData="/Event/MC/Particles2MCTTHits")
            effCheck = STEffChecker("TTEffChecker")
            effCheck.addTool(MCParticleSelector)
            effCheck.MCParticleSelector.zOrigin = 50.0
            effCheck.MCParticleSelector.pMin = 1.0 * GeV
            effCheck.MCParticleSelector.betaGammaMin = 1.0
            GaudiSequencer("MoniTTSeq").Members += [
                mcDepMoni, mcDigitMoni, digitMoni, clusMoni, mcp2MCHit,
                effCheck
            ]
            if self.getProp("DataType") == "Upgrade":
                from Configurables import STSpilloverSubtrMonitor
                GaudiSequencer("MoniTTSeq").Members += [
                    STSpilloverSubtrMonitor("TTSpilloverSubtrMonitor",
                                            DetType="TT")
                ]
            if histOpt == "Expert":
                mcDepMoni.FullDetail = True
                mcDigitMoni.FullDetail = True
                clusMoni.FullDetail = True
                effCheck.FullDetail = True

        if "OT" in moniDets:
            from Configurables import MCOTDepositMonitor
            GaudiSequencer("MoniOTSeq").Members += [MCOTDepositMonitor()]
            if histOpt == "Expert":
                importOptions("$OTMONITORROOT/options/Boole.opts")

        if "Rich" in moniDets:
            from Configurables import Rich__MC__Digi__DigitQC
            GaudiSequencer("MoniRichSeq").Members += [
                Rich__MC__Digi__DigitQC("RiDigitQC")
            ]

        if "Calo" in moniDets:
            from Configurables import CaloDigitChecker
            importOptions("$CALOMONIDIGIOPTS/CaloDigitChecker.opts")
            GaudiSequencer("MoniCaloSeq").Members += [
                CaloDigitChecker("SpdCheck"),
                CaloDigitChecker("PrsCheck"),
                CaloDigitChecker("EcalCheck"),
                CaloDigitChecker("HcalCheck")
            ]

        if "Muon" in moniDets:
            from Configurables import MuonDigitChecker
            GaudiSequencer("MoniMuonSeq").Members += ["MuonDigitChecker"]

        if "L0" in moniDets:
            from Configurables import L0Conf
            L0Conf().MoniSequencer = GaudiSequencer("MoniL0Seq")