Пример #1
0
def configureL0FromRawBank(trunk):
    """
    Build L0 Muon, Calo candidates and L0DUReport from raw banks on-demand. Puts data in trunk + <standard locations>
    """

    from Configurables import L0Conf
    L0Conf().FullL0MuonDecoding = True
    L0Conf().EnableL0DecodingOnDemand = True

    from Configurables import (L0MuonCandidatesFromRaw,
                               L0CaloCandidatesFromRaw, L0DUFromRawAlg)

    locationRoot = fixTrunk(trunk)
    name = trunkName(trunk)

    DataOnDemandSvc().AlgMap[locationRoot +
                             "Trig/L0/MuonBCSU"] = L0MuonCandidatesFromRaw(
                                 name="L0MuonFromRaw" + name,
                                 RootInTES=locationRoot)
    DataOnDemandSvc().AlgMap[locationRoot +
                             "Trig/L0/FullCalo"] = L0CaloCandidatesFromRaw(
                                 name="L0CaloFromRaw" + name,
                                 RootInTES=locationRoot)

    DataOnDemandSvc().AlgMap[locationRoot +
                             "Trig/L0/L0DUReport"] = L0DUFromRawAlg(
                                 name="L0DUFromRaw" + name,
                                 RootInTES=locationRoot)
Пример #2
0
 def configureDigiL0(self, seq, tae):
     if tae == "":
         # L0 trigger Simulation
         from Configurables import L0Conf
         L0Conf().L0Sequencer = seq
         L0Conf().SimulateL0 = True
         self.setOtherProps(L0Conf(), ["DataType"])
     else:
         raise RuntimeError("TAE not implemented for L0")
Пример #3
0
 def _decReports(self):
     """
     Make L0 reports look just like HLT reports
     """
     from Configurables import L0SelReportsMaker, L0DecReportsMaker
     DataOnDemandSvc().AlgMap["HltLikeL0/DecReports"] = L0DecReportsMaker(
         OutputLevel=4)
     DataOnDemandSvc().AlgMap["HltLikeL0/SelReports"] = L0SelReportsMaker(
         OutputLevel=4)
     from Configurables import L0Conf
     L0Conf().FullL0MuonDecoding = True
     L0Conf().EnableL0DecodingOnDemand = True
Пример #4
0
    def __apply_configuration__(self):

        #print "WAAAAAAAAAAAAAHHHHHHHHHHHHHHHH"

        ############## Set other properties ###########
        self._safeSet(LHCbApp(), [
            'EvtMax', 'SkipEvents', 'Simulation', 'DataType', 'CondDBtag',
            'DDDBtag'
        ])

        ApplicationMgr().AppName = "L0App within Moore"

        ############## The raw event ##################

        from Configurables import DataOnDemandSvc
        dod = DataOnDemandSvc()
        if dod not in ApplicationMgr().ExtSvc:
            ApplicationMgr().ExtSvc.append(dod)

        DecodeRawEvent().DataOnDemand = True

        importOptions("$L0TCK/L0DUConfig.opts")

        self._setRawEventLocations()

        ############## The L0 Part  ###################

        from DAQSys.Decoders import DecoderDB
        l0du = DecoderDB["L0DUFromRawTool"]
        l0du.Properties["StatusOnTES"] = False

        #configure L0 Sequence
        l0seq = GaudiSequencer("L0")
        ApplicationMgr().TopAlg += [l0seq]
        L0TCK = '0x%s' % self.getProp('TCK')[-4:]

        L0Conf().setProp("TCK", L0TCK)
        L0Conf().setProp("L0Sequencer", l0seq)
        self.setOtherProps(L0Conf(), ["DataType"])

        if (self.getProp("ReplaceL0Banks")):
            L0Conf().setProp("ReplaceL0BanksWithEmulated", True)
        else:
            L0Conf().setProp("SimulateL0", True)

        #done, that was quite easy, now for the output files
        self._configureOutput()
