|
ATLAS Offline Software
|
Go to the documentation of this file.
10 double threshold_histo,
int number_of_sectors) :
12 threshold_histo, number_of_sectors) {
42 const double invradius = 1. / hit->
getRadius();
43 const double hitx = hit->
getHitx();
44 const double hity = hit->
getHity();
45 const double hitz = hit->
getHitz();
49 const double dotprod = rphi * invradius;
64 int filled_binnumber =
histo->fill(rz0, theta_in_grad,
weight);
67 double half_weight = 0.5 *
weight;
85 return filled_binnumber;
89 std::pair<double, double> coordsmaximum,
90 double maximum_residu_mm,
double ,
91 int maxsector)
const {
95 double eradius{0.}, er0{0.};
97 const double rz0 = coordsmaximum.first;
99 const double phimax =
m_phisec[maxsector];
101 ATH_MSG_VERBOSE(
"hookAssociateHitsToMaximum() -- sector: " << maxsector <<
" phimax: " << phimax
102 <<
" coordsmaximumfirst: " << rz0 <<
" coordsmaximumsecond: " << coordsmaximum.second
103 <<
" coordsmaximumsecondinrad: " <<
theta <<
", size of event: " <<
event.size());
104 for (
unsigned int i = 0;
i <
event.size();
i++) {
105 const double hitx =
event.getHitx(
i);
106 const double hity =
event.getHity(
i);
109 const double hitz =
event.getHitz(
i);
114 ATH_MSG_VERBOSE(
"MuonHoughTransformer_rzcosmics() -- hitx: " << hitx <<
" hity: " << hity <<
" hitz: " << hitz
115 <<
" perp: " <<
perp <<
", residu_distance: " << residu_distance );
117 if (std::abs(residu_distance) < maximum_residu_mm)
120 <<
" already associated "<<
event.getHit(
i)->getAssociated());
122 event.getHit(
i)->setAssociated(
true);
124 double rz0hit = residu_distance + rz0;
133 eradius = eradius / (houghpattern->
size() + 1
e-7);
134 er0 = er0 / (houghpattern->
size() + 1
e-7);
142 if (houghpattern->
empty()) {
146 else if (std::abs(eradius - rz0) > 500.) {
147 ATH_MSG_VERBOSE(
"Eradius or Etheta calc. WRONG -- rz0: " << rz0 <<
" theta: "
148 <<
theta<<
", eradius: " << eradius);
156 <<
" old phi: " << phimax <<
", new r0: " << houghpattern->
getERPhi()
157 <<
" old r0: " << er0 <<
" new theta: " << houghpattern->
getETheta()
158 <<
" old theta: " <<
theta <<
" new z0: " << houghpattern->
getERTheta()
159 <<
" old z0: " << eradius );
172 double dotprod)
const
174 if (!m_add_weight_angle) {
175 return weightHoughTransform(
r0);
177 double dotprod_part = 0.5 + 0.5 * dotprod * dotprod;
178 double sintheta_part = 0.9 + 0.1 * sintheta * sintheta;
179 double sinphi_part = 0.75 + 0.25 * sinphi * sinphi;
180 float r_theta_weight = dotprod_part * sintheta_part * sinphi_part;
182 return r_theta_weight * weightHoughTransform(
r0);
192 const unsigned int size = houghpattern->
size();
194 if (
size <= 1)
return;
200 double sum_radii = 0.;
203 for (
unsigned int i = 0;
i <
size;
i++) {
204 sum_radii += houghpattern->
getHitx(
i) * cosphi + houghpattern->
getHity(
i) * sinphi;
208 const double av_radii = sum_radii / (
size + 0.);
209 const double av_z = sum_z / (
size + 0.);
213 for (
unsigned int i = 0;
i <
size;
i++) {
215 double hitz = houghpattern->
getHitz(
i);
216 double r_offset =
radius - av_radii;
217 double z_offset = hitz - av_z;
218 double weight = r_offset * r_offset + z_offset * z_offset;
220 if (r_offset *
radius + z_offset * hitz < 0) {
sign = -1; }
225 if (std::abs(sumr) < 0.000001 || std::abs(sumz) < 0.000001) {
return; }
227 double theta = std::atan2(sumr, sumz);
void setERPhi(double erphi)
set r0 of pattern
constexpr double degree_rad_conversion_factor
void setETheta(double etheta)
set theta of pattern
MuonHoughHisto2D * getHisto(int id) const
return histogram at place id
static double signedDistanceToLine(double x0, double y0, double r0, double phi)
distance from (x0,y0) to the line (r0,phi), phi in rad
double getHitz(unsigned int hitno) const
returns z position of hit hitno
Scalar phi() const
phi method
double getHitz() const
returns z position
Scalar perp() const
perp method - perpenticular length
double getHitx() const
returns x position
double getEPhi() const
returns phi of pattern
Scalar theta() const
theta method
Helper to simultaneously calculate sin and cos of the same angle.
void setEPhi(double ephi)
set phi of pattern
double getERTheta() const
returns z0 of pattern
#define ATH_MSG_VERBOSE(x)
double getHity() const
returns y position
void addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
void setERTheta(double ertheta)
set z0 of pattern
void setECurvature(double curvature)
set curvature of pattern
POOL::TEvent event(POOL::TEvent::kClassAccess)
unsigned int size() const
returns size of hitcontainer
double getHity(unsigned int hitno) const
returns y position of hit hitno
double getETheta() const
returns theta of pattern
const double r0
electron radius{cm}
double getRadius() const
returns radius
bool empty() const
returns if hitcontainer is empty
double getERPhi() const
returns r0/d0 of pattern
Helper to simultaneously calculate sin and cos of the same angle.
double angleFromGradToRadial(double angle) const
converts angle in degrees to rad
double getHitx(unsigned int hitno) const
returns x position of hit hitno
Histogram class, similar to Root's TH2D.