ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
MuonHoughHit Class Reference

#include <MuonHoughHit.h>

Collaboration diagram for MuonHoughHit:

Public Member Functions

 MuonHoughHit (const Trk::PrepRawData *prd)
 default constructor (should not be used) More...
 
 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 More...
 
virtual ~MuonHoughHit ()=default
 destructor More...
 
MuonHough::DetectorTechnology getDetectorId () const
 return DetectorTechnology More...
 
std::string getWhichDetector () const
 return DetectorTechnology in string More...
 
const Amg::Vector3DgetPosition () const
 return (x,y,z) vector More...
 
int getId () const
 returns id More...
 
double getHitx () const
 returns x position More...
 
double getHity () const
 returns y position More...
 
double getHitz () const
 returns z position More...
 
double getWeight () const
 returns weight in histogram after rescaling More...
 
double getOrigWeight () const
 returns original weight More...
 
double getProbability () const
 returns probability that hit is part of pattern (true muon) More...
 
double getRadius () const
 returns radius More...
 
double getAbs () const
 returns radius More...
 
double getTheta () const
 returns theta More...
 
double getPhi () const
 returns phi More...
 
bool isBarrel () const
 hit is barrel or endcap (for curved track model) More...
 
int phiSector () const
 phi sector of hit More...
 
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) More...
 
bool getMeasuresPhi () const
 hit measures phi? More...
 
bool getAssociated () const
 return if hit already associated to pattern More...
 
void setId (int id)
 set id More...
 
void setWeight (double weight)
 set weight More...
 
void setProbability (double prob)
 set probability More...
 
void setAssociated (bool associated)
 set associated More...
 
const Trk::PrepRawDatagetPrd () const
 return preprawdata More...
 

Protected Attributes

const Trk::PrepRawDatam_prd {nullptr}
 Pointer to preprawdata. More...
 
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
 
int m_id {0}
 unique id More...
 
double m_radius {0.}
 radius of hit More...
 
double m_abs {0.}
 absolute value of hit More...
 
double m_phi {0.}
 phi of hit More...
 
double m_theta {0.}
 theta of hit More...
 
bool m_barrel {true}
 hit is barrel / endcap More...
 
int m_phi_sector {0}
 phi sector (0,15), Atlas Convention More...
 
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) More...
 
double m_weight {1.}
 weight of hit in histogram, after rescaling More...
 
const double m_orig_weight {1.}
 original weight More...
 
double m_probability {1.}
 probability that hit belongs to true muon (based on trigger confirmation and crude segment finding (used for mdts)) More...
 
MuonHough::DetectorTechnology m_detector_id {MuonHough::MDT}
 detector technology of hit More...
 
bool m_measures_phi {false}
 hit measures phi? More...
 
bool m_associated {false}
 hit associated to pattern More...
 

Private Member Functions

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

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 }

◆ 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),
46  m_detector_id(detector_id),
47  m_measures_phi(measures_phi)
48 {
49 }

◆ ~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 }

◆ 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 }

◆ 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; }

◆ 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 }

◆ 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.

178 { m_id = id; }

◆ setProbability()

void MuonHoughHit::setProbability ( double  prob)
inline

set probability

Definition at line 180 of file MuonHoughHit.h.

180 { m_probability = prob; }

◆ setWeight()

void MuonHoughHit::setWeight ( double  weight)
inline

set weight

Definition at line 179 of file MuonHoughHit.h.

179 { m_weight = weight; }

Member Data Documentation

◆ m_abs

double MuonHoughHit::m_abs {0.}
protected

absolute value of hit

Definition at line 111 of file MuonHoughHit.h.

◆ m_associated

bool MuonHoughHit::m_associated {false}
protected

hit associated to pattern

Definition at line 137 of file MuonHoughHit.h.

◆ m_barrel

bool MuonHoughHit::m_barrel {true}
protected

hit is barrel / endcap

Definition at line 117 of file MuonHoughHit.h.

◆ 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.

◆ 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.

◆ m_measures_phi

bool MuonHoughHit::m_measures_phi {false}
protected

hit measures phi?

Definition at line 134 of file MuonHoughHit.h.

◆ m_orig_weight

const double MuonHoughHit::m_orig_weight {1.}
protected

original weight

Definition at line 126 of file MuonHoughHit.h.

◆ m_phi

double MuonHoughHit::m_phi {0.}
protected

