Beispiel #1
0
    def __apply_configuration__(self):

        GaudiKernel.ProcessJobOptions.PrintOff()
        GaudiKernel.ProcessJobOptions.PrintOn()
        log.info("Initializing sequences!")
        self.setOtherProps(
            RecSysConf(), ["SpecialData", "Context", "OutputType", "DataType"])

        #if self.isPropertySet("RecoSequence") :
        #self.setOtherProp(RecSysConf(),["RecoSequence"])
        RecSysConf().RecoSequence = self.CheckRecoSequence()

        # there is a bug in setOtherProps, so we cannot use it to set the MoniSequence.
        if not self.getProp("OnlineMode"):
            self.setOtherProps(RecMoniConf(), ["Context", "DataType"])
            RecMoniConf().MoniSequence = self.getProp("MoniSequence")
        else:
            self.setOtherProps(RecMoniConf(), ["Context", "DataType"])
            RecMoniConf().MoniSequence = self.getProp("MoniSequence")
            RecMoniConf().Context = "Offline"
            RecMoniConf().OutputLevel = FATAL
            RecMoniConf().Histograms = "OfflineFull"

        self.defineGeometry()
        self.defineEvents()
        self.defineOptions()

        # database hacking for online.
        if self.getProp('UseDBSnapshot'): self.configureDBSnapshot()

        # Use TimingAuditor for timing, suppress printout from SequencerTimerTool
        from Configurables import (ApplicationMgr, AuditorSvc,
                                   SequencerTimerTool)
        ApplicationMgr().ExtSvc += ['ToolSvc', 'AuditorSvc']
        ApplicationMgr().AuditAlgorithms = True
        AuditorSvc().Auditors += ['TimingAuditor']
        SequencerTimerTool().OutputLevel = 4

        log.info(self)
        log.info(LHCbApp())
        log.info(RecSysConf())
        log.info(TrackSys())
        if not self.getProp("OnlineMode"):
            log.info(RecMoniConf())
        log.info(TAlignment())
        log.info(DstConf())
        GaudiKernel.ProcessJobOptions.PrintOff()
Beispiel #2
0
    def __apply_configuration__(self):

        GaudiKernel.ProcessJobOptions.PrintOff()

        # database hacking for online
        if self.getProp('UseDBSnapshot') : self._configureDBSnapshot()

        self.defineGeometry()
        self.defineEvents()
        self.defineOptions()
        self.defineMonitors()
        self.setOtherProps(RecSysConf(),["Histograms","SpecialData","Context",
                                         "OutputType","DataType","Simulation","OnlineMode","SkipTracking"])
        self.setOtherProps(RecMoniConf(),["Histograms","Context","DataType","Simulation","OnlineMode","SkipTracking"])
        self.setOtherProps(TrackSys(),["DataType","Simulation"])

        if self.isPropertySet("RecoSequence") :
            self.setOtherProp(RecSysConf(),"RecoSequence")
        GaudiKernel.ProcessJobOptions.PrintOn()
        log.info( self )
        log.info( RecSysConf() )
        log.info( TrackSys() )
        log.info( RecMoniConf() )
        GaudiKernel.ProcessJobOptions.PrintOff()
Beispiel #3
0
def ConfiguredOTMonitorSequence(Name="MoniOTSeq", HistoPrint=False):
    seq = GaudiSequencer(Name)
    if RecMoniConf().getProp("Histograms") is "Online":
        OTTrackMonitor().Online = True
        OTHitEfficiencyMonitor().Online = True

    seq.Members.append(OTTimeMonitor(HistoPrint=HistoPrint))
    seq.Members.append(OTTrackMonitor(HistoPrint=HistoPrint))
    seq.Members.append(OTHitEfficiencyMonitor(HistoPrint=HistoPrint))

    from Configurables import TrackSys
    if TrackSys().cosmics():
        OTTrackMonitor().RawBankDecoder = 'OTMultiBXRawBankDecoder'
        OTHitEfficiencyMonitor().RawBankDecoder = 'OTMultiBXRawBankDecoder'
        OTTimeMonitor().RawBankDecoder = 'OTMultiBXRawBankDecoder'

    return seq
