• No results found

Hlt Raw Data & TISTOS tool (C++ & Python Tutorial)

N/A
N/A
Protected

Academic year: 2022

Share "Hlt Raw Data & TISTOS tool (C++ & Python Tutorial)"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

Hlt Raw Data & TISTOS tool (C++ & Python Tutorial)

Tomasz Skwarnicki

Syracuse University

(based on DaVinci v23r1)

(2)

Hlt Raw Data

HltDecReports HLT1,2

HltDataSvc

HltSelReports

HltVertexReports

TES classes

M a k e rs

decisions

selected candidates

W ri te rs

Raw Banks

HltDecReports HltSelReports

HltVertexReports

HltDecReports HltSelReports

HltVertexReports

R e a d e rs

HltDecReports

HltSelReports

HltVertexReports

decisions

TriggerTisTos

(classified) decisions

(classified) candidates

vertex candidates

EFF Offline

HLT run in DaVinci

O ff lin e u s e r

“classified” with respect to offline selected signal

(3)

Running HLT in DaVinci

• Setup DaVinci environment

from from from

from ConfigurablesConfigurablesConfigurablesConfigurables import import import DaVinciimport DaVinciDaVinciDaVinci DaVinci().DataType

DaVinci().DataType DaVinci().DataType

DaVinci().DataType = = = ‘= ‘‘‘DC06DC06DC06DC06’’’’ DaVinci().Simulation

DaVinci().Simulation DaVinci().Simulation

DaVinci().Simulation = True= True= True= True

DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().HltType

DaVinci().HltType DaVinci().HltType

DaVinci().HltType = 'Hlt1+Hlt2= 'Hlt1+Hlt2= 'Hlt1+Hlt2= 'Hlt1+Hlt2‘‘‘‘ unix

unix unix

unix> > > > SetupProjectSetupProjectSetupProjectSetupProject DaVinciDaVinciDaVinci v23r1DaVinci v23r1v23r1v23r1

• To run HLT from DaVinci (here for DC06 MC data) include in

your python options:

(4)

Running DaVinci in GaudiPython

• If you are not interested in python ignore this and concentrate on C++

examples

• This is not a python tutorial nor description of all different ways you can use python to analyze LHCb data

– see previous Software Week tutorials on GaudiPython, Panoramix, Bender

• Minimal python script for running HLT+DaVinci in GaudiPython:

from from from

from Gaudi.ConfigurationGaudi.ConfigurationGaudi.ConfigurationGaudi.Configuration import *import *import *import * from

from from

from ConfigurablesConfigurablesConfigurablesConfigurables import import import DaVinciimport DaVinciDaVinciDaVinci DaVinci().DataType

DaVinci().DataType DaVinci().DataType

DaVinci().DataType === = """"DDDDCCC0C0006666""""

DaVinci().Simulation DaVinci().Simulation DaVinci().Simulation

DaVinci().Simulation = True= True= True= True

DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().ReplaceL0BanksWithEmulated = True DaVinci().HltType

DaVinci().HltType DaVinci().HltType

DaVinci().HltType = 'Hlt1+Hlt2'= 'Hlt1+Hlt2'= 'Hlt1+Hlt2'= 'Hlt1+Hlt2' import

import import

import GaudiPythonGaudiPythonGaudiPythonGaudiPython appMgr

appMgr appMgr

appMgr= = = = GaudiPython.AppMgr(outputlevelGaudiPython.AppMgr(outputlevelGaudiPython.AppMgr(outputlevel=3)GaudiPython.AppMgr(outputlevel=3)=3)=3) selsel

selsel= = = appMgr.evtsel= appMgr.evtselappMgr.evtselappMgr.evtsel() # to define input file() # to define input file() # to define input file() # to define input file sel.open(['PFN

sel.open(['PFN sel.open(['PFN

sel.open(['PFN:/afs/cern.ch/lhcb/group/trigger/vol1/dijkstra/Selections/Bs2MuM:/afs/cern.ch/lhcb/group/trigger/vol1/dijkstra/Selections/Bs2MuM:/afs/cern.ch/lhcb/group/trigger/vol1/dijkstra/Selections/Bs2MuM:/afs/cern.ch/lhcb/group/trigger/vol1/dijkstra/Selections/Bs2MuMuuuu----lum2.dstlum2.dstlum2.dstlum2.dst'])'])'])']) evtevt

evtevt= = = appMgr.evtsvc= appMgr.evtsvcappMgr.evtsvcappMgr.evtsvc()()()()

appMgr.run(1) # process one event appMgr.run(1) # process one event appMgr.run(1) # process one event appMgr.run(1) # process one event evt.dump

evt.dump evt.dump

evt.dump() # dump different locations on TES (if you wish)() # dump different locations on TES (if you wish)() # dump different locations on TES (if you wish)() # dump different locations on TES (if you wish)

(5)

Accessing decisions in HltDecReports

#include "Event/

#include "Event/#include "Event/

#include "Event/HltDecReports.hHltDecReports.hHltDecReports.hHltDecReports.h““““ // get pointer to

// get pointer to // get pointer to

// get pointer to HltDecReportsHltDecReportsHltDecReportsHltDecReports from TESfrom TESfrom TESfrom TES const

const const

const HltDecReportsHltDecReportsHltDecReportsHltDecReports* * * decReports* decReportsdecReportsdecReports = = = = get<

get<get<

get<HltDecReportsHltDecReportsHltDecReports>(HltDecReports>(>(LHCb::HltDecReportsLocation::Default>(LHCb::HltDecReportsLocation::DefaultLHCb::HltDecReportsLocation::DefaultLHCb::HltDecReportsLocation::Default););););

// if you are sure trigger has to be there, this is OK // if you are sure trigger has to be there, this is OK// if you are sure trigger has to be there, this is OK // if you are sure trigger has to be there, this is OK bool

boolbool

bool hlt1dec = hlt1dec = hlt1dec = hlt1dec = decReportsdecReportsdecReports-decReports--->decReport("Hlt1Global>decReport("Hlt1Global>decReport("Hlt1Global>decReport("Hlt1Global

"

))-))-->decision();->decision();>decision();>decision();

// otherwise check the // otherwise check the // otherwise check the

// otherwise check the HltDecReportHltDecReportHltDecReport pointerHltDecReport pointerpointerpointer const

const const

const HltDecReportHltDecReportHltDecReportHltDecReport* * * * dihadRepdihadRepdihadRep = dihadRep = = = decReports decReportsdecReports

decReports---->decReport("Hlt1DiHadronDecision");>decReport("Hlt1DiHadronDecision");>decReport("Hlt1DiHadronDecision");>decReport("Hlt1DiHadronDecision");

if(

if( if(

if( dihadRepdihadRepdihadRepdihadRep ){){){){

info()<< " Hlt1DiHadronDecision " <<

info()<< " Hlt1DiHadronDecision " << info()<< " Hlt1DiHadronDecision " <<

info()<< " Hlt1DiHadronDecision " << dihadRepdihadRepdihadRepdihadRep---->decision()>decision()>decision()>decision()

<<

<< <<

<< endmsgendmsgendmsg;endmsg;;; } else {

} else {} else { } else {

info()<< " Hlt1DiHadronDecision was not configured" <<

info()<< " Hlt1DiHadronDecision was not configured" << info()<< " Hlt1DiHadronDecision was not configured" <<

info()<< " Hlt1DiHadronDecision was not configured" << endmsgendmsgendmsg;endmsg;;; }}}

}

// get all trigger names in this configuration // get all trigger names in this configuration// get all trigger names in this configuration // get all trigger names in this configuration std::vector

std::vectorstd::vector

std::vector<<<std::string<std::stringstd::string> std::string> > allConfiguredTrgLines> allConfiguredTrgLinesallConfiguredTrgLinesallConfiguredTrgLines

=

=

=

= decReportsdecReportsdecReports-decReports--->>>>decisionNamesdecisionNamesdecisionNames();decisionNames();();();

// print entire report container:

// print entire report container:// print entire report container:

// print entire report container:

info() << * info() << * info() << *

info() << *decReportsdecReportsdecReportsdecReports << << << endmsg<< endmsgendmsg;endmsg;;;

C++

(6)

Accessing decisions in HltDecReports

# get

# get

# get

# get HltDecReportsHltDecReportsHltDecReportsHltDecReports from TESfrom TESfrom TESfrom TES decReports

decReports decReports

decReports = = = evt['/Event/Hlt/DecReports= evt['/Event/Hlt/DecReportsevt['/Event/Hlt/DecReportsevt['/Event/Hlt/DecReports']']']']

# if you are sure trigger has to be there, this is OK

# if you are sure trigger has to be there, this is OK

# if you are sure trigger has to be there, this is OK

# if you are sure trigger has to be there, this is OK hlt1dec = decReports.decReport('Hlt1Global').decision() hlt1dec = decReports.decReport('Hlt1Global').decision() hlt1dec = decReports.decReport('Hlt1Global').decision() hlt1dec = decReports.decReport('Hlt1Global').decision()

# otherwise check the

# otherwise check the

# otherwise check the

# otherwise check the HltDecReportHltDecReportHltDecReport pointerHltDecReport pointerpointerpointer dihadRep

dihadRep dihadRep

dihadRep = decReports.decReport('Hlt1DiHadronDecision')= decReports.decReport('Hlt1DiHadronDecision')= decReports.decReport('Hlt1DiHadronDecision')= decReports.decReport('Hlt1DiHadronDecision') if

if if

if dihadRepdihadRepdihadRep != None:dihadRep != None:!= None:!= None:

print ' Hlt1DiHadronDecision ', print ' Hlt1DiHadronDecision ', print ' Hlt1DiHadronDecision ',

print ' Hlt1DiHadronDecision ',dihadRep.decisiondihadRep.decisiondihadRep.decision()dihadRep.decision()()() else:

else:

else:

else:

print ' Hlt1DiHadronDecision was not configured ' print ' Hlt1DiHadronDecision was not configured ' print ' Hlt1DiHadronDecision was not configured ' print ' Hlt1DiHadronDecision was not configured '

# get all trigger names in this configuration

# get all trigger names in this configuration

# get all trigger names in this configuration

# get all trigger names in this configuration allConfiguredTrgLines

allConfiguredTrgLines allConfiguredTrgLines

allConfiguredTrgLines = = = decReports.decisionNames= decReports.decisionNamesdecReports.decisionNamesdecReports.decisionNames()()()()

# print entire report container

# print entire report container

# print entire report container

# print entire report container print

print print

print decReportsdecReportsdecReportsdecReports

python

(7)

HltDecReports sample dump

• Obtained on B

s

→µµ event in DaVinci v23r1 (many lines not shown here to fit a slide)

INFO HltDecReports : configuredTCK=0 {

decisionName : Hlt1DiHadronDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 5 intDecisionID : 201 }

decisionName : Hlt1DiMuonIPCL0SegDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 5 intDecisionID : 122 } decisionName : Hlt1DiMuonNoIP2L0Decision HltDecReport : { decision : 1 errorBits : 0 numberOfCandidates : 6 executionStage : 7 intDecisionID : 111 } decisionName : Hlt1DiMuonNoIPL0DiDecision HltDecReport : { decision : 1 errorBits : 2numberOfCandidates : 2 executionStage : 7 intDecisionID : 110 } decisionName : Hlt1DiMuonNoIPL0SegDecision HltDecReport : { decision : 1 errorBits : 0 numberOfCandidates : 2 executionStage : 7 intDecisionID : 112 } decisionName : Hlt1Global HltDecReport : { decision : 1 errorBits : 0 numberOfCandidates : 0 executionStage : 7 intDecisionID : 1 }

decisionName : Hlt1IgnoringLumiDecisionHltDecReport : { decision : 1 errorBits : 0 numberOfCandidates : 0 executionStage : 7 intDecisionID : 41 }

decisionName : Hlt1L0DiMuon,lowMultDecisionHltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 2 intDecisionID : 14 } decisionName : Hlt1L0DiMuonDecisionHltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 2 executionStage : 6 intDecisionID : 12 }

decisionName : Hlt1L0ElectronDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 2 intDecisionID : 15 } decisionName : Hlt1LumiDecisionHltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 3 intDecisionID : 40 }

decisionName : Hlt1MuTrack4JPsiDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 0 intDecisionID : 151 } decisionName : Hlt1MuTrackDecision HltDecReport : { decision : 0 errorBits : 2numberOfCandidates : 0 executionStage : 5 intDecisionID : 150 } decisionName : Hlt1PhotonDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 2 intDecisionID : 300 } decisionName : Hlt1VeloClosingDecisionHltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 3 intDecisionID : 60 } decisionName : Hlt2GlobalHltDecReport : { decision : 1 errorBits : 0 numberOfCandidates : 0 executionStage : 7 intDecisionID : 2 }

decisionName : Hlt2TopoTF4BodySADEVDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 0 intDecisionID : 50810 } decisionName : Hlt2UnbiasedBs2PhiPhiDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0 executionStage : 5 intDecisionID : 50135 } decisionName : Hlt2UnbiasedDiMuonDecision HltDecReport : { decision: 1 errorBits: 0 numberOfCandidates :2 executionStage :7 intDecisionID :50200 }

Accessible as member functions of HltDecReport

Physics and non-physics trigger lines and Hltx Global reports.

Among physics lines post-scaled L0xxx pass-through-Hlt1 lines.

(from Gerhard: errorBits=2 in this release means executions of this line took a long time)

The value of numberOfCandidates() saturates at 15 (means 15 or more candidates)

(8)

HltDecReport – executionStage()

• Meaning of execuationStage() values in HltDecReport :

0 initial (did not pass prescale)

1 passed prescale (did not pass L0 seeding) 2 passed seeding (did not pass filter-0)

3 passed filter-0 (did not pass filter-1) 4 passed filter-1 (did not pass filter-2) 5 passed filter-2 (did not pass filter-last) 6 passed filter-last (did not pass postscale) 7 passed postscale [ decision is set to true ]

• More bits were added to this field – the meaning of the

values is likely to change in the future release (max value

255)

(9)

Accessing decisions via TriggerTisTos tool

In addition to getting decision() of individual trigger lines you can also check logical-OR of decisions between many lines

– Particularly easy if you can address all trigger lines of interest with a wild character matching:

#include "Kernel/

#include "Kernel/

#include "Kernel/

#include "Kernel/ITriggerTisTos.hITriggerTisTos.hITriggerTisTos.hITriggerTisTos.h""""

ITriggerTisTos ITriggerTisTos ITriggerTisTos

ITriggerTisTos* * * * m_tisTosm_tisTosm_tisTosm_tisTos; // in .h file; // in .h file; // in .h file; // in .h file // get

// get // get

// get TisTosTisTosTisTosTisTos tool in initialize():tool in initialize():tool in initialize():tool in initialize():

m_tisTos m_tisTos m_tisTos

m_tisTos= tool<= tool<= tool<ITriggerTisTos= tool<ITriggerTisTosITriggerTisTos>("ITriggerTisTos>(">(">("TriggerTisTos",thisTriggerTisTos",thisTriggerTisTos",this); TriggerTisTos",this); ); );

// use it in execute():

// use it in execute():// use it in execute():

// use it in execute():

m_tisTos m_tisTos m_tisTos

m_tisTos--->->>>setOfflineInputsetOfflineInputsetOfflineInputsetOfflineInput(); // (); // (); // (); // dummydummydummy signaldummy signalsignalsignal bool

