ATLAS Offline Software
Loading...
Searching...
No Matches
Jet_v1.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODJET_VERSIONS_JET_V1_H
8#define XAODJET_VERSIONS_JET_V1_H
9
10#include <map>
11
12
13// Core include(s):
14#include "AthLinks/ElementLink.h"
15
16// xAOD include(s):
17#include "xAODBase/IParticle.h"
19
20// Local include(s):
21//#include "xAODJet/JetConstituentIterator.h"
24#include "xAODJet/JetTypes.h"
26
28
29namespace fastjet {
30 class PseudoJet;
31}
32
33namespace xAOD {
34 class FastJetLinkBase;
35
36
37
57 class Jet_v1 : public IParticle {
58
59 public:
60
63 // typedef P4SignalState::State SignalStateType;
64
66 Jet_v1();
68 //Jet_v1( float pt, float eta, float phi, float m );
70 Jet_v1(const Jet_v1& );
71
72 ~Jet_v1();
75
77
79 virtual double pt() const;
81 virtual double eta() const;
83 virtual double phi() const;
85 virtual double m() const;
87 virtual double e() const;
89 virtual double rapidity() const;
90
93
95 virtual FourMom_t p4() const;
96
97
99 virtual Type::ObjectType type() const;
100
101
102
103
108
111
112
114 JetFourMom_t jetP4() const;
116 JetFourMom_t genvecP4() const;
117
119 float px() const;
121 float py() const;
123 float pz() const;
124
126
127
135 JetFourMom_t jetP4(JetScale s) const ;
138 JetFourMom_t jetP4(const std::string& statename) const ;
139 JetFourMom_t genvecP4(const std::string& statename) const ;
140
141 void setJetP4(const JetFourMom_t & p4);
142 void setJetP4(JetScale s, const JetFourMom_t & p4);
143
144 void setJetP4(const std::string & sname, const JetFourMom_t & p4);
145
146 //Jet_v1* cloneAtState(const std::string& state="") const ;
149
150
151
152
154 // Constituents
168 public:
170 void addConstituent( const ElementLink< IParticleContainer >& link , float weight=1.0 );
171
175 void addConstituent( const IParticle* p, float weight=1.0);
176
181
182
185
187 size_t numConstituents() const;
188
190 const IParticle* rawConstituent(size_t i) const ;
191
193 const std::vector< ElementLink< IParticleContainer > >& constituentLinks()const ;
194
195
196 protected:
197
198 void setNumConstituents(size_t n);
199
202
203
204
205
216 public:
217
219 template<class T>
220 bool getAttribute( AttributeID type, T & value ) const ;
222 template<class T>
223 bool getAttribute(const std::string &name, T &value) const;
224
226 template<class T>
227 T getAttribute(const std::string &name) const ;
228 template<class T>
230
231
232
233 template<class T>
234 void setAttribute(const std::string &name, const T& v) ;
236 template<class T>
237 void setAttribute( AttributeID type, const T& value );
238
248
249
250
254 template<typename T>
255 std::vector<const T*> getAssociatedObjects( const std::string &name) const ;
256 template<typename T>
257 std::vector<const T*> getAssociatedObjects( AssoParticlesID type) const ;
258
263 template<typename T>
264 bool getAssociatedObjects( const std::string &name, std::vector<const T*>& vec) const ;
265 template<typename T>
266 bool getAssociatedObjects( AssoParticlesID type, std::vector<const T*>& vec) const ;
267
272 template<typename T>
273 void setAssociatedObjects( const std::string &name, const std::vector<const T*>& vec) ;
274 template<typename T>
275 void setAssociatedObjects( AssoParticlesID type, const std::vector<const T*>& vec) ;
276
277
280 template<typename T>
281 const T* getAssociatedObject( const std::string &name) const ;
282 template<typename T>
284
287 template<typename T>
288 bool getAssociatedObject( const std::string &name, const T*& vec) const ;
289 template<typename T>
290 bool getAssociatedObject( AssoParticlesID type, const T*& vec) const ;
291
296 template<typename T>
297 void setAssociatedObject( const std::string &name, const T* vec) ;
298 template<typename T>
300
303
304
305
306
307
311
312 float getSizeParameter() const ;
315
316 void setSizeParameter(float p) ;
319
322
323
328 const fastjet::PseudoJet * getPseudoJet() const ;
331 template<class PSEUDOJET>
332 void setPseudoJet(const PSEUDOJET * fj);
333
334
336 // void toPersistent();
337
339 void reset();
342
343 protected:
347
348
349 }; // class Jet
350
351
352} // namespace xAOD
353
354// Declare IParticle as a base class of Jet_v1:
356
358
359#endif // XAODJET_VERSIONS_JET_V1_H
std::vector< size_t > vec
#define DATAVECTOR_BASE_FIN(T, B)
Used to finish up a forward declaration.
Definition DataVector.h:774
Defines enum to access jet attribute and associated particles/objects.
This file defines helper classes to deal with jet constituents.
static Double_t a
Class providing the definition of the 4-vector interface.
IParticle()=default
TLorentzVector FourMom_t
Definition of the 4-momentum type.
A vector of jet constituents at the scale used during jet finding.
Class describing a jet.
Definition Jet_v1.h:57
void reset()
Function making sure that the object is ready for persistification.
Definition Jet_v1.cxx:231
FastJetLinkBase * m_fastJetLink
Pointer to the fastjet object this jet is build from.
Definition Jet_v1.h:346
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
bool getAttribute(const std::string &name, T &value) const
Retrieve attribute by string.
void setAlgorithmType(JetAlgorithmType::ID a)
Definition Jet_v1.cxx:258
void setAttribute(const std::string &name, const T &v)
JetAlgorithmType::ID getAlgorithmType() const
Definition Jet_v1.cxx:249
void addConstituent(const ElementLink< IParticleContainer > &link, float weight=1.0)
Add a constituent directly in the ElementLink format.
Definition Jet_v1.cxx:111
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
Definition Jet_v1.cxx:153
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition Jet_v1.cxx:71
JetFourMom_t genvecP4() const
The full 4-momentum of the particle : internal jet type (same).
Definition Jet_v1.cxx:81
const std::vector< ElementLink< IParticleContainer > > & constituentLinks() const
Direct access to constituents. WARNING expert use only.
Definition Jet_v1.cxx:162
void setJetP4(const JetFourMom_t &p4)
Definition Jet_v1.cxx:171
JetConstitScale getConstituentsSignalState() const
The state at which constituents were when this jet was found.
Definition Jet_v1.cxx:136
bool getAssociatedObjects(AssoParticlesID type, std::vector< const T * > &vec) const
void setConstituentsSignalState(JetConstitScale t)
Set the state at which constituents were when this jet was found. This function is called by jet buil...
Definition Jet_v1.cxx:141
bool getAssociatedObject(const std::string &name, const T *&vec) const
get a single associated object returns false if the object is not existing
float py() const
The y-component of the jet's momentum.
Definition Jet_v1.cxx:94
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition Jet_v1.cxx:147
JetAttribute::AssoParticlesID AssoParticlesID
Definition Jet_v1.h:62
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
bool getAssociatedObjects(const std::string &name, std::vector< const T * > &vec) const
get associated objects as a vector<object> returns false if the object is not existing If internal li...
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition Jet_v1.cxx:67
float px() const
The x-component of the jet's momentum.
Definition Jet_v1.cxx:90
float getSizeParameter() const
Definition Jet_v1.cxx:245
void setAssociatedObjects(const std::string &name, const std::vector< const T * > &vec)
set associated objects from a vector of arbitrary object.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition Jet_v1.h:92
const fastjet::PseudoJet * getPseudoJet() const
Definition Jet_v1.cxx:236
float pz() const
The z-component of the jet's momentum.
Definition Jet_v1.cxx:99
void setAttribute(AttributeID type, const T &value)
Set number by enum.
std::vector< const T * > getAssociatedObjects(const std::string &name) const
get associated objects as a vector<object> this compact form throws an exception if the object is not...
const IParticle * rawConstituent(size_t i) const
Direct access to constituents. WARNING expert use only.
Definition Jet_v1.cxx:158
void setPseudoJet(const PSEUDOJET *fj)
Set the fast jet pointer.
void setSizeParameter(float p)
Definition Jet_v1.cxx:257
const T * getAssociatedObject(AssoParticlesID type) const
JetAttribute::AttributeID AttributeID
Definition Jet_v1.h:61
T getAttribute(AttributeID type) const
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
void setInputType(JetInput::Type t)
Definition Jet_v1.cxx:259
JetInput::Type getInputType() const
Definition Jet_v1.cxx:253
bool getAssociatedObject(AssoParticlesID type, const T *&vec) const
std::vector< const T * > getAssociatedObjects(AssoParticlesID type) const
JetFourMom_t GenVecFourMom_t
define enum ot follow naming conventions
Definition Jet_v1.h:110
Jet_v1()
Default constructor.
Definition Jet_v1.cxx:14
T getAttribute(const std::string &name) const
short form : more convenient and compact. Throws an exception if the moment is missing.
Jet_v1 & operator=(const Jet_v1 &other)
Definition Jet_v1.cxx:30
void setAssociatedObject(const std::string &name, const T *vec)
set a single associated object T must inherit AuxElement (if T inherits IParticle,...
void setAssociatedObjects(AssoParticlesID type, const std::vector< const T * > &vec)
void setAssociatedObject(AssoParticlesID type, const T *vec)
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
virtual double e() const
The total energy of the particle.
Definition Jet_v1.cxx:63
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Definition Jet_v1.cxx:76
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition Jet_v1.cxx:85
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
void setNumConstituents(size_t n)
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
JetScale
Definition JetTypes.h:26
JetConstitScale
Definition JetTypes.h:20
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17