|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/MsgStream.h"
19 for (
unsigned int i = 0;
i <
size();
i++) {
20 if (m_hit[
i]->getId() == hit->getId()) {
return true; }
30 double max_patternlength = 0;
32 if (
m_hit.size() >= 2) {
33 double pattern_length1 = 0, pattern_length2 = 0;
38 max_patternlength =
diff.mag();
40 for (
unsigned int i = 2;
i <
m_hit.size();
i++) {
42 pattern_length1 =
diff.mag();
45 pattern_length2 =
diff.mag();
47 if (pattern_length1 <= max_patternlength && pattern_length2 <= max_patternlength) {
49 }
else if (pattern_length1 > max_patternlength && pattern_length1 >= pattern_length2) {
51 max_patternlength = pattern_length1;
52 }
else if (pattern_length2 > max_patternlength && pattern_length2 > pattern_length1) {
54 max_patternlength = pattern_length2;
62 return max_patternlength;
70 for (
unsigned int hitno = 0; hitno <
m_hit.size(); hitno++) {
76 double z =
getHit(hitno)->getHitz() -
98 for (
unsigned int i = 0;
i <
m_hit.size();
i++) {
189 return {scphi.
cs * sctheta.
sn, scphi.
sn * sctheta.
sn, sctheta.
cs};
200 for (
unsigned int i = 0;
i <
size();
i++) {
208 const double av_x = sum_x / (hitsno + 0.);
209 const double av_y = sum_y / (hitsno + 0.);
213 for (
unsigned int i = 0;
i <
size();
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);
221 if (x_offset * hitx + y_offset * hity < 0) {
sign = -1; }
223 if (y_offset < 0) {
sign = -1; }
230 double weight = av_x * av_x + av_y * av_y;
235 if (std::abs(sumx) < 0.000001 || std::abs(sumy) < 0.000001) {
return; }
237 double phi = std::atan2(sumy, sumx);
244 const double r0 = scphi.
apply(av_x, -av_y);
double apply(double a, double b) const
void setERPhi(double erphi)
set r0 of pattern
static double signedDistanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
MuonHoughPattern(int id_number)
MuonHoughPattern does not own its hits (contrary to the default) MuonHoughHitContainer!
Scalar phi() const
phi method
singleton-like access to IMessageSvc via open function and helper
double getER() const
returns radius in precision plane in mm
double m_etheta
theta in rad
Amg::Vector3D getEPos() const
calulates 3d point closest to ip
std::shared_ptr< MuonHoughHit > getHit(int hitno) const
returns Hit at position hitno
Helper to simultaneously calculate sin and cos of the same angle.
void setEPhi(double ephi)
set phi of pattern
bool hitInHoughPattern(const std::shared_ptr< MuonHoughHit > &hit) const
returns if hit is in pattern
std::vector< std::shared_ptr< MuonHoughHit > > m_hit
vector of hits in container
IMessageSvc * getMessageSvc(bool quiet=false)
unsigned int size() const
returns size of hitcontainer
int m_id_number
id number of hough transform used to generate pattern
double getHity(unsigned int hitno) const
returns y position of hit hitno
const double r0
electron radius{cm}
@ hough_curved_at_a_cylinder
void updateParametersRPhi(bool cosmics=false)
update parameters in rphi plane based on weighted fit
double calculateEZ() const
calculate estimated z-position of pattern
void printHoughPattern() const
prints out info about hough pattern
void resetTracksegment()
clear pattern
Eigen::Matrix< double, 3, 1 > Vector3D
void setEAngle(double eangle)
set angle in precision plane in rad
double getEAngle() const
returns angle in precision plane in rad
bool empty() const
returns if hitcontainer is empty
Amg::Vector3D getEDir() const
calculates direction at point closest to ip
Helper to simultaneously calculate sin and cos of the same angle.
void setER(double er)
set radius in precision plane in mm
double patternLength() const
returns distance between first and last hit
double getHitx(unsigned int hitno) const
returns x position of hit hitno
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space