bool bool

bool hlt1MuDec= hlt1MuDec= hlt1MuDec= hlt1MuDec= m_tisTosm_tisTosm_tisTosm_tisTos---->triggerTisTos("Hlt1*Mu*>triggerTisTos("Hlt1*Mu*>triggerTisTos("Hlt1*Mu*>triggerTisTos("Hlt1*Mu*Decision").decisionDecision").decisionDecision").decisionDecision").decision();();();();

– You can also specify a list of trigger names to be OR-ed explicitly:

m_tisTos m_tisTos m_tisTos

m_tisTos--->->>>setOfflineInputsetOfflineInputsetOfflineInputsetOfflineInput(); (); (); ();

m_tisTos m_tisTos m_tisTos

m_tisTos--->->>>setTriggerInputsetTriggerInputsetTriggerInputsetTriggerInput(); // reset trigger (); // reset trigger (); // reset trigger (); // reset trigger namesnamesnamesnames m_tisTos

m_tisTos m_tisTos

m_tisTos--->->>>addToTriggerInputaddToTriggerInputaddToTriggerInputaddToTriggerInput((("("""Hlt1DiHadronDecisionHlt1DiHadronDecisionHlt1DiHadronDecisionHlt1DiHadronDecision""""););););

m_tisTos m_tisTos m_tisTos

m_tisTos--->->>>addToTriggerInputaddToTriggerInputaddToTriggerInputaddToTriggerInput((("("""Hlt1MuTrack4JPsiDecisionHlt1MuTrack4JPsiDecisionHlt1MuTrack4JPsiDecisionHlt1MuTrack4JPsiDecision""""););););

bool bool bool

bool hlt1MixDec= hlt1MixDec= hlt1MixDec= hlt1MixDec= m_tisTosm_tisTosm_tisTosm_tisTos---->>>>triggerTisTos().decisiontriggerTisTos().decisiontriggerTisTos().decision();triggerTisTos().decision();();();

– Passing a vector of names also works:

std std std

std::::::vector::vectorvectorvector<<<std<stdstdstd::string> ::string> ::string> mx::string> mxmxmx;;;; mx

mx mx

mx....push_backpush_backpush_back("Hlt1DiHadronDecision");push_back("Hlt1DiHadronDecision");("Hlt1DiHadronDecision");("Hlt1DiHadronDecision");mxmxmxmx...push_back.push_backpush_backpush_back("Hlt1*Mu*("Hlt1*Mu*("Hlt1*Mu*("Hlt1*Mu*DecisionDecisionDecision");Decision");");");

m_tisTos m_tisTos m_tisTos

m_tisTos--->->>>setTriggerInputsetTriggerInputsetTriggerInputsetTriggerInput((((mxmxmxmx););););

boolbool

boolbool hlt1Mix2Dec= hlt1Mix2Dec= hlt1Mix2Dec= hlt1Mix2Dec= m_tisTosm_tisTosm_tisTosm_tisTos---->>>triggerTisTos>triggerTisTostriggerTisTostriggerTisTos().().().().decisiondecisiondecision(); decision(); (); ();

C++

(10)

Accessing decisions via TriggerTisTos tool

tsvctsvc

tsvctsvc= = = = appMgr.toolsvcappMgr.toolsvcappMgr.toolsvcappMgr.toolsvc() # get () # get () # get TisTos() # get TisTosTisTosTisTos tool right before tool right before tool right before tool right before appMgr.runappMgr.runappMgr.run(appMgr.run((()))) m_tisTos

m_tisTos m_tisTos

m_tisTos= = = tsvc.create('TriggerTisTos',interface= tsvc.create('TriggerTisTos',interfacetsvc.create('TriggerTisTos',interfacetsvc.create('TriggerTisTos',interface='='='ITriggerTisTos='ITriggerTisTosITriggerTisTosITriggerTisTos') ') ') ')

# after processing an event i.e. appMgr.run(1)

# after processing an event i.e. appMgr.run(1)# after processing an event i.e. appMgr.run(1)

# after processing an event i.e. appMgr.run(1) m_tisTos.setOfflineInput

m_tisTos.setOfflineInput m_tisTos.setOfflineInput

m_tisTos.setOfflineInput() # () # () # () # dummydummydummydummy signalsignalsignalsignal hlt1MuDec =

hlt1MuDec = hlt1MuDec =

hlt1MuDec = m_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTos('Hlt1*Mu*('Hlt1*Mu*('Hlt1*Mu*('Hlt1*Mu*DecisionDecisionDecision').Decision').').').decisiondecisiondecision() # 0/1decision() # 0/1() # 0/1() # 0/1

– You can also specify a list of trigger names to be OR-ed explicitly:

m_tisTos.setOfflineInput m_tisTos.setOfflineInput m_tisTos.setOfflineInput m_tisTos.setOfflineInput()()()() m_tisTos.setTriggerInput m_tisTos.setTriggerInput m_tisTos.setTriggerInput m_tisTos.setTriggerInput()()()() m_tisTos.addToTriggerInput m_tisTos.addToTriggerInput m_tisTos.addToTriggerInput

m_tisTos.addToTriggerInput('Hlt1DiHadronDecision')('Hlt1DiHadronDecision')('Hlt1DiHadronDecision')('Hlt1DiHadronDecision') m_tisTos.addToTriggerInput

m_tisTos.addToTriggerInput m_tisTos.addToTriggerInput

m_tisTos.addToTriggerInput('Hlt1MuTrack4JPsiDecision')('Hlt1MuTrack4JPsiDecision')('Hlt1MuTrack4JPsiDecision')('Hlt1MuTrack4JPsiDecision') hlt1MixDec=

hlt1MixDec=

hlt1MixDec=

hlt1MixDec= m_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTos().().().().decisiondecisiondecisiondecision()()()()

– Passing a vector of names also works:

m_tisTos.setTriggerInput m_tisTos.setTriggerInput m_tisTos.setTriggerInput

m_tisTos.setTriggerInput(((()))) ### # rrrreeeessseseetettt tttrtrrriiiigggggggegeeerrrr iiininnpnpppuuuuttt t mx

mx mx

mx = = = m_tisTos.triggerSelectionNames= m_tisTos.triggerSelectionNamesm_tisTos.triggerSelectionNamesm_tisTos.triggerSelectionNames() #trick: () #trick: () #trick: empty() #trick: emptyemptyempty vectorvectorvectorvector<string><string><string><string>

mx mx mx

mx....push_backpush_backpush_back('Hlt1DiHadronDecision')push_back('Hlt1DiHadronDecision')('Hlt1DiHadronDecision')('Hlt1DiHadronDecision') mx

mx mx

mx....push_backpush_backpush_back('Hlt1*Mu*push_back('Hlt1*Mu*('Hlt1*Mu*('Hlt1*Mu*DecisionDecisionDecisionDecision')')')') m_tisTos.setTriggerInput

m_tisTos.setTriggerInput m_tisTos.setTriggerInput

m_tisTos.setTriggerInput((((mxmxmxmx) # ) # ) # define) # definedefine tdefine tttrrririiiggggggggeeererr r iiiinnnpnpppuuuutttt hlt1Mix2Dec=

hlt1Mix2Dec=

hlt1Mix2Dec=

hlt1Mix2Dec= m_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTosm_tisTos.triggerTisTos().().().decision().decisiondecisiondecision()()()()

python

• Python version:

(11)

TIS and TOS classifications

• Signal – off-line selected particle (simple or composite) e.g.

B

d

→ µµK*, K* → Kπ candidate

• Can classify each trigger decision (individual trigger line or OR between many lines) as:

– TOS – Trigger On Signal

– TIS – Trigger Independent of Signal

• Four types of trigger decisions:

– Neither TOS nor TIS (called “TOB”) – TOS but not TIS

– TIS but not TOS

– TOS and TIS at the same time

• Classification useful for:

– Trigger optimization (e.g. TOB events are undesired) – Trigger monitoring

– Determination of trigger efficiencies and trigger biases in physics analysis from data themselves

TOS

TIS µ

µ π K Hlt1 µ

B B

µ µ π K Hlt1 µ

TOB µ

µ π K Hlt1 dimuon

B B

(12)

Classified trigger decisions

• decision() decision() decision() decision() does not depend on the signal !

• The Trigger Input [here "Hlt2*Decision" "Hlt2*Decision" "Hlt2*Decision" "Hlt2*Decision" ] can be specified in other ways shown on slide 9

• Also the Offline Input [here Particle signal Particle signal Particle signal Particle signal ] can be specified ahead of the m_tisTos m_tisTos- m_tisTos m_tisTos - - -> > > >triggerTisTos triggerTisTos triggerTisTos triggerTisTos call, at once by setOfflineInput(signal setOfflineInput(signal setOfflineInput(signal setOfflineInput(signal) ) ) )

or part by part using addToOfflineInput(part_of_the_signal addToOfflineInput(part_of_the_signal addToOfflineInput(part_of_the_signal addToOfflineInput(part_of_the_signal) ) ) ) .

Particle signal= ...

Particle signal= ...

Particle signal= ...

Particle signal= ...your_offline_signal_candidateyour_offline_signal_candidateyour_offline_signal_candidate;your_offline_signal_candidate;;; ITriggerTisTos::TisTosDecision

ITriggerTisTos::TisTosDecision ITriggerTisTos::TisTosDecision

ITriggerTisTos::TisTosDecision classifiedHlt2Dec = classifiedHlt2Dec = classifiedHlt2Dec = classifiedHlt2Dec = m_tisTos

m_tisTosm_tisTos

m_tisTos--->->>>triggerTisTos(triggerTisTos(triggerTisTos(triggerTisTos(signalsignalsignal, signal, , , "Hlt2*Decision""Hlt2*Decision""Hlt2*Decision""Hlt2*Decision" ););););

info() << " Hlt2 decision= " << classifiedHlt2Dec.decision() info() << " Hlt2 decision= " << classifiedHlt2Dec.decision() info() << " Hlt2 decision= " << classifiedHlt2Dec.decision() info() << " Hlt2 decision= " << classifiedHlt2Dec.decision()

<< " TIS= " << classifiedHlt2Dec.

<< " TIS= " << classifiedHlt2Dec.<< " TIS= " << classifiedHlt2Dec.

<< " TIS= " << classifiedHlt2Dec.tis()tis()tis()tis()

<< " TOS= " << classifiedHlt2Dec.

<< " TOS= " << classifiedHlt2Dec.<< " TOS= " << classifiedHlt2Dec.

<< " TOS= " << classifiedHlt2Dec.tos()tos()tos()tos()

<< " TOB= " << ( classifiedHlt2Dec.decision() &&

<< " TOB= " << ( classifiedHlt2Dec.decision() &&<< " TOB= " << ( classifiedHlt2Dec.decision() &&

<< " TOB= " << ( classifiedHlt2Dec.decision() &&

!classifiedHlt2Dec.tos() && !classifiedHlt2Dec.tis() ) <<

!classifiedHlt2Dec.tos() && !classifiedHlt2Dec.tis() ) <<

!classifiedHlt2Dec.tos() && !classifiedHlt2Dec.tis() ) <<

!classifiedHlt2Dec.tos() && !classifiedHlt2Dec.tis() ) << endmsgendmsgendmsgendmsg;;;; signal= evt['/Event/Phys/PreselB2Charged2Body/Particles'][0]

signal= evt['/Event/Phys/PreselB2Charged2Body/Particles'][0]

signal= evt['/Event/Phys/PreselB2Charged2Body/Particles'][0]

signal= evt['/Event/Phys/PreselB2Charged2Body/Particles'][0]

classifiedHlt2Dec = m_tisTos.triggerTisTos(

classifiedHlt2Dec = m_tisTos.triggerTisTos(

classifiedHlt2Dec = m_tisTos.triggerTisTos(

classifiedHlt2Dec = m_tisTos.triggerTisTos(signalsignalsignal,signal,,,'Hlt2*Decision''Hlt2*Decision''Hlt2*Decision''Hlt2*Decision')))) print ' Hlt2 decision= ', classifiedHlt2Dec.decision(),

print ' Hlt2 decision= ', classifiedHlt2Dec.decision(), print ' Hlt2 decision= ', classifiedHlt2Dec.decision(), print ' Hlt2 decision= ', classifiedHlt2Dec.decision(), print ' TIS= ', classifiedHlt2Dec.

print ' TIS= ', classifiedHlt2Dec.

print ' TIS= ', classifiedHlt2Dec.

print ' TIS= ', classifiedHlt2Dec.tis()tis()tis()tis(),,,, print ' TOS= ', classifiedHlt2Dec.

print ' TOS= ', classifiedHlt2Dec.

print ' TOS= ', classifiedHlt2Dec.

print ' TOS= ', classifiedHlt2Dec.tos()tos()tos()tos(),,,,

print ' TOB= ', int(classifiedHlt2Dec.decision() and print ' TOB= ', int(classifiedHlt2Dec.decision() and print ' TOB= ', int(classifiedHlt2Dec.decision() and print ' TOB= ', int(classifiedHlt2Dec.decision() and \\\\

not classifiedHlt2Dec.tos() and not classifiedHlt2Dec not classifiedHlt2Dec.tos() and not classifiedHlt2Decnot classifiedHlt2Dec.tos() and not classifiedHlt2Dec

not classifiedHlt2Dec.tos() and not classifiedHlt2Dec.tis()).tis()).tis()).tis())

C++

python

(see slide 22 for L0 decisions!)

(13)

• You can also obtain a list of triggers (within the scope of the specified Trigger Input) which match a certain

TIS/TOS classification:

// after the // after the // after the

// after the Offline and Offline and Offline and Offline and TriggerTriggerTriggerTrigger Inputs Inputs Inputs Inputs have been defined, call:have been defined, call:have been defined, call:have been defined, call:

std::vector std::vector std::vector

std::vector<<<<std::stringstd::stringstd::stringstd::string> > > > triggerSelectionNamestriggerSelectionNamestriggerSelectionNamestriggerSelectionNames( ( ( ( unsigned

unsigned unsigned

unsigned intintintint decisionRequirementdecisionRequirementdecisionRequirementdecisionRequirement = = = = ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything, , , , unsigned

unsigned unsigned

unsigned intintintint tisRequirementtisRequirementtisRequirementtisRequirement = = = = ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything,ITriggerTisTos::kAnything,,, unsigned

unsigned unsigned

unsigned intintintint tosRequirementtosRequirementtosRequirementtosRequirement = = = = ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything ))))

// getting exclusive // getting exclusive // getting exclusive

// getting exclusive---TOS (i.e. TOS and not TIS) Hlt1 triggers:-TOS (i.e. TOS and not TIS) Hlt1 triggers:TOS (i.e. TOS and not TIS) Hlt1 triggers:TOS (i.e. TOS and not TIS) Hlt1 triggers:

std::vector std::vector std::vector

std::vector<<<std::string<std::stringstd::stringstd::string> exclTOSHlt1Triggers => exclTOSHlt1Triggers => exclTOSHlt1Triggers => exclTOSHlt1Triggers = m_tisTos

m_tisTosm_tisTos

m_tisTos--->->>triggerSelectionNames(>triggerSelectionNames(triggerSelectionNames(triggerSelectionNames(signalsignalsignal,signal,,,

"Hlt1*Decision

"Hlt1*Decision

"Hlt1*Decision

"Hlt1*Decision““““,,,, ITriggerTisTos::kTrueRequired ITriggerTisTos::kTrueRequired ITriggerTisTos::kTrueRequired ITriggerTisTos::kTrueRequired,,,, ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired, , , , ITriggerTisTos::kTrueRequiredITriggerTisTos::kTrueRequiredITriggerTisTos::kTrueRequired); ITriggerTisTos::kTrueRequired); ); );

// all known Hlt2 trigger lines // all known Hlt2 trigger lines // all known Hlt2 trigger lines // all known Hlt2 trigger lines // (no // (no // (no

// (no TisTisTis-Tis---TosTosTos-Tos---TobbingTobbingTobbing here, donTobbing here, donhere, don’here, don’’t need ’t need t need t need signalsignalsignalsignal)))) std::vector

std::vector std::vector

std::vector<<<std::string<std::stringstd::stringstd::string> hlt2Triggers = > hlt2Triggers = > hlt2Triggers = > hlt2Triggers = m_tisTos

m_tisTos m_tisTos

m_tisTos---->triggerSelectionNames(>triggerSelectionNames(>triggerSelectionNames("Hlt2*Decision">triggerSelectionNames("Hlt2*Decision""Hlt2*Decision""Hlt2*Decision"););););

Classified trigger decisions

C++

(14)

Classified trigger decisions

• Python version:

# getting exclusive

# getting exclusive

# getting exclusive

# getting exclusive---TOS (i.e. TOS and not TIS) Hlt1 triggers:-TOS (i.e. TOS and not TIS) Hlt1 triggers:TOS (i.e. TOS and not TIS) Hlt1 triggers:TOS (i.e. TOS and not TIS) Hlt1 triggers:

exclTOSHlt1Triggers = exclTOSHlt1Triggers = exclTOSHlt1Triggers = exclTOSHlt1Triggers = \\\\

m_tisTos.triggerSelectionNames(

m_tisTos.triggerSelectionNames(

m_tisTos.triggerSelectionNames(

m_tisTos.triggerSelectionNames(signalsignalsignalsignal,,,,\\\\ ''

''Hlt1*DecisionHlt1*DecisionHlt1*Decision’Hlt1*Decision’’’,,,,\\\\ m_tisTos.kTrueRequired

m_tisTos.kTrueRequired m_tisTos.kTrueRequired m_tisTos.kTrueRequired,,,\,\\\

m_tisTos.kFalseRequired,m_tisTos.kTrueRequired m_tisTos.kFalseRequired,m_tisTos.kTrueRequired m_tisTos.kFalseRequired,m_tisTos.kTrueRequired m_tisTos.kFalseRequired,m_tisTos.kTrueRequired))))

# all known Hlt2 trigger lines

# all known Hlt2 trigger lines

# all known Hlt2 trigger lines

# all known Hlt2 trigger lines

# (no

# (no

# (no

# (no TisTisTisTis----TosTosTosTos----TobbingTobbingTobbingTobbing here, donhere, donhere, donhere, don’’’t need signal)’t need signal)t need signal)t need signal) hlt2Triggers = m_tisTos.triggerSelectionNames('

hlt2Triggers = m_tisTos.triggerSelectionNames(' hlt2Triggers = m_tisTos.triggerSelectionNames('

hlt2Triggers = m_tisTos.triggerSelectionNames('Hlt2*DecisionHlt2*DecisionHlt2*Decision')Hlt2*Decision')')')

python

(15)

Access to candidates selected by triggers

• HltSelReports HltSelReports HltSelReports HltSelReports have information about selected candidates (Tracks, Vertices, Particles, …)

• I don’t expect many users will want to access

HltSelReports HltSelReports HltSelReports

HltSelReports directly

– if you do, this container has analogous structure to HltDecReports HltDecReports HltDecReports HltDecReports

(see its doxygen documentation)

• I recommend using TriggerTisTos TriggerTisTos TriggerTisTos TriggerTisTos tool instead

//

//

//

// hlthlthlt summaries of Particles passing hlt summaries of Particles passing summaries of Particles passing Hlt2UnbiasedDiMuonDecisionsummaries of Particles passing Hlt2UnbiasedDiMuonDecisionHlt2UnbiasedDiMuonDecisionHlt2UnbiasedDiMuonDecision std::vector

std::vector std::vector

std::vector<const <const <const LHCb::HltObjectSummary<const LHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummary*>*>*>*> selectedTriggerCandidatesselectedTriggerCandidates=selectedTriggerCandidatesselectedTriggerCandidates=== m_tisTos

m_tisTosm_tisTos

m_tisTos--->->>hltObjectSummaries>hltObjectSummarieshltObjectSummarieshltObjectSummaries((("Hlt2UnbiasedDiMuonDecision"("Hlt2UnbiasedDiMuonDecision""Hlt2UnbiasedDiMuonDecision""Hlt2UnbiasedDiMuonDecision"););););

// the following will also work, but you may get // the following will also work, but you may get // the following will also work, but you may get // the following will also work, but you may get

// a mix of summaries of Tracks and // a mix of summaries of Tracks and // a mix of summaries of Tracks and

// a mix of summaries of Tracks and RecVerteciesRecVerteciesRecVerteciesRecVertecies selectedTriggerCandidates

selectedTriggerCandidates selectedTriggerCandidates selectedTriggerCandidates====

m_tisTos m_tisTosm_tisTos

m_tisTos--->hltObjectSummaries("Hlt1*Decision");->hltObjectSummaries("Hlt1*Decision");>hltObjectSummaries("Hlt1*Decision");>hltObjectSummaries("Hlt1*Decision");

selectedTriggerCandidates selectedTriggerCandidates selectedTriggerCandidates

selectedTriggerCandidates = = = = \\\\ m_tisTos.

m_tisTos.

m_tisTos.

m_tisTos.hltObjectSummarieshltObjectSummarieshltObjectSummarieshltObjectSummaries('Hlt2UnbiasedDiMuonDecision')('Hlt2UnbiasedDiMuonDecision')('Hlt2UnbiasedDiMuonDecision')('Hlt2UnbiasedDiMuonDecision') selectedTriggerCandidates

selectedTriggerCandidates selectedTriggerCandidates

selectedTriggerCandidates = m_tisTos.hltObjectSummaries('Hlt1*Decision')= m_tisTos.hltObjectSummaries('Hlt1*Decision')= m_tisTos.hltObjectSummaries('Hlt1*Decision')= m_tisTos.hltObjectSummaries('Hlt1*Decision')

python

C++

(16)

Using TisTos tool to classify Trigger selection candidates

• You can obtain a list of selected candidates which are classified as TOS, TIS, TOB (or combination of them)

// after the // after the // after the

// after the Offline and Offline and Offline and Offline and TriggerTriggerTriggerTrigger Inputs Inputs Inputs Inputs have been defined, call:have been defined, call:have been defined, call:have been defined, call:

std::vector std::vector std::vector

std::vector<const <const <const <const LHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummary*> LHCb::HltObjectSummary*> *> *> hltObjectSummarieshltObjectSummarieshltObjectSummarieshltObjectSummaries(((( unsigned

unsigned unsigned

unsigned intintintint tisRequirementtisRequirementtisRequirementtisRequirement = = = = ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything,ITriggerTisTos::kAnything,,, unsigned

unsigned unsigned

unsigned intintintint tosRequirementtosRequirementtosRequirementtosRequirement = = = = ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything ))))

cannot be satisfied kTrueRequired

kTrueRequired

all trigger objects kAnything

kAnything

TIS and TOB trigger objects kFalseRequired

kAnything

TOS and TOB trigger objects kAnything

kFalseRequired

TIS trigger objects (same as kTrueRequired,kAnything) kFalseRequired

kTrueRequired

TOS trigger objects (same as kAnything,kTrueRequired) kTrueRequired

kFalseRequired

TOB trigger objects (i.e. neither TIS nor TOS);

kFalseRequired kFalseRequired

Result

TosTos TosTos

Requirement Requirement Requirement Requirement TisTisTis

Tis

Requirement RequirementRequirement Requirement

For trigger candidates TIS, TOS, TOB are all mutually exclusive (unlike for decisions!)

(17)

List of classified trigger selection candidates

• Code example:

// getting TOS objects // getting TOS objects // getting TOS objects // getting TOS objects std::vector

std::vector std::vector

std::vector<const <const <const LHCb::HltObjectSummary<const LHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummary*> *> *> *> tosCandidatestosCandidatestosCandidates =tosCandidates === m_tisTos

m_tisTosm_tisTos

m_tisTos--->->>hltObjectSummaries(>hltObjectSummaries(hltObjectSummaries(hltObjectSummaries(signalsignalsignalsignal,,,,

"Hlt1SingleMuonIPCL0Decision

"Hlt1SingleMuonIPCL0Decision

"Hlt1SingleMuonIPCL0Decision

"Hlt1SingleMuonIPCL0Decision““““,,,, ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired, , , , ITriggerTisTos::kTrueRequiredITriggerTisTos::kTrueRequiredITriggerTisTos::kTrueRequired); ITriggerTisTos::kTrueRequired); ); );

// .. and now TOB objects ( // .. and now TOB objects ( // .. and now TOB objects (

// .. and now TOB objects (signalsignalsignalsignal and and and and TriggerTriggerTriggerTrigger Input already defined)Input already defined)Input already defined)Input already defined) std::vector

std::vector std::vector

std::vector<const <const <const LHCb::HltObjectSummary<const LHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummary*> *> *> *> tobCandidatestobCandidatestobCandidates =tobCandidates === m_tisTos

m_tisTos m_tisTos

m_tisTos--->->>>hltObjectSummarieshltObjectSummarieshltObjectSummarieshltObjectSummaries((((

ITriggerTisTos::kFalseRequired ITriggerTisTos::kFalseRequired ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired, , , , ITriggerTisTos::kFalseRequiredITriggerTisTos::kFalseRequiredITriggerTisTos::kFalseRequiredITriggerTisTos::kFalseRequired););););

// check if the signal was used in the Hlt1 in any way (TOS or T // check if the signal was used in the Hlt1 in any way (TOS or T // check if the signal was used in the Hlt1 in any way (TOS or T

// check if the signal was used in the Hlt1 in any way (TOS or TOB): OB): OB): OB):

if(

if(

if(

if( m_tisTosm_tisTosm_tisTosm_tisTos---->>>>hltObjectSummaries(hltObjectSummaries(hltObjectSummaries(hltObjectSummaries(signalsignalsignalsignal, , , "Hlt1*Decision",, "Hlt1*Decision","Hlt1*Decision","Hlt1*Decision", ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired ITriggerTisTos::kFalseRequired

ITriggerTisTos::kFalseRequired, , , , ITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnythingITriggerTisTos::kAnything ).size() ){).size() ){).size() ){).size() ){

info() << "The signal was used." <<

info() << "The signal was used." <<

info() << "The signal was used." <<

info() << "The signal was used." << endmsgendmsgendmsgendmsg; }; }; }; }

C++

(18)

List of classified trigger selection candidates

# getting TOS objects

# getting TOS objects

# getting TOS objects

# getting TOS objects tosCandidates

tosCandidates tosCandidates

tosCandidates = = = = m_tisTos.hltObjectSummaries(m_tisTos.hltObjectSummaries(m_tisTos.hltObjectSummaries(m_tisTos.hltObjectSummaries(signalsignalsignal,signal,,,\\\\ ''

''Hlt1SingleMuonIPCL0DecisionHlt1SingleMuonIPCL0DecisionHlt1SingleMuonIPCL0Decision',Hlt1SingleMuonIPCL0Decision',',',\\\\ m_tisTos.kFalseRequired

m_tisTos.kFalseRequired m_tisTos.kFalseRequired

m_tisTos.kFalseRequired, , , , m_tisTos.kTrueRequiredm_tisTos.kTrueRequiredm_tisTos.kTrueRequired)m_tisTos.kTrueRequired)))

# .. and now TOB objects (

# .. and now TOB objects (

# .. and now TOB objects (

# .. and now TOB objects (signalsignalsignalsignal and and and and TriggerTriggerTriggerTrigger IIIInnnnpppupuuutttt aaalalllrrrreeeeaaadaddydyyy dddedeeeffffiiiinnneneeedddd)))) tobCandidates

tobCandidates tobCandidates

tobCandidates = = = = m_tisTos.hltObjectSummariesm_tisTos.hltObjectSummariesm_tisTos.hltObjectSummariesm_tisTos.hltObjectSummaries(((\(\\\ m_tisTos.kFalseRequired m_tisTos.kFalseRequired m_tisTos.kFalseRequired

m_tisTos.kFalseRequired, , , , m_tisTos.kFalseRequiredm_tisTos.kFalseRequiredm_tisTos.kFalseRequired)m_tisTos.kFalseRequired)))

# check if the signal was used in the Hlt1 in any way (TOS or TO

# check if the signal was used in the Hlt1 in any way (TOS or TO

# check if the signal was used in the Hlt1 in any way (TOS or TO

# check if the signal was used in the Hlt1 in any way (TOS or TOBBBB)))):::: if

if if

if m_tisTos.hltObjectSummaries(m_tisTos.hltObjectSummaries(m_tisTos.hltObjectSummaries(signalm_tisTos.hltObjectSummaries(signalsignal, 'signal, ', ', 'Hlt1*DecisionHlt1*DecisionHlt1*DecisionHlt1*Decision',',',',\\\\ m_tisTos.kFalseRequired

m_tisTos.kFalseRequired m_tisTos.kFalseRequired

m_tisTos.kFalseRequired, , , , m_tisTos.kAnythingm_tisTos.kAnythingm_tisTos.kAnythingm_tisTos.kAnything ).size():).size():).size():).size():

print 'This signal was used' print 'This signal was used' print 'This signal was used' print 'This signal was used'

python

(19)

HltObjectSummary HltObjectSummary HltObjectSummary

HltObjectSummary class

• Since selected candidates cannot be saved with full info they are summarized

• Same class for all types of candidates

(Particle,RecVertex,Track, anything we add in the future):

– Vector containing either pointers to substructure or LHCbIDs

– Numerical information with a string key identifying type of information:

• Standard Info: same set of variables for each object of the same class (has a “#”

in the label)

• Extra Info: each Hlt1 filter adds one (history of Hlt1 processing)

– Class ID of summarized class (also pointer to the object itself; on-line use only)

• See my talk on Hlt Raw Data at Dec.08 Software Week for more information

HltSelReportsMaker VERBOSE key 3{ summarizedObjectCLID : 10010 numericalInfo : { 0#Track.firstState.z:-53.5628 , 1#Track.firstState.x:-0.0431684 , 2#Track.firstState.y:-0.00109219 ,

3#Track.firstState.tx:0.00133175 , 4#Track.firstState.ty:-0.0526368 , 5#Track.firstState.qOverP:-2.85726e-05 , IP_PV2D:0.040732 , IsMuon:1 , L0ConfirmWithT:0 , PT:1840.25 , PT0:3574.56 ,

RZVeloTMatch_Hlt1SingleMuonPrepTFTConf:-47.6819 , Tf::PatVeloSpaceTool:38 , chi2_PatMatch:0.161546 , } substructure :{ } lhcbIDs: { 269033390 , 269031334 , 269027662 , 269025601 , 269024971 , 269022912 , 269019314 , 269017249 , …, } }

HltSelReportsMaker VERBOSE key 4{ summarizedObjectCLID : 10030 numericalInfo : { 0#RecVertex.position.x:-0.0460179 , 1#RecVertex.position.y:0.0697576 , 2#RecVertex.position.z:-54.4946 , DOCA:0.0436636 , VertexDimuonMass:5270.4 , } substructure: { 3:10010 , 0:10010 , } lhcbIDs: { } }

(20)

Converting object summaries to object themselves

//

//

//

// templatedtemplatedtemplated function to convert object summary to object itselftemplated function to convert object summary to object itselffunction to convert object summary to object itselffunction to convert object summary to object itself template <class T>

template <class T>template <class T>

template <class T>

const T*

const T* const T*

const T* hltObject(consthltObject(consthltObject(consthltObject(const LHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummaryLHCb::HltObjectSummary* * * * hoshoshos )hos ))) {{{

{

if( !(

if( !(

if( !(

if( !(hoshoshos-hos--->>>>summarizedObjectsummarizedObjectsummarizedObjectsummarizedObject()) )()) )()) )()) )

return (const T*)(0); // means pointer to the object is not avai return (const T*)(0); // means pointer to the object is not avai return (const T*)(0); // means pointer to the object is not avai

return (const T*)(0); // means pointer to the object is not available lable lable lable if(

if(

if(

if( hoshoshos-hos-->->>>summarizedObjectCLIDsummarizedObjectCLIDsummarizedObjectCLIDsummarizedObjectCLID() () () ()

!=

!=

!=

!= T::classIDT::classIDT::classIDT::classID() )() )() )() )

return (const T*)(0); // means different object than requested return (const T*)(0); // means different object than requested return (const T*)(0); // means different object than requested return (const T*)(0); // means different object than requested return

return return

return dynamic_castdynamic_castdynamic_cast<const T*>( dynamic_cast<const T*>( <const T*>( <const T*>( hos.summarizedObjecthos.summarizedObjecthos.summarizedObject() ) ); // converthos.summarizedObject() ) ); // convert() ) ); // convert() ) ); // convert }

}} }

// get a Track from the Track summary:

// get a Track from the Track summary:// get a Track from the Track summary:

// get a Track from the Track summary:

const const const

const LHCb::LHCb::LHCb::LHCb::HltObjectSummaryHltObjectSummaryHltObjectSummaryHltObjectSummary* * * * hoshoshoshos = = = …= …;;;; const

const const

const LHCb::TrackLHCb::TrackLHCb::TrackLHCb::Track* * * * triggerTracktriggerTracktriggerTracktriggerTrack = = = = hltObjecthltObjecthltObject<hltObject<<<LHCb::TrackLHCb::TrackLHCb::TrackLHCb::Track>( >( >( >( hoshoshoshos ););););

• In on-line environment you can go from the HltObjectSummary to the Object itself

• No need to cast in python! An object returned by the summarizedObject() method is self-aware.

triggerTrack triggerTrack triggerTrack

triggerTrack ==== hos.summarizedObjecthos.summarizedObjecthos.summarizedObjecthos.summarizedObject()()()()

C++

python

(21)

Classifying L0 decisions via Hlt1L0 trigger lines

• You can get L0 trigger decisions from L0DUReport

• Each L0 trigger (XXX=Muon, ‘Muon,lowMult’, MuonNoGlob, DiMuon,

‘DiMuon,lowMult’, Hadron, Electron, Photon, LocalPi0, GlobalPi0) has a corresponding Hlt1 pass-through line - Hlt1L0XXXDecision

– True Hlt1 trigger lines. If decision()==true then Hlt1Global decision() must be true as well.

– Heavily postscaled:

• At present one in a million kept

• They convert candidates selected by L0 triggers to Hlt1 type selections

• Postscaling means that they are allowed to fully execute i.e. create candidates if the L0 XXX line succeeded, but the decision turned to false most of the time anyway

• Classifying Hlt1L0XXXDecision decision the normal way (slide 12) not useful since decision()==false essentially all the time

• There is a work around (see next slide)

See slides 5 and 6:

decisionName : Hlt1L0DiMuon,lowMultDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 0executionStage : 2 intDecisionID : 14 } decisionName : Hlt1L0DiMuonDecision HltDecReport : { decision : 0 errorBits : 0 numberOfCandidates : 2 executionStage : 6intDecisionID : 12 }

L0 DiMuon,lowMult decision was false L0 DiMuon decision was true

(22)

Classifying L0 decisions

• Compare with slide 12. The differences are highlighted in red.

Particle signal= ...

Particle signal= ...

Particle signal= ...

Particle signal= ...your_offline_signal_candidateyour_offline_signal_candidateyour_offline_signal_candidate;your_offline_signal_candidate;;; m_tisTos

m_tisTos m_tisTos

m_tisTos--->->>>setOfflineInput(setOfflineInput(setOfflineInput(setOfflineInput(signalsignalsignalsignal); ); ); );

ITriggerTisTos::TisTosDecision ITriggerTisTos::TisTosDecision ITriggerTisTos::TisTosDecision

ITriggerTisTos::TisTosDecision classifiedL0Dec = classifiedL0Dec = classifiedL0Dec = classifiedL0Dec = m_tisTos

m_tisTos m_tisTos

m_tisTos--->->>>selectionselectionselectionselectionTisTosTisTosTisTos( TisTos( ( ( m_tisTos m_tisTos m_tisTos

m_tisTos---->triggerSelectionNames(>triggerSelectionNames(>triggerSelectionNames("Hlt1L0*Decision">triggerSelectionNames("Hlt1L0*Decision""Hlt1L0*Decision""Hlt1L0*Decision")))) ););););

bool bool bool

bool l0Decl0Decl0Decl0Dec = = m_tisTos= = m_tisTosm_tisTosm_tisTos---->hltObjectSummaries(>hltObjectSummaries(>hltObjectSummaries(>hltObjectSummaries("Hlt1L0*"Hlt1L0*"Hlt1L0*"Hlt1L0*Decision"Decision"Decision"Decision").size).size).size()!=0;).size()!=0;()!=0;()!=0;

info() << " L0 decision= " <<

info() << " L0 decision= " <<

info() << " L0 decision= " <<

info() << " L0 decision= " << l0Decl0Decl0Decl0Dec

<< " TIS= " << classifiedL0Dec.

<< " TIS= " << classifiedL0Dec.<< " TIS= " << classifiedL0Dec.

<< " TIS= " << classifiedL0Dec.tis()tis()tis()tis()

<< " TOS= " << classifiedL0Dec.

<< " TOS= " << classifiedL0Dec.<< " TOS= " << classifiedL0Dec.

<< " TOS= " << classifiedL0Dec.tos()tos()tos()tos()

<< " TOB= " << (

<< " TOB= " << ( << " TOB= " << (

<< " TOB= " << ( l0Decl0Decl0Decl0Dec &&&&&&&&

!classifiedL0Dec.tos() && !classifiedL0Dec.tis() ) <<

!classifiedL0Dec.tos() && !classifiedL0Dec.tis() ) <<

!classifiedL0Dec.tos() && !classifiedL0Dec.tis() ) <<

!classifiedL0Dec.tos() && !classifiedL0Dec.tis() ) << endmsgendmsgendmsgendmsg;;;; m_tisTos.setOfflineInput(

m_tisTos.setOfflineInput(

m_tisTos.setOfflineInput(

m_tisTos.setOfflineInput(signalsignalsignalsignal)))) classifiedL0Dec =

classifiedL0Dec = classifiedL0Dec =

classifiedL0Dec = m_tisTos.m_tisTos.m_tisTos.m_tisTos.selectionselectionselectionTisTosselectionTisTosTisTosTisTos( ( ( ( \\\\ m_tisTos.triggerSelectionNames m_tisTos.triggerSelectionNames m_tisTos.triggerSelectionNames

m_tisTos.triggerSelectionNames('('('('Hlt1L0*DecisionHlt1L0*DecisionHlt1L0*DecisionHlt1L0*Decision') )') )') )') ) l0Dec = m_tisTos.hltObjectSummaries(

l0Dec = m_tisTos.hltObjectSummaries(

l0Dec = m_tisTos.hltObjectSummaries(

l0Dec = m_tisTos.hltObjectSummaries(''''Hlt1L0*Hlt1L0*Hlt1L0*Hlt1L0*DecisionDecisionDecisionDecision'''').size).size).size).size()!=0()!=0()!=0()!=0 print ' L0 decision= ', int(

print ' L0 decision= ', int(

print ' L0 decision= ', int(

print ' L0 decision= ', int(l0Decl0Decl0Decl0Dec),),),), print ' TIS= ', classifiedL0Dec.

print ' TIS= ', classifiedL0Dec.

print ' TIS= ', classifiedL0Dec.

print ' TIS= ', classifiedL0Dec.tis()tis()tis()tis(),,,, print ' TOS= ', classifiedL0Dec.

print ' TOS= ', classifiedL0Dec.

print ' TOS= ', classifiedL0Dec.

print ' TOS= ', classifiedL0Dec.tos()tos()tos()tos(),,,, print ' TOB= ',

print ' TOB= ', print ' TOB= ',

print ' TOB= ', intintintint( ( ( l0Dec( l0Decl0Decl0Dec and and \and and \\\

not classifiedL0Dec.tos() and not classifiedL0Dec.tis() ) not classifiedL0Dec.tos() and not classifiedL0Dec.tis() ) not classifiedL0Dec.tos() and not classifiedL0Dec.tis() ) not classifiedL0Dec.tos() and not classifiedL0Dec.tis() )

C++

python

(23)

For Hlt1 developers

• By default only selected candidates by the Decision step of each trigger line are saved

• If you are interested in debugging intermediate Hlt1 selections, you can add them to

HltSelReports by changing configuration of its Maker

from from from

from ConfigurablesConfigurablesConfigurablesConfigurables import import import HltSelReportsMakerimport HltSelReportsMakerHltSelReportsMakerHltSelReportsMaker HltSelReportsMaker().DebugEventPeriod

HltSelReportsMaker().DebugEventPeriod HltSelReportsMaker().DebugEventPeriod

HltSelReportsMaker().DebugEventPeriod = 1= 1= 1= 1

# or

# or

# or

# or

HltSelReportsMaker().MaxCandidatesNonDecision HltSelReportsMaker().MaxCandidatesNonDecision HltSelReportsMaker().MaxCandidatesNonDecision

HltSelReportsMaker().MaxCandidatesNonDecision =500=500=500=500

• You can then use TriggerTisTos tool to access (and classify) their decisions and selected

candidates

(24)

HltVertexReports

• To allow easy access to vertex info (primary vertices, Velo vertices)

without overhead of saving all contributing Tracks (unlike HltSelReports)

• Container of SmartRefVector<LHCb::VertexBase> keyed with the name of the trigger algorithm making RecVertices (e.g. “PV2D”)

– Saved vertices can also be accessed as VertexBase::Container at /Event/Hlt/VertexReports/PV2D/

– Covariance matrix not stored

#include "Event/

#include "Event/

#include "Event/

#include "Event/HltVertexReports.hHltVertexReports.hHltVertexReports.hHltVertexReports.h“ HltVertexReports

HltVertexReports HltVertexReports

HltVertexReports* * * * vtxReportsvtxReportsvtxReports = vtxReports = = = get<

get<get<

get<HltVertexReportsHltVertexReportsHltVertexReportsHltVertexReports>(>(>(>(HltVertexReportsLocation::DefaultHltVertexReportsLocation::DefaultHltVertexReportsLocation::DefaultHltVertexReportsLocation::Default););););

// get // get // get

// get HltVertexReportHltVertexReportHltVertexReport for PV2DHltVertexReport for PV2Dfor PV2Dfor PV2D const

const const

const HltVertexReports::HltVertexReportHltVertexReports::HltVertexReportHltVertexReports::HltVertexReportHltVertexReports::HltVertexReport* * * vtxRep* vtxRepvtxRepvtxRep = = = = vtxReportsvtxReportsvtxReports-vtxReports--->vertexReport(">vertexReport(">vertexReport("PV2D>vertexReport("PV2DPV2DPV2D");");");");

if( if(

if( if( vtxRepvtxRepvtxRep ){vtxRep ){){){

for(

for(

for(

for( HltVertexReports::HltVertexReport::const_iteratorHltVertexReports::HltVertexReport::const_iteratorHltVertexReports::HltVertexReport::const_iteratorHltVertexReports::HltVertexReport::const_iterator iv=iv=iv=iv=vtxRepvtxRepvtxRep-vtxRep-->begin(); ->begin(); >begin(); >begin();

iv!=iv!=iv!=

iv!=vtxRepvtxRepvtxRepvtxRep---->end(); ++iv){ >end(); ++iv){ >end(); ++iv){ >end(); ++iv){

const const const

const VertexBaseVertexBaseVertexBase & v = **iv;VertexBase & v = **iv;& v = **iv;& v = **iv;

info()<<" x "<<

info()<<" x "<<

info()<<" x "<<

info()<<" x "<<v.position().xv.position().xv.position().xv.position().x()<<" y "<<()<<" y "<<()<<" y "<<()<<" y "<<v.position().yv.position().yv.position().yv.position().y()<<" z "<< ()<<" z "<< ()<<" z "<< ()<<" z "<< v.position().zv.position().zv.position().zv.position().z()()()()

<<" chi2 " << v.chi2()<< "

<<" chi2 " << v.chi2()<< " <<" chi2 " << v.chi2()<< "

<<" chi2 " << v.chi2()<< " ndfndfndf " << ndf " << " << " << v.nDoFv.nDoFv.nDoFv.nDoF()<< ()<< ()<< ()<< endmsgendmsgendmsgendmsg; ; ; ; } }

} } } } } }

C++

(25)

HltVertexReports

• Python version:

vtxReports vtxReportsvtxReports

vtxReports = = = evt['/Event/Hlt/VertexReports= evt['/Event/Hlt/VertexReportsevt['/Event/Hlt/VertexReportsevt['/Event/Hlt/VertexReports']']']']

# get

# get # get

# get HltVertexReportHltVertexReportHltVertexReportHltVertexReport for PV2D for PV2D for PV2D for PV2D vtxRep

vtxRepvtxRep

vtxRep = vtxReports.vertexReport('= vtxReports.vertexReport('= vtxReports.vertexReport('= vtxReports.vertexReport('PV2DPV2DPV2DPV2D')')')') if

if if

if vtxRepvtxRepvtxRep!=None:vtxRep!=None:!=None:!=None:

for iv in for iv in for iv in

for iv in vtxRepvtxRepvtxRep:vtxRep::: v =

v = v =

v = iv.targetiv.targetiv.targetiv.target()()()() print ' x ', print ' x ',print ' x ',

print ' x ',v.position().xv.position().xv.position().xv.position().x(),(),(),(),’’ y y y y ‘‘,,,,v.position().yv.position().yv.position().yv.position().y(),' z ',(),' z ',(),' z ',v.position().z(),' z ',v.position().zv.position().zv.position().z(),(),(),(), print ' chi2 ',v.chi2(),'

print ' chi2 ',v.chi2(),' print ' chi2 ',v.chi2(),'

print ' chi2 ',v.chi2(),' ndfndfndfndf ',',',v.nDoF',v.nDoFv.nDoF()v.nDoF()()()

python

(26)

More documentation

• Twiki TriggerTisTos tool page at

https://twiki.cern.ch/twiki/bin/view/LHCb/TriggerTisTos – Includes up-to-date extensive python sample code – Links to previous presentations

– Comments for each release (please switch to DaVinci

v23r1 !)

References

Related documents