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

#include <TrigJetCRHypoTool.h>

Inheritance diagram for TrigJetCRHypoTool:
Collaboration diagram for TrigJetCRHypoTool:

Classes

struct  JetInfo

Public Types

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

Public Member Functions

 TrigJetCRHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override final
StatusCode decide (std::vector< JetInfo > &decisions) const
 decides upon a collection of jets
bool decide_on_single_jet (JetInfo &input) const
 Auxiluary method, single jet selection.
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< float > m_jetlogRCut { this, "MinjetlogR", { float(1.2 ) }, "Jet logR requirement" }
Gaudi::Property< float > m_trackPtCut { this, "MintrackPt", { float( 2.0*Gaudi::Units::GeV ) }, "Track pT requirement" }
Gaudi::Property< float > m_deltaR { this, "MindeltaR", { float( 0.2 ) }, "deltaR(jet, track) requirement" }
Gaudi::Property< bool > m_doBIBrm { this, "doBIBremoval", { int(0) }, "option to include BIB removal" }
Gaudi::Property< bool > m_doEMFrm { this, "doEMFremoval", { int(0) }, "option to include pileip removal" }
Gaudi::Property< float > m_dEta { this, "BibMinDeltaEta", { float( 0.4 ) }, "BIB deltaEta requirement" }
Gaudi::Property< float > m_dPhi { this, "BibMinDeltaPhi", { float( 0.2 ) }, "BIB deltaPhi requirement" }
Gaudi::Property< float > m_minCellEt { this, "BibMinCellEt", { float( 240.0 ) }, "BIB cell Et requirement" }
Gaudi::Property< float > m_celltime { this, "BibCelltiming", { float( -2.0 ) }, "BIB cell timing requirement" }
Gaudi::Property< float > m_dBIBtime { this, "BibDeltatiming", { float( 5.0 ) }, "BIB delta timing requirement" }
Gaudi::Property< int > m_countCaloCell { this, "countBIBcells", { int( 4 ) }, "requirement on number of BIB cells" }
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 34 of file TrigJetCRHypoTool.h.

Member Typedef Documentation

◆ JetDecision

Definition at line 45 of file TrigJetCRHypoTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigJetCRHypoTool()

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

Definition at line 33 of file TrigJetCRHypoTool.cxx.

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

Member Function Documentation

◆ decide()

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

decides upon a collection of jets

Definition at line 141 of file TrigJetCRHypoTool.cxx.

141 {
142 for ( JetInfo& j: input ) {
143 if ( passed ( m_decisionId.numeric(), j.previousDecisionIDs ) ) {
144 if ( decide_on_single_jet( j ) ) {
145 addDecisionID( m_decisionId, j.decision );
146 return StatusCode::SUCCESS;
147
148 }
149 }
150 }
151
152 return StatusCode::SUCCESS;
153}
bool decide_on_single_jet(JetInfo &input) const
Auxiluary method, single jet selection.
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.

◆ decide_on_single_jet()

bool TrigJetCRHypoTool::decide_on_single_jet ( JetInfo & input) const

Auxiluary method, single jet selection.

Definition at line 60 of file TrigJetCRHypoTool.cxx.

60 {
61
62 auto jet = input.jet;
63 auto trackContainer = input.allTracks;
64 auto cellContainer = input.cells;
65
66 //Checking jet logRatio requirements
67 double jetEMF = jet->getAttribute<float>("EMFrac");
68 double jetRatio;
69
70 if (CxxUtils::fpcompare::greater(jetEMF,0.)){
72 ATH_MSG_DEBUG( "Fails logR cut, EMF>=1" );
73 return false;
74 }
75 else jetRatio = log10(double(1./jetEMF - 1.));
76
77 if( jetRatio < m_jetlogRCut ) return false;
78 }
79
80 // Loop over all tracks above m_trackPtCut and reject the jet if the closest track is at dR(jet, track)< m_deltaR
81 auto jetPhi= jet->phi();
82 auto jetEta= jet->eta();
83
84 for ( const xAOD::TrackParticle_v1* track : *trackContainer) {
85
86 if(track->pt() < m_trackPtCut ) continue;
87
88 double phi = track->phi0();
89 double eta = track->eta();
90
91 double dR = xAOD::P4Helpers::deltaR( eta, phi, jetEta, jetPhi );
92 if (dR<m_deltaR) return false;
93 }
94
95
96 if(m_doBIBrm==1){
97 int countCaloCell=0;
98 double countCell_layer[4] = {0,0,0,0};
99
100 for(CaloCellContainer::const_iterator celliter = cellContainer->begin(); celliter != cellContainer->end(); ++celliter){
101 //LoF cell selection in tile:
102 if((*celliter)->caloDDE()->is_tile() && (*celliter)->energy() > m_minCellEt){
103 double d_phi = xAOD::P4Helpers::deltaPhi( (*celliter)->phi(), jetPhi );
104 double d_R = xAOD::P4Helpers::deltaR( (*celliter)->eta(), (*celliter)->phi(), jetEta, jetPhi );
105 //select cells in a horizontal line, not being part of the jet and timing consistent with BIB
106 if(std::abs(d_phi) < 0.2 && d_R > 0.4){
107 //-early
108 float t = (*celliter)->time();
109 if(t < m_celltime){
110 // check cell's time consitency with BIB
111 float x = (*celliter)->x();
112 float y = (*celliter)->y();
113 float z = (*celliter)->z();
114 float r = sqrt(x*x + y*y);
115
116 if((std::abs(t - (z-sqrt(z*z + r*r))/CLHEP::c_light) < m_dBIBtime) || (std::abs(t - (-z-sqrt(z*z + r*r))/CLHEP::c_light) < m_dBIBtime)){
117 // for selected cells, store in which layer they are
118 if(r<2200){ countCell_layer[0]++;}
119 else if(r>=2200 && r<2600){ countCell_layer[1]++;}
120 else if(r>=2600 && r<3100){ countCell_layer[2]++;}
121 else if(r>=3100){ countCell_layer[3]++;}
122 }
123 }
124 }
125 }
126 }
127
128 // get max number of selected cells in a layer
129 for(int i=0; i<4; i++)
130 if(countCaloCell<countCell_layer[i]) countCaloCell=countCell_layer[i];
131
132 //apply cut on number of cells here
133 if (countCaloCell>=m_countCaloCell) return false;
134
135 return true;
136 }
137
138 return true;
139}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
#define y
#define x
#define z
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
Gaudi::Property< float > m_deltaR
Gaudi::Property< float > m_dBIBtime
Gaudi::Property< float > m_jetlogRCut
Gaudi::Property< float > m_celltime
Gaudi::Property< float > m_trackPtCut
Gaudi::Property< bool > m_doBIBrm
Gaudi::Property< int > m_countCaloCell
Gaudi::Property< float > m_minCellEt
int r
Definition globals.cxx:22
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition fpcompare.h:140
bool greater_equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition fpcompare.h:192
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi

◆ 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

◆ getId()

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

◆ initialize()

StatusCode TrigJetCRHypoTool::initialize ( )
finaloverridevirtual

Definition at line 43 of file TrigJetCRHypoTool.cxx.

43 {
44 ATH_MSG_VERBOSE( "In TrigJetCRHypoTool, initialize()." );
45
46 if (m_visitDebug){
47
48 DebugInfoCollector collector(name());
49 ATH_CHECK(m_helper->getDescription(collector));
50 auto s = collector.toString();
51
52 for(const auto& l : lineSplitter(s)){
53 ATH_MSG_INFO(l);
54 }
55 }
56
57 return StatusCode::SUCCESS;
58}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< bool > m_visitDebug
ToolHandle< ITrigJetHypoToolHelper > m_helper
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_celltime

Gaudi::Property< float > TrigJetCRHypoTool::m_celltime { this, "BibCelltiming", { float( -2.0 ) }, "BIB cell timing requirement" }
private

Definition at line 96 of file TrigJetCRHypoTool.h.

96{ this, "BibCelltiming", { float( -2.0 ) }, "BIB cell timing requirement" };

◆ m_chainName

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

Definition at line 81 of file TrigJetCRHypoTool.h.

81 {
82 this, "chain_name", {}, "chain name"};

◆ m_countCaloCell

Gaudi::Property< int > TrigJetCRHypoTool::m_countCaloCell { this, "countBIBcells", { int( 4 ) }, "requirement on number of BIB cells" }
private

