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

#include <MuonHoughPattern.h>

Inheritance diagram for MuonHoughPattern:
Collaboration diagram for MuonHoughPattern:

Public Types

using MuonHoughPatternCollection = DataVector<MuonHoughPattern>

Public Member Functions

 MuonHoughPattern (int id_number)
 MuonHoughPattern does not own its hits (contrary to the default) MuonHoughHitContainer!
virtual ~MuonHoughPattern ()=default
 destructor
void resetTracksegment ()
 clear pattern
bool hitInHoughPattern (const std::shared_ptr< MuonHoughHit > &hit) const
 returns if hit is in pattern
double calculateEZ () const
 calculate estimated z-position of pattern
double patternLength () const
 returns distance between first and last hit
void printHoughPattern () const
 prints out info about hough pattern
int getIdNumber () const
 returns id number of hough transform used to generate pattern
double getEPhi () const
 returns phi of pattern
double getERPhi () const
 returns r0/d0 of pattern
double getETheta () const
 returns theta of pattern
double getERTheta () const
 returns z0 of pattern
double getECurvature () const
 returns curvature of pattern
double getMaximumHistogram () const
 returns maximum of histogram used to generate pattern
void setEPhi (double ephi)
 set phi of pattern
void setERPhi (double erphi)
 set r0 of pattern
void setETheta (double etheta)
 set theta of pattern
void setERTheta (double ertheta)
 set z0 of pattern
void setECurvature (double curvature)
 set curvature of pattern
void setMaximumHistogram (double maximumhistogram)
 set maximum of histogram used to generate pattern
double getEAngle () const
 returns angle in precision plane in rad
double getER () const
 returns radius in precision plane in mm
void setEAngle (double eangle)
 set angle in precision plane in rad
void setER (double er)
 set radius in precision plane in mm
void setWhichSegment (bool which_segment)
 set which segment pattern is in, not in use
Amg::Vector3D getEPos () const
 calulates 3d point closest to ip
Amg::Vector3D getEDir () const
 calculates direction at point closest to ip
void updateParametersRPhi (bool cosmics=false)
 update parameters in rphi plane based on weighted fit
std::shared_ptr< MuonHoughHitgetHit (int hitno) const
 returns Hit at position hitno
const std::vector< std::shared_ptr< MuonHoughHit > > & getHits () const
 returns hit vector
void addHit (const std::shared_ptr< MuonHoughHit > &hit)
 add hit to container
void removeHit (unsigned int hitno)
 remove hit from container
int getHitId (unsigned int hitno) const
 returns hitid of hit hitno
double getHitx (unsigned int hitno) const
 returns x position of hit hitno
double getHity (unsigned int hitno) const
 returns y position of hit hitno
double getHitz (unsigned int hitno) const
 returns z position of hit hitno
double getRadius (unsigned int hitno) const
 returns radius of hit hitno
double getTheta (unsigned int hitno) const
 returns theta of hit hitno
double getPhi (unsigned int hitno) const
 returns phi of hit hitno
double getWeight (unsigned int hitno) const
 returns weight of hit hitno
double getOrigWeight (unsigned int hitno) const
 returns the orignal weight of hit hitno
bool getMeasuresPhi (unsigned int hitno) const
 returns if hit hitno measures phi
const Trk::PrepRawDatagetPrd (unsigned int hitno) const
 returns preprawdata pointer of hit hitno
std::string getWhichDetector (unsigned int hitno) const
 returns detectortechnology in string of hit hitno
MuonHough::DetectorTechnology getDetectorId (unsigned int hitno) const
 returns detectortechnology of hit hitno
unsigned int size () const
 returns size of hitcontainer
bool empty () const
 returns if hitcontainer is empty
void reserve (int size)
 allocates memory for hitvector
int getRPChitno () const
 returns number of rpc hits in container
int getRPCetahitno () const
 returns number of rpc eta hits in container
int getMDThitno () const
 returns number of mdt hits in container
int getCSChitno () const
 returns number of csc hits in container
int getTGChitno () const
 returns number of tgc hits in container

Protected Attributes

