ATLAS Offline Software
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 
15 namespace MuonHough {
19  constexpr int phisectors = 16;
21  constexpr double half_phisector = M_PI / phisectors;
22 } // namespace MuonHough
23 
24 namespace Trk {
25  class PrepRawData;
26 }
27 
28 class MuonHoughHit {
29 public:
31  // MuonHoughHit();
33  MuonHoughHit(const Trk::PrepRawData* prd);
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 
100 protected:
102  const Trk::PrepRawData* m_prd{nullptr};
103 
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};
119  int m_phi_sector{0};
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 
139 private:
141  int calcPhiSector() const;
143  double calcMagneticTrackRatio() const;
144 };
145 
146 inline 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 
156 inline int MuonHoughHit::getId() const { return m_id; }
157 inline const Amg::Vector3D& MuonHoughHit::getPosition() const { return m_pos; }
158 
159 inline double MuonHoughHit::getHitx() const { return m_pos[Amg::x]; }
160 inline double MuonHoughHit::getHity() const { return m_pos[Amg::y]; }
161 inline double MuonHoughHit::getHitz() const { return m_pos[Amg::z]; }
162 inline double MuonHoughHit::getWeight() const { return m_weight; }
163 inline double MuonHoughHit::getOrigWeight() const { return m_orig_weight; }
164 inline double MuonHoughHit::getProbability() const { return m_probability; }
165 
166 inline double MuonHoughHit::getRadius() const { return m_radius; }
167 inline double MuonHoughHit::getAbs() const { return m_abs; }
168 inline double MuonHoughHit::getTheta() const { return m_theta; }
169 inline double MuonHoughHit::getPhi() const { return m_phi; }
170 
171 inline bool MuonHoughHit::isBarrel() const { return m_barrel; }
172 inline int MuonHoughHit::phiSector() const { return m_phi_sector; }
174 
175 inline bool MuonHoughHit::getMeasuresPhi() const { return m_measures_phi; }
176 inline bool MuonHoughHit::getAssociated() const { return m_associated; }
177 
178 inline void MuonHoughHit::setId(int id) { m_id = id; }
179 inline void MuonHoughHit::setWeight(double weight) { m_weight = weight; }
181 inline void MuonHoughHit::setAssociated(bool associated) { m_associated = associated; }
182 
183 inline const Trk::PrepRawData* MuonHoughHit::getPrd() const { return m_prd; }
184 
185 #endif // MUONHOUGHPATTERNEVENT_MUONHOUGHHIT_H
MuonHoughHit::getMagneticTrackRatio
double getMagneticTrackRatio() const
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
Definition: MuonHoughHit.h:173
MuonHoughHit::m_pos
Amg::Vector3D m_pos
Definition: MuonHoughHit.h:104
MuonHoughHit::m_prd
const Trk::PrepRawData * m_prd
Pointer to preprawdata.
Definition: MuonHoughHit.h:102
MuonHoughHit::getPosition
const Amg::Vector3D & getPosition() const
return (x,y,z) vector
Definition: MuonHoughHit.h:157
MuonHoughHit::getHitz
double getHitz() const
returns z position
Definition: MuonHoughHit.h:161
MuonHough::CSC
@ CSC
Definition: MuonHoughHit.h:17
MuonHoughHit::getHitx
double getHitx() const
returns x position
Definition: MuonHoughHit.h:159
MuonHoughHit::isBarrel
bool isBarrel() const
hit is barrel or endcap (for curved track model)
Definition: MuonHoughHit.h:171
MuonHoughHit::getPrd
const Trk::PrepRawData * getPrd() const
return preprawdata
Definition: MuonHoughHit.h:183
MuonHoughHit::~MuonHoughHit
virtual ~MuonHoughHit()=default
destructor
Amg::y
@ y
Definition: GeoPrimitives.h:35
MuonHoughHit::calcPhiSector
int calcPhiSector() const
method that calculates phi sector of hit
Definition: MuonHoughHit.cxx:65
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MuonHoughHit
Definition: MuonHoughHit.h:28
MuonHoughHit::m_theta
double m_theta
theta of hit
Definition: MuonHoughHit.h:115
MuonHoughHit::setWeight
void setWeight(double weight)
set weight
Definition: MuonHoughHit.h:179
MuonHoughHit::setId
void setId(int id)
set id
Definition: MuonHoughHit.h:178
MuonHoughHit::getHity
double getHity() const
returns y position
Definition: MuonHoughHit.h:160
covarianceTool.prob
prob
Definition: covarianceTool.py:678
MuonHoughHit::m_phi
double m_phi
phi of hit
Definition: MuonHoughHit.h:113
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
MuonHough::phisectors
constexpr int phisectors
number of phi sectors
Definition: MuonHoughHit.h:19
GeoPrimitives.h
Amg::z
@ z
Definition: GeoPrimitives.h:36
MuonHoughHit::getDetectorId
MuonHough::DetectorTechnology getDetectorId() const
return DetectorTechnology
Definition: MuonHoughHit.h:154
TGC
Definition: TgcBase.h:6
MuonHoughHit::getWhichDetector
std::string getWhichDetector() const
return DetectorTechnology in string
Definition: MuonHoughHit.cxx:51
operator==
bool operator==(const MuonHoughHit &hit1, const MuonHoughHit &hit2)
Definition: MuonHoughHit.h:146
MuonHoughHit::getPhi
double getPhi() const
returns phi
Definition: MuonHoughHit.h:169
Amg::x
@ x
Definition: GeoPrimitives.h:34
MuonHoughHit::m_measures_phi
bool m_measures_phi
hit measures phi?
Definition: MuonHoughHit.h:134
MuonHough
Definition: MuonLayerHoughTool.h:42
MuonHoughHit::m_detector_id
MuonHough::DetectorTechnology m_detector_id
detector technology of hit
Definition: MuonHoughHit.h:131
MuonHoughHit::getRadius
double getRadius() const
returns radius
Definition: MuonHoughHit.h:166
MuonHoughHit::calcMagneticTrackRatio
double calcMagneticTrackRatio() const
method that calculates 'magnetic track ratio' (for curved track model)
Definition: MuonHoughHit.cxx:75
MuonHoughHit::m_radius
double m_radius
radius of hit
Definition: MuonHoughHit.h:109
MuonHoughHit::getAbs
double getAbs() const
returns radius
Definition: MuonHoughHit.h:167
Trk::PrepRawData
Definition: PrepRawData.h:62
MuonHough::RPC
@ RPC
Definition: MuonHoughHit.h:17
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
MuonHoughHit::m_id
int m_id
unique id
Definition: MuonHoughHit.h:106
MuonHough::half_phisector
constexpr double half_phisector
angle of half a sector in rad
Definition: MuonHoughHit.h:21
MuonHoughHit::getProbability
double getProbability() const
returns probability that hit is part of pattern (true muon)
Definition: MuonHoughHit.h:164
MuonHoughHit::getWeight
double getWeight() const
returns weight in histogram after rescaling
Definition: MuonHoughHit.h:162
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonHoughHit::m_weight
double m_weight
weight of hit in histogram, after rescaling
Definition: MuonHoughHit.h:124
MuonHoughHit::MuonHoughHit
MuonHoughHit(const Trk::PrepRawData *prd)
default constructor (should not be used)
Definition: MuonHoughHit.cxx:14
MuonHoughHit::m_orig_weight
const double m_orig_weight
original weight
Definition: MuonHoughHit.h:126
MuonHoughHit::phiSector
int phiSector() const
phi sector of hit
Definition: MuonHoughHit.h:172
MuonHoughHit::m_barrel
bool m_barrel
hit is barrel / endcap
Definition: MuonHoughHit.h:117
MuonHoughHit::m_phi_sector
int m_phi_sector
phi sector (0,15), Atlas Convention
Definition: MuonHoughHit.h:119
MuonHoughHit::setAssociated
void setAssociated(bool associated)
set associated
Definition: MuonHoughHit.h:181
MuonHoughHit::m_probability
double m_probability
probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (u...
Definition: MuonHoughHit.h:128
MuonHoughHit::m_associated
bool m_associated
hit associated to pattern
Definition: MuonHoughHit.h:137
MuonHoughHit::getTheta
double getTheta() const
returns theta
Definition: MuonHoughHit.h:168
MuonHoughHit::getMeasuresPhi
bool getMeasuresPhi() const
hit measures phi?
Definition: MuonHoughHit.h:175
MuonHoughHit::getOrigWeight
double getOrigWeight() const
returns original weight
Definition: MuonHoughHit.h:163
MuonHoughHit::m_magnetic_trackratio
double m_magnetic_trackratio
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
Definition: MuonHoughHit.h:122
MuonHoughHit::m_abs
double m_abs
absolute value of hit
Definition: MuonHoughHit.h:111
MuonHough::DetectorTechnology
DetectorTechnology
enum to identify the muondetectortechnology
Definition: MuonHoughHit.h:17
MuonHoughHit::setProbability
void setProbability(double prob)
set probability
Definition: MuonHoughHit.h:180
MuonHough::MDT
@ MDT
Definition: MuonHoughHit.h:17
MuonHoughHit::getAssociated
bool getAssociated() const
return if hit already associated to pattern
Definition: MuonHoughHit.h:176
MuonHoughHit::getId
int getId() const
returns id
Definition: MuonHoughHit.h:156
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32