Пример #5
0
    def configureFilter(self):
        """
        Set up the filter sequence to selectively write out events
        """
        filterDets = self.getProp("FilterSequence")
        for det in filterDets:
            if det not in self.KnownFilterSubdets:
                log.warning("Unknown subdet '%s' in FilterSequence" % det)

        filterSeq = ProcessPhase("Filter", ModeOR=True)
        filterSeq.DetectorList += filterDets

        if "L0" in filterDets:
            from Configurables import L0Conf
            L0Conf().FilterSequencer = GaudiSequencer("FilterL0Seq")

        if "ODIN" in filterDets:
            from Configurables import OdinTypesFilter
            odinFilter = OdinTypesFilter()
            GaudiSequencer("FilterODINSeq").Members += [odinFilter]
Пример #6
0
    def configureSequences(self, withMC, handleLumi, vetoHltErrorEvents):
        brunelSeq = GaudiSequencer("BrunelSequencer")
        brunelSeq.Context = self.getProp("Context")
        ApplicationMgr().TopAlg += [ brunelSeq ]
        brunelSeq.Members += [ "ProcessPhase/Init" ]
        physicsSeq = GaudiSequencer( "PhysicsSeq" )

        # Treatment of luminosity events
        if handleLumi:
            lumiSeq = GaudiSequencer("LumiSeq")

            # Prepare the FSR
            if self.getProp("WriteFSR"):
                self.setOtherProps(LumiAlgsConf(),["Context","DataType","InputType","Simulation"])
                lumiCounters = GaudiSequencer("LumiCounters")
                lumiSeq.Members += [ lumiCounters ]
                LumiAlgsConf().LumiSequencer = lumiCounters

            # Trigger masks changed in 2016, see LHCBPS-1486
            if self.getProp( "DataType" ) in self.Run1DataTypes or self.getProp( "DataType" ) in [ "2015" ]:
                physFilterRequireMask = [ 0x0, 0x4, 0x0 ]
                lumiFilterRequireMask = [ 0x0, 0x2, 0x0 ]
            else:
                physFilterRequireMask = [ 0x0, 0x0, 0x80000000 ]
                lumiFilterRequireMask = [ 0x0, 0x0, 0x40000000 ]

            # Filter out Lumi only triggers from further processing, but still write to output
            from Configurables import HltRoutingBitsFilter
            physFilter = HltRoutingBitsFilter( "PhysFilter", RequireMask = physFilterRequireMask )
            physicsSeq.Members += [ physFilter ]
            lumiFilter = HltRoutingBitsFilter( "LumiFilter", RequireMask = lumiFilterRequireMask )
            lumiSeq.Members += [ lumiFilter, physFilter ]
            lumiSeq.ModeOR = True

            # Sequence to be executed if physics sequence not called (nano events)
            notPhysSeq = GaudiSequencer("NotPhysicsSeq")
            notPhysSeq.ModeOR = True
            notPhysSeq.Members = [ physFilter ]

            brunelSeq.Members += [ lumiSeq, notPhysSeq ]
            
        # Hlt decreports decoders
        from DAQSys.Decoders import DecoderDB
        from Configurables import LoKi__HDRFilter, AddToProcStatus
        hltStages = ('Hlt1',) if self.getProp('OnlineMode') else ('Hlt1', 'Hlt2')
        hltDecoders = []
        hltErrorFilters = []
        hltFilters = []
        for stage in hltStages:
            decoder = DecoderDB["HltDecReportsDecoder/%sDecReportsDecoder" % stage].setup()
            hltDecoders += [decoder]            # decode DecReports
            # identifies events that are not of type ErrorEvent
            errorFilterCode = "HLT_PASS_RE('%s(?!ErrorEvent).*Decision')" % stage
            hltErrorFilter = LoKi__HDRFilter('%sErrorFilter' % stage, Code = errorFilterCode, Location = decoder.OutputHltDecReportsLocation)
            hltErrorFilters += [decoder, hltErrorFilter] # and apply filter
            
            filterCode = self.getProp(stage + "FilterCode")
            if filterCode:
                hltFilter = LoKi__HDRFilter('%sFilter' % stage, Code = filterCode, Location = decoder.OutputHltDecReportsLocation)
                hltFilters += [decoder, hltFilter]

        # Do not process events flagged as error in Hlt, but still write procstatus
        if vetoHltErrorEvents:
            """
            By Patrick Koppenburg, 16/6/2011
            """
            # Make a sequence that selects HltErrorEvents
            hltErrorFilterSeq = GaudiSequencer("HltErrorFilterSeq")
            if handleLumi: hltErrorFilterSeq.Members = [ physFilter ]       # protect against lumi (that doesn't have decreports)
            hltErrorFilterSeq.Members += hltErrorFilters

            # Sequence to be executed if HltErrorFilter is failing to set ProcStatus
            hltErrorSeq = GaudiSequencer("HltErrorSeq", ModeOR = True, ShortCircuit = True) # anti-logic
            addToProc = AddToProcStatus("HltErrorProc", Reason = "HltError", Subsystem = "Hlt") # write a procstatus
            hltErrorSeq.Members += [hltErrorFilterSeq, addToProc]      # only run if hltErrorFilterSeq fails
            brunelSeq.Members   += [hltErrorSeq]                       # add this sequece to Brunel _before_ physseq
            physicsSeq.Members  += [hltErrorFilterSeq]                 # take good events in physics seq

        # Filter events based on HLT decisions if filters were specified
        if hltFilters:
            hltFilterSeq = GaudiSequencer("HltFilterSeq")
            hltFilterSeq.Members = hltFilters
            physicsSeq.Members += [hltFilterSeq]

        # Convert Calo ReadoutStatus to ProcStatus
        caloBanks=GaudiSequencer("CaloBanksHandler")
        caloDetectors = [det for det in ['Spd','Prs','Ecal','Hcal'] if det in self.getProp("Detectors")]
        CaloDigitConf(ReadoutStatusConvert=True,Sequence=caloBanks,Detectors=caloDetectors)
        physicsSeq.Members += [caloBanks]
        
        # Decode L0 (and HLT if not already done)
        trgSeq = GaudiSequencer("DecodeTriggerSeq")
        l0TrgSeq = GaudiSequencer("L0TriggerSeq")
        if self.getProp( "DataType" ) not in [ "2008", "2009" ]:
            trgSeq.Members += hltDecoders
        trgSeq.Members += [ l0TrgSeq ]
        physicsSeq.Members += [ trgSeq ]
        L0Conf().L0Sequencer = l0TrgSeq
        if self.getProp("RecL0Only"):
            # Setup L0 filtering if requested, runs L0 before Reco
            L0Conf().FilterL0FromRaw = True
            self.setOtherProps( L0Conf(), ["DataType"] )
        else:
            L0Conf().DecodeL0DU = True

        if not self.isPropertySet("MainSequence"):
            if withMC:
                mainSeq = self.DefaultMCSequence
            else:
                mainSeq = self.DefaultSequence
            self.MainSequence = mainSeq
        physicsSeq.Members += self.getProp("MainSequence")
        from Configurables import ProcessPhase
        outputPhase = ProcessPhase("Output")
        brunelSeq.Members  += [ physicsSeq ]
        brunelSeq.Members  += [ outputPhase ]