std::vector< std::shared_ptr< MuonHoughHit > > m_hit
 vector of hits in container

Private Attributes

int m_id_number {-1}
 id number of hough transform used to generate pattern
bool m_whichsegment {false}
 which segment is pattern created in, not relevant if split search is off 0 lower segment, 1 uppersegment
double m_ephi {-M_PI_2}
 phi in rad
double m_erphi {0.}
 r0 in mm
double m_etheta {M_PI_2}
 theta in rad
double m_ertheta {0.}
 z0 in mm
double m_ecurvature {1.}
 curvature of pattern in rz plane in mm
double m_maximumhistogram {0.}
 maximum of histogram

Detailed Description

Definition at line 17 of file MuonHoughPattern.h.

Member Typedef Documentation

◆ MuonHoughPatternCollection

Constructor & Destructor Documentation

◆ MuonHoughPattern()

MuonHoughPattern::MuonHoughPattern ( int id_number)

MuonHoughPattern does not own its hits (contrary to the default) MuonHoughHitContainer!

constructor

Definition at line 11 of file MuonHoughPattern.cxx.

11: MuonHoughHitContainer(), m_id_number(id_number) {}
MuonHoughHitContainer()=default
MuonHoughHitContainer does own its hits all added hits should be 'newed', except when m_ownhits==fals...
int m_id_number
id number of hough transform used to generate pattern

◆ ~MuonHoughPattern()

virtual MuonHoughPattern::~MuonHoughPattern ( )
virtualdefault

destructor

Member Function Documentation

◆ addHit()

void MuonHoughHitContainer::addHit ( const std::shared_ptr< MuonHoughHit > & hit)
inherited

add hit to container

Definition at line 8 of file MuonHoughHitContainer.cxx.

8 {
9 if (hit->getId() == -1) { hit->setId(size()); }
10 m_hit.push_back(hit);
11}
unsigned int size() const
returns size of hitcontainer
std::vector< std::shared_ptr< MuonHoughHit > > m_hit
vector of hits in container
void setId(int id)
set id
int getId() const
returns id

◆ calculateEZ()

double MuonHoughPattern::calculateEZ ( ) const

calculate estimated z-position of pattern

Definition at line 65 of file MuonHoughPattern.cxx.

65 {
66 double ez = 0;
67 double count = 0;
68 // double r0 = m_erphi;
69
70 for (unsigned int hitno = 0; hitno < m_hit.size(); hitno++) {
71 // for each hit the distance from the hit to x,y line through (0,0) in the xy plane is calcualted and then distance*cos(theta) gives
72 // z_hit - z
73
75
76 double z = getHit(hitno)->getHitz() -
77 (distance * std::cos(m_etheta) / std::sin(m_etheta)); // distance * sin (m_etheta) = L // - sign correct?
78 // hough correction in here?
79
80 // straight line fitter?
81
82 ez += z;
83 count++;
84 }
85
86 ez = ez / count;
87
88 return ez;
89}
#define M_PI
#define z
double getHitx(unsigned int hitno) const
returns x position of hit hitno
double getHity(unsigned int hitno) const
returns y position of hit hitno
std::shared_ptr< MuonHoughHit > getHit(int hitno) const
returns Hit at position hitno
double getHitz() const
returns z position
static double signedDistanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
double m_ephi
phi in rad
double m_etheta
theta in rad
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space

◆ empty()

bool MuonHoughHitContainer::empty ( ) const
inlineinherited

returns if hitcontainer is empty

Definition at line 105 of file MuonHoughHitContainer.h.

105{ return m_hit.empty(); }

◆ getCSChitno()

int MuonHoughHitContainer::getCSChitno ( ) const
inherited

returns number of csc hits in container

Definition at line 37 of file MuonHoughHitContainer.cxx.

37 {
38 int cschitno = 0;
39 for (unsigned int i = 0; i < m_hit.size(); i++) { cschitno += getDetectorId(i) == MuonHough::CSC; }
40 return cschitno;
41}
MuonHough::DetectorTechnology getDetectorId(unsigned int hitno) const
returns detectortechnology of hit hitno

◆ getDetectorId()

