ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHoughHit Class Reference

#include <MuonHoughHit.h>

Collaboration diagram for MuonHoughHit:

Public Member Functions

 MuonHoughHit (const Trk::PrepRawData *prd)
 default constructor (should not be used)
 MuonHoughHit (const Amg::Vector3D &pos_vec, bool measures_phi, MuonHough::DetectorTechnology detector_id, double prob=1, double weight=1., const Trk::PrepRawData *prd=nullptr, int id=-1)
 constructor
virtual ~MuonHoughHit ()=default
 destructor
MuonHough::DetectorTechnology getDetectorId () const
 return DetectorTechnology
std::string getWhichDetector () const
 return DetectorTechnology in string
const Amg::Vector3DgetPosition () const
 return (x,y,z) vector
int getId () const
 returns id
double getHitx () const
 returns x position
double getHity () const
 returns y position
double getHitz () const
 returns z position
double getWeight () const
 returns weight in histogram after rescaling
double getOrigWeight () const
 returns original weight
double getProbability () const
 returns probability that hit is part of pattern (true muon)
double getRadius () const
 returns radius
double getAbs () const
 returns radius
double getTheta () const
 returns theta
double getPhi () const
 returns phi
bool isBarrel () const
 hit is barrel or endcap (for curved track model)
int phiSector () const
 phi sector of hit
double getMagneticTrackRatio () const
 ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)
bool getMeasuresPhi () const
 hit measures phi?
bool getAssociated () const
 return if hit already associated to pattern
void setId (int id)
 set id
void setWeight (double weight)
 set weight
void setProbability (double prob)
 set probability
void setAssociated (bool associated)
 set associated
const Trk::PrepRawDatagetPrd () const
 return preprawdata

Protected Attributes

const Trk::PrepRawDatam_prd {nullptr}
 Pointer to preprawdata.
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
int m_id {0}
 unique id
double m_radius {0.}
 radius of hit
double m_abs {0.}
 absolute value of hit
double m_phi {0.}
 phi of hit
double m_theta {0.}
 theta of hit
bool m_barrel {true}
 hit is barrel / endcap
int m_phi_sector {0}
 phi sector (0,15), Atlas Convention
double m_magnetic_trackratio {0.}
 ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)
double m_weight {1.}
 weight of hit in histogram, after rescaling
const double m_orig_weight {1.}
 original weight
double m_probability {1.}
 probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (used for mdts))
MuonHough::DetectorTechnology m_detector_id {MuonHough::MDT}
 detector technology of hit
bool m_measures_phi {false}
 hit measures phi?
bool m_associated {false}
 hit associated to pattern

Private Member Functions

int calcPhiSector () const
 method that calculates phi sector of hit
double calcMagneticTrackRatio () const
 method that calculates 'magnetic track ratio' (for curved track model)

Detailed Description

Definition at line 28 of file MuonHoughHit.h.

Constructor & Destructor Documentation

◆ MuonHoughHit() [1/2]

MuonHoughHit::MuonHoughHit ( const Trk::PrepRawData * prd)

default constructor (should not be used)

constructor per preprawdata (not used)

Definition at line 14 of file MuonHoughHit.cxx.

14 {
15 const Trk::TrkDetElementBase* element = prd->detectorElement();
16 const Identifier identifier = prd->identify();
17
18 m_pos = element->surface(identifier).Trk::Surface::localToGlobal(prd->localPosition());
19
20 m_radius = m_pos.perp();
21 m_abs = m_pos.mag();
22 m_theta = std::atan2(m_radius, getHitz());
23 m_phi = m_pos.phi();
24 m_barrel = (std::abs(m_radius / getHitz()) < MuonHough::tan_barrel) ? 0 : 1;
25
28 m_prd = prd;
29}
Amg::Vector3D m_pos
double m_abs
absolute value of hit
double m_radius
radius of hit
const Trk::PrepRawData * m_prd
Pointer to preprawdata.
int calcPhiSector() const
method that calculates phi sector of hit
double getHitz() const
returns z position
double m_phi
phi of hit
double m_magnetic_trackratio
ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic f...
int m_phi_sector
phi sector (0,15), Atlas Convention
bool m_barrel
hit is barrel / endcap
double m_theta
theta of hit
double calcMagneticTrackRatio() const
method that calculates 'magnetic track ratio' (for curved track model)
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
virtual const Surface & surface() const =0
Return surface associated with this detector element.
constexpr double tan_barrel
relation for transition between endcap and barrel 11.43 m (r) / 14m (z)

