8 const int UpX,
const int DownX,
const int UpUV,
const int DownUV,
9 const int xthr,
const int uvthr,
10 const int iroadx,
const int iroadu,
const int iroadv) :
12 m_iroadu(iroadu != -1 ? iroadu : iroadx),
13 m_iroadv(iroadv != -1 ? iroadv : iroadx),
30 for (
const auto &hit_i :
hits) {
31 if (
m_sector != hit_i->getSector())
continue;
35 slow = hit_i->getShift() +
m_slopeXlow * hit_i->getPitchOverZ();
36 shigh = hit_i->getShift() +
m_slopeXhigh * hit_i->getPitchOverZ();
38 else if (hit_i->isU()) {
39 slow = hit_i->getShift() +
m_slopeUlow * hit_i->getPitchOverZ();
40 shigh = hit_i->getShift() +
m_slopeUhigh * hit_i->getPitchOverZ();
42 else if (hit_i->isV()) {
43 slow = hit_i->getShift() +
m_slopeVlow * hit_i->getPitchOverZ();
44 shigh = hit_i->getShift() +
m_slopeVhigh * hit_i->getPitchOverZ();
48 const double val = hit_i->getRZSlope();
49 bool has_hit = (
val > 0.) ? (
val > slow &&
val < shigh) : (
val > shigh &&
val < slow);
51 if (!has_hit)
continue;
54 const int bo = hit_i->getPlane();
55 auto it = std::find_if(
m_road_hits.begin(),
m_road_hits.end(), [&bo](
const auto &hit) { return (hit.getPlane() == bo); });
58 if (!hit_i->isNoise() &&
it->isNoise()) {
64 if (has_hit)
continue;
75 sum += hit.getRZSlope();
86 const int bo = hit.getPlane();
87 if (bo == uv1 || bo == uv2) {
88 sum += hit.getRZSlope();
97 [&](
auto& hit) { return hit.isNoise()==false; });
102 [&](
auto& hit) { return (hit.isU() || hit.isV()) && hit.isNoise()==flag; });
107 [&](
auto& hit) { return hit.isX() && hit.isNoise()==flag; });
111 unsigned int nhits1 = 0, nhits2 = 0;
113 nhits1 += hit.getPlane() < 4 && !hit.isNoise();
114 nhits2 += hit.getPlane() > 3 && !hit.isNoise();
116 return (nhits1 < 4 || nhits2 < 4);
120 int nx1 = 0, nx2 = 0;
122 nx1 += hit.getPlane() >-1 && hit.getPlane() < 2;
123 nx2 += hit.getPlane() > 5 && hit.getPlane() < 8;
125 if (nx1 > 0 && nx2 > 0 && (nx1+nx2) >=
m_xthr)
return true;
131 std::vector<unsigned int> old_ihits;
132 for (
unsigned int j = 0; j <
m_road_hits.size(); j++) {
134 if (
m_road_hits[j].getAge() > (bcwind-1)) old_ihits.push_back(j);
141 if (hit.getAge() == (bcwind - 1))
return true;
147 std::vector<double> ys, zs;
150 ys.push_back(hit.getR());
151 zs.push_back(hit.getZ());
156 double sum_sq_z = std::inner_product(zs.begin(), zs.end(), zs.begin(), 0.0);
157 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)) );
175 if (nu > 0 && nv > 0 && (nu+nv) >=
m_uvthr)
return true;