MuonHough::DetectorTechnology MuonHoughHitContainer::getDetectorId ( unsigned int hitno) const
inlineinherited

returns detectortechnology of hit hitno

Definition at line 107 of file MuonHoughHitContainer.h.

107{ return m_hit[hitno]->getDetectorId(); }

◆ getEAngle()

double MuonHoughPattern::getEAngle ( ) const

returns angle in precision plane in rad

Definition at line 105 of file MuonHoughPattern.cxx.

105 {
106 double eangle = 0;
107 switch (m_id_number) {
108 case MuonHough::hough_xy: eangle = m_ephi; break;
114 default:
115 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::getEAngle");
116 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
117 }
118 return eangle;
119}
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)
@ hough_curved_at_a_cylinder

◆ getECurvature()

double MuonHoughPattern::getECurvature ( ) const
inline

returns curvature of pattern

Definition at line 120 of file MuonHoughPattern.h.

120{ return m_ecurvature; }
double m_ecurvature
curvature of pattern in rz plane in mm

◆ getEDir()

Amg::Vector3D MuonHoughPattern::getEDir ( ) const

calculates direction at point closest to ip

Definition at line 185 of file MuonHoughPattern.cxx.

185 {
187 CxxUtils::sincos scphi(m_ephi);
188 CxxUtils::sincos sctheta(m_etheta);
189 return {scphi.cs * sctheta.sn, scphi.sn * sctheta.sn, sctheta.cs};
190}

◆ getEPhi()

double MuonHoughPattern::getEPhi ( ) const
inline

returns phi of pattern

Definition at line 116 of file MuonHoughPattern.h.

116{ return m_ephi; }

◆ getEPos()

Amg::Vector3D MuonHoughPattern::getEPos ( ) const

calulates 3d point closest to ip

Definition at line 165 of file MuonHoughPattern.cxx.

165 {
166 // similar to StandardAlgs::shortestPointOfLineToOrigin3D
167
168 // should be maybe really shortest point, but
169
170 // problem is that there is no starting point on the line (well this calc. pos could be available)
171
173
174 pos[0] = m_erphi * std::sin(m_ephi);
175 pos[1] = -m_erphi * std::cos(m_ephi);
176
177 if (m_etheta != 0) {
178 pos[2] = m_ertheta / std::sin(m_etheta);
179 } else {
180 pos[2] = 0;
181 }
182 return pos;
183}
double m_ertheta
z0 in mm
double m_erphi
r0 in mm
Eigen::Matrix< double, 3, 1 > Vector3D

◆ getER()

double MuonHoughPattern::getER ( ) const

returns radius in precision plane in mm

Definition at line 121 of file MuonHoughPattern.cxx.

121 {
122 double er = 0;
123 switch (m_id_number) {
124 case MuonHough::hough_xy: er = m_erphi; break;
130 default:
131 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::getER");
132 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
133 }
134 return er;
135}

◆ getERPhi()

double MuonHoughPattern::getERPhi ( ) const
inline

returns r0/d0 of pattern

Definition at line 117 of file MuonHoughPattern.h.

117{ return m_erphi; }

◆ getERTheta()

double MuonHoughPattern::getERTheta ( ) const
inline

returns z0 of pattern

Definition at line 119 of file MuonHoughPattern.h.

119{ return m_ertheta; }

◆ getETheta()

double MuonHoughPattern::getETheta ( ) const
inline

returns theta of pattern

Definition at line 118 of file MuonHoughPattern.h.

118{ return m_etheta; }

◆ getHit()

std::shared_ptr< MuonHoughHit > MuonHoughHitContainer::getHit ( int hitno) const
inlineinherited

returns Hit at position hitno

Definition at line 91 of file MuonHoughHitContainer.h.

91{ return m_hit.at(hitno); }

◆ getHitId()

int MuonHoughHitContainer::getHitId ( unsigned int hitno) const
inlineinherited

returns hitid of hit hitno

Definition at line 93 of file MuonHoughHitContainer.h.

93{ return m_hit[hitno]->getId(); }

◆ getHits()