Пример #7
0
    def defineOptions(self):

        # Kept for Dirac backward compatibility
        if self.getProp( "NoWarnings" ) :
            log.warning("Brunel().NoWarnings=True property is obsolete and maintained for Dirac compatibility. Please use Brunel().ProductionMode=True instead")
            self.setProp( "ProductionMode", True )

        # Special settings for production
        if self.getProp( "ProductionMode" ) :
            if not self.isPropertySet( "OutputLevel" ) :
                self.setProp("OutputLevel", ERROR)
            if not LHCbApp().isPropertySet( "TimeStamp" ) :
                LHCbApp().setProp( "TimeStamp", True )
            if not self.isPropertySet( "PrintFreq" ) :
                self.setProp("PrintFreq", 1000)

        # HC does not exist in Run 1, so use appropriate split output
        if self.getProp( "DataType" ) in self.Run1DataTypes :
            if not self.isPropertySet( "SplitRawEventOutput" ) :
                self.setProp( "SplitRawEventOutput", 4.0 )

        # Online mode
        if self.getProp( "OnlineMode" ) :
            if not self.isPropertySet("Histograms") :
                self.setProp("Histograms","Online")
            if not CondDB().isPropertySet("Online") :
                CondDB().setProp("Online", True)

        inputType = self.getProp( "InputType" ).upper()
        if inputType not in self.KnownInputTypes:
            raise TypeError( "Invalid inputType '%s'"%inputType )

        outputType = self.getProp( "OutputType" ).upper()

        histOpt = self.getProp("Histograms")
        if histOpt not in self.KnownHistograms:
            raise RuntimeError("Unknown Histograms option '%s'"%histOpt)

        withMC = self.getProp("WithMC")
        if withMC:
            if inputType in [ "MDF" ]:
                log.warning( "WithMC = True, but InputType = '%s'. Forcing WithMC = False"%inputType )
                withMC = False # Force it, MDF never contains MC truth
            if outputType in [ "RDST" ]:
                log.warning( "WithMC = True, but OutputType = '%s'. Forcing WithMC = False"%inputType )
                withMC = False # Force it, RDST never contains MC truth

        if self.getProp("WriteFSR") and self.getProp("PackType").upper() in ["MDF"]:
            if hasattr( self, "WriteFSR" ): log.warning("Don't know how to write FSR to MDF output file")
            self.setProp("WriteFSR", False)

        if self.getProp( "MergeGenFSR") and not self.getProp( "Simulation" ):
            if hasattr( self, "MergeGenFSR" ): log.warning("Cannot MergeGenFSR on real data")
            self.setProp( "MergeGenFSR", False )
                
        # Do not look for Hlt errors in data without HltDecReports bank
        if self.getProp( "DataType" ) in [ "2008", "2009" ]:
            self.setProp( "VetoHltErrorEvents", False )
        # For simulation, change the default but allow to override
        if self.getProp( "Simulation" ) and not hasattr( self, "VetoHltErrorEvents" ):
            self.setProp( "VetoHltErrorEvents", False )


        # Flag to handle or not LumiEvents
        handleLumi = inputType in ["MDF"] and not withMC and not self.getProp('UseDBSnapshot')

        # Top level configuration for skipping tracking
        if self.getProp("SkipTracking"):
            if inputType in ["MDF", "DIGI" ]:
                raise RuntimeError( "Cannot skip tracking if tracks not present on the input file" )
            if withMC:
                raise RuntimeError( "SkipTracking not (yet) supported for simulation input" )
            if( self.getProp("DataType") is "Upgrade"):
                raise RuntimeError( "SkipTracking not (yet) supported for Upgrade configurations" )
            ApplicationMgr().ExtSvc += [ "DataOnDemandSvc" ] # to decode the tracks from the DST
            DstConf().setProp("EnableUnpack", ["Tracking"] )

        # veto Hlt Error Events
        vetoHltErrorEvents = self.getProp("VetoHltErrorEvents")

        self.configureSequences( withMC, handleLumi, vetoHltErrorEvents )

        self.configureInit( inputType )

        self.configureInput( inputType )

        self.configureOutput( outputType, withMC, handleLumi )

        if withMC:
            # Create associators for checking and for DST
            from Configurables import ProcessPhase
            ProcessPhase("MCLinks").DetectorList += self.getProp("MCLinksSequence")
            # Unpack Sim data
            GaudiSequencer("MCLinksUnpackSeq").Members += [ "UnpackMCParticle"]

            # particle gun uses MCVertex to fake a reconstructed one
            # unpacking again would lead to crash
            if "pGun" not in self.getProp("SpecialData"):
                GaudiSequencer("MCLinksUnpackSeq").Members += [ "UnpackMCVertex" ]
            else:
                # Cannot run trigger on pGun events...
                L0Conf().EnsureKnownTCK=False
            
            GaudiSequencer("MCLinksTrSeq").Members += [ "TrackAssociator" ]
            GaudiSequencer("MCLinksCaloSeq").Members += [ "CaloDigit2MCLinks2Table", "CaloClusterMCTruth", "CaloHypoMCTruth" ]

            # activate all configured checking (uses MC truth)
            self.configureCheck( histOpt == "Expert" )

            # data on demand needed to pack RichDigitSummary for DST, when reading unpacked DIGI
            # Also needed to unpack MCHit containers when expert checking enabled
            ApplicationMgr().ExtSvc += [ "DataOnDemandSvc" ]

        # ROOT persistency for histograms
        ApplicationMgr().HistogramPersistency = "ROOT"
        from Configurables import RootHistCnv__PersSvc
        RootHistCnv__PersSvc('RootHistCnv').ForceAlphaIds = True

        if histOpt == "None" or histOpt == "":
            # HistogramPersistency still needed to read in CaloPID DLLs.
            # so do not set ApplicationMgr().HistogramPersistency = "NONE"
            return

        # Pass expert checking option to RecSys and RecMoni
        if histOpt == "Expert":
            DstConf().EnablePackingChecks = True

        # Use a default histogram file name if not already set
        if not HistogramPersistencySvc().isPropertySet( "OutputFile" ):
            histosName   = self.getProp("DatasetName")
            if histosName == "": histosName = "Brunel"
            if self.getProp( "RecL0Only" ): histosName += '-L0Yes'
            if (self.evtMax() > 0): histosName += '-' + str(self.evtMax()) + 'ev'
            if histOpt == "Expert": histosName += '-expert'
            histosName += '-histos.root'
            HistogramPersistencySvc().OutputFile = histosName
            
        #reconfigure decoders to point to default location, if required!
        if DecodeRawEvent().isPropertySet("OverrideInputs") and DecodeRawEvent().getProp("OverrideInputs") is not None:
            #do nothing, it's been configured by someone else!
            pass
        elif self.isPropertySet("SplitRawEventInput") and self.getProp("SplitRawEventInput") is not None:
            #print "WAAAAH Overriding RawEvent Locations"
            DecodeRawEvent().setProp("OverrideInputs",self.getProp("SplitRawEventInput"))
        elif inputType in [ "MDF", "DIGI", "XDIGI" ]:
            #set to the default of what comes out of Moore
            DecodeRawEvent().setProp("OverrideInputs","Moore")
        #remember that the default is a long list of locations,
        #starting with places which only exist _after_ brunel has run!

        # Following needed to build RecSummary, even if tracking is skipped.
        if self.getProp("SkipTracking"):
            from TrackSys import RecoTracking
            RecoTracking.DecodeTracking(["FastVelo"])
