ATLAS Offline Software
TrackJet.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackJet.h
7 // Header file for TrackJet helper class
9 // (c) ATLAS Detector software
11 
12 #ifndef TRK_TRKVALEVENT_TRACKJET_H
13 #define TRK_TRKVALEVENT_TRACKJET_H
14 
15 #include <vector>
16 #include "TrkEventPrimitives/GlobalMomentum.h"
17 #include "TrkParameters/Perigee.h"
18 #include "TrkTrack/Track.h"
19 
20 namespace Trk {
21 
31 class TrackJet
32 {
33 
34  public:
36  TrackJet(): m_tracks(), m_energy(0.), m_momentum(0.0, 0.0, 0.0), m_totalPt2(0.), m_totalMom2(0.), m_pDotJetAxis(0.), m_magP(0.)
37  {
38 
39  };
41  TrackJet(const TrackJet &a){
42  m_tracks = a.m_tracks;
43  m_energy = a.m_energy;
44  m_momentum = a.m_momentum;
45  m_totalPt2 = a.m_totalPt2;
46  m_totalMom2 = a.m_totalMom2;
47  m_pDotJetAxis = a.m_pDotJetAxis;
48  m_magP = a.m_magP;
49  };
51  ~TrackJet(){}; // destructor
52 
53  void setEnergy(double energy){m_energy = energy;}
54 
55  double getEnergy(){return m_energy;}
56 
57  Trk::Track* getTrack(unsigned int i)
58  {
59  return m_tracks.at(i);
60  }
61 
62  std::vector<Trk::Track* > getTracks(){return m_tracks;}
63 
64  int getNumTracks(){return m_tracks.size();}
65 
68  void addTrack(Trk::Track* trk){
69  m_tracks.push_back(trk);
70  m_energy = m_energy + thisEnergy(trk);
71  HepGeom::Vector3D<double> moment = trk->perigeeParameters()->momentum();
72  m_momentum = m_momentum + moment;
73 
74  double longMoment = fabs((trk->perigeeParameters()->momentum()).dot((m_momentum)/(m_momentum.mag())));
75  m_totalPt2 = m_totalPt2 + pow(trk->perigeeParameters()->momentum().mag(), 2) - pow((longMoment), 2);
76  m_pDotJetAxis = m_pDotJetAxis + longMoment;
77  m_magP = m_magP + trk->perigeeParameters()->momentum().mag();
78  m_totalMom2 = m_totalMom2 + pow((trk->perigeeParameters()->momentum().mag()), 2);
79  }
80 
81  HepGeom::Vector3D<double> getMomentum(){return m_momentum;}
82 
83  double getThrust(){return m_pDotJetAxis/m_magP;}
85 
86  private:
87 
88  std::vector<Trk::Track* > m_tracks;
89  double m_energy;
90  HepGeom::Vector3D<double> m_momentum;
91  double m_totalPt2;
92  double m_totalMom2;
93  double m_pDotJetAxis;
94  double m_magP;
95 
96  double thisEnergy(const Trk::Track* i)
97  {
98  HepGeom::Vector3D<double> moment = i->perigeeParameters()->momentum();
99  return sqrt(moment.dot(moment) +139.5*139.5 );
100  }
101 };
102 
103 } // end of namespace
104 
105 #endif // TRK_TRKVALEVENT_TRACKJET_H
Trk::TrackJet::setEnergy
void setEnergy(double energy)
Definition: TrackJet.h:53
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::TrackJet::m_totalPt2
double m_totalPt2
Definition: TrackJet.h:91
Trk::TrackJet::TrackJet
TrackJet()
default constructor
Definition: TrackJet.h:36
Trk::TrackJet::m_magP
double m_magP
Definition: TrackJet.h:94
Trk::TrackJet::getMomentum
HepGeom::Vector3D< double > getMomentum()
Definition: TrackJet.h:81
Trk::TrackJet::thisEnergy
double thisEnergy(const Trk::Track *i)
Definition: TrackJet.h:96
Trk::TrackJet::m_totalMom2
double m_totalMom2
Definition: TrackJet.h:92
Trk::TrackJet::getNumTracks
int getNumTracks()
Definition: TrackJet.h:64
Track.h
Trk::TrackJet::getTracks
std::vector< Trk::Track * > getTracks()
Definition: TrackJet.h:62
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
Trk::TrackJet::m_pDotJetAxis
double m_pDotJetAxis
Definition: TrackJet.h:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::TrackJet::getEnergy
double getEnergy()
Definition: TrackJet.h:55
Trk::TrackJet::getThrust
double getThrust()
Definition: TrackJet.h:83
Trk::TrackJet::m_tracks
std::vector< Trk::Track * > m_tracks
Definition: TrackJet.h:88
Trk::TrackJet::TrackJet
TrackJet(const TrackJet &a)
copy constructor
Definition: TrackJet.h:41
Trk::TrackJet::~TrackJet
~TrackJet()
destructor
Definition: TrackJet.h:51
Trk::TrackJet::getTrack
Trk::Track * getTrack(unsigned int i)
Definition: TrackJet.h:57
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::TrackJet
short class to organise reconstructed Trk::Track objects as a jet.
Definition: TrackJet.h:32
Trk::TrackJet::m_energy
double m_energy
Definition: TrackJet.h:89
Trk::TrackJet::m_momentum
HepGeom::Vector3D< double > m_momentum
Definition: TrackJet.h:90
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Trk::TrackJet::addTrack
void addTrack(Trk::Track *trk)
the main method used during build-up clustering: adds track and re-calculated the jet quantities
Definition: TrackJet.h:68
Trk::TrackJet::getSphericity
double getSphericity()
Definition: TrackJet.h:84