const std::vector< std::shared_ptr< MuonHoughHit > > & MuonHoughHitContainer::getHits ( ) const
inlineinherited

returns hit vector

Definition at line 92 of file MuonHoughHitContainer.h.

92{ return m_hit; }

◆ getHitx()

double MuonHoughHitContainer::getHitx ( unsigned int hitno) const
inlineinherited

returns x position of hit hitno

Definition at line 94 of file MuonHoughHitContainer.h.

94{ return m_hit[hitno]->getHitx(); }

◆ getHity()

double MuonHoughHitContainer::getHity ( unsigned int hitno) const
inlineinherited

returns y position of hit hitno

Definition at line 95 of file MuonHoughHitContainer.h.

95{ return m_hit[hitno]->getHity(); }

◆ getHitz()

double MuonHoughHitContainer::getHitz ( unsigned int hitno) const
inlineinherited

returns z position of hit hitno

Definition at line 96 of file MuonHoughHitContainer.h.

96{ return m_hit[hitno]->getHitz(); }

◆ getIdNumber()

int MuonHoughPattern::getIdNumber ( ) const
inline

returns id number of hough transform used to generate pattern

Definition at line 114 of file MuonHoughPattern.h.

114{ return m_id_number; }

◆ getMaximumHistogram()

double MuonHoughPattern::getMaximumHistogram ( ) const
inline

returns maximum of histogram used to generate pattern

Definition at line 121 of file MuonHoughPattern.h.

121{ return m_maximumhistogram; }
double m_maximumhistogram
maximum of histogram

◆ getMDThitno()

int MuonHoughHitContainer::getMDThitno ( ) const
inherited

returns number of mdt hits in container

Definition at line 25 of file MuonHoughHitContainer.cxx.

25 {
26 int mdthitno = 0;
27 for (unsigned int i = 0; i < m_hit.size(); i++) { mdthitno += getDetectorId(i) == MuonHough::MDT; }
28 return mdthitno;
29}

◆ getMeasuresPhi()

bool MuonHoughHitContainer::getMeasuresPhi ( unsigned int hitno) const
inlineinherited

returns if hit hitno measures phi

Definition at line 109 of file MuonHoughHitContainer.h.

109{ return m_hit[hitno]->getMeasuresPhi(); }

◆ getOrigWeight()

double MuonHoughHitContainer::getOrigWeight ( unsigned int hitno) const
inlineinherited

returns the orignal weight of hit hitno

Definition at line 102 of file MuonHoughHitContainer.h.

102{ return m_hit[hitno]->getOrigWeight(); }

◆ getPhi()

double MuonHoughHitContainer::getPhi ( unsigned int hitno) const
inlineinherited

returns phi of hit hitno

Definition at line 100 of file MuonHoughHitContainer.h.

100{ return m_hit[hitno]->getPhi(); }

◆ getPrd()

const Trk::PrepRawData * MuonHoughHitContainer::getPrd ( unsigned int hitno) const
inlineinherited

returns preprawdata pointer of hit hitno

Definition at line 110 of file MuonHoughHitContainer.h.

110{ return m_hit[hitno]->getPrd(); }

◆ getRadius()

double MuonHoughHitContainer::getRadius ( unsigned int hitno) const
inlineinherited

returns radius of hit hitno

Definition at line 97 of file MuonHoughHitContainer.h.

97{ return m_hit[hitno]->getRadius(); }

◆ getRPCetahitno()

int MuonHoughHitContainer::getRPCetahitno ( ) const
inherited

returns number of rpc eta hits in container

Definition at line 31 of file MuonHoughHitContainer.cxx.

31 {
32 int rpchitno = 0;
33 for (unsigned int i = 0; i < m_hit.size(); i++) { rpchitno += getDetectorId(i) == MuonHough::RPC && !getMeasuresPhi(i); }
34 return rpchitno;
35}
bool getMeasuresPhi(unsigned int hitno) const
returns if hit hitno measures phi

◆ getRPChitno()

int MuonHoughHitContainer::getRPChitno ( ) const
inherited

returns number of rpc hits in container

Definition at line 19 of file MuonHoughHitContainer.cxx.

