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

James Frost
November 2014. More...

#include <JetVertexTaggerTool.h>

Inheritance diagram for JetVertexTaggerTool:
Collaboration diagram for JetVertexTaggerTool:

Public Member Functions

 JetVertexTaggerTool (const std::string &name)
virtual ~JetVertexTaggerTool ()
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 evaluateJvt (float rpt, float jvfcorr) const
float updateJvt (const xAOD::Jet &jet) const override
 Calculate the updated JVT.
const xAOD::VertexfindHSVertex () 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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_jetContainerName {this,"JetContainer", "", "SG key for the input jet container"}
Gaudi::Property< std::string > m_jvtlikelihoodHistName {this, "JVTLikelihoodHistName", "JVTRootCore_kNN100trim_pt20to50_Likelihood", "JVT likelihood histogram name"}
Gaudi::Property< std::string > m_jvtfileName {this, "JVTFileName", "JetMomentTools/JVTlikelihood_20140805.root", "JVT likelihood file name"}
Gaudi::Property< bool > m_suppressInputDeps {this, "SuppressInputDependence", false, "Will JVFCorr and SumPtTrk be created in the same algorithm that uses this tool?"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainer_key {this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_jvfCorrKey {this, "JVFCorrName", "JVFCorr", "SG key for input JVFCorr decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_jvfCorrVtxKey
SG::ReadDecorHandleKey< xAOD::JetContainerm_sumPtTrkKey {this, "SumPtTrkName", "SumPtTrkPt500", "SG key for input SumPtTrk decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_jvtKey {this, "JVTName", "Jvt", "SG key for output JVT decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_jvtVecKey
SG::WriteDecorHandleKey< xAOD::JetContainerm_rptKey {this, "RpTName", "JvtRpt", "SG key for output RpT decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_rptVecKey
Gaudi::Property< bool > m_useOriginVertex = {this, "UseOriginVertex", false, "use origin vertex for each jet"}
TString m_fn
TH2F * m_jvthisto
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

James Frost
November 2014.

Updated for Run 3 by Bill Balunas March 2020

Tool to calculate the jet vertex tag (JVT) JVT is a float per jet

The JVT likelihood is parameterised in terms of: RPT: ratio of the primary vertex track sum to the jet pT JVFCorr: a corrected JVF calculation accounting for the number of PU tracks in the event.

Calculation requires three main types of information

  1. Vertex container for the event (from evtStore), with respect to which the JVT track sums
  2. Tracks associated to each of the input jet (in the jet aux store)
  3. Track vertex association object (from evtStore)
  4. The track container needed for PU track counting
  5. The ID track selector tool to provide an input track selection.
  6. An input file with the JVT likelihood stored as a 2D histogram.

Using this information, the procedure can be broken into three main steps:

  1. Count the total number of pileup tracks
  2. Per jet: Get track pT sums needed for JVFCorr and RpT
  3. Use JVT likelihood to get JVT value

Attributes added (each is a float per jet):

  1. Jvt - the JVTLikelihood value for the jet. This is parameterised in terms of:
  2. JvtRpt - the ratio of the PV track pT sum to the jet pT
  3. JvtJvfcorr - a corrected Jvf quantity that corrects for the number of pileup tracks in an event.

Properties: JetContainer - name of the jet container VertexContainer - name of the vertex container TrackParticleContainer - name of the track container AssociatedTracks - name for attribute holding the list of associated tracks TrackVertexAssociation - name for the container holding the track-vertex associations TrackSelector - tool to select tracks (none ==> no selection) JVTFileName - ROOT Filename containing JVT likelihood histogram JVTLikelihoodHistName - JVT Likelihood histogram name JVTName - name for the 3 JVT attributes (default is "JVT") K_JVFCorrScale - the scale factor for pileup tracks in the JVFCorr calculation (default is 0.01) Z0Cut - Z0 value (in mm) within which tracks associated to no vertex may be assigned to the primary vertex (default is 3.) PUTrkPtCut - the track pT (in MeV) below which tracks associated to no vertex may be assigned to the primary vertex (default is 30000.)

Definition at line 78 of file JetVertexTaggerTool.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

◆ JetVertexTaggerTool()

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

Definition at line 23 of file JetVertexTaggerTool.cxx.

24: asg::AsgTool(name),
25 m_jvthisto(nullptr)
26{
27}

◆ ~JetVertexTaggerTool()

JetVertexTaggerTool::~JetVertexTaggerTool ( )
virtual

Definition at line 31 of file JetVertexTaggerTool.cxx.

31 {
32 if(m_jvthisto) delete m_jvthisto;
33}

Member Function Documentation

◆ 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 JetVertexTaggerTool::decorate ( const xAOD::JetContainer & jets) const
overridevirtual

Decorate a jet collection without otherwise modifying it.

Implements IJetDecorator.

Definition at line 99 of file JetVertexTaggerTool.cxx.

99 {
100
101 // Get the vertex to calculate with respect to
102 // Only appropriate if we are using a single vertex interpretation, not if using OriginVertex
103 const xAOD::Vertex* HSvertex = nullptr;
105 {
106 HSvertex = findHSVertex();
107 if(!HSvertex) return StatusCode::FAILURE;
108 }
109
110 // Grab vertices for index bookkeeping
111 SG::ReadHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle (m_vertexContainer_key);
112 const xAOD::VertexContainer* vertices = vertexHandle.cptr();
113
114 SG::ReadDecorHandle<xAOD::JetContainer, float> jvfCorrHandle(m_jvfCorrKey);
115 SG::ReadDecorHandle<xAOD::JetContainer, std::vector<float> > sumPtTrkHandle(m_sumPtTrkKey);
116 SG::WriteDecorHandle<xAOD::JetContainer, float> jvtHandle(m_jvtKey);
117 SG::WriteDecorHandle<xAOD::JetContainer, float> rptHandle(m_rptKey);
118
119
120
121 for(const xAOD::Jet * jet : jetCont) {
122 // Get origin-vertex-specific information if relevant
124 {
125 HSvertex = jet->getAssociatedObject<xAOD::Vertex>("OriginVertex");
126 if (!HSvertex) // nullptr if the attribute doesn't exist
127 {
128 ATH_MSG_ERROR("OriginVertex was requested, but the jet does not contain an OriginVertex");
129 return StatusCode::FAILURE;
130 }
131 else
132 {
133 ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() << " is using OriginVertex at index: " << HSvertex->index());
134 }
135 }
136
137 // Calculate RpT and JVFCorr
138 // Default JVFcorr to -1 when no tracks are associated.
139 float jvfcorr = jvfCorrHandle(*jet);
140 std::vector<float> sumpttrk = sumPtTrkHandle(*jet);
141 const float rpt = sumpttrk[HSvertex->index() - (*vertices)[0]->index()]/jet->pt();
142 float jvt = evaluateJvt(rpt, jvfcorr);
143
144 rptHandle(*jet) = rpt;
145 jvtHandle(*jet) = jvt;
146 ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() << ": JVT=" << jvt << ", RpT=" << rpt << ", JVFCorr=" << jvfcorr);
147 }
148
149 if (m_useOriginVertex) { // Compute JVT for jets assuming other vertices as origin
150
151 SG::ReadDecorHandle<xAOD::JetContainer, std::vector<float> > jvfCorrVtxHandle(m_jvfCorrVtxKey);
152 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> jvtVecHandle(m_jvtVecKey);
153 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float>> rptVecHandle(m_rptVecKey);
154
155 std::vector<float> jvtVtx;
156 std::vector<float> rptVtx;
157
158 for(const xAOD::Jet * jet : jetCont) {
159 jvtVtx.clear();
160 rptVtx.clear();
161 std::vector<float> sumpttrk = sumPtTrkHandle(*jet);
162 std::vector<float> jvfcorrVtx = jvfCorrVtxHandle(*jet);
163
164 // Loop over vertices
165 for(size_t vtxi=0; vtxi<vertices->size(); ++vtxi) {
166
167 float jvfcorr = jvfcorrVtx.at(vtxi);
168 const float rpt = sumpttrk[vtxi]/jet->pt();
169 float jvt = evaluateJvt(rpt, jvfcorr);
170 jvtVtx.push_back(jvt);
171 rptVtx.push_back(rpt);
172 }
173
174 jvtVecHandle(*jet) = jvtVtx;
175 rptVecHandle(*jet) = rptVtx;
176 // Done
177
178 }
179 }
180 return StatusCode::SUCCESS;
181}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
size_type size() const noexcept
Returns the number of elements in the collection.
const xAOD::Vertex * findHSVertex() const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptVecKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrVtxKey
Gaudi::Property< bool > m_useOriginVertex
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtVecKey
float evaluateJvt(float rpt, float jvfcorr) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtTrkKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtKey
size_t index() const
Return the index of this element within its container.
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Jet_v1 Jet
Definition of the current "jet version".
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.

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

◆ evaluateJvt()

float JetVertexTaggerTool::evaluateJvt ( float rpt,
float jvfcorr ) const

Definition at line 184 of file JetVertexTaggerTool.cxx.

184 {
185 // Look up JVT value
186 float jvt = -999.;
187 if ( jvfcorr == -1.0 ) {
188 jvt = -0.1;
189 } else {
190 float rpt_inputtojvt = std::min(rpt, (float) 1. );
191 int bin = std::as_const(m_jvthisto)->FindBin(jvfcorr, rpt_inputtojvt);
192 jvt = m_jvthisto->GetBinContent(bin);
193 jvt = m_jvthisto->Interpolate(jvfcorr, rpt_inputtojvt);
194 }
195 return jvt;
196}

◆ 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

◆ findHSVertex()

const xAOD::Vertex * JetVertexTaggerTool::findHSVertex ( ) const

Definition at line 234 of file JetVertexTaggerTool.cxx.

235{
236 // Get input vertex collection
237 SG::ReadHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle (m_vertexContainer_key);
238 if (!vertexHandle.isValid()){
239 ATH_MSG_ERROR("Invalid VertexContainer datahandle: " << m_vertexContainer_key.key());
240 return nullptr;
241 }
242 const xAOD::VertexContainer* vertices = vertexHandle.cptr();
243 ATH_MSG_DEBUG("Successfully retrieved VertexContainer: " << m_vertexContainer_key.key());
244
245 if (vertices->empty() ) {
246 ATH_MSG_WARNING("There are no vertices in the container. Exiting");
247 return nullptr;
248 }
249
250 for ( size_t iVertex = 0; iVertex < vertices->size(); ++iVertex ) {
251 if(vertices->at(iVertex)->vertexType() == xAOD::VxType::PriVtx) {
252
253 ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() << " Found HS vertex at index: "<< iVertex);
254 return vertices->at(iVertex);
255 }
256 }
257 ATH_MSG_VERBOSE("There is no vertex of type PriVx. Taking default vertex.");
258 return vertices->at(0);
259}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
const T * at(size_type n) const
Access an element, as an rvalue.
bool empty() const noexcept
Returns true if the collection is empty.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
VxType::VertexType vertexType() const
The type of the vertex.
@ PriVtx
Primary vertex.

◆ 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::TEvent 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::TEvent, 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::TEvent 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::TEvent, 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.

◆ initialize()

StatusCode JetVertexTaggerTool::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 37 of file JetVertexTaggerTool.cxx.

37 {
38 ATH_MSG_INFO("Initializing JetVertexTaggerTool " << name());
39 ATH_MSG_INFO("Using origin vertex: " << m_useOriginVertex);
40
41 if(m_jetContainerName.empty()){
42 ATH_MSG_ERROR("JetVertexTaggerTool needs to have its input jet container configured!");
43 return StatusCode::FAILURE;
44 }
45
46 // Use the Path Resolver to find the jvt file and retrieve the likelihood histogram
48 ATH_MSG_INFO(" Reading JVT file from:\n " << m_jvtfileName << "\n");
49 ATH_MSG_INFO(" resolved in :\n " << m_fn << "\n\n");
50
51 std::unique_ptr<TFile> jvtfile {TFile::Open(m_fn)};
52 if(!jvtfile){
53 ATH_MSG_FATAL("Cannot open JVTLikelihoodFile: " << m_fn);
54 return StatusCode::FAILURE;
55 }
56
57 ATH_MSG_VERBOSE("\n Reading JVT likelihood histogram from:\n " << m_fn << "\n\n");
58
59 m_jvthisto = (TH2F*)jvtfile->Get(std::string(m_jvtlikelihoodHistName).c_str() );
60 if(!m_jvthisto){
61 ATH_MSG_FATAL( "\n Found JVT file, but JVT histogram missing. Aborting..." );
62 return StatusCode::FAILURE;
63 }
64 m_jvthisto->SetDirectory (nullptr);
65
67 m_jvfCorrVtxKey = m_jvfCorrKey.key()+"Vec";
69 m_jvtKey = m_jetContainerName + "." + m_jvtKey.key();
70 m_jvtVecKey = m_jvtKey.key()+"Vec";
71 m_rptKey = m_jetContainerName + "." + m_rptKey.key();
72 m_rptVecKey = m_rptKey.key()+"Vec";
73
74#ifndef XAOD_STANDALONE
76 // The user has promised that these will be produced by the same alg running JVT.
77 // Tell the scheduler to ignore them to avoid circular dependencies.
80 }
81#endif
82
83 ATH_CHECK(m_vertexContainer_key.initialize());
84 ATH_CHECK(m_jvfCorrKey.initialize());
85 ATH_CHECK(m_sumPtTrkKey.initialize());
86 ATH_CHECK(m_jvtKey.initialize());
87 ATH_CHECK(m_rptKey.initialize());
88
92
93
94 return StatusCode::SUCCESS;
95}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
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_suppressInputDeps
Gaudi::Property< std::string > m_jvtlikelihoodHistName
Gaudi::Property< std::string > m_jvtfileName
Gaudi::Property< std::string > m_jetContainerName
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)

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

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

