ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHoughHit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
6#define MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
7
9
10#include <cmath>
11#include <iostream>
12#include <string>
13#include <vector>
14
15namespace MuonHough {
19 constexpr int phisectors = 16;
21 constexpr double half_phisector = M_PI / phisectors;
22} // namespace MuonHough
23
24namespace Trk {
25 class PrepRawData;
26}
27
29public:
31 // MuonHoughHit();
35 MuonHoughHit(const Amg::Vector3D& pos_vec, bool measures_phi, MuonHough::DetectorTechnology detector_id, double prob = 1,
36 double weight = 1., const Trk::PrepRawData* prd = nullptr, int id = -1);
38 virtual ~MuonHoughHit() = default;
39
43 std::string getWhichDetector() const;
44
46 const Amg::Vector3D& getPosition() const;
48 int getId() const;
50 double getHitx() const;
52 double getHity() const;
54 double getHitz() const;
56 double getWeight() const;
58 double getOrigWeight() const;
60 double getProbability() const;
61
63 double getRadius() const;
65 double getAbs() const;
67 double getTheta() const;
69 double getPhi() const;
70
72 bool isBarrel() const;
74 int phiSector() const;
77 double getMagneticTrackRatio() const;
78
80 bool getMeasuresPhi() const;
81
83 bool getAssociated() const;
84
86 void setId(int id);
87
89 void setWeight(double weight);
90
92 void setProbability(double prob);
93
95 void setAssociated(bool associated);
96
98 const Trk::PrepRawData* getPrd() const;
99
100protected:
102 const Trk::PrepRawData* m_prd{nullptr};
103
104 Amg::Vector3D m_pos{Amg::Vector3D::Zero()};
106 int m_id{0};
107
109 double m_radius{0.};
111 double m_abs{0.};
113 double m_phi{0.};
115 double m_theta{0.};
117 bool m_barrel{true};
124 double m_weight{1.};
126 const double m_orig_weight{1.};
128 double m_probability{1.};
129
132
134 bool m_measures_phi{false};
135
137 bool m_associated{false};
138
139private:
141 int calcPhiSector() const;
143 double calcMagneticTrackRatio() const;
144};
145
146inline bool operator==(const MuonHoughHit& hit1, const MuonHoughHit& hit2) {
147 bool equal_to = 0;
148
149 if (hit1.getHitx() == hit2.getHitx() && hit1.getHity() == hit2.getHity() && hit1.getHitz() == hit2.getHitz()) { equal_to = 1; }
150
151 return equal_to;
152}
153
155
156inline int MuonHoughHit::getId() const { return m_id; }
157inline const Amg::Vector3D& MuonHoughHit::getPosition() const { return m_pos; }
158
159inline double MuonHoughHit::getHitx() const { return m_pos[Amg::x]; }
160inline double MuonHoughHit::getHity() const { return m_pos[Amg::y]; }
161inline double MuonHoughHit::getHitz() const { return m_pos[Amg::z]; }
162inline double MuonHoughHit::getWeight() const { return m_weight; }
163inline double MuonHoughHit::getOrigWeight() const { return m_orig_weight; }
164inline double MuonHoughHit::getProbability() const { return m_probability; }
165
166inline double MuonHoughHit::getRadius() const { return m_radius; }
167inline double MuonHoughHit::getAbs() const { return m_abs; }
168inline double MuonHoughHit::getTheta() const { return m_theta; }
169inline double MuonHoughHit::getPhi() const { return m_phi; }
170
171inline bool MuonHoughHit::isBarrel() const { return m_barrel; }
172inline int MuonHoughHit::phiSector() const { return m_phi_sector; }
174
175inline bool MuonHoughHit::getMeasuresPhi() const { return m_measures_phi; }
176inline bool MuonHoughHit::getAssociated() const { return m_associated; }
177
178inline void MuonHoughHit::setId(int id) { m_id = id; }
179inline void MuonHoughHit::setWeight(double weight) { m_weight = weight; }
180inline void MuonHoughHit::setProbability(double prob) { m_probability = prob; }
181inline void MuonHoughHit::setAssociated(bool associated) { m_associated = associated; }
182
183inline const Trk::PrepRawData* MuonHoughHit::getPrd() const { return m_prd; }
184
185#endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
#define M_PI
bool operator==(const MuonHoughHit &hit1, const MuonHoughHit &hit2)
void setProbability(double prob)
set probability
double getHity() const
returns y position
double getOrigWeight() const
returns original weight
bool isBarrel() const
hit is barrel or endcap (for curved track model)
double getWeight() const
returns weight in histogram after rescaling
Amg::Vector3D m_pos
double m_abs
absolute value of hit
void setAssociated(bool associated)
set associated
MuonHough::DetectorTechnology getDetectorId() const
return DetectorTechnology
double m_radius
radius of hit
const Trk::PrepRawData * m_prd
Pointer to preprawdata.
int calcPhiSector() const
method that calculates phi sector of hit
bool m_associated
hit associated to pattern
MuonHoughHit(const Trk::PrepRawData *prd)
default constructor (should not be used)
bool getAssociated() const
return if hit already associated to pattern
const Trk::PrepRawData * getPrd() const
return preprawdata
const double m_orig_weight
original weight
const Amg::Vector3D & getPosition() const
return (x,y,z) vector
MuonHough::DetectorTechnology m_detector_id
detector technology of hit
int m_id
unique id
double getRadius() const
returns radius
double getMagneticTrackRatio() const
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
double getTheta() const
returns theta
double getHitz() const
returns z position
double m_phi
phi of hit
std::string getWhichDetector() const
return DetectorTechnology in string
double m_probability
probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (u...
double m_magnetic_trackratio
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
void setWeight(double weight)
set weight
double getProbability() const
returns probability that hit is part of pattern (true muon)
int m_phi_sector
phi sector (0,15), Atlas Convention
bool m_barrel
hit is barrel / endcap
double m_theta
theta of hit
double getPhi() const
returns phi
bool getMeasuresPhi() const
hit measures phi?
virtual ~MuonHoughHit()=default
destructor
double m_weight
weight of hit in histogram, after rescaling
int phiSector() const
phi sector of hit
void setId(int id)
set id
bool m_measures_phi
hit measures phi?
int getId() const
returns id
double calcMagneticTrackRatio() const
method that calculates 'magnetic track ratio' (for curved track model)
double getHitx() const
returns x position
double getAbs() const
returns radius
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr int phisectors
number of phi sectors
constexpr double half_phisector
angle of half a sector in rad
DetectorTechnology
enum to identify the muondetectortechnology
Definition TgcBase.h:6
Ensure that the ATLAS eigen extensions are properly loaded.