19 {
20 int rpchitno = 0;
21 for (unsigned int i = 0; i < m_hit.size(); i++) { rpchitno += getDetectorId(i) == MuonHough::RPC; }
22 return rpchitno;
23}

◆ getTGChitno()

int MuonHoughHitContainer::getTGChitno ( ) const
inherited

returns number of tgc hits in container

Definition at line 43 of file MuonHoughHitContainer.cxx.

43 {
44 int tgchitno = 0;
45 for (unsigned int i = 0; i < m_hit.size(); i++) { tgchitno += getDetectorId(i) == MuonHough::TGC; }
46 return tgchitno;
47}

◆ getTheta()

double MuonHoughHitContainer::getTheta ( unsigned int hitno) const
inlineinherited

returns theta of hit hitno

Definition at line 99 of file MuonHoughHitContainer.h.

99{ return m_hit[hitno]->getTheta(); }

◆ getWeight()

double MuonHoughHitContainer::getWeight ( unsigned int hitno) const
inlineinherited

returns weight of hit hitno

Definition at line 101 of file MuonHoughHitContainer.h.

101{ return m_hit[hitno]->getWeight(); }

◆ getWhichDetector()

std::string MuonHoughHitContainer::getWhichDetector ( unsigned int hitno) const
inlineinherited

returns detectortechnology in string of hit hitno

Definition at line 108 of file MuonHoughHitContainer.h.

108{ return m_hit[hitno]->getWhichDetector(); }

◆ hitInHoughPattern()

bool MuonHoughPattern::hitInHoughPattern ( const std::shared_ptr< MuonHoughHit > & hit) const

returns if hit is in pattern

Definition at line 17 of file MuonHoughPattern.cxx.

18{
19 for (unsigned int i = 0; i < size(); i++) {
20 if (m_hit[i]->getId() == hit->getId()) { return true; }
21 }
22
23 return false;
24}

◆ patternLength()

double MuonHoughPattern::patternLength ( ) const

returns distance between first and last hit

Definition at line 26 of file MuonHoughPattern.cxx.

26 {
27 // takes the first 2 hits and calculates distance and then takes next hit, and calculates from previous 2 hits which 2 are farthest
28 // away, etc.. also possible to calculate point closest to IP and determine if left/ right to pattern, app. just as fast.
29
30 double max_patternlength = 0;
31
32 if (m_hit.size() >= 2) {
33 double pattern_length1 = 0, pattern_length2 = 0;
34 int hitno1 = 0;
35 int hitno2 = 1;
36
37 Amg::Vector3D diff = m_hit[hitno1]->getPosition() - m_hit[hitno2]->getPosition();
38 max_patternlength = diff.mag();
39
40 for (unsigned int i = 2; i < m_hit.size(); i++) {
41 diff = m_hit[hitno1]->getPosition() - m_hit[i]->getPosition();
42 pattern_length1 = diff.mag();
43
44 diff = m_hit[hitno2]->getPosition() - m_hit[i]->getPosition();
45 pattern_length2 = diff.mag();
46
47 if (pattern_length1 <= max_patternlength && pattern_length2 <= max_patternlength) {
48 // nothing happens..
49 } else if (pattern_length1 > max_patternlength && pattern_length1 >= pattern_length2) {
50 hitno2 = i;
51 max_patternlength = pattern_length1;
52 } else if (pattern_length2 > max_patternlength && pattern_length2 > pattern_length1) {
53 hitno1 = i;
54 max_patternlength = pattern_length2;
55 }
56 }
57 } else {
58 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::patternLength");
59 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::pattern_size <2" << endmsg;
60 }
61
62 return max_patternlength;
63}
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631

◆ printHoughPattern()

void MuonHoughPattern::printHoughPattern ( ) const

prints out info about hough pattern

Definition at line 91 of file MuonHoughPattern.cxx.

