ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonEFTrackIsolationHypoTool Class Reference

#include <TrigMuonEFTrackIsolationHypoTool.h>

Inheritance diagram for TrigMuonEFTrackIsolationHypoTool:
Collaboration diagram for TrigMuonEFTrackIsolationHypoTool:

Classes

struct  EFIsolationMuonInfo

Public Member Functions

 TrigMuonEFTrackIsolationHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TrigMuonEFTrackIsolationHypoTool ()
virtual StatusCode initialize () override
virtual StatusCode decide (std::vector< TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo > &toolInput) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  { MaxNumberTools = 20 }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

bool decideOnSingleObject (TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo &input, size_t cutIndex) const
StatusCode inclusiveSelection (std::vector< TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo > &toolInput) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

HLT::Identifier m_decisionId
Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", true, "Ignore selection"}
Gaudi::Property< float > m_ptcone02_cut { this, "PtCone02Cut", -1.0, "cut on the pt cone 0.2 variable"}
Gaudi::Property< float > m_ptcone03_cut { this, "PtCone03Cut", -1.0, "cut on the pt cone 0.3 variable"}
Gaudi::Property< bool > m_abscut { this, "DoAbsCut", true, "cut on absolute or sumpt/pt?"}
Gaudi::Property< bool > m_useVarIso { this, "useVarIso", false, "use offline or online isolation variables?"}
Gaudi::Property< bool > m_requireCombined { this, "RequireCombinedMuon", true, "only consider combined muons for isolation?"}
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 20 of file TrigMuonEFTrackIsolationHypoTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MaxNumberTools 

Definition at line 21 of file TrigMuonEFTrackIsolationHypoTool.h.

Constructor & Destructor Documentation

◆ TrigMuonEFTrackIsolationHypoTool()

TrigMuonEFTrackIsolationHypoTool::TrigMuonEFTrackIsolationHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 13 of file TrigMuonEFTrackIsolationHypoTool.cxx.

16 : AthAlgTool( type, name, parent ),
18{
19}
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)

◆ ~TrigMuonEFTrackIsolationHypoTool()

TrigMuonEFTrackIsolationHypoTool::~TrigMuonEFTrackIsolationHypoTool ( )
virtual

Definition at line 21 of file TrigMuonEFTrackIsolationHypoTool.cxx.

21 {
22}

Member Function Documentation

◆ decide()

StatusCode TrigMuonEFTrackIsolationHypoTool::decide ( std::vector< TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo > & toolInput) const
virtual

Definition at line 153 of file TrigMuonEFTrackIsolationHypoTool.cxx.

154{
155 ATH_MSG_DEBUG("Deciding ...");
156
157 size_t numMuon = toolInput.size();
158 ATH_MSG_DEBUG("Number of muon event = " << numMuon);
159
160 if ( numMuon==0 ) {
161 ATH_MSG_DEBUG("The event has no muon, so No applying selection " << m_decisionId);
162 return StatusCode::SUCCESS;
163 } else {
164 ATH_MSG_DEBUG("Applying selection of single" << m_decisionId);
165 return inclusiveSelection(toolInput);
166 }
167
168 return StatusCode::SUCCESS;
169}
#define ATH_MSG_DEBUG(x)
StatusCode inclusiveSelection(std::vector< TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo > &toolInput) const

◆ decideOnSingleObject()

bool TrigMuonEFTrackIsolationHypoTool::decideOnSingleObject ( TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo & input,
size_t cutIndex ) const
private

Definition at line 68 of file TrigMuonEFTrackIsolationHypoTool.cxx.