◆ MuonHoughHit() [2/2]

MuonHoughHit::MuonHoughHit ( const Amg::Vector3D & pos_vec,
bool measures_phi,
MuonHough::DetectorTechnology detector_id,
double prob = 1,
double weight = 1.,
const Trk::PrepRawData * prd = nullptr,
int id = -1 )

constructor

Definition at line 31 of file MuonHoughHit.cxx.

32 :
33 m_prd(prd),
34 m_pos(pos_vec),
35 m_id(id),
36 m_radius(m_pos.perp()),
37 m_abs(m_pos.mag()),
38 m_phi(m_pos.phi()),
39 m_theta(std::atan2(m_radius, getHitz())),
40 m_barrel ((std::abs(m_radius / getHitz()) < MuonHough::tan_barrel) ? 0 : 1),
43 m_weight(weight),
44 m_orig_weight(weight),
45 m_probability(prob),
46 m_detector_id(detector_id),
47 m_measures_phi(measures_phi)
48{
49}
const double m_orig_weight
original weight
MuonHough::DetectorTechnology m_detector_id
detector technology of hit
int m_id
unique id
double m_probability
probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (u...
double m_weight
weight of hit in histogram, after rescaling
bool m_measures_phi
hit measures phi?

◆ ~MuonHoughHit()

virtual MuonHoughHit::~MuonHoughHit ( )
virtualdefault

destructor

Member Function Documentation

◆ calcMagneticTrackRatio()

double MuonHoughHit::calcMagneticTrackRatio ( ) const
private

method that calculates 'magnetic track ratio' (for curved track model)

Definition at line 75 of file MuonHoughHit.cxx.

75 {
76 // for formulas see muonhoughmathutils, only here for cpu improvements
77 double magnetic_trk_ratio = 0.;
78
79 if (m_barrel) {
80 // Barrel hypothesis
81
83 double diff_b = m_radius - MuonHough::radius_cylinder;
84 magnetic_trk_ratio = diff_b * diff_b / m_abs;
85 }
86 } else {
87 int sign = 1;
88 if (getHitz() < 0) sign = -1;
89 // Endcap hypothesis
90 if (std::abs(getHitz()) < MuonHough::z_cylinder) {
91 magnetic_trk_ratio = 0.;
92 } else if (std::abs(getHitz()) < MuonHough::z_end) {
93 // Inside Toroid
94 double diff_e = getHitz() - sign * MuonHough::z_cylinder;
95 magnetic_trk_ratio = diff_e * diff_e / m_abs;
96
97 } else {
98 // Outside Toroid
100 }
101 }
102
103 return magnetic_trk_ratio;
104}
int sign(int a)
constexpr double radius_cylinder
radius of cylinder
constexpr double z_cylinder
length of cylinder
constexpr double z_magnetic_range_squared
range where hit is curved in endcap region ('squared')
constexpr double z_end
z value whereafter no magnetic field / curvature
constexpr double z_magnetic_range
range where hit is curved in endcap region

◆ calcPhiSector()

int MuonHoughHit::calcPhiSector ( ) const
private

method that calculates phi sector of hit

Definition at line 65 of file MuonHoughHit.cxx.

65 {
66 double phi = m_phi; // [-Pi , Pi]
68
69 if (phi < 0) phi += MuonHough::two_Pi; // [ 0 , 2*Pi ]
70 int sectorhit = static_cast<int>(phi / (2 * MuonHough::half_phisector)); // 0..15
71 if (sectorhit == MuonHough::phisectors) sectorhit += -1; // could happen in rare cases
72 return sectorhit;
73}
Scalar phi() const
phi method
constexpr int phisectors
number of phi sectors
constexpr double two_Pi
constexpr double half_phisector
angle of half a sector in rad

◆ getAbs()