◆ updateJvt()

float JetVertexTaggerTool::updateJvt ( const xAOD::Jet & jet) const
overridevirtual

Calculate the updated JVT.

jet - jet for which JVT is updated The new value for JVT is returned.

Implements IJetUpdateJvt.

Definition at line 200 of file JetVertexTaggerTool.cxx.

200 {
201 SG::ReadDecorHandle<xAOD::JetContainer, float> jvfCorrHandle(m_jvfCorrKey);
202 SG::ReadDecorHandle<xAOD::JetContainer, std::vector<float> > sumPtTrkHandle(m_sumPtTrkKey);
203
204 float jvfcorr = jvfCorrHandle(jet);
205 std::vector<float> sumpttrk = sumPtTrkHandle(jet);
206
207 // Get the vertex to calculate with respect to
208 const xAOD::Vertex* HSvertex = nullptr;
210 HSvertex = findHSVertex();
211 else
212 {
213 HSvertex = jet.getAssociatedObject<xAOD::Vertex>("OriginVertex");
214 if (HSvertex) // nullptr if the attribute doesn't exist, nothing to do as behaviour is same as other method, checked below and return -1
215 ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() << " is using OriginVertex at index: " << HSvertex->index());
216 }
217
218 if(!HSvertex) {
219 ATH_MSG_ERROR("No hard scatter vertex found. Returning JVT=-1");
220 return -1.;
221 }
222
223 // Grab vertices for index bookkeeping
224 SG::ReadHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle (m_vertexContainer_key);
225 const xAOD::VertexContainer* vertices = vertexHandle.cptr();
226
227 const float rptnew = sumpttrk[HSvertex->index() - (*vertices)[0]->index()]/jet.pt();
228
229 return evaluateJvt(rptnew, jvfcorr);
230}
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
const T * getAssociatedObject(const std::string &name) const
get a single associated object this compact form throws an exception if the object is not existing

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

