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

#include <TrigJetEJsHypoTool.h>

Inheritance diagram for TrigJetEJsHypoTool:
Collaboration diagram for TrigJetEJsHypoTool:

Classes

struct  JetInfo

Public Types

using JetDecision = std::pair<const xAOD::Jet*,TrigCompositeUtils::Decision*>

Public Member Functions

 TrigJetEJsHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~TrigJetEJsHypoTool ()
StatusCode initialize ()
StatusCode finalize ()
StatusCode decide (std::vector< JetInfo > &decisions) const
const HLT::IdentifiergetId () 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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

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
ToolHandle< ITrigJetHypoToolHelperm_helper
Gaudi::Property< bool > m_visitDebug {this, "visit_debug", false, "debug flag"}
Gaudi::Property< std::string > m_chainName
Gaudi::Property< double > m_ptf {this, "PTF", 1.0, ""}
Gaudi::Property< double > m_dr {this, "dR", 1.0, ""}
Gaudi::Property< int > m_trackless {this, "Trackless", 1.0, ""}
double m_trackEtaCut_Exotics = 2.4
double m_trackEtaCut_Trackless = 2.4
double m_trackPtCut_Exotics = 1.0*Gaudi::Units::GeV
double m_trackPtCut_Trackless = 2.0*Gaudi::Units::GeV
double m_jetPtCut_Exotics = 50.0*Gaudi::Units::GeV
double m_jetPtCut_Trackless = 50.0*Gaudi::Units::GeV
double m_jetEtaCut_Exotics = 2.0
double m_jetEtaCut_Trackless = 2.0
double m_PTFSigmaCut = 2.5
int m_matchedTracksCut_Trackless = 0
double m_PV_z = 10.0
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 39 of file TrigJetEJsHypoTool.h.

Member Typedef Documentation

◆ JetDecision

Definition at line 52 of file TrigJetEJsHypoTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigJetEJsHypoTool()

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

Definition at line 33 of file TrigJetEJsHypoTool.cxx.

35 :
36 AthAlgTool(type, name, parent),
38
39}
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionId

◆ ~TrigJetEJsHypoTool()

TrigJetEJsHypoTool::~TrigJetEJsHypoTool ( )

Definition at line 42 of file TrigJetEJsHypoTool.cxx.

42 {
43}

Member Function Documentation

◆ decide()

StatusCode TrigJetEJsHypoTool::decide ( std::vector< JetInfo > & decisions) const

Definition at line 66 of file TrigJetEJsHypoTool.cxx.

