28 for (
unsigned int i = 0; i < 3; i++)
59 std::vector< pma::Hit3D* > hitsColl, hitsInd1, hitsInd2;
66 case geo::kZ: hitsColl.push_back(
h);
break;
67 case geo::kV: hitsInd2.push_back(
h);
break;
68 case geo::kU: hitsInd1.push_back(
h);
break;
85 case geo::kZ: hitsColl.push_back(
h);
break;
86 case geo::kV: hitsInd2.push_back(
h);
break;
87 case geo::kU: hitsInd1.push_back(
h);
break;
98 case geo::kZ: hitsColl.push_back(
h);
break;
99 case geo::kV: hitsInd2.push_back(
h);
break;
100 case geo::kU: hitsInd1.push_back(
h);
break;
111 float amp, sigmaMax = 0.0F;
113 for (
size_t i = 0; i < hitsInd1.size(); i++)
115 amp = hitsInd1[i]->GetAmplitude();
116 if (amp > sigmaMax) sigmaMax = amp;
119 for (
size_t i = 0; i < hitsInd1.size(); i++)
123 amp = hitsInd1[i]->GetAmplitude();
125 hitsInd1[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
126 else hitsInd1[i]->SetSigmaFactor(0.01F);
128 else hitsInd1[i]->SetSigmaFactor(1.0F);
133 for (
size_t i = 0; i < hitsInd2.size(); i++)
135 amp = hitsInd2[i]->GetAmplitude();
136 if (amp > sigmaMax) sigmaMax = amp;
139 for (
size_t i = 0; i < hitsInd2.size(); i++)
143 amp = hitsInd2[i]->GetAmplitude();
145 hitsInd2[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
146 else hitsInd2[i]->SetSigmaFactor(0.01F);
148 else hitsInd2[i]->SetSigmaFactor(1.0F);
153 for (
size_t i = 0; i < hitsColl.size(); i++)
155 amp = hitsColl[i]->SummedADC();
156 if (amp > sigmaMax) sigmaMax = amp;
159 for (
size_t i = 0; i < hitsColl.size(); i++)
163 amp = hitsColl[i]->SummedADC();
165 hitsColl[i]->SetSigmaFactor((
float)sqrt(amp / sigmaMax));
166 else hitsColl[i]->SetSigmaFactor(0.01F);
168 else hitsColl[i]->SetSigmaFactor(1.0F);
184 double d, ref_sum = 0.0F;
188 if (d > 0.0) ref_sum += d *
d;
192 ref_sum *= 0.2 *
fAssignedHits.size() / fAssignedPoints.size();
208 double hit_sum = 0.0F;
213 unsigned int hitView =
h->View2D();
217 h->GetSigmaFactor() *
233 TVector3 mean3D(0, 0, 0);
236 if (
h->View2D() == view)
237 { mean3D +=
h->Point3D(); nHits++; }
238 if (!nHits)
return 0.0;
239 mean3D *= (1.0 / nHits);
241 double r2, maxR2 = 0.0;
242 for (
auto h : fAssignedHits)
243 if (
h->View2D() == view)
246 if (r2 > maxR2) maxR2 = r2;
256 for (
size_t i = 0; i < 3; ++i) nhits[i] =
NHits(i);
260 for (
size_t i = 0; i < 3; ++i)
262 if (nhits[i] >= 2 * nmax_per_view)
264 m[i] = nhits[i] / nmax_per_view;
267 else if (nhits[i] > nmax_per_view)
269 m[i] = nhits[i] / (nhits[i] - nmax_per_view);
272 else { m[i] = 0; state[i] =
false; }
277 bool b, changed =
false;
282 size_t view =
h->View2D();
285 if (count[view] % m[view] == 0)
h->SetEnabled(state[view]);
286 else h->SetEnabled(!(state[view]));
290 else h->SetEnabled(
true);
292 changed |= (b !=
h->IsEnabled());
299 bool changed =
false;
302 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
Implementation of the Projection Matching Algorithm.
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)