Beispiel #4
0
Escher().InputType = "DIGI"
Escher().Kalman = True
Escher().Millepede = False
# Escher().TrackContainer = "Rec/Track/Velo" # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo
Escher().EvtMax = -1
Escher().MoniSequence = []
Escher().RecoSequence = [
    "Decoding", "VP", "VELOPIX", "Tr", "Vertex", "CALO", "PROTO"
]
Escher().WithMC = True
Escher().Simulation = True
Escher().DataType = 'Upgrade'
Escher().Upgrade = True
RecSysConf().Detectors = detectors
RecMoniConf().Detectors = detectors

Escher().ExpertTracking = ["kalmanSmoother"]

TrackSys().TrackExtraInfoAlgorithms = []
TrackSys().DataType = 'Upgrade'
TrackSys().Simulation = True
TrackSys().WithMC = True
#TrackSys().TrackTypes   = ["Velo"]
TrackSys().TrackPatRecAlgorithms = [
    "VP", "Forward", "TsaSeed", "Match", "Downstream"
]
DstConf().Detectors = detectors

hvpseq = GaudiSequencer("VPSeq")
prLHCbID2mc = PrLHCbID2MCParticle()
Beispiel #5
0
    def configureCheck(self,expert):
        # "Check" histograms filled only with simulated data

        KnownCheckSubdets = ["Pat"]

        # CheckSubdets
        if [det for det in ['Rich1', 'Rich2', 'Rich1Pmt', 'Rich2Pmt'] if det in self.getProp("Detectors")]:
            KnownCheckSubdets.append("RICH")
        if [det for det in ['Muon', 'MuonNoM1'] if det in self.getProp("Detectors")]:
            KnownCheckSubdets.append("MUON")

        # Expert Check Subdets
        KnownExpertCheckSubdets = [] + KnownCheckSubdets
        
        if [det for det in ['TT'] if det in self.getProp("Detectors")]:
            KnownExpertCheckSubdets.append("TT")

        tmpExpertSubdets = [det for det in ['IT', 'OT'] if det in self.getProp("Detectors")]
        if tmpExpertSubdets:
            for det in tmpExpertSubdets:
                KnownExpertCheckSubdets.append(det)
        if [det for det in ['Tr'] if det in self.getProp("Detectors")]:
            KnownExpertCheckSubdets.append('Tr')
        if [det for det in ['Spd', 'Prs', 'Ecal', 'Hcal'] if det in self.getProp("Detectors")]:
            KnownExpertCheckSubdets.append("CALO")

        KnownExpertCheckSubdets.append("PROTO")


        RecMoniConf().setProp( "CheckEnabled", True )

        if not self.isPropertySet("MCCheckSequence"):
            if expert:
                checkSeq = KnownExpertCheckSubdets
            else:
                checkSeq = KnownCheckSubdets
            self.MCCheckSequence = checkSeq
        else:
            for seq in self.getProp("MCCheckSequence"):
                if expert:
                    if seq not in KnownExpertCheckSubdets:
                        log.warning("Unknown subdet '%s' in MCCheckSequence"%seq)
                else:
                    if seq not in KnownCheckSubdets:
                        log.warning("Unknown subdet '%s' in MCCheckSequence"%seq)

        checkSeq = self.getProp("MCCheckSequence")
        from Configurables import ProcessPhase
        ProcessPhase("Check").DetectorList += checkSeq

        # Tracking handled inside TrackSys configurable
        TrackSys().setProp( "WithMC", True )

        if ("MUON" in checkSeq) and ("Muon" in self.getProp("Detectors")):
            from MuonPIDChecker import ConfigureMuonPIDChecker as cmuon
            mydata =  self.getProp("DataType")
            mycheckconf = cmuon.ConfigureMuonPIDChecker(data = mydata)
            mycheckconf.configure(UseMC = True, HistosLevel = self.getProp("Histograms"))

        if ("RICH" in checkSeq) and [det for det in ['Rich1', 'Rich2', 'Rich1Pmt', 'Rich2Pmt'] if det in self.getProp("Detectors")] :
            from Configurables import GaudiSequencer
            richMoniConf = RichRecQCConf(self.richMoniConfName)
            self.setOtherProps(richMoniConf, ["Histograms","Context","OutputLevel","OnlineMode",
                                              "DataType","WithMC","Simulation"] )
            richMoniConf.setProp("MoniSequencer", GaudiSequencer("CheckRICHSeq"))

        if expert:
            # Data on Demand for MCParticle to MCHit association, needed by ST, IT, OT, Tr, Muon
            # Different for upgrade and non-upgrade
            if( self.getProp("DataType") is "Upgrade" ):
                importOptions( "$ASSOCIATORSROOT/options/MCParticleToMCHitUpgrade.py" )
            else:
                importOptions( "$ASSOCIATORSROOT/options/MCParticleToMCHit.py" )
                
            # Allow multiple files open at once (SIM,DST,DIGI etc.)
            IODataManager().AgeLimit += 1

            if (
                ("TT" in checkSeq) and
                (hasattr(self, "Detectors")) and
                ("TT" in self.getProp("Detectors"))
                ):
                from Configurables import ( STEffChecker, MCParticleSelector )
                from GaudiKernel.SystemOfUnits import GeV
                effCheck = STEffChecker("TTEffChecker")
                effCheck.FullDetail = True
                effCheck.addTool(MCParticleSelector)
                effCheck.MCParticleSelector.zOrigin = 50.0
                effCheck.MCParticleSelector.pMin = 1.0*GeV
                effCheck.MCParticleSelector.betaGammaMin = 1.0
                from Configurables import GaudiSequencer
                GaudiSequencer("CheckTTSeq").Members += [effCheck]

            if (
                ("IT" in checkSeq) and
                (hasattr(self, "Detectors")) and
                ("IT" in self.getProp("Detectors"))
                ):
                from Configurables import ( STEffChecker, MCParticleSelector )
                from GaudiKernel.SystemOfUnits import GeV
                effCheck = STEffChecker("ITEffChecker")
                effCheck.FullDetail = True
                effCheck.addTool(MCParticleSelector)
                effCheck.MCParticleSelector.zOrigin = 50.0
                effCheck.MCParticleSelector.pMin = 1.0*GeV
                effCheck.MCParticleSelector.betaGammaMin = 1.0
                effCheck.DetType = "IT"
                from Configurables import GaudiSequencer
                GaudiSequencer("CheckITSeq").Members += [effCheck]

            if (
                ("OT" in checkSeq) and
                (hasattr(self, "Detectors")) and
                ("OT" in self.getProp("Detectors"))
                ):
                GaudiSequencer("CheckOTSeq").Members += ["OTTimeChecker"] # needs MCHits

            if "Tr" in  checkSeq :
                # Checking on the tracks in the "best" container - needs MCHits
                # not active for upgrade for the moment
                if( self.getProp("DataType") is "Upgrade" ):
                    pass
                else:
                    importOptions( "$TRACKSYSROOT/options/TrackChecking.opts" )

            if "CALO" in  checkSeq :
                import GaudiKernel.ProcessJobOptions
                GaudiKernel.ProcessJobOptions.PrintOn()
                from Configurables import GaudiSequencer
                ccseq=GaudiSequencer("CaloCheckers")
                noSPDPRS = False
                if [det for det in ['Spd', 'Prs'] if det in self.getProp("Detectors")]:
                    noSPDPRS = True
                caloMoni = CaloMoniDstConf( CheckerSequence  = ccseq,
                                            OutputLevel = self.getProp('OutputLevel'),
                                            Context = 'Offline',
                                            NoSpdPrs = noSPDPRS)
                caloMoni.printConf()

                GaudiKernel.ProcessJobOptions.PrintOff()
                GaudiSequencer("CheckCALOSeq").Members = [ "CaloDigit2MCLinks2Table", "CaloClusterMCTruth" ,ccseq] 

            if "PROTO" in checkSeq :
                from Configurables import GaudiSequencer
                self.setOtherProps(GlobalRecoChecks(),["OutputLevel"])
                exSeq = GaudiSequencer("ExpertProtoMoni")
                GaudiSequencer("CheckPROTOSeq").Members += [exSeq]
                GlobalRecoChecks().Sequencer = exSeq
Beispiel #6
0
    def configureInit(self, inputType):
        # Init sequence
        if not self.isPropertySet("InitSequence"):
            if self._isReprocessing(inputType):
                self.setProp( "InitSequence", self.DefaultReproInitSequence )
            else:
                self.setProp( "InitSequence", self.DefaultInitSequence )
        from Configurables import ProcessPhase
        ProcessPhase("Init").DetectorList += self.getProp("InitSequence")

        from Configurables import RecInit, MemoryTool
        recInit = RecInit( "BrunelInit",
                           PrintFreq = self.getProp("PrintFreq"))
        GaudiSequencer("InitBrunelSeq").Members += [ recInit ]
        recInit.addTool( MemoryTool(), name = "BrunelMemory" )
        recInit.BrunelMemory.HistoTopDir = "Brunel/"
        recInit.BrunelMemory.HistoDir    = "MemoryTool"
        if not recInit.isPropertySet( "MemoryPurgeLimit" ): recInit.MemoryPurgeLimit = 2000 * 1000 # 2GB

        # count events
        from Configurables import EventCountHisto
        evtC = EventCountHisto("BrunelEventCount")
        evtC.HistoTopDir = "Brunel/"
        GaudiSequencer("InitBrunelSeq").Members += [ evtC ]

        # kill some RAW banks
        banksToKill = []
        if self.isPropertySet( "RawBanksToKill" ):
            banksToKill  = self.getProp( "RawBanksToKill" )
        if ("2009" == self.getProp("DataType")) and (inputType in ["MDF"]) and not self.getProp("Simulation") :
            banksToKill += ["VeloFull", "L0PUFull"]
        if len(banksToKill) > 0 :
            from Configurables import bankKiller
            bkKill = bankKiller("BrunelBankKiller")
            bkKill.BankTypes = banksToKill
            GaudiSequencer("InitBrunelSeq").Members += [ bkKill ]

        # Do not print event number at every event (done already by BrunelInit)
        EventSelector().PrintFreq = -1

        # OutputLevel
        self.setOtherProp(LHCbApp(),"OutputLevel")
        if self.isPropertySet( "OutputLevel" ) :
            level = self.getProp("OutputLevel")
            if level == ERROR or level == WARNING :
                # Suppress known warnings
                importOptions( "$BRUNELOPTS/SuppressWarnings.opts" )
                if not recInit.isPropertySet( "OutputLevel" ): recInit.OutputLevel = INFO
        self.setOtherProps(RecSysConf(), ["OutputLevel","Detectors"])
        self.setOtherProps(RecMoniConf(),["OutputLevel","Detectors"])

        # New NoSPDPRS switches
        noSPDPRS = False
        if [det for det in ['Spd', 'Prs'] if det not in self.getProp("Detectors")]:
            noSPDPRS = True
        # only set properties if no use RecoSequence is defined or if it contains 'PROTO'
        # not that 'PROTO' alone is not sufficient to run the Calo reconstruction, but a requirement
        if ( not self.isPropertySet("RecoSequence") or "PROTO" in self.getProp("RecoSequence") ):
            CaloProcessor().setProp("NoSpdPrs", noSPDPRS)
            GlobalRecoConf().setProp("NoSpdPrs", noSPDPRS)


        # Always print Magnetic Field used
        from Configurables import MagneticFieldSvc
        magSvc = MagneticFieldSvc()
        if not magSvc.isPropertySet("OutputLevel") :
            magSvc.setProp("OutputLevel", INFO)

        # Switch off LoKi banner
        from Configurables import LoKiSvc
        LoKiSvc().Welcome = False
# Available steering options and defaults are documented in
# $BRUNELROOT/python/Brunel/Configuration.py
###############################################################################

# Just instantiate the configurable...
theApp = Brunel()
theApp.DataType = "2015"
theApp.InputType = "MDF"
theApp.EvtMax = 100
theApp.PrintFreq = 100
theApp.Simulation = False
theApp.OutputType = "NONE"

#theApp.RecoSequence = [ "Decoding", "VELO", "TT", "IT", "OT", "Tr", "Vertex" ]
from Configurables import RecMoniConf
RecMoniConf().setProp("MoniSequence", ["OT"])

theApp.DDDBtag = "dddb-20150526"
theApp.CondDBtag = "cond-20150601"

# Setup CondDB
from Configurables import CondDB
conddb = CondDB()
conddb.IgnoreHeartBeat = True
#if running online
#conddb.UseDBSnapshot = True
#conddb.EnableRunChangeHandler = True
#conddb.Tags['ONLINE'] = 'fake'
#import AllHlt1
#conddb.RunChangeHandlerConditions = AllHlt1.ConditionMap
Beispiel #8
0
#rConf.richTools().PhotonRecoType = "EstiFromRadius"#use for faster photon reconstruction!!

#Brunel options
Brunel().DataType = "2011"
Brunel().EvtMax = -1
Brunel().PrintFreq = 1
Brunel().OutputType = "None"
Brunel().InitSequence = ["Brunel"]
Brunel().RecoSequence = ["RICH"]
Brunel().Histograms = "OfflineExpress"
#tags
LHCbApp().DDDBtag = "head-20110914"
LHCbApp().CondDBtag = "head-20111111"

from Configurables import RecMoniConf
RecMoniConf().MoniSequence = ["RICH"]

from Configurables import HistogramPersistencySvc
HistogramPersistencySvc().OutputFile = "Histos-2011-Collisions.root"

from Configurables import RichRecSysConf
# disable PID
RichRecSysConf(
    "RichOfflineRec").photonConfig().SelectionMode = "ParticleSearch"
#RichRecSysConf ("RichOfflineRec").setProp("PidConfig", "None")

from Configurables import RichParticleSearchConf
PtConf = RichParticleSearchConf
PtConf.R2NTupleProduce = True
#PtConf.AerogelNTupleProduce = True
PtConf.NTupleProduce = True
from Configurables import Brunel, NTupleSvc, TrackSys, RecMoniConf

Brunel().InputType = "DIGI" # implies also Brunel().Simulation = True
Brunel().WithMC    = True   # implies also Brunel().Simulation = True
Brunel().OutputType   = "NONE"
Brunel().Histograms   = "Expert"
TrackSys().TrackPatRecAlgorithms = [ "Truth", "FastVelo" ]
Brunel().RecoSequence = ["Decoding", "Truth", "VELO" ]
RecMoniConf().MoniSequence = [ ]
Brunel().MCLinksSequence = [ "Tr" ]
Brunel().MCCheckSequence = [ "Fit" ]

from Configurables import DDDBConf
DDDBConf().DbRoot = "/afs/cern.ch/user/o/ogruenbe/public/FT_upgrade/static_DDDB_FT_v4/lhcb.xml"
Brunel().DDDBtag   = "MC11-20111102"
Brunel().CondDBtag = "sim-20111111-vc-md100"

NTupleSvc().Output = ["FILE1 DATAFILE='~/w0/track.root' TYP='ROOT' OPT='NEW'"]

from Configurables import LHCbApp

from Gaudi.Configuration import * 
from GaudiConf import IOHelper

IOHelper().inputFiles(['PFN:root://castorlhcb.cern.ch//castor/cern.ch/user/o/ocallot/Bs_mumu_v4_nu50.digi?svcClass=default'])
Brunel().EvtMax     = 1000

def doMyChanges():
   from Configurables import GaudiSequencer
   GaudiSequencer("CaloBankHandler").Members = []
   GaudiSequencer("RecoDecodingSeq").Members = [ "DecodeVeloRawBuffer/DecodeVeloClusters", "FTRawBankDecoder" ]
Beispiel #10
0
LHCbApp().CondDBtag = "sim-20150716-vc-mu100"
LHCbApp().DataType = "Upgrade"
#LHCbApp().Detectors = ['VP', 'UT', 'FT', "Tr"]

L0Conf().EnsureKnownTCK = False

from Configurables import RootCnvSvc
RootCnvSvc().GlobalCompression = "ZLIB:1"

#from Configurables import MCFTDigitCreator
#MCFTDigitCreator().SimulateNoise = False

from Configurables import DecodeRawEvent
DecodeRawEvent().setProp("OverrideInputs", 4.2)

from Configurables import RichRecSysConf, RichRecQCConf
rConf = RichRecSysConf("RichOfflineRec")
# No Aerogel
rConf.Radiators = ["Rich1Gas", "Rich2Gas"]
# no photon sel cuts (need optimising)
rConf.photonConfig().SelectionMode = "All"
# Corrections to CK theta
rConf.richTools().photonReco().CKThetaQuartzRefractCorrections = [
    -0.00625, 0.00010, 2.9e-5
]

RecMoniConf().Detectors = ["Tr"]
RecMoniConf().MoniSequence = ["Tr"]

ApplicationMgr().ExtSvc += ["DataOnDemandSvc"]
Beispiel #11
0
def ConfiguredTrackMonitorSequence(Name="TrackMonitorSequence",
                                   HistoPrint=False):

    # figure out detectors
    seq = GaudiSequencer(Name)
    subDets = None  #default, all monitors
    from Configurables import LHCbApp
    if hasattr(LHCbApp(), "Detectors"):
        if LHCbApp().isPropertySet("Detectors"):
            subDets = LHCbApp().getProp("Detectors")
    seq.Members.append(TrackMonitor(HistoPrint=HistoPrint))
    seq.Members.append(TrackDiMuonMonitor(HistoPrint=HistoPrint))
    seq.Members.append(TrackVertexMonitor(HistoPrint=HistoPrint))
    seq.Members.append(AlignmentOnlineMonitor(HistoPrint=HistoPrint))

    from Configurables import TrackSys
    if TrackSys().timing():
        seq.Members.append(TrackTimingMonitor(HistoPrint=HistoPrint))

    if not RecMoniConf().getProp("Histograms") is "Online":
        seq.Members.append(TrackV0Monitor(HistoPrint=HistoPrint))
        seq.Members.append(TrackFitMatchMonitor(HistoPrint=HistoPrint))
        seq.Members.append(TrackAlignMonitor(HistoPrint=HistoPrint))
        if (subDets is None or "IT" in subDets):
            seq.Members.append(TrackITOverlapMonitor(HistoPrint=HistoPrint))
        if (subDets is None or "Velo" in subDets):
            seq.Members.append(TrackVeloOverlapMonitor(HistoPrint=HistoPrint))
        if (subDets is None or "TT" in subDets):
            seq.Members.append(TTTrackMonitor(HistoPrint=HistoPrint))
        if (subDets is None or "IT" in subDets):
            seq.Members.append(ITTrackMonitor(HistoPrint=HistoPrint))
        seq.Members.append(TrackPV2HalfAlignMonitor(HistoPrint=HistoPrint))
        if RecMoniConf().expertHistos():
            if [
                    det for det in ['Velo', 'TT', 'IT', 'OT']
                    if (subDets is None or det in subDets)
            ]:
                seq.Members.append(HitEffPlotter(HistoPrint=HistoPrint))
            #else:
            #    log.warning("HitEffPlotter not defined for upgrade")
        if "CALO" in RecSysConf().RecoSequence:
            if (subDets is None or "Ecal" in subDets):
                seq.Members.append(
                    TrackCaloMatchMonitor("TrackEcalMatchMonitor",
                                          CaloSystem='Ecal',
                                          HistoPrint=HistoPrint))
            #if ("Hcal" in subDets):
            #seq.Members.append(TrackCaloMatchMonitor("TrackHcalMatchMonitor", CaloSystem='Hcal', HistoPrint=HistoPrint))
            if (subDets is None or "Spd" in subDets):
                seq.Members.append(
                    TrackCaloMatchMonitor("TrackSpdMatchMonitor",
                                          CaloSystem='Spd',
                                          HistoPrint=HistoPrint))
            if (subDets is None or "Prs" in subDets):
                seq.Members.append(
                    TrackCaloMatchMonitor("TrackPrsMatchMonitor",
                                          CaloSystem='Prs',
                                          HistoPrint=HistoPrint))

        if "MUON" in RecSysConf().RecoSequence:
            if (subDets is None or "Muon" in subDets):
                seq.Members.append(
                    TrackMuonMatchMonitor("TrackMuonMatchMonitor",
                                          HistoPrint=HistoPrint))

    return seq