ATLAS Offline Software
FPGATrackSimOfflineTrack.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGFPGATrackSimOBJECTS_FPGATrackSimOFFLINETRACK_H
6 #define TRIGFPGATrackSimOBJECTS_FPGATrackSimOFFLINETRACK_H
7 
9 #include <cmath>
10 #include <TObject.h>
11 
13 public:
15  virtual ~FPGATrackSimOfflineTrack() = default;
16 
17  void setQOverPt(double v) { m_qoverpt = v; }
18  void setEta(double v) { m_eta = v; }
19  void setPhi(double v) { m_phi = v; }
20  void setD0(double v) { m_d0 = v; }
21  void setZ0(double v) { m_z0 = v; }
22  void setBarcode(unsigned long v) { m_barcode = v; }
23  void setBarcodeFrac(float v) { m_barcode_frac = v; }
24 
25  double getPt() const { return m_qoverpt != 0 ? std::abs(sin(2 * std::atan(std::exp(-m_eta))) / m_qoverpt) : 99999999.; }
26  double getEta() const { return m_eta; }
27  double getPhi() const { return m_phi; }
28  double getD0() const { return m_d0; }
29  double getZ0() const { return m_z0; }
30  double getQOverPt() const { return m_qoverpt / sin(2 * std::atan(std::exp(-m_eta))); }
31  unsigned long getBarcode() const { return m_barcode; }
32  double getBarcodeFrac() const { return m_barcode_frac; }
33 
34  // handling hits
35  const std::vector<FPGATrackSimOfflineHit>& getOfflineHits() const { return m_hits; }
36  int nHits() const { return m_hits.size(); }
37  void addHit(const FPGATrackSimOfflineHit& s) { m_hits.push_back(s); }
38 
39 
40 private:
41  // This is actually qoverp instead of qoverpt. (qoverpt = qoverp / sin(theta)),
42  // where theta = 2 * atan(exp(-eta)). We can fix this in the next round.
43  // The current workaround is to change the get functions.
44  double m_qoverpt;
45  double m_eta;
46  double m_phi;
47  double m_d0;
48  double m_z0;
49 
50  unsigned long m_barcode; // matched geant particle barcode
51  double m_barcode_frac; // largest "matching fraction" with any "good"
52  // geant particle, corresponding to the
53  // particle with m_barcode
54 
55  std::vector<FPGATrackSimOfflineHit> m_hits;
56 
57 
58  ClassDefNV(FPGATrackSimOfflineTrack, 5)
59 };
60 
61 std::ostream& operator<<(std::ostream&, const FPGATrackSimOfflineTrack&);
62 #endif // TRIGFPGATrackSimOBJECTS_FPGATrackSimOFFLINETRACK_H
FPGATrackSimOfflineTrack::addHit
void addHit(const FPGATrackSimOfflineHit &s)
Definition: FPGATrackSimOfflineTrack.h:37
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
FPGATrackSimOfflineTrack::getPt
double getPt() const
Definition: FPGATrackSimOfflineTrack.h:25
FPGATrackSimOfflineTrack::getZ0
double getZ0() const
Definition: FPGATrackSimOfflineTrack.h:29
FPGATrackSimOfflineTrack::getEta
double getEta() const
Definition: FPGATrackSimOfflineTrack.h:26
FPGATrackSimOfflineTrack::getPhi
double getPhi() const
Definition: FPGATrackSimOfflineTrack.h:27
FPGATrackSimOfflineTrack::setZ0
void setZ0(double v)
Definition: FPGATrackSimOfflineTrack.h:21
FPGATrackSimOfflineTrack::m_d0
double m_d0
Definition: FPGATrackSimOfflineTrack.h:47
FPGATrackSimOfflineTrack::FPGATrackSimOfflineTrack
FPGATrackSimOfflineTrack()
Definition: FPGATrackSimOfflineTrack.cxx:9
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
FPGATrackSimOfflineTrack::m_phi
double m_phi
Definition: FPGATrackSimOfflineTrack.h:46
FPGATrackSimOfflineTrack::m_z0
double m_z0
Definition: FPGATrackSimOfflineTrack.h:48
FPGATrackSimOfflineTrack::getBarcode
unsigned long getBarcode() const
Definition: FPGATrackSimOfflineTrack.h:31
FPGATrackSimOfflineTrack::getQOverPt
double getQOverPt() const
Definition: FPGATrackSimOfflineTrack.h:30
FPGATrackSimOfflineHit.h
FPGATrackSimOfflineTrack::nHits
int nHits() const
Definition: FPGATrackSimOfflineTrack.h:36
FPGATrackSimOfflineTrack
Definition: FPGATrackSimOfflineTrack.h:12
FPGATrackSimOfflineTrack::setD0
void setD0(double v)
Definition: FPGATrackSimOfflineTrack.h:20
FPGATrackSimOfflineTrack::m_eta
double m_eta
Definition: FPGATrackSimOfflineTrack.h:45
FPGATrackSimOfflineTrack::setEta
void setEta(double v)
Definition: FPGATrackSimOfflineTrack.h:18
FPGATrackSimOfflineTrack::setBarcode
void setBarcode(unsigned long v)
Definition: FPGATrackSimOfflineTrack.h:22
FPGATrackSimOfflineTrack::m_hits
std::vector< FPGATrackSimOfflineHit > m_hits
Definition: FPGATrackSimOfflineTrack.h:55
FPGATrackSimOfflineTrack::m_qoverpt
double m_qoverpt
Definition: FPGATrackSimOfflineTrack.h:44
python.PyAthena.v
v
Definition: PyAthena.py:154
FPGATrackSimOfflineTrack::m_barcode_frac
double m_barcode_frac
Definition: FPGATrackSimOfflineTrack.h:51
FPGATrackSimOfflineTrack::getOfflineHits
const std::vector< FPGATrackSimOfflineHit > & getOfflineHits() const
Definition: FPGATrackSimOfflineTrack.h:35
FPGATrackSimOfflineTrack::getD0
double getD0() const
Definition: FPGATrackSimOfflineTrack.h:28
FPGATrackSimOfflineTrack::setQOverPt
void setQOverPt(double v)
Definition: FPGATrackSimOfflineTrack.h:17
FPGATrackSimOfflineTrack::setBarcodeFrac
void setBarcodeFrac(float v)
Definition: FPGATrackSimOfflineTrack.h:23
FPGATrackSimOfflineTrack::getBarcodeFrac
double getBarcodeFrac() const
Definition: FPGATrackSimOfflineTrack.h:32
FPGATrackSimOfflineTrack::~FPGATrackSimOfflineTrack
virtual ~FPGATrackSimOfflineTrack()=default
FPGATrackSimOfflineHit
Definition: FPGATrackSimOfflineHit.h:12
operator<<
std::ostream & operator<<(std::ostream &, const FPGATrackSimOfflineTrack &)
Definition: FPGATrackSimOfflineTrack.cxx:14
FPGATrackSimOfflineTrack::m_barcode
unsigned long m_barcode
Definition: FPGATrackSimOfflineTrack.h:50
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
FPGATrackSimOfflineTrack::setPhi
void setPhi(double v)
Definition: FPGATrackSimOfflineTrack.h:19