#include <MMT_Road.h>
|
| | MMT_Road (const char sector, const int roadSize, const int UpX, const int DownX, const int UpUV, const int DownUV, const int xthr, const int uvthr, const int iroadx, const int iroadu=-1, const int iroadv=-1) |
| | ~MMT_Road ()=default |
| void | addHits (const std::vector< std::shared_ptr< MMT_Hit > > &hits) |
| double | avgSofXUV (const char type) const |
| bool | checkCoincidences (const int bcwind) const |
| unsigned int | countHits () const |
| unsigned int | countUHits () const |
| unsigned int | countXHits () const |
| bool | evaluateLowRes () const |
| bool | horizontalCheck () const |
| void | incrementAge (const int bcwind) |
| const std::vector< MMT_Hit > & | getHitVector () const |
| char | getSector () const |
| int | getXthreshold () const |
| int | getUVthreshold () const |
| int | iRoadx () const |
| int | iRoadu () const |
| int | iRoadv () const |
| bool | matureCheck (const int bcwind) const |
| double | mxl () const |
| bool | stereoCheck () const |
Definition at line 12 of file MMT_Road.h.
◆ MMT_Road()
| MMT_Road::MMT_Road |
( |
const char | sector, |
|
|
const int | roadSize, |
|
|
const int | UpX, |
|
|
const int | DownX, |
|
|
const int | UpUV, |
|
|
const int | DownUV, |
|
|
const int | xthr, |
|
|
const int | uvthr, |
|
|
const int | iroadx, |
|
|
const int | iroadu = -1, |
|
|
const int | iroadv = -1 ) |
Definition at line 7 of file MMT_Road.cxx.
10 :
12 m_iroadu(iroadu != -1 ? iroadu : iroadx),
13 m_iroadv(iroadv != -1 ? iroadv : iroadx),
17{
18
21
24
27}
◆ ~MMT_Road()
◆ addHits()
| void MMT_Road::addHits |
( |
const std::vector< std::shared_ptr< MMT_Hit > > & | hits | ) |
|
Definition at line 29 of file MMT_Road.cxx.
29 {
30 for (const auto &hit_i : hits) {
31 double slow, shigh;
32 if (hit_i->isX()) {
33 slow = hit_i->getShift() +
m_slopeXlow * hit_i->getPitchOverZ();
34 shigh = hit_i->getShift() +
m_slopeXhigh * hit_i->getPitchOverZ();
35 }
36 else if (hit_i->isU()) {
37 slow = hit_i->getShift() +
m_slopeUlow * hit_i->getPitchOverZ();
38 shigh = hit_i->getShift() +
m_slopeUhigh * hit_i->getPitchOverZ();
39 }
40 else {
41 slow = hit_i->getShift() +
m_slopeVlow * hit_i->getPitchOverZ();
42 shigh = hit_i->getShift() +
m_slopeVhigh * hit_i->getPitchOverZ();
43 }
44
45 const double val = hit_i->getRZSlope();
46 bool has_hit = (
val > 0.) ? (val > slow && val < shigh) : (
val > shigh &&
val < slow);
47 if (!has_hit) continue;
48
49 const int pl = hit_i->getPlane();
50 if (std::ranges::any_of(
m_road_hits, [&pl](
const auto &hit) {
return (hit.getPlane() == pl); }))
continue;
51
54 }
55}
std::vector< MMT_Hit > m_road_hits
◆ avgSofXUV()
| double MMT_Road::avgSofXUV |
( |
const char | type | ) |
const |
Definition at line 57 of file MMT_Road.cxx.
57 {
59 unsigned short int N = 0;
61 if (hit.isX() && type == 'X') {
62 sum += hit.getRZSlope();
64 }
65 else if (hit.isU() && type == 'U') {
66 sum += hit.getRZSlope();
68 }
69 else if (hit.isV() && type == 'V') {
70 sum += hit.getRZSlope();
72 }
73 else continue;
74 }
76}
◆ checkCoincidences()
| bool MMT_Road::checkCoincidences |
( |
const int | bcwind | ) |
const |
|
inline |
Definition at line 20 of file MMT_Road.h.
20 {
22 }
bool matureCheck(const int bcwind) const
bool horizontalCheck() const
◆ countHits()
| unsigned int MMT_Road::countHits |
( |
| ) |
const |
|
inline |
◆ countUHits()
| unsigned int MMT_Road::countUHits |
( |
| ) |
const |
Definition at line 78 of file MMT_Road.cxx.
78 {
80 [](const auto& hit) { return hit.isU(); });
81}
◆ countXHits()
| unsigned int MMT_Road::countXHits |
( |
| ) |
const |
Definition at line 83 of file MMT_Road.cxx.
83 {
85 [](const auto& hit) { return hit.isX(); });
86}
◆ evaluateLowRes()
| bool MMT_Road::evaluateLowRes |
( |
| ) |
const |
Definition at line 88 of file MMT_Road.cxx.
88 {
89 unsigned short int nhits1 = 0, nhits2 = 0;
91 nhits1 += hit.getPlane() < 4;
92 nhits2 += hit.getPlane() > 3;
93 }
94 return (nhits1 < 4 || nhits2 < 4);
95}
◆ getHitVector()
| const std::vector< MMT_Hit > & MMT_Road::getHitVector |
( |
| ) |
const |
|
inline |
◆ getSector()
| char MMT_Road::getSector |
( |
| ) |
const |
|
inline |
◆ getUVthreshold()
| int MMT_Road::getUVthreshold |
( |
| ) |
const |
|
inline |
◆ getXthreshold()
| int MMT_Road::getXthreshold |
( |
| ) |
const |
|
inline |
◆ horizontalCheck()
| bool MMT_Road::horizontalCheck |
( |
| ) |
const |
Definition at line 97 of file MMT_Road.cxx.
97 {
98 unsigned short int nx1 = 0, nx2 = 0;
100 nx1 += hit.getPlane() < 2;
101 nx2 += hit.getPlane() > 5;
102
103 if (nx1 > 0 && nx2 > 0 && (nx1+nx2) >=
m_xthr)
return true;
104 }
105 return false;
106}
◆ incrementAge()
| void MMT_Road::incrementAge |
( |
const int | bcwind | ) |
|
Definition at line 108 of file MMT_Road.cxx.
108 {
109 unsigned short int old_ihits = 0;
111 hit.setAge(hit.getAge()+1);
112 if (hit.getAge() > (bcwind-1)) ++old_ihits;
113 }
115}
◆ iRoadu()
| int MMT_Road::iRoadu |
( |
| ) |
const |
|
inline |
◆ iRoadv()
| int MMT_Road::iRoadv |
( |
| ) |
const |
|
inline |
◆ iRoadx()
| int MMT_Road::iRoadx |
( |
| ) |
const |
|
inline |
◆ matureCheck()
| bool MMT_Road::matureCheck |
( |
const int | bcwind | ) |
const |
Definition at line 117 of file MMT_Road.cxx.
117 {
119 if (hit.getAge() == (bcwind - 1)) return true;
120 }
121 return false;
122}
◆ mxl()
| double MMT_Road::mxl |
( |
| ) |
const |
Definition at line 124 of file MMT_Road.cxx.
124 {
125 std::vector<double> ys, zs;
127 if (hit.isX()) {
128 ys.push_back(hit.getR());
129 zs.push_back(hit.getZ());
130 }
131 }
133 double avg_z = std::accumulate(zs.begin(), zs.end(), 0.0)/(
double)zs.size();
134 double sum_sq_z = std::inner_product(zs.begin(), zs.end(), zs.begin(), 0.0);
135 for (
unsigned int i = 0;
i < ys.size();
i++)
mxl += ys[i]*( (zs[i]-avg_z) / (sum_sq_z - zs.size()*std::pow(avg_z,2)) );
136
138}
◆ stereoCheck()
| bool MMT_Road::stereoCheck |
( |
| ) |
const |
Definition at line 140 of file MMT_Road.cxx.
140 {
141 unsigned short int nu = 0, nv = 0;
143 nu += hit.isU();
144 nv += hit.isV();
145
146 if (nu > 0 && nv > 0 && (nu+nv) >=
m_uvthr)
return true;
147 }
148 return false;
149}
◆ m_iroadu
◆ m_iroadv
◆ m_iroadx
◆ m_road_hits
| std::vector<MMT_Hit> MMT_Road::m_road_hits |
|
private |
◆ m_sector
◆ m_slopeUhigh
| double MMT_Road::m_slopeUhigh |
|
private |
◆ m_slopeUlow
| double MMT_Road::m_slopeUlow |
|
private |
◆ m_slopeVhigh
| double MMT_Road::m_slopeVhigh |
|
private |
◆ m_slopeVlow
| double MMT_Road::m_slopeVlow |
|
private |
◆ m_slopeXhigh
| double MMT_Road::m_slopeXhigh |
|
private |
◆ m_slopeXlow
| double MMT_Road::m_slopeXlow |
|
private |
◆ m_uvthr
◆ m_xthr
The documentation for this class was generated from the following files: