1 #ifndef CLUSTERPARAMSALG_CXX 2 #define CLUSTERPARAMSALG_CXX 18 inline constexpr T
sqr(T
const& v) {
return v*v; }
58 if(!(inhitlist.size())) {
64 for(
auto h : inhitlist)
73 if(
verbose) std::cout <<
" the hitlist is too small. Continuing to run may result in crash!!! " <<std::endl;
126 unsigned int length = 13;
127 if (data.size() != length)
152 std::vector<float> data;
155 std::cout <<
"Printing FANN input vector:\n" 156 <<
" Opening Angle (normalized) ... : " << data[0] <<
"\n" 157 <<
" Opening Angle charge weight .. : " << data[1] <<
"\n" 158 <<
" Closing Angle (normalized) ... : " << data[2] <<
"\n" 159 <<
" Closing Angle charge weight .. : " << data[3] <<
"\n" 160 <<
" Principal Eigenvalue ......... : " << data[4] <<
"\n" 161 <<
" Secondary Eigenvalue ......... : " << data[5] <<
"\n" 162 <<
" Width / Length ............... : " << data[6] <<
"\n" 163 <<
" Hit Density / M.H.D. ......... : " << data[7] <<
"\n" 164 <<
" Percent MultiHit Wires ....... : " << data[8] <<
"\n" 165 <<
" Percent High Charge Hits ..... : " << data[9] <<
"\n" 166 <<
" Modified Hit Density ......... : " << data[10] <<
"\n" 167 <<
" Charge RMS / Mean Charge ...... : " << data[11] <<
"\n" 168 <<
" log(Sum Charge / Length) ...... : " << data[12] <<
"\n";
187 TStopwatch localWatch;
242 template <
typename Stream>
245 stream <<
"ClusterParamsAlg Report: " <<
"\n" 253 <<
"--------------------------------------" <<
"\n";
259 bool override_DoGetRoughAxis ,
260 bool override_DoGetProfileInfo ,
263 bool override_DoStartPointsAndDirection,
264 bool override_DoGetFinalSlope ,
265 bool override_DoTrackShowerSep,
266 bool override_DoEndCharge){
284 TStopwatch localWatch;
287 TPrincipal fPrincipal(2,
"D");
291 std::map<double, int> wireMap;
296 int multi_hit_wires = 0;
303 fPrincipal.AddRow(data);
310 if (wireMap[
hit.w] == 0) {
313 if (wireMap[
hit.w] == 1) {
333 if(fPrincipal.GetMeanValues()->GetNrows()<2) {
351 fPrincipal.MakePrincipals();
376 TStopwatch localWatch;
386 double sumwiretime=0;
387 double sumwirewire=0;
402 sumwiretime+=
hit.w *
hit.t;
403 sumwirewire+=pow(
hit.w,2);
415 if((ncw*sumwirewire-sumwire*sumwire) > 0.00001)
416 fRough2DSlope= (ncw*sumwiretime- sumwire*sumtime)/(ncw*sumwirewire-sumwire*sumwire);
447 TStopwatch localWatch;
450 bool drawOrtHistos =
false;
457 double inv_2d_slope=0;
461 inv_2d_slope=-999999.;
468 double InterHigh=-999999;
469 double InterLow=999999;
470 double WireHigh=-999999;
471 double WireLow=999999;
474 double min_ortdist(999), max_ortdist(-999);
485 double intercept=
hit.t - inv_2d_slope * (double)(
hit.w);
495 if (ortdist < min_ortdist) min_ortdist = ortdist;
496 if (ortdist > max_ortdist) max_ortdist = ortdist;
498 if(inv_2d_slope!=-999999)
500 if(intercept > InterHigh ){
504 if(intercept < InterLow ){
510 if(
hit.w > WireHigh ){
514 if(
hit.w < WireLow ){
538 util::PxPoint HighOnlinePoint, LowOnlinePoint,BeginOnlinePoint, EndOnlinePoint;
540 if(inv_2d_slope!=-999999)
543 InterHigh,HighOnlinePoint);
545 InterLow,LowOnlinePoint);
563 std::cout <<
" Low online point: " << LowOnlinePoint.
w <<
", " << LowOnlinePoint.
t 564 <<
" High: " << HighOnlinePoint.
w <<
", " << HighOnlinePoint.
t << std::endl;
570 if(HighOnlinePoint.
w >= LowOnlinePoint.
w)
572 BeginOnlinePoint=LowOnlinePoint;
574 EndOnlinePoint=HighOnlinePoint;
579 BeginOnlinePoint=HighOnlinePoint;
581 EndOnlinePoint=LowOnlinePoint;
608 std::vector<double> ort_profile;
610 ort_profile.resize(NBINS);
612 std::vector<double> ort_dist_vect;
613 ort_dist_vect.reserve(fHitVector.size());
615 double current_maximum=0;
616 for(
auto&
hit : fHitVector)
628 ort_dist_vect.push_back(ortdist);
632 else if (max_ortdist == min_ortdist)
635 ortbin =(int)(ortdist-min_ortdist)/(max_ortdist-min_ortdist)*(NBINS-1);
637 ort_profile.at(ortbin)+=
hit.charge;
647 double weight= (ortdist<1.) ? 10 * (
hit.charge) : 5 * (
hit.charge) / ortdist;
683 if(
verbose) std::cout <<
"end second loop " << std::endl;
688 for(ix=0;ix<NBINS;ix++)
690 integral+=ort_profile.at(ix);
697 fParams.
width=2*(double)ix/(
double)(NBINS-1)*(
double)(max_ortdist-min_ortdist);
699 if(
verbose) std::cout <<
" after width " << std::endl;
704 new TH1F(
"ortDistHist",
705 "Orthogonal Distance to axis;Distance (cm)",
706 100, min_ortdist, max_ortdist);
707 TH1F * ortDistHistCharge =
708 new TH1F(
"ortDistHistCharge",
709 "Orthogonal Distance to axis (Charge Weighted);Distance (cm)",
710 100, min_ortdist, max_ortdist);
711 TH1F * ortDistHistAndrzej=
712 new TH1F(
"ortDistHistAndrzej",
713 "Orthogonal Distance Andrzej weighting",
714 100, min_ortdist, max_ortdist);
717 ortDistHist ->
Fill(ort_dist_vect.at(index));
718 ortDistHistCharge ->
Fill(ort_dist_vect.at(index), fHitVector.at(index).charge);
719 double weight= (ort_dist_vect.at(index)<1.) ?
720 10 * (fHitVector.at(index).charge) :
721 (5 * (fHitVector.at(index).charge)/ort_dist_vect.at(index));
722 ortDistHistAndrzej ->
Fill(ort_dist_vect.at(index),
weight);
724 ortDistHist ->
Scale(1.0/ortDistHist->Integral());
725 ortDistHistCharge ->
Scale(1.0/ortDistHistCharge->Integral());
726 ortDistHistAndrzej ->
Scale(1.0/ortDistHistAndrzej->Integral());
728 TCanvas * ortCanv =
new TCanvas(
"ortCanv",
"ortCanv", 600, 600);
731 ortDistHistAndrzej ->
Draw(
"");
732 ortDistHistCharge ->
Draw(
"same");
734 ortDistHist ->
Draw(
"same");
736 TLegend *
leg =
new TLegend(.4,.6,.8,.9);
737 leg -> SetHeader(
"Charge distribution");
738 leg ->
AddEntry(ortDistHist,
"Unweighted Hits");
739 leg ->
AddEntry(ortDistHistCharge,
"Charge Weighted Hits");
740 leg ->
AddEntry(ortDistHistAndrzej,
"Charge Weighted by Guessology");
791 && endbin+1<fProfileNbins-1 && endbin+2<fProfileNbins-1
803 if(inv_2d_slope!=-999999)
824 double wire_begin=WireLow+(WireHigh-WireLow)/fProfileNbins*startbin;
831 double wire_end=WireLow+(WireHigh-WireLow)/fProfileNbins*endbin;
871 TStopwatch localWatch;
877 if(!
override)
override =
true;
914 std::vector <const util::PxHit*> subhit;
915 double linearlimit=8;
923 linearlimit,ortlimit,lineslopetest,
927 if(!(subhit.size()) || subhit.size()<3) {
928 if(
verbose) std::cout<<
"Subhit list is empty or too small. Using rough start/end points..."<<std::endl;
944 double avgwire= averageHit.
w;
945 double avgtime= averageHit.
t;
947 std::vector<std::pair<double,double>> vertil;
949 vertil.reserve(subhit.size() * subhit.size());
951 std::vector<double> vs;
954 std::vector<const util::PxHit*> ghits;
955 ghits.reserve(subhit.size());
957 double fardistcurrent=0;
970 std::vector<util::PxHit> returnhits;
971 std::vector<double> radiusofhit;
972 std::vector<int> closehits;
1005 for(
unsigned int a=0; a<subhit.size();a++){
1006 for(
unsigned int b=a+1;b<subhit.size();b++){
1007 if(subhit.at(a)->w != subhit.at(b)->w){
1008 double xtil = ((subhit.at(a)->t - avgtime) - (subhit.at(b)->t - avgtime));
1009 xtil /= ((subhit.at(a)->w - avgwire)-(subhit.at(b)->w - avgwire));
1010 double ytil = (subhit.at(a)->w - avgwire)*xtil -(subhit.at(a)->t - avgtime);
1012 std::pair<double,double> tv(xtil,ytil);
1013 vertil.push_back(tv);
1018 for(
unsigned int z=0;
z<vertil.size();
z++){
1020 for(
unsigned int c=0; c<vertil.size();c++)
1022 vd+= sqrt(pow((vertil.at(
z).first - vertil.at(c).first),2)
1023 + pow((vertil.at(
z).second-vertil.at(c).second),2));
1030 if(
verbose) std::cout<<
"vertil list is empty. all subhits are on the same wire?"<<std::endl;
1046 int minvs= std::min_element(vs.begin(),vs.end())-vs.begin();
1050 double tilwire=vertil.at(minvs).first;
1051 double tiltimet=-vertil.at(minvs).second+d*sqrt(1+pow(tilwire,2));
1052 double tiltimeb=-vertil.at(minvs).second-d*sqrt(1+pow(tilwire,2));
1054 for(
unsigned int a=0; a<subhit.size(); a++){
1055 double dtstrip= (-tilwire * (subhit.at(a)->w - avgwire)
1056 +(subhit.at(a)->t - avgtime)-tiltimet)/sqrt(tilwire*tilwire+1);
1057 double dbstrip= (-tilwire * (subhit.at(a)->w - avgwire)
1058 +(subhit.at(a)->t - avgtime)-tiltimeb)/sqrt(tilwire*tilwire+1);
1060 if((dtstrip<0.0 && dbstrip>0.0)||(dbstrip<0.0 && dtstrip>0.0)){
1061 ghits.push_back(subhit.at(a));
1069 for(
unsigned int g=0; g<ghits.size();g++){
1073 gwiretime+= ghits.at(g)->w * ghits.at(g)->t;
1074 gwire+= ghits.at(g)->w;
1075 gtime+= ghits.at(g)->t;
1076 gwirewire+= ghits.at(g)->w * ghits.at(g)->w;
1079 double fardist= sqrt(pow(ghits.at(g)->w - farhit.
w,2)+pow(ghits.at(g)->t - farhit.
t,2));
1082 if(fardist>fardistcurrent){
1083 fardistcurrent=fardist;
1085 startpoint.
t = ghits.at(g)->t;
1086 startpoint.
w = ghits.at(g)->w;
1087 startpoint.
plane = ghits.at(g)->plane;
1088 startpoint.
charge = ghits.at(g)->charge;
1112 static int count(0);
1141 TStopwatch localWatch;
1151 const int NBINS=720;
1152 std::vector< int > fh_omega_single(NBINS,0);
1156 double current_maximum=0;
1157 double curr_max_bin=-1;
1162 int nbin=(omx+TMath::Pi())*(NBINS-1)/(2*TMath::Pi());
1163 if(nbin >= NBINS) nbin=NBINS-1;
1164 if(nbin < 0) nbin=0;
1165 fh_omega_single[nbin]+=
hit.charge;
1167 if( fh_omega_single[nbin]>current_maximum )
1169 current_maximum= fh_omega_single[nbin];
1183 if(cos(mod_angle*
PI/180.))
1199 bool drawProfileHisto=
false;
1200 if (drawProfileHisto)
1204 double corr_factor=1;
1205 if(cos(mod_angle*
PI/180.))
1209 corr_factor*=(2.45*cos(mod_angle*
PI/180.)+0.2595);
1211 corr_factor*=(1.036*mod_angle*
PI/180.-0.2561);
1235 for(
auto hit : fHitVector){
1259 TH1F * charge_histo =
1262 TH1F * charge_diff =
1269 if(ix>2 && ix < fProfileNbins-3)
1276 charge_diff->SetBinContent(ix,diff);
1280 TCanvas * chCanv =
new TCanvas(
"chCanv",
"chCanv", 600, 600);
1283 charge_histo ->
Draw(
"");
1285 charge_diff ->
Draw(
"same");
1312 if(!
override)
override =
true;
1314 TStopwatch localWatch;
1344 std::cout <<
"Angle: Start point: (" << this_startPoint.
w 1345 <<
", " << this_startPoint.
t <<
")\n";
1346 std::cout <<
"Angle: End point : (" << this_endPoint.
w 1347 <<
", " << this_endPoint.
t <<
")\n";
1349 double endStartDiff_x = (this_endPoint.
w - this_startPoint.
w);
1350 double endStartDiff_y = (this_endPoint.
t - this_startPoint.
t);
1351 double rms_forward = 0;
1352 double rms_backward = 0;
1353 double mean_forward = 0;
1354 double mean_backward = 0;
1356 double hit_counter_forward = 0;
1357 double hit_counter_backward = 0;
1359 if (
verbose && endStartDiff_y == 0 && endStartDiff_x == 0) {
1360 std::cerr <<
"Error: end point and start point are the same!\n";
1367 double percentage = 0.90;
1369 const int NBINS=200;
1373 std::vector<float> opening_angle_bin(NBINS,0.0 ) ;
1374 std::vector<float> closing_angle_bin(NBINS,0.0 ) ;
1375 std::vector<float> opening_angle_highcharge_bin(NBINS,0.0 ) ;
1376 std::vector<float> closing_angle_highcharge_bin(NBINS,0.0 ) ;
1377 std::vector<float> opening_angle_chargeWgt_bin(NBINS,0.0 ) ;
1378 std::vector<float> closing_angle_chargeWgt_bin(NBINS,0.0 ) ;
1391 double hitStartDiff_x = (
hit.w - this_startPoint.
w) ;
1392 double hitStartDiff_y = (
hit.t - this_startPoint.
t) ;
1394 if (hitStartDiff_x == 0 && hitStartDiff_y == 0)
continue;
1396 double cosangle_start = (endStartDiff_x*hitStartDiff_x +
1397 endStartDiff_y*hitStartDiff_y);
1398 cosangle_start /= ( pow(pow(endStartDiff_x,2)+pow(endStartDiff_y,2),0.5)
1399 * pow(pow(hitStartDiff_x,2)+pow(hitStartDiff_y,2),0.5));
1401 if(cosangle_start>0) {
1404 mean_forward += cosangle_start;
1405 rms_forward += pow(cosangle_start,2);
1406 hit_counter_forward++;
1410 double hitEndDiff_x = (
hit.w - this_endPoint.
w);
1411 double hitEndDiff_y = (
hit.t - this_endPoint.
t);
1412 if (hitEndDiff_x == 0 && hitEndDiff_y == 0)
continue;
1414 double cosangle_end = (endStartDiff_x*hitEndDiff_x +
1415 endStartDiff_y*hitEndDiff_y) * (-1.);
1416 cosangle_end /= ( pow(pow(endStartDiff_x,2)+pow(endStartDiff_y,2),0.5)
1417 * pow(pow(hitEndDiff_x,2)+pow(hitEndDiff_y,2),0.5));
1419 if(cosangle_end>0) {
1421 mean_backward += cosangle_end;
1422 rms_backward += pow(cosangle_end,2);
1423 hit_counter_backward++;
1426 int N_bins_OPEN = (NBINS-1) * acos(cosangle_start)/
PI;
1427 int N_bins_CLOSE = (NBINS-1) * acos(cosangle_end)/
PI;
1428 if (N_bins_OPEN < 0) N_bins_OPEN = 0;
1429 if (N_bins_CLOSE < 0) N_bins_CLOSE = 0;
1437 opening_angle_chargeWgt_bin[N_bins_OPEN ]
1439 closing_angle_chargeWgt_bin[N_bins_CLOSE]
1441 opening_angle_bin[N_bins_OPEN] += wgt;
1442 closing_angle_bin[N_bins_CLOSE] += wgt;
1446 opening_angle_highcharge_bin[N_bins_OPEN] += wgt;
1447 closing_angle_highcharge_bin[N_bins_CLOSE] += wgt;
1453 int iBin(0), jBin(0), kBin(0), lBin(0), mBin(0), nBin(0);
1454 double percentage_OPEN(0.0),
1455 percentage_CLOSE(0.0),
1456 percentage_OPEN_HC(0.0),
1457 percentage_CLOSE_HC(0.0),
1458 percentage_OPEN_CHARGEWGT(0.0),
1459 percentage_CLOSE_CHARGEWGT(0.0);
1461 for(iBin = 0; percentage_OPEN<= percentage && iBin < NBINS; iBin++)
1463 percentage_OPEN += opening_angle_bin[iBin];
1466 for(jBin = 0; percentage_CLOSE<= percentage && jBin < NBINS; jBin++)
1468 percentage_CLOSE += closing_angle_bin[jBin];
1471 for(kBin = 0; percentage_OPEN_HC<= percentage_HC && kBin < NBINS; kBin++)
1473 percentage_OPEN_HC += opening_angle_highcharge_bin[kBin];
1476 for(lBin = 0; percentage_CLOSE_HC<= percentage_HC && lBin < NBINS; lBin++)
1478 percentage_CLOSE_HC += closing_angle_highcharge_bin[lBin];
1481 for(mBin = 0; percentage_OPEN_CHARGEWGT<= percentage && mBin < NBINS; mBin++)
1483 percentage_OPEN_CHARGEWGT += opening_angle_chargeWgt_bin[mBin];
1486 for(nBin = 0; percentage_CLOSE_CHARGEWGT<= percentage && nBin < NBINS; nBin++)
1488 percentage_CLOSE_CHARGEWGT += closing_angle_chargeWgt_bin[nBin];
1491 double opening_angle = iBin *
PI /NBINS ;
1492 double closing_angle = jBin *
PI /NBINS ;
1493 double opening_angle_highcharge = kBin *
PI /NBINS ;
1494 double closing_angle_highcharge = lBin *
PI /NBINS ;
1495 double opening_angle_charge_wgt = mBin *
PI /NBINS ;
1496 double closing_angle_charge_wgt = nBin *
PI /NBINS ;
1507 double value_1 = closing_angle/opening_angle -1;
1510 if (value_2 < 100.0 && value_2 > 0.01)
1511 value_2 = log(value_2);
1514 double value_3 = closing_angle_charge_wgt/opening_angle_charge_wgt -1;
1528 if (value_1 > 3 ) value_1 = 3.0;
1529 if (value_1 < -3 ) value_1 = -3.0;
1530 if (value_2 > 3 ) value_2 = 3.0;
1531 if (value_2 < -3 ) value_2 = -3.0;
1532 if (value_3 > 3 ) value_3 = 3.0;
1533 if (value_3 < -3 ) value_3 = -3.0;
1535 double Exp = exp(value_1 + value_2 + value_3);
1536 double sigmoid = (Exp - 1)/(Exp + 1);
1541 if (sigmoid < 0) flip =
true;
1543 if(
verbose) std::cout <<
"Flipping!" << std::endl;
1544 std::swap(opening_angle,closing_angle);
1545 std::swap(opening_angle_highcharge,closing_angle_highcharge);
1546 std::swap(opening_angle_charge_wgt,closing_angle_charge_wgt);
1551 std::cout <<
"Not Flipping!\n";
1571 TStopwatch localWatch;
1575 std::vector<const util::PxHit*> container_polygon;
1578 std::pair<float,float> tmpvertex;
1580 std::vector<std::pair<float,float> > vertices;
1581 for (
unsigned int i=0; i<container_polygon.size(); i++){
1582 tmpvertex = std::make_pair( container_polygon.at(i)->w,
1583 container_polygon.at(i)->t );
1584 vertices.push_back( tmpvertex );
1601 TStopwatch localWatch;
1604 if(
verbose) std::cout <<
" here!!! " << std::endl;
1620 std::cout <<
"REFINING .... " << std::endl;
1621 std::cout <<
" Rough start and end point: " << std::endl;
1629 std::cout <<
" Once Refined start and end point: " << std::endl;
1639 std::cout <<
" Twice Refined start and end point: " << std::endl;
1649 std::cout <<
" Final start and end point: " << std::endl;
1663 if(!
override)
return;
1664 if(
verbose) std::cout <<
" ---- Trying T/S sep. ------ \n";
1666 if(
verbose) std::cout <<
" ---- Doing T/S sep. ------- \n";
1667 std::vector<float> FeatureVector, outputVector;
1674 if(
verbose) std::cout <<
" ---- Failed T/S sep. ------ \n";
1686 TStopwatch localWatch;
1702 (
double m,
double q,
double x1,
double x2)
1704 return m / 2. * (
sqr(x2) -
sqr(x1)) + q * (x2 - x1);
1710 double from_length,
double to_length,
1711 unsigned int fit_first_bin,
unsigned int fit_end_bin
1717 if (fit_first_bin > fit_end_bin) std::swap(fit_first_bin, fit_end_bin);
1720 const unsigned int nbins =
std::min 1721 (fit_end_bin - fit_first_bin, (
unsigned int)
fChargeProfile.size());
1722 if (nbins == 0)
return 0;
1727 fit_first_bin = fit_end_bin - nbins;
1737 for (
unsigned int iBin = fit_first_bin; iBin < fit_end_bin; ++iBin) {
1747 catch (std::range_error) {
1752 std::cerr <<
"IntegrateFitCharge(): linear fit failed!" << std::endl;
1758 const double length_to_bin
1760 const double from_bin = from_length * length_to_bin,
1761 to_bin = to_length * length_to_bin;
1770 (
float length ,
unsigned int nbins )
1779 const unsigned int fit_first_bin = 0, fit_last_bin = nbins;
1787 (
float length ,
unsigned int nbins )
1801 const unsigned int fit_first_bin = MaxBins > nbins? MaxBins - nbins: 0,
1802 fit_last_bin = MaxBins;
double rms_ADC
RMS (standard deviation of sample) of ADC counts of hits in ADC.
util::GeometryUtilities * fGSer
void GetRoughAxis(bool override=false)
double modified_hit_density
std::vector< double > fChargeProfileNew
bool fFinishedGetRoughAxis
static const GeometryUtilities * GetME()
void GetProfileInfo(bool override=false)
double closing_angle_charge_wgt
Same for charge_wgt.
std::vector< std::string > fTimeRecord_ProcName
double charge_wgt_y
Mean of hits along y, charge weighted.
Double_t Get2DDistance(Double_t wire1, Double_t time1, Double_t wire2, Double_t time2) const
void RefineStartPoints(bool override=false)
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.
double EndCharge(float length=1., unsigned int nbins=10)
Returns the expected charge at the end of the cluster.
util::PxPoint fRoughBeginPoint
Float_t x1[n_points_granero]
TNtupleSim Fill(f1, f2, f3, f4)
void GetFinalSlope(bool override=false)
double rms_charge
RMS (standard deviation of sample) of charge of hits in ADC.
double StartCharge(float length=1., unsigned int nbins=10)
Returns the expected charge at the beginning of the cluster.
Polygon2D PolyObject
Polygon Object...see Polygon2D.hh.
ClusterParamsAlg()
Default constructor.
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.
void FillParams(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)
Weight_t RMS() const
Returns the root mean square.
bool fFinishedGetFinalSlope
Classes performing simple fits.
double fProfileIntegralBackward
float MultipleHitDensity()
Returns the number of multiple hits per wire.
Performs a linear regression of data.
Weight_t Average() const
Returns the value average.
bool fFinishedRefineStartPointAndDirection
void Report(Stream &os) const
double eigenvalue_secondary
the secondary eigenvalue from PCA
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 TrackShowerSeparation(bool override=false)
std::vector< double > fTimeRecord_ProcTime
util::PxPoint start_point
start point
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)
double angle_2d
Angle of axis in wire/hit view.
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.
void RefineStartPointAndDirection(bool override=false)
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
bool fFinishedRefineDirection
virtual FitParameters_t FitParameters() const override
Computes and returns all the parameters of the fit result.
leg AddEntry(gr1,"Reference data","lp")
double sum_ADC
Sum charge of ADC counts of hits, in ADC.
util::PxPoint fRoughEndPoint
std::vector< double > fCoarseChargeProfile
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 GetEndCharges(bool override_=false)
bool fFinishedGetAverages
double opening_angle
Width of angular distubtion wrt vertx.
Int_t GetPointOnLineWSlopes(Double_t slope, Double_t intercept, Double_t ort_intercept, Double_t &wireout, Double_t &timeout) const
Float_t x2[n_points_geant4]
void Report(Stream &stream) const
double IntegrateFitCharge(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 cluster_angle_2d
Linear best fit to high-charge hits in the cluster.
double rms_x
rms of hits along x (wires)
simulatedPeak Scale(1/simulationNormalisationFactor)
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].
void SelectPolygonHitList(const std::vector< util::PxHit > &hitlist, std::vector< const util::PxHit * > &hitlistlocal)
double closing_angle
Width of angular distubtion wrt endpoint.
std::vector< double > fChargeProfile
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.