phi of hit

Definition at line 113 of file MuonHoughHit.h.

◆ m_phi_sector

int MuonHoughHit::m_phi_sector {0}
protected

phi sector (0,15), Atlas Convention

Definition at line 119 of file MuonHoughHit.h.

◆ m_pos

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

Definition at line 104 of file MuonHoughHit.h.

◆ m_prd

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

Pointer to preprawdata.

Definition at line 102 of file MuonHoughHit.h.

◆ 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.

◆ m_radius

double MuonHoughHit::m_radius {0.}
protected

radius of hit

Definition at line 109 of file MuonHoughHit.h.

◆ m_theta

double MuonHoughHit::m_theta {0.}
protected

theta of hit

Definition at line 115 of file MuonHoughHit.h.

◆ m_weight

double MuonHoughHit::m_weight {1.}
protected

weight of hit in histogram, after rescaling

Definition at line 124 of file MuonHoughHit.h.


The documentation for this class was generated from the following files:
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
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
MuonHoughHit::getHitz
double getHitz() const
returns z position
Definition: MuonHoughHit.h:161
MuonHough::CSC
@ CSC
Definition: MuonHoughHit.h:17
Amg::y
@ y
Definition: GeoPrimitives.h:35
MuonHoughHit::calcPhiSector
int calcPhiSector() const
method that calculates phi sector of hit
Definition: MuonHoughHit.cxx:65
MuonHough::z_cylinder
constexpr double z_cylinder
length of cylinder
Definition: MuonHoughMathUtils.h:26
MuonHoughHit::m_theta
double m_theta
theta of hit
Definition: MuonHoughHit.h:115
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
covarianceTool.prob
prob
Definition: covarianceTool.py:678
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonHoughHit::m_phi
double m_phi
phi of hit
Definition: MuonHoughHit.h:113
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
MuonHough::phisectors
constexpr int phisectors
number of phi sectors
Definition: MuonHoughHit.h:19
Amg::z
@ z
Definition: GeoPrimitives.h:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Amg::x
@ x
Definition: GeoPrimitives.h:34
MuonHoughHit::m_measures_phi
bool m_measures_phi
hit measures phi?
Definition: MuonHoughHit.h:134
MuonHoughHit::m_detector_id
MuonHough::DetectorTechnology m_detector_id
detector technology of hit
Definition: MuonHoughHit.h:131
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
MuonHough::z_end
constexpr double z_end
z value whereafter no magnetic field / curvature
Definition: MuonHoughMathUtils.h:28
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
MuonHough::RPC
@ RPC
Definition: MuonHoughHit.h:17
MuonHough::two_Pi
constexpr double two_Pi
Definition: MuonHoughMathUtils.h:16
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
MuonHough::TGC
@ TGC
Definition: MuonHoughHit.h:17
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MuonHoughHit::m_id
int m_id
unique id
Definition: MuonHoughHit.h:106
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
MuonHough::half_phisector
constexpr double half_phisector
angle of half a sector in rad
Definition: MuonHoughHit.h:21
MuonHoughHit::m_weight
double m_weight
weight of hit in histogram, after rescaling
Definition: MuonHoughHit.h:124
MuonHoughHit::m_orig_weight
const double m_orig_weight
original weight
Definition: MuonHoughHit.h:126
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::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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonHoughHit::m_associated
bool m_associated
hit associated to pattern
Definition: MuonHoughHit.h:137
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
MuonHough::radius_cylinder
constexpr double radius_cylinder
radius of cylinder
Definition: MuonHoughMathUtils.h:24
MuonHoughHit::m_abs
double m_abs
absolute value of hit
Definition: MuonHoughHit.h:111
MuonHough::tan_barrel
constexpr double tan_barrel
relation for transition between endcap and barrel 11.43 m (r) / 14m (z)
Definition: MuonHoughMathUtils.h:22
MuonHough::z_magnetic_range
constexpr double z_magnetic_range
range where hit is curved in endcap region
Definition: MuonHoughMathUtils.h:30
MuonHough::MDT
@ MDT
Definition: MuonHoughHit.h:17
MuonHough::z_magnetic_range_squared
constexpr double z_magnetic_range_squared
range where hit is curved in endcap region ('squared')
Definition: MuonHoughMathUtils.h:32
Trk::PrepRawData::detectorElement
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...
Identifier
Definition: IdentifierFieldParser.cxx:14