ATLAS Offline Software
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"
23 #include "xAODJet/JetAttributes.h"
24 #include "xAODJet/JetTypes.h"
26 
28 
29 namespace fastjet {
30  class PseudoJet;
31 }
32 
33 namespace 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 
76  Jet_v1& operator=(const Jet_v1& other);
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 ;
314  JetInput::Type getInputType() 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
xAOD::Jet_v1::getPseudoJet
const fastjet::PseudoJet * getPseudoJet() const
Definition: Jet_v1.cxx:236
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::Jet_v1::m_fastJetLink
FastJetLinkBase * m_fastJetLink
Pointer to the fastjet object this jet is build from.
Definition: Jet_v1.h:346
JetContainerInfo.h
IParticle.h
Jet_v1.icc
fastjet
Definition: FastJetLinkBase.h:22
xAOD::Jet_v1::Jet_v1
Jet_v1()
Default constructor.
Definition: Jet_v1.cxx:14
xAOD::Jet_v1::getAssociatedObjects
std::vector< const T * > getAssociatedObjects(AssoParticlesID type) const
xAOD::Jet_v1::getAssociatedObject
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
xAOD::Jet_v1::operator=
Jet_v1 & operator=(const Jet_v1 &other)
Definition: Jet_v1.cxx:30
JetAttributes.h
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
athena.value
value
Definition: athena.py:124
xAOD::Jet_v1::jetP4
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Definition: Jet_v1.cxx:76
xAOD::Jet_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: Jet_v1.cxx:54
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::FastJetLinkBase
Definition: FastJetLinkBase.h:28
xAOD::Jet_v1::getAlgorithmType
JetAlgorithmType::ID getAlgorithmType() const
Definition: Jet_v1.cxx:249
xAOD::Jet_v1::getConstituents
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition: Jet_v1.cxx:147
JetConstituentVector.h
This file defines helper classes to deal with jet constituents.
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::Jet_v1::getInputType
JetInput::Type getInputType() const
Definition: Jet_v1.cxx:253
xAOD::Jet_v1::setAssociatedObjects
void setAssociatedObjects(AssoParticlesID type, const std::vector< const T * > &vec)
xAOD::Jet_v1::getAttribute
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
xAOD::Jet_v1::getAssociatedObject
bool getAssociatedObject(AssoParticlesID type, const T *&vec) const
xAOD::Jet_v1::setAssociatedObject
void setAssociatedObject(const std::string &name, const T *vec)
set a single associated object T must inherit AuxElement (if T inherits IParticle,...
xAOD::Jet_v1::setAttribute
void setAttribute(AttributeID type, const T &value)
Set number by enum.
xAOD::Jet_v1::getAttribute
T getAttribute(const std::string &name) const
short form : more convenient and compact. Throws an exception if the moment is missing.
xAOD::JetAttribute::AttributeID
AttributeID
Definition: JetAttributes.h:24
xAOD::Jet_v1::~Jet_v1
~Jet_v1()
Definition: Jet_v1.cxx:39
xAOD::Jet_v1::setJetP4
void setJetP4(const JetFourMom_t &p4)
Definition: Jet_v1.cxx:171
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
xAOD::Jet_v1::setAssociatedObject
void setAssociatedObject(AssoParticlesID type, const T *vec)
xAOD::Jet_v1::getAssociatedObjects
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...
JetContainerFwd.h
xAOD::Jet_v1::setNumConstituents
void setNumConstituents(size_t n)
xAOD::Jet_v1::AssoParticlesID
JetAttribute::AssoParticlesID AssoParticlesID
Definition: Jet_v1.h:62
xAOD::Jet_v1::pz
float pz() const
The z-component of the jet's momentum.
Definition: Jet_v1.cxx:99
xAOD::Jet_v1::type
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition: Jet_v1.cxx:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::Jet_v1::setSizeParameter
void setSizeParameter(float p)
Definition: Jet_v1.cxx:257
xAOD::Jet_v1::reset
void reset()
Function making sure that the object is ready for persistification.
Definition: Jet_v1.cxx:231
xAOD::Jet_v1::getSizeParameter
float getSizeParameter() const
Definition: Jet_v1.cxx:245
IParticleContainer.h
xAOD::Jet_v1::AttributeID
JetAttribute::AttributeID AttributeID
Definition: Jet_v1.h:61
xAOD::Jet_v1::getConstituentsSignalState
JetConstitScale getConstituentsSignalState() const
The state at which constituents were when this jet was found.
Definition: Jet_v1.cxx:136
xAOD::Jet_v1::setConstituentsSignalState
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
xAOD::JetScale
JetScale
Definition: JetTypes.h:26
xAOD::Jet_v1::getAssociatedObject
bool getAssociatedObject(const std::string &name, const T *&vec) const
get a single associated object returns false if the object is not existing
xAOD::Jet_v1::getAssociatedObjects
bool getAssociatedObjects(AssoParticlesID type, std::vector< const T * > &vec) const
xAOD::Jet_v1::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition: Jet_v1.h:92
xAOD::JetAttribute::AssoParticlesID
AssoParticlesID
Definition: JetAttributes.h:251
xAOD::JetAlgorithmType::ID
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
Definition: JetContainerInfo.h:29
xAOD::Jet_v1::py
float py() const
The y-component of the jet's momentum.
Definition: Jet_v1.cxx:94
xAOD::JetInput::Type
Type
Definition: JetContainerInfo.h:54
xAOD::Jet_v1::addConstituent
void addConstituent(const ElementLink< IParticleContainer > &link, float weight=1.0)
Add a constituent directly in the ElementLink format.
Definition: Jet_v1.cxx:111
xAOD::Jet_v1::rapidity
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition: Jet_v1.cxx:67
xAOD::Jet_v1::setAttribute
void setAttribute(const std::string &name, const T &v)
xAOD::Jet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: Jet_v1.cxx:49
xAOD::Jet_v1::constituentLinks
const std::vector< ElementLink< IParticleContainer > > & constituentLinks() const
Direct access to constituents. WARNING expert use only.
Definition: Jet_v1.cxx:162
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
DATAVECTOR_BASE_FIN
DATAVECTOR_BASE_FIN(xAOD::Jet_v1, xAOD::IParticle)
xAOD::Jet_v1::px
float px() const
The x-component of the jet's momentum.
Definition: Jet_v1.cxx:90
xAOD::JetConstitScale
JetConstitScale
Definition: JetTypes.h:20
xAOD::Jet_v1::getAssociatedObjects
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...
xAOD::Jet_v1::rawConstituent
const IParticle * rawConstituent(size_t i) const
Direct access to constituents. WARNING expert use only.
Definition: Jet_v1.cxx:158
xAOD::Jet_v1::setAssociatedObjects
void setAssociatedObjects(const std::string &name, const std::vector< const T * > &vec)
set associated objects from a vector of arbitrary object.
xAOD::Jet_v1::setInputType
void setInputType(JetInput::Type t)
Definition: Jet_v1.cxx:259
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::Jet_v1::getAttribute
T getAttribute(AttributeID type) const
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::Jet_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Jet_v1.cxx:71
xAOD::Jet_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: Jet_v1.cxx:59
a
TList * a
Definition: liststreamerinfos.cxx:10
xAOD::Jet_v1::e
virtual double e() const
The total energy of the particle.
Definition: Jet_v1.cxx:63
FastJetLinkBase
xAOD::Jet_v1::getAssociatedObject
const T * getAssociatedObject(AssoParticlesID type) const
xAOD::Jet_v1::getAttribute
bool getAttribute(const std::string &name, T &value) const
Retrieve attribute by string.
xAOD::Jet_v1::genvecP4
JetFourMom_t genvecP4() const
The full 4-momentum of the particle : internal jet type (same).
Definition: Jet_v1.cxx:81
xAOD::JetConstituentVector
A vector of jet constituents at the scale used during jet finding.
Definition: JetConstituentVector.h:117
JetTypes.h
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition: ObjectType.h:32
xAOD::Jet_v1::GenVecFourMom_t
JetFourMom_t GenVecFourMom_t
define enum ot follow naming conventions
Definition: Jet_v1.h:110
xAOD::Jet_v1::numConstituents
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
xAOD::Jet_v1::setPseudoJet
void setPseudoJet(const PSEUDOJET *fj)
Set the fast jet pointer.
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
xAOD::Jet_v1::setAlgorithmType
void setAlgorithmType(JetAlgorithmType::ID a)
Definition: Jet_v1.cxx:258