66 {
67
68 for ( auto i: input ) {
69
70 if ( i.previousDecisionsIDs.count( m_decisionId.numeric() ) == 0 ) {
71 continue;
72 }
73
74 ATH_MSG_DEBUG("starting exotic/trackless jet chain");
75
76 bool objDecision = true;
77
78 // start with cut on jet pT
79 auto jetPt= (i.jet)->pt();
80 if((m_trackless == 0 && jetPt < m_jetPtCut_Exotics ) || \
81 (m_trackless == 1 && jetPt < m_jetPtCut_Trackless)) {
82 objDecision = false;
83 }
84
85 // cut on jet eta
86 auto jetEta=std::abs( (i.jet)->p4().Eta() );
87 if ( (m_trackless == 0 && jetEta > m_jetEtaCut_Exotics ) || \
88 (m_trackless == 1 && jetEta > m_jetEtaCut_Trackless ) || \
89 (jetPt <= 0.0) ) {
90 objDecision = false;
91 }
92
93 float promptTrackFrac = -2.0;
94
95 if (objDecision == true) {
96
97 // Exotics (emerging jets) chain decision
98 if (m_trackless == 0) {
99 promptTrackFrac = 0.0;
100 for (auto trackIter = i.AllTracks->begin(); trackIter != i.AllTracks->end(); ++trackIter){
101 float trackPt = (*trackIter)->pt();
102 if (std::abs((*trackIter)->z0() + (*trackIter)->vz() - i.PV->z()) > m_PV_z || trackPt < m_trackPtCut_Exotics || \
103 std::abs((*trackIter)->eta()) > m_trackEtaCut_Exotics || (i.jet)->p4().DeltaR((*trackIter)->p4()) > m_dr)
104 continue;
105
106 float sigma = 1e6;
107 // Definition of promptTrackFrac background jet d0 RMS
108 if (trackPt > 0.0) sigma = 1000.0 * 0.0463 / trackPt + 0.0195;
109
110 // if d0 greater than a multiple of sigma, is not a prompt track
111 if (std::abs((*trackIter)->d0()) > m_PTFSigmaCut*sigma) continue;
112 promptTrackFrac += trackPt;
113
114 // Exit track loop if PTF is greater than cut, no need to continue loop
115 if (promptTrackFrac/jetPt > m_ptf) break;
116 }
117
118 promptTrackFrac /= jetPt;
119
120 ATH_MSG_DEBUG("exotics jets chain promptTrackFrac: " << promptTrackFrac);
121 if (promptTrackFrac < -0.5 || promptTrackFrac > m_ptf) objDecision = false;
122 }
123
124 // Trackless chain decision
125 else if (m_trackless == 1) {
126 int matchedtracks = 0;
127 // Loop over tracks, selection ones passing pT, eta, and dR cuts to jet
128 for (auto trackIter = i.AllTracks->begin(); trackIter != i.AllTracks->end(); ++trackIter){
129 if ((*trackIter)->pt() < m_trackPtCut_Trackless || std::abs((*trackIter)->eta()) > m_trackEtaCut_Trackless \
130 || (i.jet)->p4().DeltaR((*trackIter)->p4()) > m_dr)
131 continue;
132 matchedtracks++;
133 if (matchedtracks > m_matchedTracksCut_Trackless) {
134 objDecision = false;
135 break;
136 }
137
138 }
139 ATH_MSG_DEBUG("Number of matched tracks (" << matchedtracks << ") greater than cutoff - in trackless jet chain");
140 }
141
142 } // end if objDecision == true
143
144 if ( objDecision == true ) {
145 ATH_MSG_DEBUG("passed exotics/trackless jet chain decision with PTF: " << promptTrackFrac << "\ttrackless: " << m_trackless << "\tpt: " << jetPt << "\teta: " << jetEta);
146 addDecisionID( m_decisionId.numeric(), i.decision );
147 }
148
149 } // end loop over inputs
150
151 return StatusCode::SUCCESS;
152}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< double > m_dr
Gaudi::Property< double > m_ptf
Gaudi::Property< int > m_trackless
bool trackPt(const xAOD::TauJet &, const xAOD::TauTrack &track, float &out)
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.

◆ 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

◆ finalize()

StatusCode TrigJetEJsHypoTool::finalize ( )

Definition at line 61 of file TrigJetEJsHypoTool.cxx.

61 {
62 return StatusCode::SUCCESS;
63}

◆ getId()

const HLT::Identifier & TrigJetEJsHypoTool::getId ( ) const

◆ initialize()

StatusCode TrigJetEJsHypoTool::initialize ( )

Definition at line 45 of file TrigJetEJsHypoTool.cxx.

45 {
46
47 if (m_visitDebug){
48
49 DebugInfoCollector collector(name());
50 CHECK(m_helper->getDescription(collector));
51 auto s = collector.toString();
52
53 for(const auto& l : lineSplitter(s)){
54 ATH_MSG_INFO(l);
55 }
56 }
57
58 return StatusCode::SUCCESS;
59}
#define ATH_MSG_INFO(x)
#define CHECK(...)
Evaluate an expression and check for errors.
ToolHandle< ITrigJetHypoToolHelper > m_helper
Gaudi::Property< bool > m_visitDebug
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)

◆ 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_chainName

Gaudi::Property<std::string> TrigJetEJsHypoTool::m_chainName
private
Initial value:
{
this, "chain_name", {}, "chain name"}

Definition at line 78 of file TrigJetEJsHypoTool.h.

