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

#include <JetForwardJvtTool.h>

Inheritance diagram for JetForwardJvtTool:
Collaboration diagram for JetForwardJvtTool:

Public Member Functions

 JetForwardJvtTool (const std::string &name)
 Constructor with parameters:
virtual ~JetForwardJvtTool ()
 Destructor:
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode decorate (const xAOD::JetContainer &jetCont) const override
 Decorate a jet collection without otherwise modifying it.
float getFJVT (const xAOD::Jet *jet, const std::vector< TVector2 > &pileupMomenta, std::size_t pvind) const
bool forwardJet (const xAOD::Jet *jet) const
bool centralJet (const xAOD::Jet *jet) const
float getDrpt (const xAOD::Jet *jet) const
int getJetVertex (const xAOD::Jet *jet) const
StatusCode tagTruth (const xAOD::JetContainer *jets, const xAOD::JetContainer *truthJets)
std::vector< TVector2 > calculateVertexMomenta (const xAOD::JetContainer *jets, std::size_t pvind) const
float getCombinedWidth (const xAOD::Jet *jet) const
virtual void print () const
 Print the state of the tool.
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
virtual StatusCode modify (xAOD::JetContainer &jets) const override final
 Concrete implementation of the function inherited from IJetModifier.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

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

std::size_t getPV () const
 JetForwardJvtTool ()
 Default constructor:
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< double > m_etaThresh {this, "EtaThresh", 2.5, "Eta threshold"}
Gaudi::Property< double > m_forwardMinPt {this, "ForwardMinPt", 20e3, "Forward minimum Pt"}
Gaudi::Property< double > m_forwardMaxPt {this, "ForwardMaxPt", 50e3, "Forward maximum Pt"}
Gaudi::Property< double > m_centerMinPt {this, "CentralMinPt", 20e3, "Central minimum Pt"}
Gaudi::Property< double > m_centerMaxPt {this, "CentralMaxPt", -1, "Central maximum Pt"}
Gaudi::Property< double > m_centerJvtThresh {this, "CentralJvtThresh", 0.14, "Central JVT threshold"}
Gaudi::Property< double > m_centerDrptThresh {this, "CentralDrptThresh", 0.2, "Central drpt threshold"}
Gaudi::Property< double > m_maxStochPt {this, "CentralMaxStochPt", 35e3, "Central maximum StochPt"}
Gaudi::Property< double > m_jetScaleFactor {this, "JetScaleFactor", 0.4, "Jet scale factor"}
Gaudi::Property< double > m_fjvtThresh {this, "FjvtThresh", 15e3, "FJVT threshold"}
Gaudi::Property< bool > m_tightOP {this, "UseTightOP", false, "Use tight (true) or loose (false)"}
Gaudi::Property< bool > m_recalculateFjvt {this, "RecalculateFjvt", true, "Recalculate Fjvt or use stored value"}
Gaudi::Property< bool > m_renounceOutputs {this, "RenounceOutputs", false, "If true, then we're not interested in output dependencies. In that case, JetContainer is irrelevant."}
Gaudi::Property< std::string > m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_orKey {this, "OverlapDec", "", "Overlap decoration key"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_outKey {this, "OutputDec", "passFJVT", "Output decoration key"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_isHSKey {this, "IsJvtHSName", "isJvtHS", "Decoration key for isJvtHS"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_isPUKey {this, "IsJvtPUName", "isJvtPU", "Decoration key for isJvtPU"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_fjvtDecKey {this, "FJVTName", "fJvt", "Decoration key for fJvt"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainerName {this, "VertexContainerName", "PrimaryVertices", "SG key for vertex container"}
SG::ReadHandleKey< xAOD::MissingETContainerm_trkMETName {this, "Met_TrackName", "MET_Track", "SG key for MET track container"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_widthKey {this, "WidthName", "Width", "SG key for jet width"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_jvtMomentKey {this, "JvtMomentName", "Jvt", "JVT moment name"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_sumPtsKey {this, "SumPtsName", "SumPtTrkPt500", "SG key for SumPt vector"}
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 35 of file JetForwardJvtTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ JetForwardJvtTool() [1/2]

JetForwardJvtTool::JetForwardJvtTool ( const std::string & name)

Constructor with parameters:

Definition at line 27 of file JetForwardJvtTool.cxx.

27 :
28 AsgTool(name) {
29 }
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58

◆ ~JetForwardJvtTool()

JetForwardJvtTool::~JetForwardJvtTool ( )
virtualdefault

Destructor:

◆ JetForwardJvtTool() [2/2]

JetForwardJvtTool::JetForwardJvtTool ( )
private

Default constructor:

Member Function Documentation

◆ calculateVertexMomenta()

std::vector< TVector2 > JetForwardJvtTool::calculateVertexMomenta ( const xAOD::JetContainer * jets,
std::size_t pvind ) const

Definition at line 127 of file JetForwardJvtTool.cxx.

127 {
128
129 SG::ReadHandle<xAOD::MissingETContainer> trkMetHandle(m_trkMETName);
130 SG::ReadHandle<xAOD::VertexContainer> vertexContainerHandle(m_vertexContainerName);
131 if( !trkMetHandle.isValid() ) {
132 ATH_MSG_WARNING("xAOD::MissingETContainer " << m_trkMETName.key() << " is invalid");
133 return {};
134 }
135 if( !vertexContainerHandle.isValid() ) {
136 ATH_MSG_WARNING("xAOD::VertexContainer " << m_vertexContainerName.key() << " is invalid");
137 return {};
138 }
139
140 std::vector<TVector2> pileupMomenta;
141 for(const auto *const vx : *vertexContainerHandle) {
142 if(vx->vertexType()!=xAOD::VxType::PriVtx && vx->vertexType()!=xAOD::VxType::PileUp) continue;
143 TString vname = "PVTrack_vx";
144 vname += vx->index();
145 pileupMomenta.push_back((vx->index()==pvind ? 0 : -(1./m_jetScaleFactor)) *
146 TVector2(0.5*(*trkMetHandle)[vname.Data()]->mpx(),
147 0.5*(*trkMetHandle)[vname.Data()]->mpy()));
148 }
149
150 for (const auto *const jet : *jets) {
151 if (!centralJet(jet)) continue;
152 int jetvert = getJetVertex(jet);
153 if (jetvert>=0) pileupMomenta[jetvert] += TVector2(0.5*jet->pt()*cos(jet->phi()),0.5*jet->pt()*sin(jet->phi()));
154 }
155 return pileupMomenta;
156 }
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::MissingETContainer > m_trkMETName
bool centralJet(const xAOD::Jet *jet) const
int getJetVertex(const xAOD::Jet *jet) const
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerName
Gaudi::Property< double > m_jetScaleFactor
@ PileUp
Pile-up vertex.
@ PriVtx
Primary vertex.

◆ centralJet()

bool JetForwardJvtTool::centralJet ( const xAOD::Jet * jet) const

Definition at line 184 of file JetForwardJvtTool.cxx.

184 {
185 if (fabs(jet->eta())>m_etaThresh) return false;
186 if (jet->pt()<m_centerMinPt || (m_centerMaxPt>0 && jet->pt()>m_centerMaxPt)) return false;
187 if(!m_orKey.key().empty()){
188 SG::ReadDecorHandle<xAOD::JetContainer, char> orHandle(m_orKey);
189 if(!orHandle(*jet)) return false;
190 }
191 float jvt = 0;
192 SG::ReadDecorHandle<xAOD::JetContainer, float> jvtMomentHandle(m_jvtMomentKey);
193 jvt = jvtMomentHandle(*jet);
194 if (jvt>m_centerJvtThresh) return false;
195 if (jet->pt()<m_maxStochPt && getDrpt(jet)<m_centerDrptThresh) return false;
196 return true;
197 }
Gaudi::Property< double > m_maxStochPt
Gaudi::Property< double > m_centerJvtThresh
SG::ReadDecorHandleKey< xAOD::JetContainer > m_orKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvtMomentKey
Gaudi::Property< double > m_etaThresh
Gaudi::Property< double > m_centerMinPt
Gaudi::Property< double > m_centerDrptThresh
float getDrpt(const xAOD::Jet *jet) const
Gaudi::Property< double > m_centerMaxPt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49

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

◆ decorate()

StatusCode JetForwardJvtTool::decorate ( const xAOD::JetContainer & jets) const
overridevirtual

Decorate a jet collection without otherwise modifying it.

Implements IJetDecorator.

Definition at line 90 of file JetForwardJvtTool.cxx.

90 {
91 SG::WriteDecorHandle<xAOD::JetContainer, char> outHandle(m_outKey);
92 SG::WriteDecorHandle<xAOD::JetContainer, float> fjvtDecHandle(m_fjvtDecKey);
93
94 std::vector<TVector2> pileupMomenta;
95 const std::size_t pvind = getPV();
96 if (m_recalculateFjvt && !jetCont.empty()) {
97 pileupMomenta = calculateVertexMomenta(&jetCont, pvind);
98 }
99 for(const auto *const jetF : jetCont) {
100 outHandle(*jetF) = 1;
101 if(m_recalculateFjvt) fjvtDecHandle(*jetF) = 0;
102 if (!forwardJet(jetF)) continue;
103 double fjvt = getFJVT(jetF, pileupMomenta, pvind)/jetF->pt();
104 if (fjvt>m_fjvtThresh) outHandle(*jetF) = 0;
105 fjvtDecHandle(*jetF) = fjvt;
106 }
107 return StatusCode::SUCCESS;
108 }
Gaudi::Property< bool > m_recalculateFjvt
Gaudi::Property< double > m_fjvtThresh
bool forwardJet(const xAOD::Jet *jet) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fjvtDecKey
std::vector< TVector2 > calculateVertexMomenta(const xAOD::JetContainer *jets, std::size_t pvind) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_outKey
float getFJVT(const xAOD::Jet *jet, const std::vector< TVector2 > &pileupMomenta, std::size_t pvind) const
std::size_t getPV() const

◆ 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

◆ forwardJet()

bool JetForwardJvtTool::forwardJet ( const xAOD::Jet * jet) const

Definition at line 178 of file JetForwardJvtTool.cxx.

178 {
179 if (fabs(jet->eta())<m_etaThresh) return false;
180 if (jet->pt()<m_forwardMinPt || jet->pt()>m_forwardMaxPt) return false;
181 return true;
182 }
Gaudi::Property< double > m_forwardMaxPt
Gaudi::Property< double > m_forwardMinPt

◆ getCombinedWidth()

float JetForwardJvtTool::getCombinedWidth ( const xAOD::Jet * jet) const

Definition at line 158 of file JetForwardJvtTool.cxx.

158 {
159 float Width = 0;
160 float CWidth = 0;
161 float ptsum = 0;
162 SG::ReadDecorHandle<xAOD::JetContainer, float> widthHandle(m_widthKey);
163 Width = widthHandle(*jet);
164 xAOD::JetConstituentVector constvec = jet->getConstituents();
165 for (xAOD::JetConstituentVector::iterator it = constvec.begin(); it != constvec.end(); ++it) {
166 const xAOD::CaloCluster *cl = static_cast<const xAOD::CaloCluster*>((*it)->rawConstituent());
167 float secondR = cl->getMomentValue(xAOD::CaloCluster::MomentType::SECOND_R);
168 float centermag = cl->getMomentValue(xAOD::CaloCluster::MomentType::CENTER_MAG);
169 CWidth+=fabs(cl->pt()*atan(sqrt(secondR)/centermag)*cosh(cl->eta()));
170 ptsum += cl->pt();
171 }
172 if (ptsum != 0.)[[likely]]{
173 CWidth /= ptsum;
174 }
175 return (CWidth + Width);
176 }
SG::ReadDecorHandleKey< xAOD::JetContainer > m_widthKey
@ SECOND_R
Second Moment in .
@ CENTER_MAG
Cluster Centroid ( ).
iterator begin() const
iterator on the first constituent
iterator end() const
iterator after the last constituent
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition Jet_v1.cxx:149
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
#define likely(x)

◆ getDrpt()

float JetForwardJvtTool::getDrpt ( const xAOD::Jet * jet) const

Definition at line 214 of file JetForwardJvtTool.cxx.

214 {
215 std::vector<float> sumpts;
216 SG::ReadDecorHandle<xAOD::JetContainer, std::vector<float> > sumPtsHandle(m_sumPtsKey);
217 sumpts = sumPtsHandle(*jet);
218 if (sumpts.size()<2) return 0;
219
220 std::nth_element(sumpts.begin(),sumpts.begin()+sumpts.size()/2,sumpts.end(),std::greater<int>());
221 double median = sumpts[sumpts.size()/2];
222 std::nth_element(sumpts.begin(),sumpts.begin(),sumpts.end(),std::greater<int>());
223 double max = sumpts[0];
224 return (max-median)/jet->pt();
225 }
#define max(a, b)
Definition cfImp.cxx:41
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtsKey
float median(std::vector< float > &Vec)

◆ getFJVT()

float JetForwardJvtTool::getFJVT ( const xAOD::Jet * jet,
const std::vector< TVector2 > & pileupMomenta,
std::size_t pvind ) const

Definition at line 110 of file JetForwardJvtTool.cxx.

110 {
112 SG::WriteDecorHandle<xAOD::JetContainer, float> fjvtDecHandle(m_fjvtDecKey);
113 return fjvtDecHandle(*jet);
114 }
115
116 TVector2 fjet(-jet->pt()*cos(jet->phi()),-jet->pt()*sin(jet->phi()));
117 double fjvt = 0;
118 for (size_t pui = 0; pui < pileupMomenta.size(); pui++) {
119 if (pui==pvind) continue;
120 double projection = pileupMomenta[pui]*fjet/fjet.Mod();
121 if (projection>fjvt) fjvt = projection;
122 }
123 //fjvt += getCombinedWidth(jet);
124 return fjvt;
125 }
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54

◆ getJetVertex()

int JetForwardJvtTool::getJetVertex ( const xAOD::Jet * jet) const

Definition at line 199 of file JetForwardJvtTool.cxx.

199 {
200 std::vector<float> sumpts;
201 SG::ReadDecorHandle<xAOD::JetContainer, std::vector<float> > sumPtsHandle(m_sumPtsKey);
202 sumpts = sumPtsHandle(*jet);
203 double firstVal = 0;
204 int bestMatch = -1;
205 for (size_t i = 0; i < sumpts.size(); i++) {
206 if (sumpts[i]>firstVal) {
207 bestMatch = i;
208 firstVal = sumpts[i];
209 }
210 }
211 return bestMatch;
212 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getPV()

std::size_t JetForwardJvtTool::getPV ( ) const
private

Definition at line 227 of file JetForwardJvtTool.cxx.

227 {
228
229 std::size_t pvind = 0;
230 auto vertexContainer = SG::makeHandle (m_vertexContainerName);
231 if (!vertexContainer.isValid()){
232 ATH_MSG_WARNING("Invalid xAOD::VertexContainer datahandle");
233 return pvind;
234 }
235 const auto *vxCont = vertexContainer.cptr();
236
237 if(vxCont->empty()) {
238 ATH_MSG_WARNING("Event has no primary vertices!");
239 } else {
240 ATH_MSG_DEBUG("Successfully retrieved primary vertex container");
241 for(const auto *const vx : *vxCont) {
242 if(vx->vertexType()==xAOD::VxType::PriVtx)
243 {pvind = vx->index(); break;}
244 }
245 }
246 return pvind;
247 }
#define ATH_MSG_DEBUG(x)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ initialize()

StatusCode JetForwardJvtTool::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 38 of file JetForwardJvtTool.cxx.

39 {
40 ATH_MSG_DEBUG ("Initializing " << name() << "...");
41 if (m_tightOP) m_fjvtThresh = 0.4;
42 else m_fjvtThresh = 0.5;
43
44 ATH_CHECK(m_vertexContainerName.initialize());
45 ATH_CHECK(m_trkMETName.initialize());
46
47 if(m_jetContainerName.empty()) {
49 m_jetContainerName = "_dummy";
50 }
51 else {
52 ATH_MSG_ERROR("JetForwardJvtTool needs to have its input jet container configured!");
53 return StatusCode::FAILURE;
54 }
55 }
56 if(!m_orKey.key().empty()) m_orKey = m_jetContainerName + "." + m_orKey.key();
57 m_outKey = m_jetContainerName + "." + m_outKey.key();
64
65 ATH_CHECK(m_orKey.initialize(!m_orKey.key().empty()));
66 ATH_CHECK(m_outKey.initialize());
67 ATH_CHECK(m_isHSKey.initialize());
68 ATH_CHECK(m_isPUKey.initialize());
69 ATH_CHECK(m_fjvtDecKey.initialize());
70 ATH_CHECK(m_widthKey.initialize());
71 ATH_CHECK(m_jvtMomentKey.initialize());
72 ATH_CHECK(m_sumPtsKey.initialize());
73
74#ifndef XAOD_STANDALONE
84 }
85#endif
86
87 return StatusCode::SUCCESS;
88 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
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)
Gaudi::Property< bool > m_renounceOutputs
Gaudi::Property< bool > m_tightOP
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isPUKey
Gaudi::Property< std::string > m_jetContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isHSKey

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

◆ modify()

virtual StatusCode IJetDecorator::modify ( xAOD::JetContainer & jets) const
inlinefinaloverridevirtualinherited

Concrete implementation of the function inherited from IJetModifier.

Implements IJetModifier.

Definition at line 32 of file IJetDecorator.h.

32{return decorate(jets);};
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

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

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

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

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

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

◆ tagTruth()

StatusCode JetForwardJvtTool::tagTruth ( const xAOD::JetContainer * jets,
const xAOD::JetContainer * truthJets )

Definition at line 249 of file JetForwardJvtTool.cxx.

249 {
250 SG::WriteDecorHandle<xAOD::JetContainer, bool> isHSHandle(m_isHSKey);
251 SG::WriteDecorHandle<xAOD::JetContainer, bool> isPUHandle(m_isPUKey);
252 for(const auto *const jet : *jets) {
253 bool ishs = false;
254 bool ispu = true;
255 for(const auto *const tjet : *truthJets) {
256 if (tjet->p4().DeltaR(jet->p4())<0.3 && tjet->pt()>10e3) ishs = true;
257 if (tjet->p4().DeltaR(jet->p4())<0.6) ispu = false;
258 }
259 isHSHandle(*jet)=ishs;
260 isPUHandle(*jet)=ispu;
261 }
262 return StatusCode::SUCCESS;
263 }

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

Gaudi::Property<double> JetForwardJvtTool::m_centerDrptThresh {this, "CentralDrptThresh", 0.2, "Central drpt threshold"}
private

Definition at line 79 of file JetForwardJvtTool.h.

79{this, "CentralDrptThresh", 0.2, "Central drpt threshold"};

◆ m_centerJvtThresh

Gaudi::Property<double> JetForwardJvtTool::m_centerJvtThresh {this, "CentralJvtThresh", 0.14, "Central JVT threshold"}
private

Definition at line 78 of file JetForwardJvtTool.h.

78{this, "CentralJvtThresh", 0.14, "Central JVT threshold"};

◆ m_centerMaxPt

Gaudi::Property<double> JetForwardJvtTool::m_centerMaxPt {this, "CentralMaxPt", -1, "Central maximum Pt"}
private

Definition at line 77 of file JetForwardJvtTool.h.

77{this, "CentralMaxPt", -1, "Central maximum Pt"};

◆ m_centerMinPt

Gaudi::Property<double> JetForwardJvtTool::m_centerMinPt {this, "CentralMinPt", 20e3, "Central minimum Pt"}
private

Definition at line 76 of file JetForwardJvtTool.h.

76{this, "CentralMinPt", 20e3, "Central minimum Pt"};

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

Gaudi::Property<double> JetForwardJvtTool::m_etaThresh {this, "EtaThresh", 2.5, "Eta threshold"}
private

Definition at line 73 of file JetForwardJvtTool.h.

73{this, "EtaThresh", 2.5, "Eta threshold"};

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

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_fjvtDecKey {this, "FJVTName", "fJvt", "Decoration key for fJvt"}
private

Definition at line 96 of file JetForwardJvtTool.h.

96{this, "FJVTName", "fJvt", "Decoration key for fJvt"};

◆ m_fjvtThresh

Gaudi::Property<double> JetForwardJvtTool::m_fjvtThresh {this, "FjvtThresh", 15e3, "FJVT threshold"}
private

Definition at line 82 of file JetForwardJvtTool.h.

82{this, "FjvtThresh", 15e3, "FJVT threshold"}; //15GeV->92%,11GeV->85%

◆ m_forwardMaxPt

Gaudi::Property<double> JetForwardJvtTool::m_forwardMaxPt {this, "ForwardMaxPt", 50e3, "Forward maximum Pt"}
private

Definition at line 75 of file JetForwardJvtTool.h.

75{this, "ForwardMaxPt", 50e3, "Forward maximum Pt"};

◆ m_forwardMinPt

Gaudi::Property<double> JetForwardJvtTool::m_forwardMinPt {this, "ForwardMinPt", 20e3, "Forward minimum Pt"}
private

Definition at line 74 of file JetForwardJvtTool.h.

74{this, "ForwardMinPt", 20e3, "Forward minimum Pt"};

◆ m_isHSKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_isHSKey {this, "IsJvtHSName", "isJvtHS", "Decoration key for isJvtHS"}
private

Definition at line 94 of file JetForwardJvtTool.h.

94{this, "IsJvtHSName", "isJvtHS", "Decoration key for isJvtHS"};

◆ m_isPUKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_isPUKey {this, "IsJvtPUName", "isJvtPU", "Decoration key for isJvtPU"}
private

Definition at line 95 of file JetForwardJvtTool.h.

95{this, "IsJvtPUName", "isJvtPU", "Decoration key for isJvtPU"};

◆ m_jetContainerName

Gaudi::Property<std::string> JetForwardJvtTool::m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"}
private

Definition at line 91 of file JetForwardJvtTool.h.

91{this, "JetContainer", "", "SG key for the input jet container"};

◆ m_jetScaleFactor

Gaudi::Property<double> JetForwardJvtTool::m_jetScaleFactor {this, "JetScaleFactor", 0.4, "Jet scale factor"}
private

Definition at line 81 of file JetForwardJvtTool.h.

81{this, "JetScaleFactor", 0.4, "Jet scale factor"};

◆ m_jvtMomentKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_jvtMomentKey {this, "JvtMomentName", "Jvt", "JVT moment name"}
private

Definition at line 102 of file JetForwardJvtTool.h.

102{this, "JvtMomentName", "Jvt", "JVT moment name"};

◆ m_maxStochPt

Gaudi::Property<double> JetForwardJvtTool::m_maxStochPt {this, "CentralMaxStochPt", 35e3, "Central maximum StochPt"}
private

Definition at line 80 of file JetForwardJvtTool.h.

80{this, "CentralMaxStochPt", 35e3, "Central maximum StochPt"};

◆ m_orKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_orKey {this, "OverlapDec", "", "Overlap decoration key"}
private

Definition at line 92 of file JetForwardJvtTool.h.

92{this, "OverlapDec", "", "Overlap decoration key"};

◆ m_outKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_outKey {this, "OutputDec", "passFJVT", "Output decoration key"}
private

Definition at line 93 of file JetForwardJvtTool.h.

93{this, "OutputDec", "passFJVT", "Output decoration key"};

◆ m_recalculateFjvt

Gaudi::Property<bool> JetForwardJvtTool::m_recalculateFjvt {this, "RecalculateFjvt", true, "Recalculate Fjvt or use stored value"}
private

Definition at line 84 of file JetForwardJvtTool.h.

84{this, "RecalculateFjvt", true, "Recalculate Fjvt or use stored value"};

◆ m_renounceOutputs

Gaudi::Property<bool> JetForwardJvtTool::m_renounceOutputs {this, "RenounceOutputs", false, "If true, then we're not interested in output dependencies. In that case, JetContainer is irrelevant."}
private

Definition at line 90 of file JetForwardJvtTool.h.

90{this, "RenounceOutputs", false, "If true, then we're not interested in output dependencies. In that case, JetContainer is irrelevant."};

◆ m_sumPtsKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_sumPtsKey {this, "SumPtsName", "SumPtTrkPt500", "SG key for SumPt vector"}
private

Definition at line 103 of file JetForwardJvtTool.h.

103{this, "SumPtsName", "SumPtTrkPt500", "SG key for SumPt vector"};

◆ m_tightOP

Gaudi::Property<bool> JetForwardJvtTool::m_tightOP {this, "UseTightOP", false, "Use tight (true) or loose (false)"}
private

Definition at line 83 of file JetForwardJvtTool.h.

83{this, "UseTightOP", false, "Use tight (true) or loose (false)"};

◆ m_trkMETName

SG::ReadHandleKey<xAOD::MissingETContainer> JetForwardJvtTool::m_trkMETName {this, "Met_TrackName", "MET_Track", "SG key for MET track container"}
private

Definition at line 99 of file JetForwardJvtTool.h.

99{this, "Met_TrackName", "MET_Track", "SG key for MET track container"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainerName

SG::ReadHandleKey<xAOD::VertexContainer> JetForwardJvtTool::m_vertexContainerName {this, "VertexContainerName", "PrimaryVertices", "SG key for vertex container"}
private

Definition at line 98 of file JetForwardJvtTool.h.

98{this, "VertexContainerName", "PrimaryVertices", "SG key for vertex container"};

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_widthKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtTool::m_widthKey {this, "WidthName", "Width", "SG key for jet width"}
private

Definition at line 101 of file JetForwardJvtTool.h.

101{this, "WidthName", "Width", "SG key for jet width"};

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