Definition at line 3330 of file TRTCalib_makeplots.cxx.
◆ RresTbin()
| RresTbin::RresTbin |
( |
TFile * |
file, |
|
|
const string & |
detname, |
|
|
int |
det |
|
) |
| |
Definition at line 3345 of file TRTCalib_makeplots.cxx.
3348 TF1
ff(
"fitfunc",
"gaus");
3349 TF1 *ff2 =
new TF1(
"fitfunc2",
"pol3");
3351 TDirectory *trt =
nullptr;
3352 TDirectory *detdir =
nullptr;
3353 TDirectory *binhist =
nullptr;
3356 if (detname.find(
"Ar") != string::npos)
3358 bool allTRT =
false;
3359 if (detname ==
"WholeBarrel_1")
3361 resname =
"reshists5";
3363 else if (detname ==
"Detector_-1")
3365 resname =
"reshists2";
3367 else if (detname ==
"Detector_1")
3369 resname =
"reshists3";
3371 else if (detname ==
"Detector_-2")
3373 resname =
"reshists1";
3375 else if (detname ==
"Detector_2")
3377 resname =
"reshists4";
3381 resname =
"reshists";
3384 else if (detname ==
"WholeBarrel_Ar_1")
3386 resname =
"reshists_Ar5";
3388 else if (detname ==
"Detector_Ar_-1")
3390 resname =
"reshists_Ar2";
3392 else if (detname ==
"Detector_Ar_1")
3394 resname =
"reshists_Ar3";
3396 else if (detname ==
"Detector_Ar_-2")
3398 resname =
"reshists_Ar1";
3400 else if (detname ==
"Detector_Ar_2")
3402 resname =
"reshists_Ar4";
3406 resname =
"reshists_Ar";
3411 trt = (TDirectory *)
file->FindKey(
"TRT_all")->ReadObj();
3413 trt = (TDirectory *)
file->FindKey(
"TRT_Ar_all")->ReadObj();
3416 cout <<
"In RresTbin Xenon" << endl;
3418 cout <<
"In RresTbin Argon" << endl;
3421 cout <<
" found TRT_all directory " << endl;
3422 detdir = (TDirectory *)trt->FindKey(detname.c_str())->ReadObj();
3425 cout <<
" found binhist directory for detector name " << detname << endl;
3428 binhist = (TDirectory *)detdir->FindKey(resname.c_str())->ReadObj();
3432 binhist = (TDirectory *)trt->FindKey(resname.c_str())->ReadObj();
3437 cout <<
" found reshists directory for detector number: " <<
det << endl;
3441 cout <<
" did not find reshists directory for detector number " <<
det << endl;
3446 cout <<
" did not find binhist directory for detector name " << detname << endl;
3451 cout <<
" did not find TRT_all directory " << endl;
3457 TVectorD *tbins = (TVectorD *)
file->FindKey(
"tbins")->ReadObj();
3461 const size_t nElements = tbins->GetNoElements();
3462 cout <<
" found tbins vector with length " << nElements << endl;
3463 m_rdata = std::vector<double>(nElements,0.);
3464 m_erdata = std::vector<double>(nElements,0.);
3465 m_tdata = std::vector<double>(nElements,0.);
3466 m_etdata = std::vector<double>(nElements,0.);
3470 for (
int ihist = 0; ihist < tbins->GetNoElements(); ihist++)
3473 TH1D *reshist =
nullptr;
3476 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_bar", ihist));
3478 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_trt", ihist));
3480 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_%i", ihist,
det));
3482 if (reshist !=
nullptr)
3484 double lolim = -0.1;
3487 if (reshist->Fit(&
ff,
"Q",
"", lolim, hilim) + 1)
3491 m_tdata[ipoint] = (*tbins)[ihist];
3501 cout <<
" succesfully fitted " << ipoint <<
" histograms " << endl;
3502 for (
int ip = 0;
ip < ipoint;
ip++)
3513 cout <<
" draw t-binned residual graph " << endl;
3514 string detstr[8] = {
"endcap A",
"barrel A",
"",
"barrel C",
"endcap C",
"",
"whole barrel",
"whole TRT"};
3517 m_thegraph.SetTitle(Form(
"t-binned absolute residual (%s)", detstr[
det + 2].c_str()));
3519 m_thegraph.GetYaxis()->SetTitle(
"|r|-|r_{track}| /mm");
3520 m_thegraph.GetYaxis()->SetRangeUser(-0.150, 0.150);
3524 printf(
"RPOLDIFF %i %e %e %e %e\n",
det, ff2->GetParameter(0), ff2->GetParameter(1), ff2->GetParameter(2), ff2->GetParameter(3));
◆ m_erdata
| std::vector<double> RresTbin::m_erdata |
|
private |
◆ m_etdata
| std::vector<double> RresTbin::m_etdata |
|
private |
◆ m_rdata
| std::vector<double> RresTbin::m_rdata |
|
private |
◆ m_tdata
| std::vector<double> RresTbin::m_tdata |
|
private |
◆ m_thegraph
| TGraphErrors RresTbin::m_thegraph |
|
private |
◆ reshists
| vector<TH1D *> RresTbin::reshists |
◆ resmap
| map<double, double> RresTbin::resmap |
The documentation for this class was generated from the following file: