17 #include "TPrincipal.h" 18 #include "TStopwatch.h" 24 #include "cetlib/pow.h" 27 constexpr
double PI{3.14159265};
54 if (!(inhitlist.size())) {
60 for (
auto h : inhitlist)
67 std::cout <<
" the hitlist is too small. Continuing to run may result in crash!!! " 86 unsigned int length = 13;
87 if (data.size() != length) data.resize(length);
106 std::vector<float> data;
109 std::cout <<
"Printing FANN input vector:\n" 110 <<
" Opening Angle (normalized) ... : " << data[0] <<
"\n" 111 <<
" Opening Angle charge weight .. : " << data[1] <<
"\n" 112 <<
" Closing Angle (normalized) ... : " << data[2] <<
"\n" 113 <<
" Closing Angle charge weight .. : " << data[3] <<
"\n" 114 <<
" Principal Eigenvalue ......... : " << data[4] <<
"\n" 115 <<
" Secondary Eigenvalue ......... : " << data[5] <<
"\n" 116 <<
" Width / Length ............... : " << data[6] <<
"\n" 117 <<
" Hit Density / M.H.D. ......... : " << data[7] <<
"\n" 118 <<
" Percent MultiHit Wires ....... : " << data[8] <<
"\n" 119 <<
" Percent High Charge Hits ..... : " << data[9] <<
"\n" 120 <<
" Modified Hit Density ......... : " << data[10] <<
"\n" 121 <<
" Charge RMS / Mean Charge ...... : " << data[11] <<
"\n" 122 <<
" log(Sum Charge / Length) ...... : " << data[12] <<
"\n";
131 TStopwatch localWatch;
178 bool override_DoGetAverages,
179 bool override_DoGetRoughAxis,
180 bool override_DoGetProfileInfo,
181 bool override_DoStartPointsAndDirection,
182 bool override_DoGetFinalSlope,
183 bool override_DoTrackShowerSep,
184 bool override_DoEndCharge)
202 TStopwatch localWatch;
205 TPrincipal fPrincipal(2,
"D");
209 std::map<double, int> wireMap;
214 int multi_hit_wires = 0;
219 fPrincipal.AddRow(data);
225 if (wireMap[
hit.w] == 0) { uniquewires++; }
226 if (wireMap[
hit.w] == 1) { multi_hit_wires++; }
256 fPrincipal.MakePrincipals();
281 TStopwatch localWatch;
291 double sumwiretime = 0;
292 double sumwirewire = 0;
306 sumwiretime +=
hit.w *
hit.t;
307 sumwirewire += pow(
hit.w, 2);
318 if ((ncw * sumwirewire - sumwire * sumwire) > 0.00001)
320 (ncw * sumwirewire - sumwire * sumwire);
349 TStopwatch localWatch;
352 bool drawOrtHistos =
false;
358 double inv_2d_slope = 0;
362 inv_2d_slope = -999999.;
364 double InterHigh = -999999;
365 double InterLow = 999999;
366 double WireHigh = -999999;
367 double WireLow = 999999;
370 double min_ortdist(999), max_ortdist(-999);
378 double intercept =
hit.t - inv_2d_slope * (double)(
hit.w);
386 if (ortdist < min_ortdist) min_ortdist = ortdist;
387 if (ortdist > max_ortdist) max_ortdist = ortdist;
389 if (inv_2d_slope != -999999)
391 if (intercept > InterHigh) { InterHigh = intercept; }
393 if (intercept < InterLow) { InterLow = intercept; }
397 if (
hit.w > WireHigh) { WireHigh =
hit.w; }
398 if (
hit.w < WireLow) { WireLow =
hit.w; }
414 util::PxPoint HighOnlinePoint, LowOnlinePoint, BeginOnlinePoint, EndOnlinePoint;
416 if (inv_2d_slope != -999999)
429 std::cout <<
" Low online point: " << LowOnlinePoint.
w <<
", " << LowOnlinePoint.
t 430 <<
" High: " << HighOnlinePoint.
w <<
", " << HighOnlinePoint.
t << std::endl;
433 if (HighOnlinePoint.
w >= LowOnlinePoint.
w) {
434 BeginOnlinePoint = LowOnlinePoint;
436 EndOnlinePoint = HighOnlinePoint;
440 BeginOnlinePoint = HighOnlinePoint;
442 EndOnlinePoint = LowOnlinePoint;
463 std::vector<double> ort_profile;
464 const int NBINS = 100;
465 ort_profile.resize(NBINS);
467 std::vector<double> ort_dist_vect;
468 ort_dist_vect.reserve(fHitVector.size());
470 double current_maximum = 0;
471 for (
auto&
hit : fHitVector) {
478 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
479 ort_dist_vect.push_back(ortdist);
483 else if (max_ortdist == min_ortdist)
486 ortbin = (int)(ortdist - min_ortdist) / (max_ortdist - min_ortdist) * (NBINS - 1);
488 ort_profile.at(ortbin) +=
hit.charge;
496 double weight = (ortdist < 1.) ? 10 * (
hit.charge) : 5 * (
hit.charge) / ortdist;
508 if (
fChargeProfile.at(fine_bin) > current_maximum && fine_bin != 0 &&
520 if (
verbose) std::cout <<
"end second loop " << std::endl;
524 for (ix = 0; ix < NBINS; ix++) {
525 integral += ort_profile.at(ix);
530 2 * (double)ix / (
double)(NBINS - 1) *
531 (
double)(max_ortdist -
534 if (
verbose) std::cout <<
" after width " << std::endl;
537 TH1F* ortDistHist =
new TH1F(
538 "ortDistHist",
"Orthogonal Distance to axis;Distance (cm)", 100, min_ortdist, max_ortdist);
539 TH1F* ortDistHistCharge =
540 new TH1F(
"ortDistHistCharge",
541 "Orthogonal Distance to axis (Charge Weighted);Distance (cm)",
545 TH1F* ortDistHistAndrzej =
new TH1F(
"ortDistHistAndrzej",
546 "Orthogonal Distance Andrzej weighting",
552 ortDistHist->Fill(ort_dist_vect.at(index));
553 ortDistHistCharge->Fill(ort_dist_vect.at(index), fHitVector.at(index).charge);
554 double weight = (ort_dist_vect.at(index) < 1.) ?
555 10 * (fHitVector.at(index).charge) :
556 (5 * (fHitVector.at(index).charge) / ort_dist_vect.at(index));
557 ortDistHistAndrzej->Fill(ort_dist_vect.at(index),
weight);
559 ortDistHist->Scale(1.0 / ortDistHist->Integral());
560 ortDistHistCharge->Scale(1.0 / ortDistHistCharge->Integral());
561 ortDistHistAndrzej->Scale(1.0 / ortDistHistAndrzej->Integral());
563 TCanvas* ortCanv =
new TCanvas(
"ortCanv",
"ortCanv", 600, 600);
565 ortDistHistAndrzej->SetLineColor(3);
566 ortDistHistAndrzej->Draw(
"");
567 ortDistHistCharge->Draw(
"same");
568 ortDistHist->SetLineColor(2);
569 ortDistHist->Draw(
"same");
571 TLegend*
leg =
new TLegend(.4, .6, .8, .9);
572 leg->SetHeader(
"Charge distribution");
573 leg->AddEntry(ortDistHist,
"Unweighted Hits");
574 leg->AddEntry(ortDistHistCharge,
"Charge Weighted Hits");
575 leg->AddEntry(ortDistHistAndrzej,
"Charge Weighted by Guessology");
599 int startbin, endbin;
616 for (endbin =
fProfileMaximumBin; endbin > 0 && endbin < fProfileNbins - 1; endbin++) {
622 endbin + 1 < fProfileNbins - 1 && endbin + 2 < fProfileNbins - 1 &&
634 if (inv_2d_slope != -999999)
636 double ort_intercept_begin =
641 double ort_intercept_end =
650 double wire_begin = WireLow + (WireHigh - WireLow) / fProfileNbins * startbin;
656 double wire_end = WireLow + (WireHigh - WireLow) / fProfileNbins * endbin;
688 TStopwatch localWatch;
714 std::vector<const util::PxHit*> subhit;
715 double linearlimit = 8;
716 double ortlimit = 12;
723 fHitVector, subhit, startHit, linearlimit, ortlimit, lineslopetest, averageHit);
725 if (!(subhit.size()) || subhit.size() < 3) {
727 std::cout <<
"Subhit list is empty or too small. Using rough start/end points..." 740 double avgwire = averageHit.
w;
741 double avgtime = averageHit.
t;
743 std::vector<std::pair<double, double>> vertil;
745 std::vector<double> vs;
747 std::vector<const util::PxHit*> ghits;
748 ghits.reserve(subhit.size());
749 double fardistcurrent = 0;
758 std::vector<util::PxHit> returnhits;
759 std::vector<double> radiusofhit;
760 std::vector<int> closehits;
763 for (
unsigned int a = 0; a < subhit.size(); a++) {
764 for (
unsigned int b = a + 1; b < subhit.size(); b++) {
765 if (subhit.at(a)->w != subhit.at(b)->w) {
766 double xtil = ((subhit.at(a)->t - avgtime) - (subhit.at(b)->t - avgtime));
767 xtil /= ((subhit.at(a)->w - avgwire) - (subhit.at(b)->w - avgwire));
768 double ytil = (subhit.at(a)->w - avgwire) * xtil - (subhit.at(a)->t - avgtime);
770 std::pair<double, double> tv(xtil, ytil);
771 vertil.push_back(tv);
776 for (
unsigned int z = 0;
z < vertil.size();
z++) {
778 for (
unsigned int c = 0; c < vertil.size(); c++)
779 vd += std::hypot(vertil.at(
z).first - vertil.at(c).first,
780 vertil.at(
z).second - vertil.at(c).second);
788 std::cout <<
"vertil list is empty. all subhits are on the same wire?" << std::endl;
800 int minvs = std::min_element(vs.begin(), vs.end()) - vs.begin();
804 double tilwire = vertil.at(minvs).first;
805 double tiltimet = -vertil.at(minvs).second +
806 d * sqrt(1 + pow(tilwire, 2));
807 double tiltimeb = -vertil.at(minvs).second -
808 d * sqrt(1 + pow(tilwire, 2));
810 for (
unsigned int a = 0; a < subhit.size(); a++) {
812 (-tilwire * (subhit.at(a)->w - avgwire) + (subhit.at(a)->t - avgtime) - tiltimet) /
813 sqrt(tilwire * tilwire + 1);
815 (-tilwire * (subhit.at(a)->w - avgwire) + (subhit.at(a)->t - avgtime) - tiltimeb) /
816 sqrt(tilwire * tilwire + 1);
818 if ((dtstrip < 0.0 && dbstrip > 0.0) || (dbstrip < 0.0 && dtstrip > 0.0)) {
819 ghits.push_back(subhit.at(a));
827 for (
unsigned int g = 0; g < ghits.size(); g++) {
832 double fardist = std::hypot(ghits.at(g)->w - farhit.
w, ghits.at(g)->t - farhit.
t);
835 if (fardist > fardistcurrent) {
836 fardistcurrent = fardist;
838 startpoint.
t = ghits.at(g)->t;
839 startpoint.
w = ghits.at(g)->w;
840 startpoint.
plane = ghits.at(g)->plane;
841 startpoint.
charge = ghits.at(g)->charge;
883 TStopwatch localWatch;
891 const int NBINS = 720;
892 std::vector<int> fh_omega_single(NBINS, 0);
894 double current_maximum = 0;
895 double curr_max_bin = -1;
901 int nbin = (omx + TMath::Pi()) * (NBINS - 1) / (2 * TMath::Pi());
902 if (nbin >= NBINS) nbin = NBINS - 1;
903 if (nbin < 0) nbin = 0;
904 fh_omega_single[nbin] +=
hit.charge;
906 if (fh_omega_single[nbin] > current_maximum) {
907 current_maximum = fh_omega_single[nbin];
913 fParams.
angle_2d = (curr_max_bin / 720 * (2 * TMath::Pi())) - TMath::Pi();
926 if (mod_angle <= 75.)
941 bool drawProfileHisto =
false;
942 if (drawProfileHisto) {
945 double corr_factor = 1;
951 if (mod_angle <= 75.)
952 corr_factor *= (2.45 * cos(mod_angle *
PI / 180.) + 0.2595);
954 corr_factor *= (1.036 * mod_angle *
PI / 180. - 0.2561);
973 for (
auto hit : fHitVector) {
979 double linedist = gser.
Get2DDistance(&OnlinePoint, &BeginOnlinePoint);
995 if (ix > 2 && ix < fProfileNbins - 3) {
1000 charge_diff->SetBinContent(ix, diff);
1004 TCanvas* chCanv =
new TCanvas(
"chCanv",
"chCanv", 600, 600);
1006 charge_histo->SetLineColor(3);
1007 charge_histo->Draw(
"");
1008 charge_diff->SetLineColor(2);
1009 charge_diff->Draw(
"same");
1033 if (!
override)
override =
true;
1035 TStopwatch localWatch;
1065 std::cout <<
"Angle: Start point: (" << this_startPoint.
w <<
", " << this_startPoint.
t 1067 std::cout <<
"Angle: End point : (" << this_endPoint.
w <<
", " << this_endPoint.
t <<
")\n";
1069 double endStartDiff_x = (this_endPoint.
w - this_startPoint.
w);
1070 double endStartDiff_y = (this_endPoint.
t - this_startPoint.
t);
1071 double hit_counter_forward = 0;
1072 double hit_counter_backward = 0;
1074 if (
verbose && endStartDiff_y == 0 && endStartDiff_x == 0) {
1075 std::cerr <<
"Error: end point and start point are the same!\n";
1082 double percentage = 0.90;
1084 const int NBINS = 200;
1088 std::vector<float> opening_angle_bin(NBINS, 0.0);
1089 std::vector<float> closing_angle_bin(NBINS, 0.0);
1090 std::vector<float> opening_angle_highcharge_bin(NBINS, 0.0);
1091 std::vector<float> closing_angle_highcharge_bin(NBINS, 0.0);
1092 std::vector<float> opening_angle_chargeWgt_bin(NBINS, 0.0);
1093 std::vector<float> closing_angle_chargeWgt_bin(NBINS, 0.0);
1106 double hitStartDiff_x = (
hit.w - this_startPoint.
w);
1107 double hitStartDiff_y = (
hit.t - this_startPoint.
t);
1109 if (hitStartDiff_x == 0 && hitStartDiff_y == 0)
continue;
1111 double cosangle_start = (endStartDiff_x * hitStartDiff_x + endStartDiff_y * hitStartDiff_y);
1112 cosangle_start /= (pow(pow(endStartDiff_x, 2) + pow(endStartDiff_y, 2), 0.5) *
1113 pow(pow(hitStartDiff_x, 2) + pow(hitStartDiff_y, 2), 0.5));
1115 if (cosangle_start > 0) {
1118 hit_counter_forward++;
1122 double hitEndDiff_x = (
hit.w - this_endPoint.
w);
1123 double hitEndDiff_y = (
hit.t - this_endPoint.
t);
1124 if (hitEndDiff_x == 0 && hitEndDiff_y == 0)
continue;
1126 double cosangle_end = (endStartDiff_x * hitEndDiff_x + endStartDiff_y * hitEndDiff_y) * (-1.);
1127 cosangle_end /= (pow(pow(endStartDiff_x, 2) + pow(endStartDiff_y, 2), 0.5) *
1128 pow(pow(hitEndDiff_x, 2) + pow(hitEndDiff_y, 2), 0.5));
1130 if (cosangle_end > 0) {
1132 hit_counter_backward++;
1135 int N_bins_OPEN = (NBINS - 1) * acos(cosangle_start) /
PI;
1136 int N_bins_CLOSE = (NBINS - 1) * acos(cosangle_end) /
PI;
1137 if (N_bins_OPEN < 0) N_bins_OPEN = 0;
1138 if (N_bins_CLOSE < 0) N_bins_CLOSE = 0;
1142 opening_angle_bin[N_bins_OPEN] += wgt;
1143 closing_angle_bin[N_bins_CLOSE] += wgt;
1147 opening_angle_highcharge_bin[N_bins_OPEN] += wgt;
1148 closing_angle_highcharge_bin[N_bins_CLOSE] += wgt;
1153 int iBin(0), jBin(0), kBin(0), lBin(0), mBin(0), nBin(0);
1154 double percentage_OPEN(0.0), percentage_CLOSE(0.0), percentage_OPEN_HC(0.0),
1155 percentage_CLOSE_HC(0.0),
1156 percentage_OPEN_CHARGEWGT(0.0), percentage_CLOSE_CHARGEWGT(0.0);
1158 for (iBin = 0; percentage_OPEN <= percentage && iBin < NBINS; iBin++) {
1159 percentage_OPEN += opening_angle_bin[iBin];
1162 for (jBin = 0; percentage_CLOSE <= percentage && jBin < NBINS; jBin++) {
1163 percentage_CLOSE += closing_angle_bin[jBin];
1166 for (kBin = 0; percentage_OPEN_HC <= percentage_HC && kBin < NBINS; kBin++) {
1167 percentage_OPEN_HC += opening_angle_highcharge_bin[kBin];
1170 for (lBin = 0; percentage_CLOSE_HC <= percentage_HC && lBin < NBINS; lBin++) {
1171 percentage_CLOSE_HC += closing_angle_highcharge_bin[lBin];
1174 for (mBin = 0; percentage_OPEN_CHARGEWGT <= percentage && mBin < NBINS; mBin++) {
1175 percentage_OPEN_CHARGEWGT += opening_angle_chargeWgt_bin[mBin];
1178 for (nBin = 0; percentage_CLOSE_CHARGEWGT <= percentage && nBin < NBINS; nBin++) {
1179 percentage_CLOSE_CHARGEWGT += closing_angle_chargeWgt_bin[nBin];
1182 double opening_angle = iBin *
PI / NBINS;
1183 double closing_angle = jBin *
PI / NBINS;
1184 double opening_angle_highcharge = kBin *
PI / NBINS;
1185 double closing_angle_highcharge = lBin *
PI / NBINS;
1186 double opening_angle_charge_wgt = mBin *
PI / NBINS;
1187 double closing_angle_charge_wgt = nBin *
PI / NBINS;
1189 double value_1 = closing_angle / opening_angle - 1;
1191 if (value_2 < 100.0 && value_2 > 0.01)
1192 value_2 = log(value_2);
1195 double value_3 = closing_angle_charge_wgt / opening_angle_charge_wgt - 1;
1201 if (value_1 > 3) value_1 = 3.0;
1202 if (value_1 < -3) value_1 = -3.0;
1203 if (value_2 > 3) value_2 = 3.0;
1204 if (value_2 < -3) value_2 = -3.0;
1205 if (value_3 > 3) value_3 = 3.0;
1206 if (value_3 < -3) value_3 = -3.0;
1208 double Exp = exp(value_1 + value_2 + value_3);
1209 double sigmoid = (Exp - 1) / (Exp + 1);
1212 if (sigmoid < 0) flip =
true;
1214 if (
verbose) std::cout <<
"Flipping!" << std::endl;
1215 std::swap(opening_angle, closing_angle);
1216 std::swap(opening_angle_highcharge, closing_angle_highcharge);
1217 std::swap(opening_angle_charge_wgt, closing_angle_charge_wgt);
1222 std::cout <<
"Not Flipping!\n";
1238 TStopwatch localWatch;
1242 std::vector<const util::PxHit*> container_polygon;
1245 std::pair<float, float> tmpvertex;
1247 std::vector<std::pair<float, float>> vertices;
1248 for (
unsigned int i = 0; i < container_polygon.size(); i++) {
1249 tmpvertex = std::make_pair(container_polygon.at(i)->w, container_polygon.at(i)->t);
1250 vertices.push_back(tmpvertex);
1268 TStopwatch localWatch;
1271 if (
verbose) std::cout <<
" here!!! " << std::endl;
1288 std::cout <<
"REFINING .... " << std::endl;
1289 std::cout <<
" Rough start and end point: " << std::endl;
1297 std::cout <<
" Once Refined start and end point: " << std::endl;
1307 std::cout <<
" Twice Refined start and end point: " << std::endl;
1317 std::cout <<
" Final start and end point: " << std::endl;
1331 if (!
override)
return;
1332 if (
verbose) std::cout <<
" ---- Trying T/S sep. ------ \n";
1334 if (
verbose) std::cout <<
" ---- Doing T/S sep. ------- \n";
1335 std::vector<float> FeatureVector, outputVector;
1339 if (
verbose) std::cout <<
" ---- Failed T/S sep. ------ \n";
1352 TStopwatch localWatch;
1367 return m / 2. * (cet::square(x2) - cet::square(x1)) + q * (x2 - x1);
1374 unsigned int fit_first_bin,
1375 unsigned int fit_end_bin)
1381 if (fit_first_bin > fit_end_bin) std::swap(fit_first_bin, fit_end_bin);
1384 const unsigned int nbins =
1385 std::min(fit_end_bin - fit_first_bin, (
unsigned int)
fChargeProfile.size());
1386 if (nbins == 0)
return 0;
1391 fit_first_bin = fit_end_bin - nbins;
1401 for (
unsigned int iBin = fit_first_bin; iBin < fit_end_bin; ++iBin) {
1411 catch (std::range_error
const&) {
1416 std::cerr <<
"IntegrateFitCharge(): linear fit failed!" << std::endl;
1423 const double from_bin = from_length * length_to_bin, to_bin = to_length * length_to_bin;
1432 unsigned int nbins )
1442 const unsigned int fit_first_bin = 0, fit_last_bin = nbins;
1450 unsigned int nbins )
1464 const unsigned int fit_first_bin = MaxBins > nbins ? MaxBins - nbins : 0,
1465 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
double Get2DDistance(double wire1, double time1, double wire2, double time2) const
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 mean_x
Mean of hits along x, peaks only.
double start_charge
Charge at the start of the cluster.
util::PxPoint fRoughBeginPoint
Float_t x1[n_points_granero]
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.
int GetPointOnLine(double slope, double intercept, double wire1, double time1, double &wireout, double &timeout) const
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.
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 SelectLocalHitlist(const std::vector< PxHit > &hitlist, std::vector< const PxHit * > &hitlistlocal, PxPoint &startHit, double &linearlimit, double &ortlimit, double &lineslopetest) const
void TrackShowerSeparation(bool override=false)
std::vector< double > fTimeRecord_ProcTime
util::PxPoint start_point
start point
int GetPointOnLineWSlopes(double slope, double intercept, double ort_intercept, double &wireout, double &timeout) const
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)
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.
void SelectPolygonHitList(const std::vector< PxHit > &hitlist, std::vector< const PxHit * > &hitlistlocal) const
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
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.
Float_t x2[n_points_geant4]
double Get2Dangle(double deltawire, double deltatime) 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.
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.