78 {
79 this, "chain_name", {}, "chain name"};

◆ m_decisionId

HLT::Identifier TrigJetEJsHypoTool::m_decisionId
private

Definition at line 70 of file TrigJetEJsHypoTool.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_dr

Gaudi::Property< double > TrigJetEJsHypoTool::m_dr {this, "dR", 1.0, ""}
private

Definition at line 82 of file TrigJetEJsHypoTool.h.

82{this, "dR", 1.0, ""};

◆ 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_helper

ToolHandle<ITrigJetHypoToolHelper> TrigJetEJsHypoTool::m_helper
private
Initial value:
{
this, "helper_tool", {}, "Jet hypo helper AlgTool"}

Definition at line 72 of file TrigJetEJsHypoTool.h.

72 {
73 this, "helper_tool", {}, "Jet hypo helper AlgTool"};

◆ m_jetEtaCut_Exotics

double TrigJetEJsHypoTool::m_jetEtaCut_Exotics = 2.0
private

Definition at line 98 of file TrigJetEJsHypoTool.h.

◆ m_jetEtaCut_Trackless

double TrigJetEJsHypoTool::m_jetEtaCut_Trackless = 2.0
private

Definition at line 99 of file TrigJetEJsHypoTool.h.

◆ m_jetPtCut_Exotics

double TrigJetEJsHypoTool::m_jetPtCut_Exotics = 50.0*Gaudi::Units::GeV
private

Definition at line 93 of file TrigJetEJsHypoTool.h.

◆ m_jetPtCut_Trackless

double TrigJetEJsHypoTool::m_jetPtCut_Trackless = 50.0*Gaudi::Units::GeV
private

Definition at line 94 of file TrigJetEJsHypoTool.h.

◆ m_matchedTracksCut_Trackless

int TrigJetEJsHypoTool::m_matchedTracksCut_Trackless = 0
private

Definition at line 105 of file TrigJetEJsHypoTool.h.

◆ m_ptf

Gaudi::Property< double > TrigJetEJsHypoTool::m_ptf {this, "PTF", 1.0, ""}
private

Definition at line 81 of file TrigJetEJsHypoTool.h.

81{this, "PTF", 1.0, ""};

◆ m_PTFSigmaCut

double TrigJetEJsHypoTool::m_PTFSigmaCut = 2.5
private

Definition at line 102 of file TrigJetEJsHypoTool.h.

◆ m_PV_z

double TrigJetEJsHypoTool::m_PV_z = 10.0
private

Definition at line 107 of file TrigJetEJsHypoTool.h.

◆ m_trackEtaCut_Exotics

double TrigJetEJsHypoTool::m_trackEtaCut_Exotics = 2.4
private

Definition at line 86 of file TrigJetEJsHypoTool.h.

◆ m_trackEtaCut_Trackless

double TrigJetEJsHypoTool::m_trackEtaCut_Trackless = 2.4
private

Definition at line 87 of file TrigJetEJsHypoTool.h.

◆ m_trackless

Gaudi::Property< int > TrigJetEJsHypoTool::m_trackless {this, "Trackless", 1.0, ""}
private

Definition at line 83 of file TrigJetEJsHypoTool.h.

83{this, "Trackless", 1.0, ""};

◆ m_trackPtCut_Exotics

double TrigJetEJsHypoTool::m_trackPtCut_Exotics = 1.0*Gaudi::Units::GeV
private

Definition at line 89 of file TrigJetEJsHypoTool.h.

◆ m_trackPtCut_Trackless

double TrigJetEJsHypoTool::m_trackPtCut_Trackless = 2.0*Gaudi::Units::GeV
private

Definition at line 90 of file TrigJetEJsHypoTool.h.

◆ 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.

◆ m_visitDebug

Gaudi::Property<bool> TrigJetEJsHypoTool::m_visitDebug {this, "visit_debug", false, "debug flag"}
private

Definition at line 76 of file TrigJetEJsHypoTool.h.

76{this, "visit_debug", false, "debug flag"};

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