Пример #8
0
from Configurables import L0Conf
from Configurables import NTupleSvc
from Configurables import PrChecker2
from Configurables import LoKi__Hybrid__MCTool
from Gaudi.Configuration import GaudiSequencer

# As we haven't ran Moore
L0Conf().EnsureKnownTCK = False

# Required to avoid Loki issues when running PrChecker2
myFactory = LoKi__Hybrid__MCTool("MCHybridFactory")
myFactory.Modules = ["LoKiMC.decorators"]
PrChecker2("PrChecker2").addTool(myFactory)

GaudiSequencer("CheckPatSeq").Members = [
    "PrChecker",
    "PrChecker2",
    "TrackIPResolutionChecker",
    "TrackIPResolutionCheckerNT",
    "VPClusterMonitor"
]

NTupleSvc().Output += ["FILE1 DATAFILE='Brunel-tuples.root' TYP='ROOT' OPT='NEW'"]
from GaudiKernel.ProcessJobOptions import importOptions

from Gaudi.Configuration import *

from Configurables import Boole, LHCbApp, CondDB  #, GaudiSequencer
from Configurables import MCFTDepositCreator, MCFTDigitCreator, FTClusterCreator
#from Configurables import MCFTDepositMonitor, MCFTDigitMonitor, FTClusterMonitor
from Configurables import FTRawBankEncoder, FTRawBankDecoder
from Configurables import L0Conf, DDDBConf
L0Conf().TCK = '0x002A'

#CondDB().Upgrade    = True
DDDBConf(
).DbRoot = "/afs/cern.ch/user/o/ogruenbe/public/FT_upgrade/test_DDDBupgrade_FT_v20/lhcb.xml"
#DDDBConf().DbRoot   = "/afs/cern.ch/user/c/cogneras/scratch0/DDDBUpgrade-v20/lhcb.xml"
LHCbApp().DDDBtag = "dddb-20130408"
LHCbApp().CondDBtag = "simcond-20121001-vc-md100"

#-- Event input
#DDDBConf().DbRoot = "/afs/cern.ch/user/o/ogruenbe/public/FT_upgrade/test_DDDBupgrade_FT_v20/lhcb.xml"
#DDDBConf().DbRoot = "/afs/cern.ch/user/o/ogruenbe/public/FT_upgrade/test_DDDB_FT_v20/lhcb.xml"
#DDDBConf().DbRoot = "/afs/cern.ch/user/c/cogneras/public/forFT/DDDB/lhcb.xml"
#DDDBConf().DbRoot = "/afs/cern.ch/user/s/szczypka/public/upgrade/forFT/DDDB/lhcb.xml"
#LHCbApp().DDDBtag   = "dddb-20130408"
#LHCbApp().CondDBtag = "simcond-20121001-vc-md100"

#Datasetname="Bs_mumu_v6_nu325"
#Datasetname="Bs_mumu_v6_nu65"

#Datasetname="MiniBias_v6_nu325"
#Datasetname="MiniBias_v6_nu65"
#             to make a digi file out of an xdst.
# Author    : SciFi usual suspects
# Version   : this file was written for Boole v28r1

# Questions : Please contact [email protected]

###################################################################################

from Gaudi.Configuration import *
from Configurables import Boole, LHCbApp, DDDBConf, CondDB

from Boole.Configuration import *

from Configurables import L0Conf

L0Conf().TCK = '0x0037'
CondDB().Upgrade = True
LHCbApp().DDDBtag = "dddb-20131025"
LHCbApp().CondDBtag = "sim-20130830-vc-md100"
LHCbApp().Simulation = True
CondDB().AllLocalTagsByDataType = [
    "VP_UVP+RICH_2019+UT_UUT", "FT_StereoAngle5"
]
importOptions("$APPCONFIGOPTS/Boole/Default.py")
importOptions("$APPCONFIGOPTS/Boole/xdigi.py")

from Configurables import Boole
Boole().DetectorLink = ['VP', 'UT', 'FT', 'Tr', 'Magnet']
Boole().DetectorDigi = ['VP', 'UT', 'FT', 'Magnet']
Boole().DetectorMoni = ['VP', 'UT', 'FT', 'Magnet']
Boole().DataType = "Upgrade"
from TeslaTools import TeslaTruthUtils
seq = TeslaTruthUtils.associateSequence("Tesla", False)
relations = TeslaTruthUtils.getRelLoc("Tesla")
TeslaTruthUtils.makeTruth(
    tuple, relations,
    ["MCTupleToolKinematic", "MCTupleToolHierarchy", "MCTupleToolPID"])