91 {
92 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::printHoughPattern");
93 if (m_hit.empty()) {
94 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::No pattern_Segment" << endmsg;
95 }
96
97 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::Size of MuonHoughPattern: " << m_hit.size() << endmsg;
98 for (unsigned int i = 0; i < m_hit.size(); i++) {
99 if (log.level() <= MSG::VERBOSE)
100 log << MSG::VERBOSE << m_hit[i]->getHitx() << " " << m_hit[i]->getHity() << " " << m_hit[i]->getHitz() << " "
101 << m_hit[i]->getId() << endmsg;
102 }
103}

◆ removeHit()

void MuonHoughHitContainer::removeHit ( unsigned int hitno)
inherited

remove hit from container

Definition at line 13 of file MuonHoughHitContainer.cxx.

13 {
14 if (hitno >= m_hit.size()) { throw std::runtime_error("MuonHoughHitContainer::range error!"); }
15
16 m_hit.erase(m_hit.begin() + hitno);
17}

◆ reserve()

void MuonHoughHitContainer::reserve ( int size)
inlineinherited

allocates memory for hitvector

Definition at line 106 of file MuonHoughHitContainer.h.

106{ m_hit.reserve(size); }

◆ resetTracksegment()

void MuonHoughPattern::resetTracksegment ( )

clear pattern

Definition at line 13 of file MuonHoughPattern.cxx.

13 {
14 m_hit.clear();
15}

◆ setEAngle()

void MuonHoughPattern::setEAngle ( double eangle)

set angle in precision plane in rad

Definition at line 137 of file MuonHoughPattern.cxx.

137 {
138 switch (m_id_number) {
139 case MuonHough::hough_xy: m_ephi = eangle; break;
145 default:
146 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::setEAngle");
147 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
148 }
149}

◆ setECurvature()

void MuonHoughPattern::setECurvature ( double curvature)
inline

set curvature of pattern

Definition at line 127 of file MuonHoughPattern.h.

127{ m_ecurvature = ecurvature; }

◆ setEPhi()

void MuonHoughPattern::setEPhi ( double ephi)
inline

set phi of pattern

Definition at line 123 of file MuonHoughPattern.h.

123{ m_ephi = ephi; }

◆ setER()

void MuonHoughPattern::setER ( double er)

set radius in precision plane in mm

Definition at line 151 of file MuonHoughPattern.cxx.

151 {
152 switch (m_id_number) {
153 case MuonHough::hough_xy: m_erphi = er; break;
159 default:
160 MsgStream log(Athena::getMessageSvc(), "MuonHoughPattern::setER");
161 if (log.level() <= MSG::VERBOSE) log << MSG::VERBOSE << "MuonHoughPattern::no valid id_number" << endmsg;
162 }
163}

◆ setERPhi()

void MuonHoughPattern::setERPhi ( double erphi)
inline

set r0 of pattern

Definition at line 124 of file MuonHoughPattern.h.

124{ m_erphi = erphi; }

◆ setERTheta()

void MuonHoughPattern::setERTheta ( double ertheta)
inline

set z0 of pattern

Definition at line 126 of file MuonHoughPattern.h.

126{ m_ertheta = ertheta; }

◆ setETheta()

void MuonHoughPattern::setETheta ( double etheta)
inline

set theta of pattern

Definition at line 125 of file MuonHoughPattern.h.

125{ m_etheta = etheta; }

◆ setMaximumHistogram()

void MuonHoughPattern::setMaximumHistogram ( double maximumhistogram)
inline

set maximum of histogram used to generate pattern

Definition at line 128 of file MuonHoughPattern.h.

128{ m_maximumhistogram = maximumhistogram; }

◆ setWhichSegment()

void MuonHoughPattern::setWhichSegment ( bool which_segment)
inline

set which segment pattern is in, not in use

Definition at line 130 of file MuonHoughPattern.h.

130{ m_whichsegment = which_segment; }
bool m_whichsegment
which segment is pattern created in, not relevant if split search is off 0 lower segment,...

◆ size()

unsigned int MuonHoughHitContainer::size ( ) const
inlineinherited

returns size of hitcontainer

Definition at line 104 of file MuonHoughHitContainer.h.

104{ return m_hit.size(); }

◆ updateParametersRPhi()

void MuonHoughPattern::updateParametersRPhi ( bool cosmics = false)