69{
70 ATH_MSG_DEBUG("Decision ...");
71
72 float ptcone20(-1), ptcone30(-1);
73 auto fex_ptcone03 = Monitored::Scalar("PtCone03", 0.0);
74 auto fex_ptconeRel03 = Monitored::Scalar("PtConeRel03", 0.0);
75
76 auto monitorIt = Monitored::Group( m_monTool, fex_ptcone03, fex_ptconeRel03 );
77
78 ATH_MSG_VERBOSE( "Cut index " << cutIndex );
79
80 bool result = false;
81
82 if( m_acceptAll ) {
83 result = true;
84 ATH_MSG_DEBUG("Accept property is set: taking all the events");
85 return result;
86 }
87
88 auto pMuon = input.muEFIso;
89 if ( !pMuon ) {
90 result = false;
91 ATH_MSG_ERROR("Retrieval of L2StandAloneMuon from vector failed");
92 return result;
93 }
94
95 const xAOD::Muon::MuonType muontype = pMuon->muonType();
96
97 if ( m_requireCombined && muontype != xAOD::Muon::MuonType::Combined ) {
98 result = false;
99 ATH_MSG_DEBUG("Require combined muon, but this muon is not combined. -> false");
100 return result;
101 } else if ( muontype != xAOD::Muon::MuonType::MuonStandAlone && muontype != xAOD::Muon::MuonType::Combined ) {
102 result = false;
103 ATH_MSG_DEBUG("This muon type is neither standalone nor combined. -> false");
104 return result;
105 }
106
107
108 bool goodmu=true;
109 ptcone20 = input.ptcone20;
110 ptcone30 = input.ptcone30;
111
112 fex_ptcone03=ptcone30/1000;
113 if ( m_abscut ) { //absolute cut
114 if ( m_ptcone02_cut > 0.0 ) {
115 if ( ptcone20 >= m_ptcone02_cut ) goodmu=false;
116 }
117 if ( m_ptcone03_cut > 0.0 ) {
118 if ( ptcone30 >= m_ptcone03_cut ) goodmu=false;
119 }
120
121 ATH_MSG_DEBUG("Muon with pT cone 0.2 = " << ptcone20 << ", pT cone 0.3 = " << ptcone30
122 << " so result for this muon is " << (goodmu?"true":"false") );
123 } else { //relative cut
124
125 const double mupt = pMuon->pt();
126 fex_ptconeRel03 = ptcone30/mupt;
127 ATH_MSG_DEBUG("Muon with pT " << mupt);
128
129 // now we can make the cut(s)
130 if ( m_ptcone02_cut > 0.0 ) {
131 if( ptcone20/mupt >= m_ptcone02_cut ) goodmu=false;
132 }
133 if ( m_ptcone03_cut > 0.0 ) {
134 if ( ptcone30/mupt >= m_ptcone03_cut ) goodmu=false;
135 }
136
137 ATH_MSG_DEBUG("Muon with pT cone 0.2 / pt = " << ptcone20/mupt << ", pT cone 0.3 / pt = " << ptcone30/mupt
138 << " so result for this muon is " << (goodmu?"true":"false") );
139 }
140
141 if ( goodmu ) {
142 result = true;
143 }
144
145 ATH_MSG_DEBUG("Algo result = " << (result?"true":"false") );
146
147 return result;
148}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
ToolHandle< GenericMonitoringTool > m_monTool
@ ptcone20
Track isolation.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ inclusiveSelection()

StatusCode TrigMuonEFTrackIsolationHypoTool::inclusiveSelection ( std::vector< TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo > & toolInput) const
private

Definition at line 172 of file TrigMuonEFTrackIsolationHypoTool.cxx.