TString JetVertexTaggerTool::m_fn
private

Definition at line 126 of file JetVertexTaggerTool.h.

◆ m_jetContainerName

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

Definition at line 109 of file JetVertexTaggerTool.h.

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

◆ m_jvfCorrKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_jvfCorrKey {this, "JVFCorrName", "JVFCorr", "SG key for input JVFCorr decoration"}
private

Definition at line 115 of file JetVertexTaggerTool.h.

115{this, "JVFCorrName", "JVFCorr", "SG key for input JVFCorr decoration"};

◆ m_jvfCorrVtxKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_jvfCorrVtxKey
private

Definition at line 116 of file JetVertexTaggerTool.h.

◆ m_jvtfileName

Gaudi::Property<std::string> JetVertexTaggerTool::m_jvtfileName {this, "JVTFileName", "JetMomentTools/JVTlikelihood_20140805.root", "JVT likelihood file name"}
private

Definition at line 111 of file JetVertexTaggerTool.h.

111{this, "JVTFileName", "JetMomentTools/JVTlikelihood_20140805.root", "JVT likelihood file name"};

◆ m_jvthisto

TH2F* JetVertexTaggerTool::m_jvthisto
private

Definition at line 127 of file JetVertexTaggerTool.h.

◆ m_jvtKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_jvtKey {this, "JVTName", "Jvt", "SG key for output JVT decoration"}
private

Definition at line 118 of file JetVertexTaggerTool.h.

118{this, "JVTName", "Jvt", "SG key for output JVT decoration"};

◆ m_jvtlikelihoodHistName

Gaudi::Property<std::string> JetVertexTaggerTool::m_jvtlikelihoodHistName {this, "JVTLikelihoodHistName", "JVTRootCore_kNN100trim_pt20to50_Likelihood", "JVT likelihood histogram name"}
private

Definition at line 110 of file JetVertexTaggerTool.h.

110{this, "JVTLikelihoodHistName", "JVTRootCore_kNN100trim_pt20to50_Likelihood", "JVT likelihood histogram name"};

◆ m_jvtVecKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_jvtVecKey
private

Definition at line 119 of file JetVertexTaggerTool.h.

◆ m_rptKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_rptKey {this, "RpTName", "JvtRpt", "SG key for output RpT decoration"}
private

Definition at line 120 of file JetVertexTaggerTool.h.

120{this, "RpTName", "JvtRpt", "SG key for output RpT decoration"};

◆ m_rptVecKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_rptVecKey
private

Definition at line 121 of file JetVertexTaggerTool.h.

◆ m_sumPtTrkKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetVertexTaggerTool::m_sumPtTrkKey {this, "SumPtTrkName", "SumPtTrkPt500", "SG key for input SumPtTrk decoration"}
private

Definition at line 117 of file JetVertexTaggerTool.h.

117{this, "SumPtTrkName", "SumPtTrkPt500", "SG key for input SumPtTrk decoration"};

◆ m_suppressInputDeps

Gaudi::Property<bool> JetVertexTaggerTool::m_suppressInputDeps {this, "SuppressInputDependence", false, "Will JVFCorr and SumPtTrk be created in the same algorithm that uses this tool?"}
private

Definition at line 112 of file JetVertexTaggerTool.h.

112{this, "SuppressInputDependence", false, "Will JVFCorr and SumPtTrk be created in the same algorithm that uses this tool?"};

◆ m_useOriginVertex

Gaudi::Property<bool> JetVertexTaggerTool::m_useOriginVertex = {this, "UseOriginVertex", false, "use origin vertex for each jet"}
private

Definition at line 123 of file JetVertexTaggerTool.h.

123{this, "UseOriginVertex", false, "use origin vertex for each jet"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainer_key

SG::ReadHandleKey<xAOD::VertexContainer> JetVertexTaggerTool::m_vertexContainer_key {this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"}
private

Definition at line 114 of file JetVertexTaggerTool.h.

114{this, "VertexContainer", "PrimaryVertices", "SG key for input vertex container"};

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