double MuonHoughHit::getAbs ( ) const
inline

returns radius

Definition at line 167 of file MuonHoughHit.h.

167{ return m_abs; }

◆ getAssociated()

bool MuonHoughHit::getAssociated ( ) const
inline

return if hit already associated to pattern

Definition at line 176 of file MuonHoughHit.h.

176{ return m_associated; }
bool m_associated
hit associated to pattern

◆ getDetectorId()

MuonHough::DetectorTechnology MuonHoughHit::getDetectorId ( ) const
inline

return DetectorTechnology

Definition at line 154 of file MuonHoughHit.h.

154{ return m_detector_id; }

◆ getHitx()

double MuonHoughHit::getHitx ( ) const
inline

returns x position

Definition at line 159 of file MuonHoughHit.h.

159{ return m_pos[Amg::x]; }

◆ getHity()

double MuonHoughHit::getHity ( ) const
inline

returns y position

Definition at line 160 of file MuonHoughHit.h.

160{ return m_pos[Amg::y]; }

◆ getHitz()

double MuonHoughHit::getHitz ( ) const
inline

returns z position

Definition at line 161 of file MuonHoughHit.h.

161{ return m_pos[Amg::z]; }

◆ getId()

int MuonHoughHit::getId ( ) const
inline

returns id

Definition at line 156 of file MuonHoughHit.h.

156{ return m_id; }

◆ getMagneticTrackRatio()

double MuonHoughHit::getMagneticTrackRatio ( ) const
inline

ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)

Definition at line 173 of file MuonHoughHit.h.

173{ return m_magnetic_trackratio; }

◆ getMeasuresPhi()

bool MuonHoughHit::getMeasuresPhi ( ) const
inline

hit measures phi?

Definition at line 175 of file MuonHoughHit.h.

175{ return m_measures_phi; }

◆ getOrigWeight()

double MuonHoughHit::getOrigWeight ( ) const
inline

returns original weight

Definition at line 163 of file MuonHoughHit.h.

163{ return m_orig_weight; }

◆ getPhi()

double MuonHoughHit::getPhi ( ) const
inline

returns phi

Definition at line 169 of file MuonHoughHit.h.

169{ return m_phi; }

◆ getPosition()

const Amg::Vector3D & MuonHoughHit::getPosition ( ) const
inline

return (x,y,z) vector

Definition at line 157 of file MuonHoughHit.h.

157{ return m_pos; }

◆ getPrd()

const Trk::PrepRawData * MuonHoughHit::getPrd ( ) const
inline

return preprawdata

Definition at line 183 of file MuonHoughHit.h.

183{ return m_prd; }

◆ getProbability()

double MuonHoughHit::getProbability ( ) const
inline

returns probability that hit is part of pattern (true muon)

Definition at line 164 of file MuonHoughHit.h.

164{ return m_probability; }

◆ getRadius()

double MuonHoughHit::getRadius ( ) const
inline

returns radius

Definition at line 166 of file MuonHoughHit.h.

166{ return m_radius; }

◆ getTheta()

double MuonHoughHit::getTheta ( ) const
inline

returns theta

Definition at line 168 of file MuonHoughHit.h.

168{ return m_theta; }

◆ getWeight()

double MuonHoughHit::getWeight ( ) const
inline

returns weight in histogram after rescaling

Definition at line 162 of file MuonHoughHit.h.

162{ return m_weight; }

◆ getWhichDetector()

std::string MuonHoughHit::getWhichDetector ( ) const

return DetectorTechnology in string

Definition at line 51 of file MuonHoughHit.cxx.

51 {
52 std::string detector_name;
53 switch (m_detector_id) {
54 case MuonHough::MDT: detector_name = "MDT"; break;
55 case MuonHough::CSC: detector_name = "CSC"; break;
56 case MuonHough::RPC: detector_name = "RPC"; break;
57 case MuonHough::TGC: detector_name = "TGC"; break;
58 default:
59 MsgStream log(Athena::getMessageSvc(), "MuonHoughHit::getWhichDetector");
60 if (log.level() <= MSG::WARNING) log << MSG::WARNING << "MuonHoughHit:: no valid detector_id" << endmsg;
61 }
62 return detector_name;
63}
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)

◆ isBarrel()

bool MuonHoughHit::isBarrel ( ) const
inline

hit is barrel or endcap (for curved track model)

Definition at line 171 of file MuonHoughHit.h.

171{ return m_barrel; }

◆ phiSector()

int MuonHoughHit::phiSector ( ) const
inline

phi sector of hit

Definition at line 172 of file MuonHoughHit.h.

172{ return m_phi_sector; }

◆ setAssociated()

void MuonHoughHit::setAssociated ( bool associated)
inline

set associated

Definition at line 181 of file MuonHoughHit.h.

181{ m_associated = associated; }

◆ setId()

void MuonHoughHit::setId ( int id)
inline

set id

Definition at line 178 of file MuonHoughHit.h.

◆ setProbability()

void MuonHoughHit::setProbability ( double prob)
inline

set probability

Definition at line 180 of file MuonHoughHit.h.

◆ setWeight()

void MuonHoughHit::setWeight ( double weight)
inline

set weight

Definition at line 179 of file MuonHoughHit.h.

Member Data Documentation

◆ m_abs

double MuonHoughHit::m_abs {0.}
protected

absolute value of hit

Definition at line 111 of file MuonHoughHit.h.

111{0.};

◆ m_associated

bool MuonHoughHit::m_associated {false}
protected

hit associated to pattern

Definition at line 137 of file MuonHoughHit.h.

137{false};

◆ m_barrel

bool MuonHoughHit::m_barrel {true}
protected

hit is barrel / endcap

Definition at line 117 of file MuonHoughHit.h.

117{true};

◆ m_detector_id

MuonHough::DetectorTechnology MuonHoughHit::m_detector_id {MuonHough::MDT}
protected

detector technology of hit

Definition at line 131 of file MuonHoughHit.h.

◆ m_id

int MuonHoughHit::m_id {0}
protected

unique id

Definition at line 106 of file MuonHoughHit.h.

106{0};

◆ m_magnetic_trackratio

double MuonHoughHit::m_magnetic_trackratio {0.}
protected

ratio of the tracklength of the particle to which hit might belong would have traversed in magnetic field (for curved track model)

Definition at line 122 of file MuonHoughHit.h.

122{0.};

◆ m_measures_phi

bool MuonHoughHit::m_measures_phi {false}
protected

hit measures phi?

Definition at line 134 of file MuonHoughHit.h.

134{false};

◆ m_orig_weight

const double MuonHoughHit::m_orig_weight {1.}
protected

original weight

Definition at line 126 of file MuonHoughHit.h.

126{1.};

◆ m_phi

double MuonHoughHit::m_phi {0.}
protected

phi of hit

Definition at line 113 of file MuonHoughHit.h.

113{0.};

◆ m_phi_sector

int MuonHoughHit::m_phi_sector {0}
protected

phi sector (0,15), Atlas Convention

Definition at line 119 of file MuonHoughHit.h.

119{0};

◆ m_pos

Amg::Vector3D MuonHoughHit::m_pos {Amg::Vector3D::Zero()}
protected

Definition at line 104 of file MuonHoughHit.h.

104{Amg::Vector3D::Zero()};

◆ m_prd

const Trk::PrepRawData* MuonHoughHit::m_prd {nullptr}
protected

Pointer to preprawdata.

Definition at line 102 of file MuonHoughHit.h.

102{nullptr};

◆ m_probability

double MuonHoughHit::m_probability {1.}
protected

probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (used for mdts))

Definition at line 128 of file MuonHoughHit.h.

128{1.};

◆ m_radius

double MuonHoughHit::m_radius {0.}
protected

radius of hit

Definition at line 109 of file MuonHoughHit.h.

109{0.};

◆ m_theta

double MuonHoughHit::m_theta {0.}
protected

theta of hit

Definition at line 115 of file MuonHoughHit.h.

115{0.};

◆ m_weight

double MuonHoughHit::m_weight {1.}
protected

weight of hit in histogram, after rescaling

Definition at line 124 of file MuonHoughHit.h.

124{1.};

The documentation for this class was generated from the following files: