def __apply_configuration__(self): from HltLine.HltLine import Hlt1Line priorities = self.getProp("Priorities") doTiming = self.getProp('DoTiming') Hlt1Line('TrackAllL0', prescale = self.prescale, postscale = self.postscale, priority = priorities[ 'AllL0' ] if 'AllL0' in priorities else None, L0DU = self.__l0du('AllL0'), ODIN = self.__odin('AllL0'), algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hlt1TrackBlock_Streamer( 'TrackAllL0', self.localise_props( 'AllL0' ) ) ] ) Hlt1Line('TrackMuon', prescale = self.prescale, postscale = self.postscale, priority = priorities[ 'Muon' ] if 'Muon' in priorities else None, L0DU = self.__l0du('Muon'), algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hlt1TrackMuon_Streamer( 'TrackMuon', self.localise_props( 'Muon' ) ) ] ) Hlt1Line('TrackMuonNoSPD', prescale = self.prescale, postscale = self.postscale, priority = priorities[ 'MuonNoSPD' ] if 'MuonNoSPD' in priorities else None, L0DU = self.__l0du('MuonNoSPD'), algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hlt1TrackMuon_Streamer( 'TrackMuonNoSPD', self.localise_props( 'MuonNoSPD' ) ) ] )
def __apply_configuration__(self) : from HltLine.HltLine import Hlt1Line doTiming = self.getProp( 'DoTiming' ) # Rich Mirror Calibration Hlt1Line('CalibRICHMirrorRICH2', prescale = self.prescale, postscale = self.postscale, L0DU = 'L0_DECISION_PHYSICS', algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hltRICHMirrorBlock_Streamer( 'CalibRICHMirrorRICH2', self.localise_props( 'R2L' ) ) ] ) Hlt1Line('CalibRICHMirrorRICH1', prescale = self.prescale, postscale = self.postscale, L0DU = 'L0_DECISION_PHYSICS', algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hltRICHMirrorBlock_Streamer( 'CalibRICHMirrorRICH1', self.localise_props( 'R1L' ) ) ] ) # High PT in Low Multiplicity events Hlt1Line('CalibHighPTLowMultTrks', prescale = self.prescale, postscale = self.postscale, L0DU = 'L0_DECISION_PHYSICS', algos = [ self.do_timing( unit ) if doTiming else unit for unit in \ self.hltHighPTLowMultiplicity_Streamer( 'CalibHighPTLowMultTrks', self.localise_props( 'LM' ) ) ] )
def __apply_configuration__(self): from HltLine.HltLine import Hlt1Line as Line from HltLine.HltLine import hlt1Lines from Hlt1Lines.HltL0Candidates import (convertL0Candidates, L0Mask, L0Mask2ODINPredicate) channels = self.getProp('L0Channels') for channel in channels: converter = convertL0Candidates(channel) mask = L0Mask(channel) Line('L0' + channel, prescale=self.prescale, ODIN=L0Mask2ODINPredicate(mask) if mask else None, L0DU="L0_CHANNEL('%s')" % channel, algos=[converter] if converter else [], postscale=self.postscale) ## How to deal with the MASKing ??? # Actually, we don't have to -- ODIN will do this 'upstream' of us ;-) for (name, l0du) in [('L0Any', 'L0_DECISION_PHYSICS'), ('L0AnyNoSPD', "L0_CHANNEL_RE('.*NoSPD')"), ('L0HighSumETJet', "L0_CHANNEL_RE('HighSumETJet')")]: l = Line(name, L0DU=l0du, prescale=self.prescale, postscale=self.postscale) l.clone(name + 'RateLimited', prescale=self.prescale, postscale=self.postscale)
def __apply_configuration__(self): from HltLine.HltDecodeRaw import DecodeOT from HltLine.HltLine import Hlt1Line from Configurables import HltCosmicsOT from Hlt1Lines.Hlt1GECs import Hlt1GECUnit from HltTracking.HltSharedTracking import MinimalVelo, HltHPTTracking from HltLine.HltLine import Hlt1Member from HltLine.HltLine import Hlt1Line from HltLine.HltDecodeRaw import DecodeVELO from Configurables import LoKi__VoidFilter from HltTracking.HltPVs import PV3D from Hlt1Lines.Hlt1GECs import Hlt1GECUnit fltr_veloHits = self.__filterVeloHits("HighVeloMult", self.getProp("MinVeloHits"), self.getProp("MaxVeloHits")) fltr_veloHits_PV = self.__filterVeloHits( "HighVeloMultSinglePV", self.getProp("MinVeloHits_PV"), self.getProp("MaxVeloHits")) pvReco = PV3D('Hlt1') fltr_nPVs = LoKi__VoidFilter ( 'HighVeloMultSinglePV_NPVsFilter' , Code = " CONTAINS('%(pvLoc)s')==%(nPVs)s " \ % {"pvLoc" : pvReco.output, "nPVs": self.getProp("nPVs")}) Hlt1Line( 'HighVeloMult', prescale=self.prescale, postscale=self.postscale, ODIN=self.getProp('ODIN'), algos=[ Hlt1GECUnit( 'Activity' ) # cut on a minimum of hits in the tracking detectors , fltr_veloHits # select high velo multiplicity events ]) Hlt1Line( 'HighVeloMultSinglePV', prescale=self.prescale, postscale=self.postscale, ODIN=self.getProp('ODIN'), algos=[ Hlt1GECUnit( 'Activity' ) # cut on a minimum of hits in the tracking detectors , pvReco # Reconstruct PVs , fltr_nPVs # Filter on exactly 1 PV , fltr_veloHits_PV # select high velo multiplicity events ])
def __apply_configuration__(self) : from HltLine.HltLine import Hlt1Line Hlt1Line('B2GammaGamma', prescale=self.prescale, postscale=self.postscale, L0DU="L0_CHANNEL('Photon') | L0_CHANNEL('Electron')", algos=self.hlt1B2GammaGammaLine_Streamer("B2GammaGamma", self.getProps()))
def __create_nonParasitic_line__(self, whichLine, whichBeam): ''' Function to create the Lines for 'ee'(2), 'be'(1), 'eb'(1), 'lonely bb'(2) and 'forced bb'(2) crossings. Algorithms: 1) FastVeloTracking with enlarged z-window (the same algorithm for all lines) 2) PV3D (the same algorithm for all lines) 3) Loki-Filter the produced vertices (Algo name should be <name of line> + Decision) In Algos 2) and 3) need to exclude lumi region for the 'lonely bb' and 'forced bb' cases ''' nameParts = self.getProp("LineNameParts")[whichLine] nameKey = nameParts[1] + whichBeam lineName = nameParts[0] + nameKey ### Get the L0 Rate Limit L0RateLimit = self.getProp('L0RateLimit')[nameKey] if ( nameKey in self.getProp('L0RateLimit').keys()) else None ### Create the L0DU and ODIN filters if 'ForcedReco' in nameParts[1]: l0du = self.getProp('L0Filter')['BB'] odin = '(ODIN_BXTYP == LHCb.ODIN.BeamCrossing)' #reject lumi events for the FullZ line if whichBeam == 'FullZ' and self.getProp('FullZVetoLumiTriggers'): odin += ' & (ODIN_TRGTYP != LHCb.ODIN.LumiTrigger)' elif 'HighRho' in nameParts[1]: l0du = self.getProp('L0Filter')['BB'] reqBB = '(ODIN_BXTYP == LHCb.ODIN.BeamCrossing)' reqNonBB = '((ODIN_BXTYP == LHCb.ODIN.Beam1) | (ODIN_BXTYP == LHCb.ODIN.Beam2))' rateLimBB = self.getProp('ODINLimitHighRho')['HighRhoBB'] rateLimNonBB = self.getProp('ODINLimitHighRho')['HighRhoNonBB'] odin = '(scale(%s, %s) | scale(%s, %s))' % (reqBB, rateLimBB, reqNonBB, rateLimNonBB) else: l0du = self.getProp('L0Filter')[nameKey] if ( nameKey in self.getProp('L0Filter').keys()) else None if 'NoBeam' == nameParts[1]: odin = '(ODIN_BXTYP == LHCb.ODIN.NoBeam)' elif '' == nameParts[1]: odin = '(ODIN_BXTYP == LHCb.ODIN.' + whichBeam + ')' elif 'Enhanced' == nameParts[1]: odin = '(ODIN_TRGTYP == LHCb.ODIN.BeamGasTrigger) & (ODIN_BXTYP == LHCb.ODIN.BeamCrossing)' else: print "\n\nFATAL ERROR - Can't set ODIN Filter\n\n" gec_algs = self._get_GEC() main_algs = self._create_main_algos(lineName) return Hlt1Line(lineName, priority=None, prescale=self.prescale, ODIN=odin, L0DU='scale({}, RATE({}))'.format(l0du, L0RateLimit) if L0RateLimit else l0du, algos=gec_algs + [DecodeVELO] + main_algs, postscale=self.postscale, Turbo=self.getProp("Turbo"))
def build_line(self, name, algos, l0): from HltLine.HltLine import Hlt1Line line = Hlt1Line(name, prescale=self.prescale, postscale=self.postscale, L0DU=l0, ODIN='', algos=algos)
def build_line(self, name, algos): from HltLine.HltLine import Hlt1Line line = Hlt1Line ( name , prescale = self.prescale , postscale = self.postscale , L0DU = self.getProp('l0') , ODIN = self.getProp('odin'), #'(ODIN_BXTYP == LHCb.ODIN.Beam1) | jbit( ODIN_EVTTYP,2 )', algos = algos )
def __apply_configuration__( self ) : from HltLine.HltLine import Hlt1Line Hlt1Line( 'DiProton', ## prescale = self.prescale, postscale = self.postscale, L0DU = "L0_CHANNEL( 'Hadron' ) & ( L0_DATA('Spd(Mult)') < %(DiProton_SpdMult)s )" % self.getProps(), ## algos = [ self.DiProton_streamer() ] ) Hlt1Line( 'DiProtonLowMult', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( L0_DATA('Spd(Mult)') < %(DiProtonLowMult_SpdMult)s )" % self.getProps(), ## algos = [ self.DiProtonLowMult_streamer() ] )
def build_line(self, name, streamer): from HltLine.HltLine import Hlt1Line algos = [ self.do_timing(unit) if self.getProp('DoTiming') else unit for unit in streamer(self.localise_props(name)) ] L0DU = self.getProp("L0Channels")[name] if type(L0DU) != type(""): L0DU = "|".join(["L0_CHANNEL('%s')" % channel for channel in L0DU]) line = Hlt1Line(name, prescale=self.prescale, postscale=self.postscale, L0DU=L0DU, algos=algos)
def build_line(self, name, streamer): from HltLine.HltLine import Hlt1Line algos = [ self.do_timing(unit) if self.getProp("DoTiming") else unit for unit in streamer(self.localise_props(name)) ] priorities = self.getProp("Priorities") priority = priorities[name] if name in priorities else None line = Hlt1Line(name, prescale=self.prescale, postscale=self.postscale, priority=priority, L0DU="L0_DECISION_PHYSICS", algos=algos)
def build_line(self, name, streamer): from HltLine.HltLine import Hlt1Line algos = [ self.do_timing(unit) if self.getProp('DoTiming') else unit for unit in streamer(self.localise_props(name)) ] priorities = self.getProp("Priorities") priority = priorities[name] if name in priorities else None line = Hlt1Line(name, prescale=self.prescale, postscale=self.postscale, priority=priority, L0DU=self.__l0du(name), ODIN=self.__odin(name), algos=algos)
def build_line(self, name, streamer, inputParticles): from HltLine.HltLine import Hlt1Line algos = [ unit for unit in streamer(name, self.localise_props(name), inputParticles) ] priorities = self.getProp("Priorities") priority = priorities[name] if name in priorities else None line = Hlt1Line(name, prescale=self.prescale, postscale=self.postscale, priority=priority, ODIN=self.__odin(name), L0DU=self.__l0du(name), algos=algos)
def __apply_configuration__( self ) : from HltLine.HltLine import Hlt1Line from HltTracking.HltSharedTracking import MinimalVelo Hlt1Line( 'LowMult', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( ( L0_DATA('Spd(Mult)') < %(SpdMult)s ) & ( %(LowMultLineL0Dependency)s ) )" % self.getProps(), ## algos = [ MinimalVelo ] + self.streamer() ) Hlt1Line( 'LowMultVeloCut_Hadrons', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( ( L0_DATA('Spd(Mult)') < %(VeloCut_Hadrons_SpdMult)s ) & ( %(LowMultVeloCut_HadronsLineL0Dependency)s ) )" % self.getProps(), ## algos = [ MinimalVelo ] + self.streamer_VeloCut_Hadrons('LowMultVeloCut_Hadrons') ) Hlt1Line( 'LowMultVeloCut_Leptons', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( ( L0_DATA('Spd(Mult)') < %(SpdMult)s ) & ( %(LowMultVeloCut_LeptonsLineL0Dependency)s ) )" % self.getProps(), ## algos = [ MinimalVelo ] + self.streamer_VeloCut_Leptons('LowMultVeloCut_Leptons') ) Hlt1Line( 'LowMultMaxVeloCut', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( ( L0_DATA('Spd(Mult)') < %(SpdMult)s ) & ( %(LowMultMaxVeloCutLineL0Dependency)s ) )" % self.getProps(), ## algos = [ MinimalVelo ] + self.streamer_MaxVeloCut('LowMultMaxVeloCut') ) Hlt1Line( 'NoBiasNonBeamBeam', ## prescale = self.prescale, postscale = self.postscale, ODIN = ('( (ODIN_TRGTYP == LHCb.ODIN.%(NoBiasTriggerType)s) ' % self.getProps()) +\ ('& ~(ODIN_BXTYP == LHCb.ODIN.%(NoBiasBeamCrossingTypeVeto)s) )' % self.getProps()) ) Hlt1Line( 'LowMultPassThrough', ## prescale = self.prescale, postscale = self.postscale, L0DU = "( %(LowMultPassThroughLineL0Dependency)s )" % self.getProps(), ## )
def __create_parasitic_line__(self): ''' Function to create the Parasitic line for bb crossings. Algorithms: 1) Check if Velo tracks have already been reconstructed 2) Run the proto-vertexing algorithm (excluding the lumi region) 3) Run Full Fast Velo tracking (the same instance as in the non-parasitic lines) 4) PV3D (the same instance as in the non-parasitic lines) 5) Filter the produced vertices ''' nameParts = ['BeamGasCrossing', 'Parasitic'] nameKey = nameParts[1] lineName = nameParts[0] + nameKey ### Get the L0 Rate Limit L0RateLimit = self.getProp('L0RateLimit')[nameKey] if ( nameKey in self.getProp('L0RateLimit').keys()) else None ### Create the L0DU and ODIN filters l0du = self.getProp('L0Filter')['BB'] odin = "(ODIN_BXTYP == LHCb.ODIN.BeamCrossing)" ### Algorithm to check for existing Velo tracks from HltTracking.HltSharedTracking import MinimalVelo from Configurables import LoKi__VoidFilter as VoidFilter algCheckTracks = VoidFilter('Hlt1BeamGasCheckVeloTracks', Code="CONTAINS('%s') > 0" % MinimalVelo.outputSelection()) ### ProtoVertexing algorithm algProtoVertex = self._create_proto_vertex_alg( lineName, MinimalVelo.outputSelection()) gec_algs = self._get_GEC() main_algs = self._create_main_algos(lineName) return Hlt1Line(lineName, priority=200, prescale=self.prescale, ODIN=odin, L0DU='scale({}, RATE({}))'.format(l0du, L0RateLimit) if L0RateLimit else l0du, algos=gec_algs + [DecodeVELO, algCheckTracks, algProtoVertex] + main_algs, postscale=self.postscale, Turbo=self.getProp("Turbo")) return TheLine
def __apply_configuration__(self): ## Apply ThresholdSettings to HLT1 lines configurables from ThresholdUtils import setThresholds from functools import partial map(partial(setThresholds, self.getProp("ThresholdSettings")), _hlt1linesconfs) ## Create Hlt1Global from HltLine.HltLine import Hlt1Line from Configurables import LoKi__HDRFilter as HDRFilter from DAQSys.Decoders import DecoderDB decoder = DecoderDB["HltDecReportsDecoder/Hlt1DecReportsDecoder"] Hlt1Line('Global', priority=255, algos=[ HDRFilter('Hlt1GlobalFilter', Code="HLT_PASS_SUBSTR('Hlt1') ", Location=decoder.listOutputs()[0]) ]) # add a few thing to our printout def __counter(n): m = 3 while m <= n: yield ''.join(str(i) for i in range(1, m)) m += 1 from HltLine.HltLine import addHlt1Prop addHlt1Prop([ 'RoutingBits', 'Accept', 'FilterDescriptor', 'Code', 'Preambulo', 'InputLocations', 'Input', 'Inputs', 'Output', 'OutputProtoParticleLocation', 'InputTrackLocation', 'DaughtersCuts', 'CombinationCut', 'MotherCut', 'DecayDescriptor', 'OutputSelection', 'Context', 'TisTosSpecs' ] + ['Combination%sCut' % s for s in __counter(8)]) ## finally, define the Hlt1 sequence!! from Configurables import GaudiSequencer as Sequence Sequence('Hlt1', ModeOR=True, ShortCircuit=False)
def build_Jpsi2MuMuLine(self): from Hlt1SharedParticles import Hlt1SharedParticles muons = Hlt1SharedParticles().muonUnit() name = "CalibMuonAlignJpsi" myproperties = self.localise_props(name) #print " XXXXXXX" , myproperties from HltTracking.HltPVs import PV3D algos = [ PV3D('Hlt1'), muons, self.MuMu_Unit(self.localise_props(name)), self.Jpsi2MuMu_Unit(self.localise_props(name)) ] fullname = name from HltLine.HltLine import Hlt1Line priorities = self.getProp("Priorities") priority = priorities[name] if name in priorities else None line = Hlt1Line(fullname, prescale=self.prescale, postscale=self.postscale, priority=priority, L0DU=self.__l0du(name), ODIN=self.__odin(name), algos=algos)