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;
147 std::vector<double> ys, zs;
150 ys.push_back(hit.getR());
151 zs.push_back(hit.getZ());
155 double avg_z = std::accumulate(zs.begin(), zs.end(), 0.0)/(double)zs.size();
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)) );
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)