update parameters in rphi plane based on weighted fit

Definition at line 192 of file MuonHoughPattern.cxx.

192 {
193 if (empty()) return;
194
195 double sum_x = 0.;
196 double sum_y = 0.;
197
198 int hitsno = size();
199
200 for (unsigned int i = 0; i < size(); i++) {
201 sum_x += getHitx(i); //*getOrigWeight(i);
202 sum_y += getHity(i); //*getOrigWeight(i);
203 }
204
205 // adding interaction point constraint:
206 if (!cosmics || size() == 1) hitsno += size();
207
208 const double av_x = sum_x / (hitsno + 0.);
209 const double av_y = sum_y / (hitsno + 0.);
210
211 double sumx = 0.;
212 double sumy = 0.;
213 for (unsigned int i = 0; i < size(); i++) {
214 double hitx = getHitx(i);
215 double hity = getHity(i);
216 double x_offset = hitx - av_x;
217 double y_offset = hity - av_y;
218 double weight = (x_offset * x_offset + y_offset * y_offset); //*getOrigWeight(i);
219 int sign = 1;
220 if (!cosmics) {
221 if (x_offset * hitx + y_offset * hity < 0) { sign = -1; }
222 } else {
223 if (y_offset < 0) { sign = -1; } // assume cosmic muon comes from above
224 }
225 sumx += weight * sign * x_offset;
226 sumy += weight * sign * y_offset;
227 }
228 // adding interaction point (count size)
229 if (!cosmics) {
230 double weight = av_x * av_x + av_y * av_y;
231 sumx += size() * weight * av_x;
232 sumy += size() * weight * av_y;
233 }
234
235 if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) { return; }
236
237 double phi = std::atan2(sumy, sumx);
238 if (cosmics) {
239 if (phi > 0) phi -= M_PI; // phi between 0,-Pi for cosmics!
240 }
241
242 CxxUtils::sincos scphi(phi);
243
244 const double r0 = scphi.apply(av_x, -av_y);
245
246 setEPhi(phi);
247 setERPhi(r0);
248}
Scalar phi() const
phi method
int sign(int a)
bool empty() const
returns if hitcontainer is empty
void setERPhi(double erphi)
set r0 of pattern
void setEPhi(double ephi)
set phi of pattern
const double r0
electron radius{cm}

Member Data Documentation

◆ m_ecurvature

double MuonHoughPattern::m_ecurvature {1.}
private

curvature of pattern in rz plane in mm

Definition at line 109 of file MuonHoughPattern.h.

109{1.};

◆ m_ephi

double MuonHoughPattern::m_ephi {-M_PI_2}
private

phi in rad

Definition at line 101 of file MuonHoughPattern.h.

101{-M_PI_2};

◆ m_erphi

double MuonHoughPattern::m_erphi {0.}
private

r0 in mm

Definition at line 103 of file MuonHoughPattern.h.

103{0.};

◆ m_ertheta

double MuonHoughPattern::m_ertheta {0.}
private

z0 in mm

Definition at line 107 of file MuonHoughPattern.h.

107{0.};

◆ m_etheta

double MuonHoughPattern::m_etheta {M_PI_2}
private

theta in rad

Definition at line 105 of file MuonHoughPattern.h.

105{M_PI_2};

◆ m_hit

std::vector<std::shared_ptr<MuonHoughHit> > MuonHoughHitContainer::m_hit
protectedinherited

vector of hits in container

Definition at line 86 of file MuonHoughHitContainer.h.

◆ m_id_number

int MuonHoughPattern::m_id_number {-1}
private

id number of hough transform used to generate pattern

Definition at line 94 of file MuonHoughPattern.h.

94{-1};

◆ m_maximumhistogram

double MuonHoughPattern::m_maximumhistogram {0.}
private

maximum of histogram

Definition at line 111 of file MuonHoughPattern.h.

111{0.};

◆ m_whichsegment

bool MuonHoughPattern::m_whichsegment {false}
private

which segment is pattern created in, not relevant if split search is off 0 lower segment, 1 uppersegment

Definition at line 98 of file MuonHoughPattern.h.

98{false};

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