9 #include <TFitResult.h>
28 TH3D * hist3D = setClustersInTH3D(track);
34 lin_fit_3D->SetParameters(0, 0, 100, 1, 1, 1);
37 TFitResultPtr fitResult = hist3D->Fit(lin_fit_3D,
"SV");
41 printf(
"\n\nWARNING: Fit failed for Track with trkID: %d and g3PID: %d\n", result.
trkID, result.
g3PID);
44 double chi2Ndf = fitResult->Chi2() / fitResult->Ndf();
45 printf(
"For track.trkID = %d, chi2/NDF = %f\n\n\n", track.
trkID, chi2Ndf);
51 hist3D->Write(Form(
"graph2D_%d_%d_%d_%d", eventID, track.
trkID, track.
g3PID, track.
clusters.size()));
52 lin_fit_3D->Write(Form(
"fit3D_%d_%d_%d_%d", eventID, track.
trkID, track.
g3PID, track.
clusters.size()));
58 result.
fit = fitResult;
Definition: ClusterFitter3D.h:17
Line::FitLine3D fitClustersToLine3D(const AMSTrdMCTrack::Track &track, const int &eventID, TFile *file)
Definition: ClusterFitter3D.h:19
double distanceFromLine3D(double *coords, double *params)
Definition: Line.h:122
Definition: AMSTrdMCTrack.h:49
int trkID
Definition: AMSTrdMCTrack.h:50
std::vector< Cluster > clusters
Definition: AMSTrdMCTrack.h:52
int g3PID
Definition: AMSTrdMCTrack.h:51
int g3PID
Definition: Line.h:52
int trkID
Definition: Line.h:51
TFitResultPtr fit
Definition: Line.h:50