16 #include "TPrincipal.h" 17 #include "TStopwatch.h" 18 #include "TVectorDfwd.h" 29 constexpr
double PI{3.14159265};
57 if (!(inhitlist.size())) {
63 for (
auto h : inhitlist)
70 std::cout <<
" the hitlist is too small. Continuing to run may result in crash!!! " 91 unsigned int length = 13;
92 if (data.size() != length) data.resize(length);
112 std::vector<float>
data;
115 std::cout <<
"Printing FANN input vector:\n" 116 <<
" Opening Angle (normalized) ... : " << data[0] <<
"\n" 117 <<
" Opening Angle charge weight .. : " << data[1] <<
"\n" 118 <<
" Closing Angle (normalized) ... : " << data[2] <<
"\n" 119 <<
" Closing Angle charge weight .. : " << data[3] <<
"\n" 120 <<
" Principal Eigenvalue ......... : " << data[4] <<
"\n" 121 <<
" Secondary Eigenvalue ......... : " << data[5] <<
"\n" 122 <<
" Width / Length ............... : " << data[6] <<
"\n" 123 <<
" Hit Density / M.H.D. ......... : " << data[7] <<
"\n" 124 <<
" Percent MultiHit Wires ....... : " << data[8] <<
"\n" 125 <<
" Percent High Charge Hits ..... : " << data[9] <<
"\n" 126 <<
" Modified Hit Density ......... : " << data[10] <<
"\n" 127 <<
" Charge RMS / Mean Charge ...... : " << data[11] <<
"\n" 128 <<
" log(Sum Charge / Length) ...... : " << data[12] <<
"\n";
138 TStopwatch localWatch;
187 bool override_DoGetAverages,
188 bool override_DoGetRoughAxis,
189 bool override_DoGetProfileInfo,
190 bool override_DoStartPointsAndDirection,
191 bool override_DoGetFinalSlope,
192 bool override_DoTrackShowerSep,
193 bool override_DoEndCharge)
212 TStopwatch localWatch;
215 TPrincipal fPrincipal(2,
"D");
219 std::map<double, int> wireMap;
224 int multi_hit_wires = 0;
229 fPrincipal.AddRow(data);
235 if (wireMap[
hit.w] == 0) { uniquewires++; }
236 if (wireMap[
hit.w] == 1) { multi_hit_wires++; }
266 fPrincipal.MakePrincipals();
292 TStopwatch localWatch;
302 double sumwiretime = 0;
303 double sumwirewire = 0;
317 sumwiretime +=
hit.w *
hit.t;
318 sumwirewire +=
pow(
hit.w, 2);
329 if ((ncw * sumwirewire - sumwire * sumwire) > 0.00001)
331 (ncw * sumwirewire - sumwire * sumwire);
361 TStopwatch localWatch;
364 bool drawOrtHistos =
false;
370 double inv_2d_slope = 0;
374 inv_2d_slope = -999999.;
376 double InterHigh = -999999;
377 double InterLow = 999999;
378 double WireHigh = -999999;
379 double WireLow = 999999;
382 double min_ortdist(999), max_ortdist(-999);
390 double intercept =
hit.t - inv_2d_slope * (double)(
hit.w);
398 if (ortdist < min_ortdist) min_ortdist = ortdist;
399 if (ortdist > max_ortdist) max_ortdist = ortdist;
401 if (inv_2d_slope != -999999)
403 if (intercept > InterHigh) { InterHigh = intercept; }
405 if (intercept < InterLow) { InterLow = intercept; }
409 if (
hit.w > WireHigh) { WireHigh =
hit.w; }
410 if (
hit.w < WireLow) { WireLow =
hit.w; }
426 util::PxPoint HighOnlinePoint, LowOnlinePoint, BeginOnlinePoint, EndOnlinePoint;
428 if (inv_2d_slope != -999999)
441 std::cout <<
" Low online point: " << LowOnlinePoint.
w <<
", " << LowOnlinePoint.
t 442 <<
" High: " << HighOnlinePoint.
w <<
", " << HighOnlinePoint.
t <<
std::endl;
445 if (HighOnlinePoint.
w >= LowOnlinePoint.
w) {
446 BeginOnlinePoint = LowOnlinePoint;
448 EndOnlinePoint = HighOnlinePoint;
452 BeginOnlinePoint = HighOnlinePoint;
454 EndOnlinePoint = LowOnlinePoint;
475 std::vector<double> ort_profile;
476 const int NBINS = 100;
477 ort_profile.resize(NBINS);
479 std::vector<double> ort_dist_vect;
480 ort_dist_vect.reserve(fHitVector.size());
482 double current_maximum = 0;
483 for (
auto&
hit : fHitVector) {
490 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
491 ort_dist_vect.push_back(ortdist);
495 else if (max_ortdist == min_ortdist)
498 ortbin = (
int)(ortdist - min_ortdist) / (max_ortdist - min_ortdist) * (NBINS - 1);
500 ort_profile.at(ortbin) +=
hit.charge;
508 double weight = (ortdist < 1.) ? 10 * (
hit.charge) : 5 * (
hit.charge) / ortdist;
520 if (
fChargeProfile.at(fine_bin) > current_maximum && fine_bin != 0 &&
536 for (ix = 0; ix < NBINS; ix++) {
537 integral += ort_profile.at(ix);
542 2 * (double)ix / (
double)(NBINS - 1) *
543 (
double)(max_ortdist -
549 TH1F* ortDistHist =
new TH1F(
550 "ortDistHist",
"Orthogonal Distance to axis;Distance (cm)", 100, min_ortdist, max_ortdist);
551 TH1F* ortDistHistCharge =
552 new TH1F(
"ortDistHistCharge",
553 "Orthogonal Distance to axis (Charge Weighted);Distance (cm)",
557 TH1F* ortDistHistAndrzej =
new TH1F(
"ortDistHistAndrzej",
558 "Orthogonal Distance Andrzej weighting",
564 ortDistHist->Fill(ort_dist_vect.at(
index));
565 ortDistHistCharge->Fill(ort_dist_vect.at(
index), fHitVector.at(
index).charge);
567 10 * (fHitVector.at(
index).charge) :
568 (5 * (fHitVector.at(
index).charge) / ort_dist_vect.at(
index));
569 ortDistHistAndrzej->Fill(ort_dist_vect.at(
index),
weight);
571 ortDistHist->Scale(1.0 / ortDistHist->Integral());
572 ortDistHistCharge->Scale(1.0 / ortDistHistCharge->Integral());
573 ortDistHistAndrzej->Scale(1.0 / ortDistHistAndrzej->Integral());
575 TCanvas* ortCanv =
new TCanvas(
"ortCanv",
"ortCanv", 600, 600);
577 ortDistHistAndrzej->SetLineColor(3);
578 ortDistHistAndrzej->Draw(
"");
579 ortDistHistCharge->Draw(
"same");
580 ortDistHist->SetLineColor(2);
581 ortDistHist->Draw(
"same");
583 TLegend*
leg =
new TLegend(.4, .6, .8, .9);
584 leg->SetHeader(
"Charge distribution");
585 leg->AddEntry(ortDistHist,
"Unweighted Hits");
586 leg->AddEntry(ortDistHistCharge,
"Charge Weighted Hits");
587 leg->AddEntry(ortDistHistAndrzej,
"Charge Weighted by Guessology");
611 int startbin, endbin;
628 for (endbin =
fProfileMaximumBin; endbin > 0 && endbin < fProfileNbins - 1; endbin++) {
634 endbin + 1 < fProfileNbins - 1 && endbin + 2 < fProfileNbins - 1 &&
646 if (inv_2d_slope != -999999)
648 double ort_intercept_begin =
653 double ort_intercept_end =
662 double wire_begin = WireLow + (WireHigh - WireLow) / fProfileNbins * startbin;
668 double wire_end = WireLow + (WireHigh - WireLow) / fProfileNbins * endbin;
701 TStopwatch localWatch;
727 std::vector<const util::PxHit*> subhit;
728 double linearlimit = 8;
729 double ortlimit = 12;
736 fHitVector, subhit, startHit, linearlimit, ortlimit, lineslopetest, averageHit);
738 if (!(subhit.size()) || subhit.size() < 3) {
740 std::cout <<
"Subhit list is empty or too small. Using rough start/end points..." 753 double avgwire = averageHit.
w;
754 double avgtime = averageHit.
t;
756 std::vector<std::pair<double, double>> vertil;
758 std::vector<double> vs;
760 std::vector<const util::PxHit*> ghits;
761 ghits.reserve(subhit.size());
763 double fardistcurrent = 0;
765 double gwiretime = 0;
768 double gwirewire = 0;
776 std::vector<util::PxHit> returnhits;
777 std::vector<double> radiusofhit;
778 std::vector<int> closehits;
781 for (
unsigned int a = 0;
a < subhit.size();
a++) {
782 for (
unsigned int b =
a + 1;
b < subhit.size();
b++) {
783 if (subhit.at(
a)->w != subhit.at(
b)->w) {
784 double xtil = ((subhit.at(
a)->t - avgtime) - (subhit.at(
b)->t - avgtime));
785 xtil /= ((subhit.at(
a)->w - avgwire) - (subhit.at(
b)->w - avgwire));
786 double ytil = (subhit.at(
a)->w - avgwire) * xtil - (subhit.at(
a)->t - avgtime);
788 std::pair<double, double> tv(xtil, ytil);
789 vertil.push_back(tv);
794 for (
unsigned int z = 0;
z < vertil.size();
z++) {
796 for (
unsigned int c = 0;
c < vertil.size();
c++)
797 vd +=
std::hypot(vertil.at(
z).first - vertil.at(
c).first,
798 vertil.at(
z).second - vertil.at(
c).second);
806 std::cout <<
"vertil list is empty. all subhits are on the same wire?" <<
std::endl;
818 int minvs = std::min_element(vs.begin(), vs.end()) - vs.begin();
822 double tilwire = vertil.at(minvs).first;
823 double tiltimet = -vertil.at(minvs).second +
824 d * sqrt(1 +
pow(tilwire, 2));
825 double tiltimeb = -vertil.at(minvs).second -
826 d * sqrt(1 +
pow(tilwire, 2));
828 for (
unsigned int a = 0;
a < subhit.size();
a++) {
830 (-tilwire * (subhit.at(
a)->w - avgwire) + (subhit.at(
a)->t - avgtime) - tiltimet) /
831 sqrt(tilwire * tilwire + 1);
833 (-tilwire * (subhit.at(
a)->w - avgwire) + (subhit.at(
a)->t - avgtime) - tiltimeb) /
834 sqrt(tilwire * tilwire + 1);
836 if ((dtstrip < 0.0 && dbstrip > 0.0) || (dbstrip < 0.0 && dtstrip > 0.0)) {
837 ghits.push_back(subhit.at(
a));
845 for (
unsigned int g = 0;
g < ghits.size();
g++) {
849 gwiretime += ghits.at(
g)->w * ghits.at(
g)->t;
850 gwire += ghits.at(
g)->w;
851 gtime += ghits.at(
g)->t;
852 gwirewire += ghits.at(
g)->w * ghits.at(
g)->w;
855 double fardist =
std::hypot(ghits.at(
g)->w - farhit.
w, ghits.at(
g)->t - farhit.
t);
858 if (fardist > fardistcurrent) {
859 fardistcurrent = fardist;
861 startpoint.
t = ghits.at(
g)->t;
862 startpoint.
w = ghits.at(
g)->w;
863 startpoint.
plane = ghits.at(
g)->plane;
864 startpoint.
charge = ghits.at(
g)->charge;
907 TStopwatch localWatch;
915 const int NBINS = 720;
916 std::vector<int> fh_omega_single(NBINS, 0);
918 double current_maximum = 0;
919 double curr_max_bin = -1;
925 int nbin = (omx + TMath::Pi()) * (NBINS - 1) / (2 * TMath::Pi());
926 if (nbin >= NBINS) nbin = NBINS - 1;
927 if (nbin < 0) nbin = 0;
928 fh_omega_single[nbin] +=
hit.charge;
930 if (fh_omega_single[nbin] > current_maximum) {
931 current_maximum = fh_omega_single[nbin];
936 fParams.
angle_2d = (curr_max_bin / 720 * (2 * TMath::Pi())) - TMath::Pi();
949 if (mod_angle <= 75.)
964 bool drawProfileHisto =
false;
965 if (drawProfileHisto) {
968 double corr_factor = 1;
974 if (mod_angle <= 75.)
975 corr_factor *= (2.45 * cos(mod_angle *
PI / 180.) + 0.2595);
977 corr_factor *= (1.036 * mod_angle *
PI / 180. - 0.2561);
996 for (
auto hit : fHitVector) {
1002 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
1018 if (ix > 2 && ix < fProfileNbins - 3) {
1023 charge_diff->SetBinContent(ix, diff);
1027 TCanvas* chCanv =
new TCanvas(
"chCanv",
"chCanv", 600, 600);
1029 charge_histo->SetLineColor(3);
1030 charge_histo->Draw(
"");
1031 charge_diff->SetLineColor(2);
1032 charge_diff->Draw(
"same");
1057 if (!
override)
override =
true;
1059 TStopwatch localWatch;
1089 std::cout <<
"Angle: Start point: (" << this_startPoint.
w <<
", " << this_startPoint.
t 1091 std::cout <<
"Angle: End point : (" << this_endPoint.
w <<
", " << this_endPoint.
t <<
")\n";
1093 double endStartDiff_x = (this_endPoint.
w - this_startPoint.
w);
1094 double endStartDiff_y = (this_endPoint.
t - this_startPoint.
t);
1095 double rms_forward = 0;
1096 double rms_backward = 0;
1097 double mean_forward = 0;
1098 double mean_backward = 0;
1100 double hit_counter_forward = 0;
1101 double hit_counter_backward = 0;
1103 if (
verbose && endStartDiff_y == 0 && endStartDiff_x == 0) {
1104 std::cerr <<
"Error: end point and start point are the same!\n";
1111 double percentage = 0.90;
1113 const int NBINS = 200;
1117 std::vector<float> opening_angle_bin(NBINS, 0.0);
1118 std::vector<float> closing_angle_bin(NBINS, 0.0);
1119 std::vector<float> opening_angle_highcharge_bin(NBINS, 0.0);
1120 std::vector<float> closing_angle_highcharge_bin(NBINS, 0.0);
1121 std::vector<float> opening_angle_chargeWgt_bin(NBINS, 0.0);
1122 std::vector<float> closing_angle_chargeWgt_bin(NBINS, 0.0);
1135 double hitStartDiff_x = (
hit.w - this_startPoint.
w);
1136 double hitStartDiff_y = (
hit.t - this_startPoint.
t);
1138 if (hitStartDiff_x == 0 && hitStartDiff_y == 0)
continue;
1140 double cosangle_start = (endStartDiff_x * hitStartDiff_x + endStartDiff_y * hitStartDiff_y);
1141 cosangle_start /= (
pow(
pow(endStartDiff_x, 2) +
pow(endStartDiff_y, 2), 0.5) *
1142 pow(
pow(hitStartDiff_x, 2) +
pow(hitStartDiff_y, 2), 0.5));
1144 if (cosangle_start > 0) {
1147 mean_forward += cosangle_start;
1148 rms_forward +=
pow(cosangle_start, 2);
1149 hit_counter_forward++;
1153 double hitEndDiff_x = (
hit.w - this_endPoint.
w);
1154 double hitEndDiff_y = (
hit.t - this_endPoint.
t);
1155 if (hitEndDiff_x == 0 && hitEndDiff_y == 0)
continue;
1157 double cosangle_end = (endStartDiff_x * hitEndDiff_x + endStartDiff_y * hitEndDiff_y) * (-1.);
1158 cosangle_end /= (
pow(
pow(endStartDiff_x, 2) +
pow(endStartDiff_y, 2), 0.5) *
1159 pow(
pow(hitEndDiff_x, 2) +
pow(hitEndDiff_y, 2), 0.5));
1161 if (cosangle_end > 0) {
1163 mean_backward += cosangle_end;
1164 rms_backward +=
pow(cosangle_end, 2);
1165 hit_counter_backward++;
1168 int N_bins_OPEN = (NBINS - 1) * acos(cosangle_start) /
PI;
1169 int N_bins_CLOSE = (NBINS - 1) * acos(cosangle_end) /
PI;
1170 if (N_bins_OPEN < 0) N_bins_OPEN = 0;
1171 if (N_bins_CLOSE < 0) N_bins_CLOSE = 0;
1175 opening_angle_bin[N_bins_OPEN] += wgt;
1176 closing_angle_bin[N_bins_CLOSE] += wgt;
1180 opening_angle_highcharge_bin[N_bins_OPEN] += wgt;
1181 closing_angle_highcharge_bin[N_bins_CLOSE] += wgt;
1186 int iBin(0), jBin(0), kBin(0), lBin(0), mBin(0), nBin(0);
1187 double percentage_OPEN(0.0), percentage_CLOSE(0.0), percentage_OPEN_HC(0.0),
1188 percentage_CLOSE_HC(0.0),
1189 percentage_OPEN_CHARGEWGT(0.0), percentage_CLOSE_CHARGEWGT(0.0);
1191 for (iBin = 0; percentage_OPEN <= percentage && iBin < NBINS; iBin++) {
1192 percentage_OPEN += opening_angle_bin[iBin];
1195 for (jBin = 0; percentage_CLOSE <= percentage && jBin < NBINS; jBin++) {
1196 percentage_CLOSE += closing_angle_bin[jBin];
1199 for (kBin = 0; percentage_OPEN_HC <= percentage_HC && kBin < NBINS; kBin++) {
1200 percentage_OPEN_HC += opening_angle_highcharge_bin[kBin];
1203 for (lBin = 0; percentage_CLOSE_HC <= percentage_HC && lBin < NBINS; lBin++) {
1204 percentage_CLOSE_HC += closing_angle_highcharge_bin[lBin];
1207 for (mBin = 0; percentage_OPEN_CHARGEWGT <= percentage && mBin < NBINS; mBin++) {
1208 percentage_OPEN_CHARGEWGT += opening_angle_chargeWgt_bin[mBin];
1211 for (nBin = 0; percentage_CLOSE_CHARGEWGT <= percentage && nBin < NBINS; nBin++) {
1212 percentage_CLOSE_CHARGEWGT += closing_angle_chargeWgt_bin[nBin];
1215 double opening_angle = iBin *
PI / NBINS;
1216 double closing_angle = jBin *
PI / NBINS;
1217 double opening_angle_highcharge = kBin *
PI / NBINS;
1218 double closing_angle_highcharge = lBin *
PI / NBINS;
1219 double opening_angle_charge_wgt = mBin *
PI / NBINS;
1220 double closing_angle_charge_wgt = nBin *
PI / NBINS;
1222 double value_1 = closing_angle / opening_angle - 1;
1224 if (value_2 < 100.0 && value_2 > 0.01)
1225 value_2 = log(value_2);
1228 double value_3 = closing_angle_charge_wgt / opening_angle_charge_wgt - 1;
1234 if (value_1 > 3) value_1 = 3.0;
1235 if (value_1 < -3) value_1 = -3.0;
1236 if (value_2 > 3) value_2 = 3.0;
1237 if (value_2 < -3) value_2 = -3.0;
1238 if (value_3 > 3) value_3 = 3.0;
1239 if (value_3 < -3) value_3 = -3.0;
1241 double Exp = exp(value_1 + value_2 + value_3);
1242 double sigmoid = (Exp - 1) / (Exp + 1);
1245 if (sigmoid < 0) flip =
true;
1248 std::swap(opening_angle, closing_angle);
1249 std::swap(opening_angle_highcharge, closing_angle_highcharge);
1250 std::swap(opening_angle_charge_wgt, closing_angle_charge_wgt);
1255 std::cout <<
"Not Flipping!\n";
1272 TStopwatch localWatch;
1276 std::vector<const util::PxHit*> container_polygon;
1279 std::pair<float, float> tmpvertex;
1281 std::vector<std::pair<float, float>> vertices;
1282 for (
unsigned int i = 0; i < container_polygon.size(); i++) {
1283 tmpvertex = std::make_pair(container_polygon.at(i)->w, container_polygon.at(i)->t);
1284 vertices.push_back(tmpvertex);
1302 TStopwatch localWatch;
1322 std::cout <<
"REFINING .... " <<
std::endl;
1323 std::cout <<
" Rough start and end point: " <<
std::endl;
1331 std::cout <<
" Once Refined start and end point: " <<
std::endl;
1341 std::cout <<
" Twice Refined start and end point: " <<
std::endl;
1351 std::cout <<
" Final start and end point: " <<
std::endl;
1366 if (!
override)
return;
1367 if (
verbose) std::cout <<
" ---- Trying T/S sep. ------ \n";
1369 if (
verbose) std::cout <<
" ---- Doing T/S sep. ------- \n";
1370 std::vector<float> FeatureVector, outputVector;
1374 if (
verbose) std::cout <<
" ---- Failed T/S sep. ------ \n";
1387 TStopwatch localWatch;
1411 unsigned int fit_first_bin,
1412 unsigned int fit_end_bin)
1418 if (fit_first_bin > fit_end_bin)
std::swap(fit_first_bin, fit_end_bin);
1421 const unsigned int nbins =
1423 if (nbins == 0)
return 0;
1428 fit_first_bin = fit_end_bin -
nbins;
1438 for (
unsigned int iBin = fit_first_bin; iBin < fit_end_bin; ++iBin) {
1448 catch (std::range_error
const&) {
1453 std::cerr <<
"IntegrateFitCharge(): linear fit failed!" <<
std::endl;
1460 const double from_bin = from_length * length_to_bin, to_bin = to_length * length_to_bin;
1470 unsigned int nbins )
1480 const unsigned int fit_first_bin = 0, fit_last_bin =
nbins;
1489 unsigned int nbins )
1503 const unsigned int fit_first_bin = MaxBins > nbins ? MaxBins - nbins : 0,
1504 fit_last_bin = MaxBins;
double rms_ADC
RMS (standard deviation of sample) of ADC counts of hits in ADC.
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.
static constexpr double g
void FillPolygon(util::GeometryUtilities const &gser)
Double_t Get2DDistance(Double_t wire1, Double_t time1, Double_t wire2, Double_t time2) const
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.
Cluster finding and building.
double mean_y
Mean of hits along y, peaks only.
Classes gathering simple statistics.
Weight_t RMS() const
Returns the root mean square.
bool fFinishedGetFinalSlope
Classes performing simple fits.
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
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.
void swap(Handle< T > &a, Handle< T > &b)
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)
Detector simulation of raw signals on wires.
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
virtual FitParameters_t FitParameters() const override
Computes and returns all the parameters of the fit result.
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
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
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
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)
Collects statistics on a single quantity (weighted)
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.
QTextStream & endl(QTextStream &s)
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.