Definition at line 98 of file TrigJetCRHypoTool.h.

98{ this, "countBIBcells", { int( 4 ) }, "requirement on number of BIB cells" };

◆ m_dBIBtime

Gaudi::Property< float > TrigJetCRHypoTool::m_dBIBtime { this, "BibDeltatiming", { float( 5.0 ) }, "BIB delta timing requirement" }
private

Definition at line 97 of file TrigJetCRHypoTool.h.

97{ this, "BibDeltatiming", { float( 5.0 ) }, "BIB delta timing requirement" };

◆ m_decisionId

HLT::Identifier TrigJetCRHypoTool::m_decisionId
private

Definition at line 73 of file TrigJetCRHypoTool.h.

◆ m_deltaR

Gaudi::Property< float > TrigJetCRHypoTool::m_deltaR { this, "MindeltaR", { float( 0.2 ) }, "deltaR(jet, track) requirement" }
private

Definition at line 88 of file TrigJetCRHypoTool.h.

88{ this, "MindeltaR", { float( 0.2 ) }, "deltaR(jet, track) requirement" };

◆ m_dEta

Gaudi::Property< float > TrigJetCRHypoTool::m_dEta { this, "BibMinDeltaEta", { float( 0.4 ) }, "BIB deltaEta requirement" }
private

Definition at line 93 of file TrigJetCRHypoTool.h.

93{ this, "BibMinDeltaEta", { float( 0.4 ) }, "BIB deltaEta requirement" };

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

Gaudi::Property< bool > TrigJetCRHypoTool::m_doBIBrm { this, "doBIBremoval", { int(0) }, "option to include BIB removal" }
private

Definition at line 90 of file TrigJetCRHypoTool.h.

90{ this, "doBIBremoval", { int(0) }, "option to include BIB removal" };

◆ m_doEMFrm

Gaudi::Property< bool > TrigJetCRHypoTool::m_doEMFrm { this, "doEMFremoval", { int(0) }, "option to include pileip removal" }
private

Definition at line 91 of file TrigJetCRHypoTool.h.

91{ this, "doEMFremoval", { int(0) }, "option to include pileip removal" };

◆ m_dPhi

Gaudi::Property< float > TrigJetCRHypoTool::m_dPhi { this, "BibMinDeltaPhi", { float( 0.2 ) }, "BIB deltaPhi requirement" }
private

Definition at line 94 of file TrigJetCRHypoTool.h.

94{ this, "BibMinDeltaPhi", { float( 0.2 ) }, "BIB deltaPhi requirement" };

◆ 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> TrigJetCRHypoTool::m_helper
private
Initial value:
{
this, "helper_tool", {}, "Jet hypo helper AlgTool"}

Definition at line 75 of file TrigJetCRHypoTool.h.

75 {
76 this, "helper_tool", {}, "Jet hypo helper AlgTool"};

◆ m_jetlogRCut

Gaudi::Property< float > TrigJetCRHypoTool::m_jetlogRCut { this, "MinjetlogR", { float(1.2 ) }, "Jet logR requirement" }
private

Definition at line 85 of file TrigJetCRHypoTool.h.

85{ this, "MinjetlogR", { float(1.2 ) }, "Jet logR requirement" };

◆ m_minCellEt

Gaudi::Property< float > TrigJetCRHypoTool::m_minCellEt { this, "BibMinCellEt", { float( 240.0 ) }, "BIB cell Et requirement" }
private

Definition at line 95 of file TrigJetCRHypoTool.h.

95{ this, "BibMinCellEt", { float( 240.0 ) }, "BIB cell Et requirement" };

◆ m_trackPtCut

Gaudi::Property< float > TrigJetCRHypoTool::m_trackPtCut { this, "MintrackPt", { float( 2.0*Gaudi::Units::GeV ) }, "Track pT requirement" }
private

Definition at line 87 of file TrigJetCRHypoTool.h.

87{ this, "MintrackPt", { float( 2.0*Gaudi::Units::GeV ) }, "Track pT requirement" };

◆ 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> TrigJetCRHypoTool::m_visitDebug {this, "visit_debug", false, "debug flag"}
private

Definition at line 79 of file TrigJetCRHypoTool.h.

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

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