tuple2 = MCDecayTreeTuple("MCTeslaTuple")
tuple2.Inputs = ['/Event/Tesla/Particles']
tuple2.Decay = tuple.Decay

from Configurables import DataOnDemandSvc, L0SelReportsMaker, L0DecReportsMaker
DataOnDemandSvc().AlgMap["HltLikeL0/DecReports"] = L0DecReportsMaker()
DataOnDemandSvc().AlgMap["HltLikeL0/SelReports"] = L0SelReportsMaker()
from Configurables import L0Conf
L0Conf().FullL0MuonDecoding = True
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().EnsureKnownTCK = False

tuple3 = DecayTreeTuple("StrippingTuple")
tuple3.Inputs = [
    '/Event/AllStreams/Phys/FullDSTDiMuonJpsi2MuMuDetachedLine/Particles'
]
tuple3.Decay = tuple.Decay
tuple3.ToolList = tuple.ToolList
tuple3.addTool(TupleToolTrigger, name="TupleToolTrigger")
tuple3.addTool(TupleToolTISTOS, name="TupleToolTISTOS")
tuple3.TupleToolTrigger.Verbose = True
tuple3.TupleToolTrigger.TriggerList = tlist
tuple3.TupleToolTISTOS.Verbose = True
tuple3.TupleToolTISTOS.TriggerList = tlist
Пример #12
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")
Пример #13
0
    def configureLink(self, linkDets, moniDets):
        """
        Set up the MC links sequence
        """

        doWriteTruth = ("DIGI" in self.getProp("Outputs")) and (
            self.getProp("DigiType").capitalize() != "Minimal")

        if "Velo" in linkDets or "Velo" in moniDets or "Tr" in linkDets:
            seq = GaudiSequencer("LinkVeloSeq")
            from Configurables import DecodeVeloRawBuffer
            decodeVelo = DecodeVeloRawBuffer()
            decodeVelo.DecodeToVeloClusters = True
            decodeVelo.DecodeToVeloLiteClusters = False
            seq.Members += [decodeVelo]
            seq.Members += ["VeloCluster2MCHitLinker"]
            seq.Members += ["VeloCluster2MCParticleLinker"]

        if "VeloPix" in linkDets or "VeloPix" in moniDets:
            from Configurables import VeloPixDigit2MCHitLinker, VeloPixDigit2MCParticleLinker, VeloPixCluster2MCHitLinker, VeloPixCluster2MCParticleLinker
            seq = GaudiSequencer("LinkVeloPixSeq")
            seq.Members += [
                VeloPixDigit2MCHitLinker("VeloPixDigit2MCHitLinker")
            ]
            seq.Members += [
                VeloPixDigit2MCParticleLinker("VeloPixDigit2MCParticleLinker")
            ]
            seq.Members += [
                VeloPixCluster2MCHitLinker("VeloPixCluster2MCHitLinker")
            ]
            seq.Members += [
                VeloPixCluster2MCParticleLinker(
                    "VeloPixCluster2MCParticleLinker")
            ]

        if "TT" in linkDets or "IT" in linkDets or "TT" in moniDets or "IT" in moniDets or "Tr" in linkDets:
            from Configurables import STDigit2MCHitLinker, STCluster2MCHitLinker, STCluster2MCParticleLinker
            if "TT" in linkDets or "TT" in moniDets:
                seq = GaudiSequencer("LinkTTSeq")
                seq.Members += [STDigit2MCHitLinker("TTDigitLinker")]
                seq.Members += [STCluster2MCHitLinker("TTClusterLinker")]
                seq.Members += [STCluster2MCParticleLinker("TTTruthLinker")]

            if "IT" in linkDets or "IT" in moniDets:
                seq = GaudiSequencer("LinkITSeq")
                seq.Members += [
                    STDigit2MCHitLinker("ITDigitLinker", DetType="IT")
                ]
                seq.Members += [
                    STCluster2MCHitLinker("ITClusterLinker", DetType="IT")
                ]
                seq.Members += [
                    STCluster2MCParticleLinker("ITTruthLinker", DetType="IT")
                ]

        if "OT" in linkDets or "OT" in moniDets or "Tr" in linkDets:
            seq = GaudiSequencer("LinkOTSeq")
            seq.Members += ["OTMCDepositLinker"]
            seq.Members += ["OTMCHitLinker"]
            seq.Members += ["OTMCParticleLinker"]

        if "Tr" in linkDets and doWriteTruth:
            seq = GaudiSequencer("LinkTrSeq")
            if "VeloPix" in linkDets:
                seq.Members += ["BuildMCTrackWithVeloPixInfo"]
            else:
                seq.Members += ["BuildMCTrackInfo"]

        if "Rich" in linkDets and doWriteTruth:
            seq = GaudiSequencer("LinkRichSeq")
            seq.Members += ["Rich::MC::MCRichDigitSummaryAlg"]

        if "Calo" in linkDets or "Calo" in moniDets:
            from Configurables import CaloDigitsFromRaw, CaloReCreateMCLinks, CaloDigitMCTruth
            seq = GaudiSequencer("LinkCaloSeq")
            seq.Members += [CaloDigitsFromRaw("EcalFromRaw")]
            seq.Members += [CaloDigitsFromRaw("HcalFromRaw")]
            recreateLinks = CaloReCreateMCLinks()
            recreateLinks.Digits = ["Raw/Ecal/Digits", "Raw/Hcal/Digits"]
            recreateLinks.MCDigits = ["MC/Ecal/Digits", "MC/Hcal/Digits"]
            seq.Members += [recreateLinks]
            seq.Members += [CaloDigitMCTruth("EcalDigitMCTruth")]
            hcalTruth = CaloDigitMCTruth("HcalDigitMCTruth")
            hcalTruth.Input = "Raw/Hcal/Digits"
            hcalTruth.Detector = "/dd/Structure/LHCb/DownstreamRegion/Hcal"
            seq.Members += [hcalTruth]

        if "Muon" in linkDets and doWriteTruth:
            seq = GaudiSequencer("LinkMuonSeq")
            seq.Members += ["MuonDigit2MCParticleAlg"]
            seq.Members += ["MuonTileDigitInfo"]

        if "L0" in linkDets and doWriteTruth:
            from Configurables import L0Conf
            L0Conf().LinkSequencer = GaudiSequencer("LinkL0Seq")
Пример #14
0
Moore().CondDBtag = "sim-20131023-vc-md100"


from GaudiConf import IOHelper
IOHelper().inputFiles( [ "PFN:root://castorlhcb.cern.ch//castor/cern.ch/user/s/sbenson/TempTestFiles/00026133_00000013_1.allstreams.dst" ] ) 

from Configurables import Hlt__Service
Hlt__Service().Pedantic = False
from Configurables import DataOnDemandSvc
from Configurables import DstConf, CaloDstUnPackConf
CaloDstUnPackConf().Enable=True
DstConf().EnableUnpack= ["Reconstruction","Stripping"]
from Configurables import L0MuonAlg
L0MuonAlg("L0Muon").L0DUConfigProviderType="L0DUConfigProvider"
from Configurables import L0Conf
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().FastL0DUDecoding = True
L0Conf().DecodeL0DU = True
L0Conf().TCK = '0x0045'

#from Configurables import Hlt2Conf
#Hlt2Conf().Hlt1TrackOption = "Rerun"

import GaudiPython
from Gaudi.Configuration import ApplicationMgr
from Configurables import LoKiSvc

appMgr = ApplicationMgr()
#
from Configurables import EventNodeKiller
enk = EventNodeKiller('KillTrigRawEvent')