27 for (
unsigned int i = 0; i < 3; i++)
58 std::vector< pma::Hit3D* > hitsColl, hitsInd1, hitsInd2;
65 case geo::kZ: hitsColl.push_back(h);
break;
66 case geo::kV: hitsInd2.push_back(h);
break;
67 case geo::kU: hitsInd1.push_back(h);
break;
76 for (
size_t b = 0; b < chain->
NextCount(); b++)
84 case geo::kZ: hitsColl.push_back(h);
break;
85 case geo::kV: hitsInd2.push_back(h);
break;
86 case geo::kU: hitsInd1.push_back(h);
break;
97 case geo::kZ: hitsColl.push_back(h);
break;
98 case geo::kV: hitsInd2.push_back(h);
break;
99 case geo::kU: hitsInd1.push_back(h);
break;
110 float amp, sigmaMax = 0.0F;
112 for (
size_t i = 0; i < hitsInd1.size(); i++)
114 amp = hitsInd1[i]->GetAmplitude();
115 if (amp > sigmaMax) sigmaMax = amp;
118 for (
size_t i = 0; i < hitsInd1.size(); i++)
122 amp = hitsInd1[i]->GetAmplitude();
124 hitsInd1[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
125 else hitsInd1[i]->SetSigmaFactor(0.01F);
127 else hitsInd1[i]->SetSigmaFactor(1.0F);
132 for (
size_t i = 0; i < hitsInd2.size(); i++)
134 amp = hitsInd2[i]->GetAmplitude();
135 if (amp > sigmaMax) sigmaMax = amp;
138 for (
size_t i = 0; i < hitsInd2.size(); i++)
142 amp = hitsInd2[i]->GetAmplitude();
144 hitsInd2[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
145 else hitsInd2[i]->SetSigmaFactor(0.01F);
147 else hitsInd2[i]->SetSigmaFactor(1.0F);
152 for (
size_t i = 0; i < hitsColl.size(); i++)
154 amp = hitsColl[i]->SummedADC();
155 if (amp > sigmaMax) sigmaMax = amp;
158 for (
size_t i = 0; i < hitsColl.size(); i++)
162 amp = hitsColl[i]->SummedADC();
164 hitsColl[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
165 else hitsColl[i]->SetSigmaFactor(0.01F);
167 else hitsColl[i]->SetSigmaFactor(1.0F);
183 double d, ref_sum = 0.0F;
187 if (d > 0.0) ref_sum += d *
d;
191 ref_sum *= 0.2 *
fAssignedHits.size() / fAssignedPoints.size();
207 double hit_sum = 0.0F;
212 unsigned int hitView = h->View2D();
216 h->GetSigmaFactor() *
232 TVector3 mean3D(0, 0, 0);
235 if (h->View2D() == view)
236 { mean3D += h->Point3D(); nHits++; }
237 if (!nHits)
return 0.0;
238 mean3D *= (1.0 / nHits);
240 double r2, maxR2 = 0.0;
241 for (
auto h : fAssignedHits)
242 if (h->View2D() == view)
245 if (r2 > maxR2) maxR2 = r2;
255 for (
size_t i = 0; i < 3; ++i) nhits[i] =
NHits(i);
259 for (
size_t i = 0; i < 3; ++i)
261 if (nhits[i] >= 2 * nmax_per_view)
263 m[i] = nhits[i] / nmax_per_view;
266 else if (nhits[i] > nmax_per_view)
268 m[i] = nhits[i] / (nhits[i] - nmax_per_view);
271 else { m[i] = 0; state[i] =
false; }
276 bool b, changed =
false;
281 size_t view = h->View2D();
284 if (count[view] % m[view] == 0) h->SetEnabled(state[view]);
285 else h->SetEnabled(!(state[view]));
289 else h->SetEnabled(
true);
291 changed |= (b != h->IsEnabled());
298 bool changed =
false;
301 changed |= !(h->IsEnabled());
double GetHitsRadius2D(const std::vector< pma::Hit3D * > &hits, bool exact=false)
double Dist2(const TVector2 &v1, const TVector2 &v2)
Planes which measure Z direction.
double HitsRadius3D(unsigned int view) const
virtual void ClearAssigned(pma::Track3D *trk=0)
Implementation of the Projection Matching Algorithm.
virtual unsigned int NextCount(void) const
std::vector< TVector3 * > fAssignedPoints
std::vector< pma::Hit3D * > fAssignedHits
static float fOptFactors[3]
double SumDist2(void) const
Implementation of the Projection Matching Algorithm.
bool SelectRndHits(size_t nmax_per_view)
size_t fNThisHitsEnabledAll
virtual double GetDistance2To(const TVector3 &p3d) const =0
Distance [cm] from the 3D point to the object 3D.
void UpdateHitParams(void)
virtual pma::SortedObjectBase * Prev(void) const
virtual double SumDist2Hits(void) const =0
virtual pma::SortedObjectBase * Next(unsigned int index=0) const
size_t NEnabledHits(unsigned int view=geo::kUnknown) const
Implementation of the Projection Matching Algorithm.
static float OptFactor(unsigned int view)