6#ifdef BUILD_HISTO_FOR_EACH_STANTION
17#include "L1Algo/CbmL1Def.h"
70 cout <<
x <<
" " <<
y <<
" " <<
tx <<
" " <<
ty <<
" " <<
qp << endl;
75 "x",
"y",
"tx",
"ty",
"qp"
89 void Build(
bool draw = 1);
93 void makeUpHisto(TH1* hist, TString title,
float& sigma);
96 vector<TL1TrackParameters> fGPulls;
97 vector<TL1TrackParameters> fStaPulls[
NStations];
100 vector<TL1TrackParameters> fGRes;
103 static const float TailCut = 5000.;
104 static const float csCut = 5.;
105 static const int textFont = 22;
116 static bool first_call = 1;
125 TString name =
"pull_";
127 histoPull[
i] =
new TH1F(name, name, 50, -10, 10);
130#ifdef BUILD_HISTO_FOR_EACH_STANTION
134 TString name =
"pull_sta";
138 histoPull[
i] =
new TH1F(name, name, 50, -10, 10);
143 TString name =
"residual_";
147 case 0: size = .01;
break;
148 case 1: size = .01;
break;
149 case 2: size = 0.003;
break;
150 case 3: size = 0.003;
break;
151 case 4: size = 0.1;
break;
153 histoRes[
i] =
new TH1F(name, name, 50, -size, size);
157 histoStyle =
new TStyle(
"histoStyle",
"Plain Style(no colors/fill areas)");
159 histoStyle->SetTextFont(textFont);
160 histoStyle->SetPadColor(0);
161 histoStyle->SetCanvasColor(0);
162 histoStyle->SetTitleColor(0);
163 histoStyle->SetStatColor(0);
165 histoStyle->SetOptTitle(0);
166 histoStyle->SetOptStat(1000001010);
182 histoStyle->SetOptFit(10001);
189 histoStyle->SetStatW(0.175);
190 histoStyle->SetStatH(0.02);
191 histoStyle->SetStatX(0.95);
192 histoStyle->SetStatY(0.97);
193 histoStyle->SetStatFontSize(0.05);
195 histoStyle->SetStatFont(textFont);
216 if (T_.
chi2[
i] > csCut * T_.
NDF[
i])
return;
219 if (!( finite(T_.
C00[
i]) && T_.
C00[
i] > 0 ))
return;
220 if (!( finite(T_.
C11[
i]) && T_.
C11[
i] > 0 ))
return;
221 if (!( finite(T_.
C22[
i]) && T_.
C22[
i] > 0 ))
return;
222 if (!( finite(T_.
C33[
i]) && T_.
C33[
i] > 0 ))
return;
223 if (!( finite(T_.
C44[
i]) && T_.
C44[
i] > 0 ))
return;
231 int iMCP = fL1->vHitMCRef[ih];
232 if (iMCP < 0)
return;
238 fGRes.push_back(res);
242 fGPulls.push_back(P);
244#ifdef BUILD_HISTO_FOR_EACH_STANTION
247 fStaPulls[ista].push_back(P);
254 cout <<
"Correct pulls: " << fGPulls.size() << endl;
255 cout <<
"x y tx ty qp" << endl;
256 for (
int i = 0;
i < fGPulls.size();
i++){
266 for (
int i = 0;
i < fGPulls.size();
i++){
269 if (TailCut >
fabs(pull[ih])) histoPull[ih] ->Fill(pull[ih]);
272#ifdef BUILD_HISTO_FOR_EACH_STANTION
274 for (
int iSta = 0; iSta <
NStations; iSta++){
275 vector<TL1TrackParameters>&
Pulls = fStaPulls[iSta];
276 for (
int i = 0;
i <
Pulls.size();
i++){
286 for (
int i = 0;
i < fGRes.size();
i++){
289 if (TailCut >
fabs(res[ih])) histoRes[ih] ->Fill(res[ih]);
298 system(
"mkdir L1_Pulls -p");
300 TCanvas *c2 =
new TCanvas(
"c2",
"c2",0,0,600,400);
304 makeUpHisto(histoPull[ih], histoPull[ih]->GetName(), pulls[ih][0]);
305 pulls[ih][1] = histoPull[ih]->GetRMS();
307 histoPull[ih] ->Draw();
308 TString name = histoPull[ih]->GetName();
314 makeUpHisto(histoRes[ih], histoRes[ih]->GetName(), residuals[ih][0]);
315 residuals[ih][1] = histoRes[ih]->GetRMS();
317 histoRes[ih] ->Draw();
318 TString name = histoRes[ih]->GetName();
326 cout <<
"All entries: " <<
fNAllPulls << endl;
327 cout <<
"Correct entries: " << fGPulls.size() << endl;
328 cout <<
"Pulls sigma & RMS: " << endl;
332 if ( (ista > 0) && (ipar == 0) ) cout <<
"Station " << ista-1 << endl;
335 cout <<
"Residuals sigma & RMS: " << endl;
342inline void L1AlgoPulls::makeUpHisto(TH1* hist, TString title,
float& sigma)
344 if (hist && (hist->GetEntries() != 0)){
345 TF1 *fit =
new TF1(
"fit",
"gaus");
346 fit->SetLineColor(2);
347 fit->SetLineWidth(3);
348 hist->Fit(
"fit",
"",
"",hist->GetXaxis()->GetXmin(),hist->GetXaxis()->GetXmax());
349 sigma = fit->GetParameter(2);
351 hist->GetXaxis()->SetLabelFont(textFont);
352 hist->GetXaxis()->SetTitleFont(textFont);
353 hist->GetYaxis()->SetLabelFont(textFont);
354 hist->GetYaxis()->SetTitleFont(textFont);
356 hist->GetXaxis()->SetTitle(title);
357 hist->GetXaxis()->SetTitleOffset(1);
358 hist->GetYaxis()->SetTitle(
"Entries");
359 hist->GetYaxis()->SetTitleOffset(1.05);
362 std::cout <<
" E: Read hists error! " << std::endl;
const TString L1TrackParametersNames[TL1TrackParameters::NParameters]
void Pulls(int i, int j, int k, double *mc, L1TrackPar &T, fvec qp0, L1FieldRegion &fld)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 fabs(const F32vec4 &a)
static CbmL1 * Instance()
reconstructed tracks
void AddOne(L1TrackPar &T, int i, THitI ih)
TL1TrackParameters(L1TrackPar &T, int i)
TL1TrackParameters(CbmL1MCPoint &T)
TL1TrackParameters operator-(TL1TrackParameters &b)
static const int NParameters
TL1TrackParameters operator/(TL1TrackParameters &b)