17 #include "TPrincipal.h"
18 #include "TStopwatch.h"
24 #include "cetlib/pow.h"
27 constexpr
double PI{3.14159265};
55 if (!(inhitlist.size())) {
61 for (
auto h : inhitlist)
68 std::cout <<
" the hitlist is too small. Continuing to run may result in crash!!! "
89 unsigned int length = 13;
90 if (data.size() != length) data.resize(length);
110 std::vector<float> data;
113 std::cout <<
"Printing FANN input vector:\n"
114 <<
" Opening Angle (normalized) ... : " << data[0] <<
"\n"
115 <<
" Opening Angle charge weight .. : " << data[1] <<
"\n"
116 <<
" Closing Angle (normalized) ... : " << data[2] <<
"\n"
117 <<
" Closing Angle charge weight .. : " << data[3] <<
"\n"
118 <<
" Principal Eigenvalue ......... : " << data[4] <<
"\n"
119 <<
" Secondary Eigenvalue ......... : " << data[5] <<
"\n"
120 <<
" Width / Length ............... : " << data[6] <<
"\n"
121 <<
" Hit Density / M.H.D. ......... : " << data[7] <<
"\n"
122 <<
" Percent MultiHit Wires ....... : " << data[8] <<
"\n"
123 <<
" Percent High Charge Hits ..... : " << data[9] <<
"\n"
124 <<
" Modified Hit Density ......... : " << data[10] <<
"\n"
125 <<
" Charge RMS / Mean Charge ...... : " << data[11] <<
"\n"
126 <<
" log(Sum Charge / Length) ...... : " << data[12] <<
"\n";
136 TStopwatch localWatch;
185 bool override_DoGetAverages,
186 bool override_DoGetRoughAxis,
187 bool override_DoGetProfileInfo,
188 bool override_DoStartPointsAndDirection,
189 bool override_DoGetFinalSlope,
190 bool override_DoTrackShowerSep,
191 bool override_DoEndCharge)
210 TStopwatch localWatch;
213 TPrincipal fPrincipal(2,
"D");
217 std::map<double, int> wireMap;
222 int multi_hit_wires = 0;
227 fPrincipal.AddRow(data);
233 if (wireMap[
hit.w] == 0) { uniquewires++; }
234 if (wireMap[
hit.w] == 1) { multi_hit_wires++; }
264 fPrincipal.MakePrincipals();
290 TStopwatch localWatch;
300 double sumwiretime = 0;
301 double sumwirewire = 0;
315 sumwiretime +=
hit.w *
hit.t;
316 sumwirewire += pow(
hit.w, 2);
327 if ((ncw * sumwirewire - sumwire * sumwire) > 0.00001)
329 (ncw * sumwirewire - sumwire * sumwire);
359 TStopwatch localWatch;
362 bool drawOrtHistos =
false;
368 double inv_2d_slope = 0;
372 inv_2d_slope = -999999.;
374 double InterHigh = -999999;
375 double InterLow = 999999;
376 double WireHigh = -999999;
377 double WireLow = 999999;
380 double min_ortdist(999), max_ortdist(-999);
388 double intercept =
hit.t - inv_2d_slope * (double)(
hit.w);
396 if (ortdist < min_ortdist) min_ortdist = ortdist;
397 if (ortdist > max_ortdist) max_ortdist = ortdist;
399 if (inv_2d_slope != -999999)
401 if (intercept > InterHigh) { InterHigh = intercept; }
403 if (intercept < InterLow) { InterLow = intercept; }
407 if (
hit.w > WireHigh) { WireHigh =
hit.w; }
408 if (
hit.w < WireLow) { WireLow =
hit.w; }
424 util::PxPoint HighOnlinePoint, LowOnlinePoint, BeginOnlinePoint, EndOnlinePoint;
426 if (inv_2d_slope != -999999)
439 std::cout <<
" Low online point: " << LowOnlinePoint.
w <<
", " << LowOnlinePoint.
t
440 <<
" High: " << HighOnlinePoint.
w <<
", " << HighOnlinePoint.
t << std::endl;
443 if (HighOnlinePoint.
w >= LowOnlinePoint.
w) {
444 BeginOnlinePoint = LowOnlinePoint;
446 EndOnlinePoint = HighOnlinePoint;
450 BeginOnlinePoint = HighOnlinePoint;
452 EndOnlinePoint = LowOnlinePoint;
473 std::vector<double> ort_profile;
474 const int NBINS = 100;
475 ort_profile.resize(NBINS);
477 std::vector<double> ort_dist_vect;
478 ort_dist_vect.reserve(fHitVector.size());
480 double current_maximum = 0;
481 for (
auto&
hit : fHitVector) {
488 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
489 ort_dist_vect.push_back(ortdist);
493 else if (max_ortdist == min_ortdist)
496 ortbin = (int)(ortdist - min_ortdist) / (max_ortdist - min_ortdist) * (NBINS - 1);
498 ort_profile.at(ortbin) +=
hit.charge;
506 double weight = (ortdist < 1.) ? 10 * (
hit.charge) : 5 * (
hit.charge) / ortdist;
518 if (
fChargeProfile.at(fine_bin) > current_maximum && fine_bin != 0 &&
534 for (ix = 0; ix < NBINS; ix++) {
535 integral += ort_profile.at(ix);
540 2 * (double)ix / (
double)(NBINS - 1) *
541 (
double)(max_ortdist -
547 TH1F* ortDistHist =
new TH1F(
548 "ortDistHist",
"Orthogonal Distance to axis;Distance (cm)", 100, min_ortdist, max_ortdist);
549 TH1F* ortDistHistCharge =
550 new TH1F(
"ortDistHistCharge",
551 "Orthogonal Distance to axis (Charge Weighted);Distance (cm)",
555 TH1F* ortDistHistAndrzej =
new TH1F(
"ortDistHistAndrzej",
556 "Orthogonal Distance Andrzej weighting",
562 ortDistHist->Fill(ort_dist_vect.at(index));
563 ortDistHistCharge->Fill(ort_dist_vect.at(index), fHitVector.at(index).charge);
564 double weight = (ort_dist_vect.at(index) < 1.) ?
565 10 * (fHitVector.at(index).charge) :
566 (5 * (fHitVector.at(index).charge) / ort_dist_vect.at(index));
567 ortDistHistAndrzej->Fill(ort_dist_vect.at(index), weight);
569 ortDistHist->Scale(1.0 / ortDistHist->Integral());
570 ortDistHistCharge->Scale(1.0 / ortDistHistCharge->Integral());
571 ortDistHistAndrzej->Scale(1.0 / ortDistHistAndrzej->Integral());
573 TCanvas* ortCanv =
new TCanvas(
"ortCanv",
"ortCanv", 600, 600);
575 ortDistHistAndrzej->SetLineColor(3);
576 ortDistHistAndrzej->Draw(
"");
577 ortDistHistCharge->Draw(
"same");
578 ortDistHist->SetLineColor(2);
579 ortDistHist->Draw(
"same");
581 TLegend* leg =
new TLegend(.4, .6, .8, .9);
582 leg->SetHeader(
"Charge distribution");
583 leg->AddEntry(ortDistHist,
"Unweighted Hits");
584 leg->AddEntry(ortDistHistCharge,
"Charge Weighted Hits");
585 leg->AddEntry(ortDistHistAndrzej,
"Charge Weighted by Guessology");
609 int startbin, endbin;
626 for (endbin =
fProfileMaximumBin; endbin > 0 && endbin < fProfileNbins - 1; endbin++) {
632 endbin + 1 < fProfileNbins - 1 && endbin + 2 < fProfileNbins - 1 &&
644 if (inv_2d_slope != -999999)
646 double ort_intercept_begin =
651 double ort_intercept_end =
660 double wire_begin = WireLow + (WireHigh - WireLow) / fProfileNbins * startbin;
666 double wire_end = WireLow + (WireHigh - WireLow) / fProfileNbins * endbin;
699 TStopwatch localWatch;
725 std::vector<const util::PxHit*> subhit;
726 double linearlimit = 8;
727 double ortlimit = 12;
734 fHitVector, subhit, startHit, linearlimit, ortlimit, lineslopetest, averageHit);
736 if (!(subhit.size()) || subhit.size() < 3) {
738 std::cout <<
"Subhit list is empty or too small. Using rough start/end points..."
751 double avgwire = averageHit.
w;
752 double avgtime = averageHit.
t;
754 std::vector<std::pair<double, double>> vertil;
756 std::vector<double> vs;
758 std::vector<const util::PxHit*> ghits;
759 ghits.reserve(subhit.size());
761 double fardistcurrent = 0;
763 double gwiretime = 0;
766 double gwirewire = 0;
774 std::vector<util::PxHit> returnhits;
775 std::vector<double> radiusofhit;
776 std::vector<int> closehits;
779 for (
unsigned int a = 0;
a < subhit.size();
a++) {
780 for (
unsigned int b =
a + 1; b < subhit.size(); b++) {
781 if (subhit.at(
a)->w != subhit.at(b)->w) {
782 double xtil = ((subhit.at(
a)->t - avgtime) - (subhit.at(b)->t - avgtime));
783 xtil /= ((subhit.at(
a)->w - avgwire) - (subhit.at(b)->w - avgwire));
784 double ytil = (subhit.at(
a)->w - avgwire) * xtil - (subhit.at(
a)->t - avgtime);
786 std::pair<double, double> tv(xtil, ytil);
787 vertil.push_back(tv);
792 for (
unsigned int z = 0;
z < vertil.size();
z++) {
794 for (
unsigned int c = 0; c < vertil.size(); c++)
795 vd += std::hypot(vertil.at(
z).first - vertil.at(c).first,
796 vertil.at(
z).second - vertil.at(c).second);
804 std::cout <<
"vertil list is empty. all subhits are on the same wire?" << std::endl;
816 int minvs = std::min_element(vs.begin(), vs.end()) - vs.begin();
820 double tilwire = vertil.at(minvs).first;
821 double tiltimet = -vertil.at(minvs).second +
822 d * sqrt(1 + pow(tilwire, 2));
823 double tiltimeb = -vertil.at(minvs).second -
824 d * sqrt(1 + pow(tilwire, 2));
826 for (
unsigned int a = 0;
a < subhit.size();
a++) {
828 (-tilwire * (subhit.at(
a)->w - avgwire) + (subhit.at(
a)->t - avgtime) - tiltimet) /
829 sqrt(tilwire * tilwire + 1);
831 (-tilwire * (subhit.at(
a)->w - avgwire) + (subhit.at(
a)->t - avgtime) - tiltimeb) /
832 sqrt(tilwire * tilwire + 1);
834 if ((dtstrip < 0.0 && dbstrip > 0.0) || (dbstrip < 0.0 && dtstrip > 0.0)) {
835 ghits.push_back(subhit.at(
a));
843 for (
unsigned int g = 0;
g < ghits.size();
g++) {
847 gwiretime += ghits.at(
g)->w * ghits.at(
g)->t;
848 gwire += ghits.at(
g)->w;
849 gtime += ghits.at(
g)->t;
850 gwirewire += ghits.at(
g)->w * ghits.at(
g)->w;
853 double fardist = std::hypot(ghits.at(
g)->w - farhit.
w, ghits.at(
g)->t - farhit.
t);
856 if (fardist > fardistcurrent) {
857 fardistcurrent = fardist;
859 startpoint.
t = ghits.at(
g)->t;
860 startpoint.
w = ghits.at(
g)->w;
861 startpoint.
plane = ghits.at(
g)->plane;
862 startpoint.
charge = ghits.at(
g)->charge;
905 TStopwatch localWatch;
913 const int NBINS = 720;
914 std::vector<int> fh_omega_single(NBINS, 0);
916 double current_maximum = 0;
917 double curr_max_bin = -1;
923 int nbin = (omx + TMath::Pi()) * (NBINS - 1) / (2 * TMath::Pi());
924 if (nbin >= NBINS) nbin = NBINS - 1;
925 if (nbin < 0) nbin = 0;
926 fh_omega_single[nbin] +=
hit.charge;
928 if (fh_omega_single[nbin] > current_maximum) {
929 current_maximum = fh_omega_single[nbin];
935 fParams.
angle_2d = (curr_max_bin / 720 * (2 * TMath::Pi())) - TMath::Pi();
948 if (mod_angle <= 75.)
963 bool drawProfileHisto =
false;
964 if (drawProfileHisto) {
967 double corr_factor = 1;
973 if (mod_angle <= 75.)
974 corr_factor *= (2.45 * cos(mod_angle *
PI / 180.) + 0.2595);
976 corr_factor *= (1.036 * mod_angle *
PI / 180. - 0.2561);
995 for (
auto hit : fHitVector) {
1001 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
1017 if (ix > 2 && ix < fProfileNbins - 3) {
1022 charge_diff->SetBinContent(ix, diff);
1026 TCanvas* chCanv =
new TCanvas(
"chCanv",
"chCanv", 600, 600);
1028 charge_histo->SetLineColor(3);
1029 charge_histo->Draw(
"");
1030 charge_diff->SetLineColor(2);
1031 charge_diff->Draw(
"same");
1056 if (!
override)
override =
true;
1058 TStopwatch localWatch;
1088 std::cout <<
"Angle: Start point: (" << this_startPoint.
w <<
", " << this_startPoint.
t
1090 std::cout <<
"Angle: End point : (" << this_endPoint.
w <<
", " << this_endPoint.
t <<
")\n";
1092 double endStartDiff_x = (this_endPoint.
w - this_startPoint.
w);
1093 double endStartDiff_y = (this_endPoint.
t - this_startPoint.
t);
1094 double rms_forward = 0;
1095 double rms_backward = 0;
1096 double mean_forward = 0;
1097 double mean_backward = 0;
1099 double hit_counter_forward = 0;
1100 double hit_counter_backward = 0;
1102 if (
verbose && endStartDiff_y == 0 && endStartDiff_x == 0) {
1103 std::cerr <<
"Error: end point and start point are the same!\n";
1110 double percentage = 0.90;
1112 const int NBINS = 200;
1116 std::vector<float> opening_angle_bin(NBINS, 0.0);
1117 std::vector<float> closing_angle_bin(NBINS, 0.0);
1118 std::vector<float> opening_angle_highcharge_bin(NBINS, 0.0);
1119 std::vector<float> closing_angle_highcharge_bin(NBINS, 0.0);
1120 std::vector<float> opening_angle_chargeWgt_bin(NBINS, 0.0);
1121 std::vector<float> closing_angle_chargeWgt_bin(NBINS, 0.0);
1134 double hitStartDiff_x = (
hit.w - this_startPoint.
w);
1135 double hitStartDiff_y = (
hit.t - this_startPoint.
t);
1137 if (hitStartDiff_x == 0 && hitStartDiff_y == 0)
continue;
1139 double cosangle_start = (endStartDiff_x * hitStartDiff_x + endStartDiff_y * hitStartDiff_y);
1140 cosangle_start /= (pow(pow(endStartDiff_x, 2) + pow(endStartDiff_y, 2), 0.5) *
1141 pow(pow(hitStartDiff_x, 2) + pow(hitStartDiff_y, 2), 0.5));
1143 if (cosangle_start > 0) {
1146 mean_forward += cosangle_start;
1147 rms_forward += pow(cosangle_start, 2);
1148 hit_counter_forward++;
1152 double hitEndDiff_x = (
hit.w - this_endPoint.
w);
1153 double hitEndDiff_y = (
hit.t - this_endPoint.
t);
1154 if (hitEndDiff_x == 0 && hitEndDiff_y == 0)
continue;
1156 double cosangle_end = (endStartDiff_x * hitEndDiff_x + endStartDiff_y * hitEndDiff_y) * (-1.);
1157 cosangle_end /= (pow(pow(endStartDiff_x, 2) + pow(endStartDiff_y, 2), 0.5) *
1158 pow(pow(hitEndDiff_x, 2) + pow(hitEndDiff_y, 2), 0.5));
1160 if (cosangle_end > 0) {
1162 mean_backward += cosangle_end;
1163 rms_backward += pow(cosangle_end, 2);
1164 hit_counter_backward++;
1167 int N_bins_OPEN = (NBINS - 1) * acos(cosangle_start) /
PI;
1168 int N_bins_CLOSE = (NBINS - 1) * acos(cosangle_end) /
PI;
1169 if (N_bins_OPEN < 0) N_bins_OPEN = 0;
1170 if (N_bins_CLOSE < 0) N_bins_CLOSE = 0;
1174 opening_angle_bin[N_bins_OPEN] += wgt;
1175 closing_angle_bin[N_bins_CLOSE] += wgt;
1179 opening_angle_highcharge_bin[N_bins_OPEN] += wgt;
1180 closing_angle_highcharge_bin[N_bins_CLOSE] += wgt;
1185 int iBin(0), jBin(0), kBin(0), lBin(0), mBin(0), nBin(0);
1186 double percentage_OPEN(0.0), percentage_CLOSE(0.0), percentage_OPEN_HC(0.0),
1187 percentage_CLOSE_HC(0.0),
1188 percentage_OPEN_CHARGEWGT(0.0), percentage_CLOSE_CHARGEWGT(0.0);
1190 for (iBin = 0; percentage_OPEN <= percentage && iBin < NBINS; iBin++) {
1191 percentage_OPEN += opening_angle_bin[iBin];
1194 for (jBin = 0; percentage_CLOSE <= percentage && jBin < NBINS; jBin++) {
1195 percentage_CLOSE += closing_angle_bin[jBin];
1198 for (kBin = 0; percentage_OPEN_HC <= percentage_HC && kBin < NBINS; kBin++) {
1199 percentage_OPEN_HC += opening_angle_highcharge_bin[kBin];
1202 for (lBin = 0; percentage_CLOSE_HC <= percentage_HC && lBin < NBINS; lBin++) {
1203 percentage_CLOSE_HC += closing_angle_highcharge_bin[lBin];
1206 for (mBin = 0; percentage_OPEN_CHARGEWGT <= percentage && mBin < NBINS; mBin++) {
1207 percentage_OPEN_CHARGEWGT += opening_angle_chargeWgt_bin[mBin];
1210 for (nBin = 0; percentage_CLOSE_CHARGEWGT <= percentage && nBin < NBINS; nBin++) {
1211 percentage_CLOSE_CHARGEWGT += closing_angle_chargeWgt_bin[nBin];
1214 double opening_angle = iBin *
PI / NBINS;
1215 double closing_angle = jBin *
PI / NBINS;
1216 double opening_angle_highcharge = kBin *
PI / NBINS;
1217 double closing_angle_highcharge = lBin *
PI / NBINS;
1218 double opening_angle_charge_wgt = mBin *
PI / NBINS;
1219 double closing_angle_charge_wgt = nBin *
PI / NBINS;
1221 double value_1 = closing_angle / opening_angle - 1;
1223 if (value_2 < 100.0 && value_2 > 0.01)
1224 value_2 = log(value_2);
1227 double value_3 = closing_angle_charge_wgt / opening_angle_charge_wgt - 1;
1233 if (value_1 > 3) value_1 = 3.0;
1234 if (value_1 < -3) value_1 = -3.0;
1235 if (value_2 > 3) value_2 = 3.0;
1236 if (value_2 < -3) value_2 = -3.0;
1237 if (value_3 > 3) value_3 = 3.0;
1238 if (value_3 < -3) value_3 = -3.0;
1240 double Exp =
exp(value_1 + value_2 + value_3);
1241 double sigmoid = (Exp - 1) / (Exp + 1);
1244 if (sigmoid < 0) flip =
true;
1247 std::swap(opening_angle, closing_angle);
1248 std::swap(opening_angle_highcharge, closing_angle_highcharge);
1249 std::swap(opening_angle_charge_wgt, closing_angle_charge_wgt);
1271 TStopwatch localWatch;
1275 std::vector<const util::PxHit*> container_polygon;
1278 std::pair<float, float> tmpvertex;
1280 std::vector<std::pair<float, float>> vertices;
1281 for (
unsigned int i = 0; i < container_polygon.size(); i++) {
1282 tmpvertex = std::make_pair(container_polygon.at(i)->w, container_polygon.at(i)->t);
1283 vertices.push_back(tmpvertex);
1301 TStopwatch localWatch;
1321 std::cout <<
"REFINING .... " << std::endl;
1322 std::cout <<
" Rough start and end point: " << std::endl;
1330 std::cout <<
" Once Refined start and end point: " << std::endl;
1340 std::cout <<
" Twice Refined start and end point: " << std::endl;
1350 std::cout <<
" Final start and end point: " << std::endl;
1365 if (!
override)
return;
1369 std::vector<float> FeatureVector, outputVector;
1386 TStopwatch localWatch;
1402 return m / 2. * (cet::square(x2) - cet::square(x1)) + q * (x2 - x1);
1410 unsigned int fit_first_bin,
1411 unsigned int fit_end_bin)
1417 if (fit_first_bin > fit_end_bin) std::swap(fit_first_bin, fit_end_bin);
1420 const unsigned int nbins =
1421 std::min(fit_end_bin - fit_first_bin, (
unsigned int)
fChargeProfile.size());
1422 if (nbins == 0)
return 0;
1427 fit_first_bin = fit_end_bin - nbins;
1437 for (
unsigned int iBin = fit_first_bin; iBin < fit_end_bin; ++iBin) {
1447 catch (std::range_error
const&) {
1452 std::cerr <<
"IntegrateFitCharge(): linear fit failed!" << std::endl;
1459 const double from_bin = from_length * length_to_bin, to_bin = to_length * length_to_bin;
1469 unsigned int nbins )
1479 const unsigned int fit_first_bin = 0, fit_last_bin = nbins;
1488 unsigned int nbins )
1502 const unsigned int fit_first_bin = MaxBins > nbins ? MaxBins - nbins : 0,
1503 fit_last_bin = MaxBins;
double rms_ADC
RMS (standard deviation of sample) of ADC counts of hits in ADC.
process_name opflash particleana ie ie ie z
void GetRoughAxis(bool override=false)
double modified_hit_density
bool fFinishedGetRoughAxis
void GetFinalSlope(util::GeometryUtilities const &gser, bool override=false)
double closing_angle_charge_wgt
Same for charge_wgt.
std::vector< double > fCoarseChargeProfile
std::vector< std::string > fTimeRecord_ProcName
double charge_wgt_y
Mean of hits along y, charge weighted.
void FillPolygon(util::GeometryUtilities const &gser)
Double_t Get2DDistance(Double_t wire1, Double_t time1, Double_t wire2, Double_t time2) const
BEGIN_PROLOG could also be cerr
Double_t Get2Dangle(Double_t deltawire, Double_t deltatime) const
double mean_x
Mean of hits along x, peaks only.
double start_charge
Charge at the start of the cluster.
util::PxPoint fRoughBeginPoint
double IntegrateFitCharge(util::GeometryUtilities const &gser, double from_length, double to_length, unsigned int fit_first_bin, unsigned int fit_end_bin)
Integrates the charge between two positions in the cluster axis.
double rms_charge
RMS (standard deviation of sample) of charge of hits in ADC.
void GetProfileInfo(util::GeometryUtilities const &gser, bool override=false)
Polygon2D PolyObject
Polygon Object...see Polygon2D.hh.
std::vector< util::PxHit > fHitVector
double eigenvalue_principal
the principal eigenvalue from PCA
double mean_ADC
Mean (average) of ADC counts of hits, in ADC.
double mean_y
Mean of hits along y, peaks only.
Classes gathering simple statistics.
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
Weight_t RMS() const
Returns the root mean square.
bool fFinishedGetFinalSlope
Classes performing simple fits.
double fProfileIntegralBackward
void RefineStartPoints(util::GeometryUtilities const &gser)
Performs a linear regression of data.
Weight_t Average() const
Returns the value average.
Class def header for exception classes in ClusterRecoUtil package.
bool fFinishedRefineStartPointAndDirection
double eigenvalue_secondary
the secondary eigenvalue from PCA
float MultipleHitDensity(util::GeometryUtilities const &gser)
Returns the number of multiple hits per wire.
double fProfileIntegralForward
double sum_charge
Sum charge of hits in ADC.
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
cluster::cluster_params fParams
Weight_t Sum() const
Returns the weighted sum of the values.
bool fFinishedGetEndCharges
void GetEndCharges(util::GeometryUtilities const &gser, bool override_=false)
void TrackShowerSeparation(bool override=false)
std::vector< double > fTimeRecord_ProcTime
util::PxPoint start_point
start point
double angle_2d
Angle of axis in wire/hit view.
double EndCharge(util::GeometryUtilities const &gser, float length=1., unsigned int nbins=10)
Returns the expected charge at the end of the cluster.
std::array< Data_t, NParams > FitParameters_t
type of set of fit parameters
bool fFinishedGetProfileInfo
void GetAverages(bool override=false)
std::vector< double > fChargeProfile
void RefineDirection(bool override=false)
Int_t GetPointOnLine(Double_t slope, Double_t intercept, Double_t wire1, Double_t time1, Double_t &wireout, Double_t &timeout) const
void RefineStartPointAndDirection(util::GeometryUtilities const &gser, bool override=false)
bool fFinishedRefineDirection
std::vector< double > fChargeProfileNew
double sum_ADC
Sum charge of ADC counts of hits, in ADC.
util::PxPoint fRoughEndPoint
util::PxPoint end_point
end point
size_t fMinNHits
Cut value for # hits: below this value clusters are not evaluated.
double mean_charge
Mean (average) charge of hits in ADC.
int SetHits(const std::vector< util::PxHit > &)
bool fFinishedRefineStartPoints
double charge_wgt_x
Mean of hits along x, charge weighted.
double opening_angle_charge_wgt
Same for charge_wgt.
bool fFinishedTrackShowerSep
virtual FitParameters_t FitParameters() const override
Computes and returns all the parameters of the fit result.
void FillParams(util::GeometryUtilities const &gser, bool override_DoGetAverages=false, bool override_DoGetRoughAxis=false, bool override_DoGetProfileInfo=false, bool override_DoRefineStartPointsAndDirection=false, bool override_DoGetFinalSlope=false, bool override_DoTrackShowerSep=false, bool override_DoEndCharge=false)
bool fFinishedGetAverages
double opening_angle
Width of angular distubtion wrt vertx.
void SelectPolygonHitList(const std::vector< util::PxHit > &hitlist, std::vector< const util::PxHit * > &hitlistlocal) const
Int_t GetPointOnLineWSlopes(Double_t slope, Double_t intercept, Double_t ort_intercept, Double_t &wireout, Double_t &timeout) const
double cluster_angle_2d
Linear best fit to high-charge hits in the cluster.
double rms_x
rms of hits along x (wires)
double rms_y
rms of hits along y, (time)
bool add(Data_t x, Data_t y, Data_t sy=Data_t(1.0))
static double LinearIntegral(double m, double q, double x1, double x2)
Returns the integral of f(x) = mx + q defined in [x1, x2].
double closing_angle
Width of angular distubtion wrt endpoint.
double StartCharge(util::GeometryUtilities const &gser, float length=1., unsigned int nbins=10)
Returns the expected charge at the beginning of the cluster.
BEGIN_PROLOG could also be cout
void SelectLocalHitlist(const std::vector< util::PxHit > &hitlist, std::vector< const util::PxHit * > &hitlistlocal, util::PxPoint &startHit, Double_t &linearlimit, Double_t &ortlimit, Double_t &lineslopetest) const
std::vector< double > fChargeCutoffThreshold
float MultipleHitWires()
Returns the number of multiple hits per wire.
void add(Data_t value, Weight_t weight=Weight_t(1.0))
Adds one entry with specified value and weight.
void GetFANNVector(std::vector< float > &data)
double end_charge
Charge at the (other) end of the cluster.