173{
174 ATH_MSG_DEBUG("Inclusive ...");
175
176 for ( auto&i : toolInput ) {
177 // If muon event has defference DecisionID, it shouldn't apply.
178 if ( TrigCompositeUtils::passed( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
179 if ( decideOnSingleObject( i, 0 )==true ) {
180 ATH_MSG_DEBUG("Pass through selection " << m_decisionId );
182 } else {
183 ATH_MSG_DEBUG("Not pass through selection " << m_decisionId );
184 }
185 } else {
186 ATH_MSG_DEBUG("Not match DecisionID:" << m_decisionId );
187 }
188 }
189 return StatusCode::SUCCESS;
190}
bool decideOnSingleObject(TrigMuonEFTrackIsolationHypoTool::EFIsolationMuonInfo &input, size_t cutIndex) const
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.

◆ initialize()

StatusCode TrigMuonEFTrackIsolationHypoTool::initialize ( )
overridevirtual

Definition at line 27 of file TrigMuonEFTrackIsolationHypoTool.cxx.

28{
29 ATH_MSG_DEBUG("Initializing " << name());
30
31 if ( m_acceptAll ) {
32 ATH_MSG_DEBUG("AcceptAll = True");
33 ATH_MSG_DEBUG("Accepting all the events!");
34 }
35 else {
36 ATH_MSG_DEBUG("AcceptAll = False");
37 if ( m_ptcone02_cut < 0.0 && m_ptcone03_cut < 0.0 ) {
38 ATH_MSG_ERROR("Configured to apply cuts, but not cut was specified");
39 return StatusCode::SUCCESS;
40 }
41 if ( m_ptcone02_cut > 0.0 ) {
42 if ( m_abscut ) {
43 ATH_MSG_DEBUG("Requiring sum pT in 0.2 cone < " << m_ptcone02_cut.value() << " MeV");
44 } else {
45 ATH_MSG_DEBUG("Requiring sum pT in 0.2 cone / muon pT < " << m_ptcone02_cut.value());
46 }
47 }
48 if ( m_ptcone03_cut > 0.0 ) {
49 if ( m_abscut ) {
50 ATH_MSG_DEBUG("Requiring sum pT in 0.3 cone < " << m_ptcone03_cut.value() << " MeV");
51 } else {
52 ATH_MSG_DEBUG("Requiring sum pT in 0.3 cone / muon pT < " << m_ptcone03_cut.value());
53 }
54 }
55 }
56
57 if ( not m_monTool.name().empty() ) {
58 ATH_CHECK( m_monTool.retrieve() );
59 ATH_MSG_DEBUG("MonTool name: " << m_monTool);
60 }
61
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_abscut

Gaudi::Property<bool> TrigMuonEFTrackIsolationHypoTool::m_abscut { this, "DoAbsCut", true, "cut on absolute or sumpt/pt?"}
private

Definition at line 71 of file TrigMuonEFTrackIsolationHypoTool.h.

71{ this, "DoAbsCut", true, "cut on absolute or sumpt/pt?"};

◆ m_acceptAll

Gaudi::Property<bool> TrigMuonEFTrackIsolationHypoTool::m_acceptAll { this, "AcceptAll", true, "Ignore selection"}
private

Definition at line 65 of file TrigMuonEFTrackIsolationHypoTool.h.

65{ this, "AcceptAll", true, "Ignore selection"};

◆ m_decisionId

HLT::Identifier TrigMuonEFTrackIsolationHypoTool::m_decisionId
private

Definition at line 63 of file TrigMuonEFTrackIsolationHypoTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_monTool

ToolHandle< GenericMonitoringTool > TrigMuonEFTrackIsolationHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 77 of file TrigMuonEFTrackIsolationHypoTool.h.

77{ this, "MonTool", "", "Monitoring tool" };

◆ m_ptcone02_cut

Gaudi::Property<float> TrigMuonEFTrackIsolationHypoTool::m_ptcone02_cut { this, "PtCone02Cut", -1.0, "cut on the pt cone 0.2 variable"}
private

Definition at line 67 of file TrigMuonEFTrackIsolationHypoTool.h.

67{ this, "PtCone02Cut", -1.0, "cut on the pt cone 0.2 variable"};

◆ m_ptcone03_cut

Gaudi::Property<float> TrigMuonEFTrackIsolationHypoTool::m_ptcone03_cut { this, "PtCone03Cut", -1.0, "cut on the pt cone 0.3 variable"}
private

Definition at line 69 of file TrigMuonEFTrackIsolationHypoTool.h.

69{ this, "PtCone03Cut", -1.0, "cut on the pt cone 0.3 variable"};

◆ m_requireCombined

Gaudi::Property<bool> TrigMuonEFTrackIsolationHypoTool::m_requireCombined { this, "RequireCombinedMuon", true, "only consider combined muons for isolation?"}
private

Definition at line 75 of file TrigMuonEFTrackIsolationHypoTool.h.

75{ this, "RequireCombinedMuon", true, "only consider combined muons for isolation?"};

◆ m_useVarIso

Gaudi::Property<bool> TrigMuonEFTrackIsolationHypoTool::m_useVarIso { this, "useVarIso", false, "use offline or online isolation variables?"}
private

Definition at line 73 of file TrigMuonEFTrackIsolationHypoTool.h.

73{ this, "useVarIso", false, "use offline or online isolation variables?"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: