Definition at line 3324 of file TRTCalib_makeplots.cxx.
◆ RresTbin()
RresTbin::RresTbin |
( |
TFile * |
file, |
|
|
const string & |
detname, |
|
|
int |
det |
|
) |
| |
Definition at line 3339 of file TRTCalib_makeplots.cxx.
3342 TF1
ff(
"fitfunc",
"gaus");
3343 TF1 *ff2 =
new TF1(
"fitfunc2",
"pol3");
3345 TDirectory *trt =
nullptr;
3346 TDirectory *detdir =
nullptr;
3347 TDirectory *binhist =
nullptr;
3350 if (detname.find(
"Ar") != string::npos)
3352 bool allTRT =
false;
3353 if (detname ==
"WholeBarrel_1")
3355 resname =
"reshists5";
3357 else if (detname ==
"Detector_-1")
3359 resname =
"reshists2";
3361 else if (detname ==
"Detector_1")
3363 resname =
"reshists3";
3365 else if (detname ==
"Detector_-2")
3367 resname =
"reshists1";
3369 else if (detname ==
"Detector_2")
3371 resname =
"reshists4";
3375 resname =
"reshists";
3378 else if (detname ==
"WholeBarrel_Ar_1")
3380 resname =
"reshists_Ar5";
3382 else if (detname ==
"Detector_Ar_-1")
3384 resname =
"reshists_Ar2";
3386 else if (detname ==
"Detector_Ar_1")
3388 resname =
"reshists_Ar3";
3390 else if (detname ==
"Detector_Ar_-2")
3392 resname =
"reshists_Ar1";
3394 else if (detname ==
"Detector_Ar_2")
3396 resname =
"reshists_Ar4";
3400 resname =
"reshists_Ar";
3405 trt = (TDirectory *)
file->FindKey(
"TRT_all")->ReadObj();
3407 trt = (TDirectory *)
file->FindKey(
"TRT_Ar_all")->ReadObj();
3410 cout <<
"In RresTbin Xenon" << endl;
3412 cout <<
"In RresTbin Argon" << endl;
3415 cout <<
" found TRT_all directory " << endl;
3416 detdir = (TDirectory *)trt->FindKey(detname.c_str())->ReadObj();
3419 cout <<
" found binhist directory for detector name " << detname << endl;
3422 binhist = (TDirectory *)detdir->FindKey(resname.c_str())->ReadObj();
3426 binhist = (TDirectory *)trt->FindKey(resname.c_str())->ReadObj();
3431 cout <<
" found reshists directory for detector number: " <<
det << endl;
3435 cout <<
" did not find reshists directory for detector number " <<
det << endl;
3440 cout <<
" did not find binhist directory for detector name " << detname << endl;
3445 cout <<
" did not find TRT_all directory " << endl;
3451 TVectorD *tbins = (TVectorD *)
file->FindKey(
"tbins")->ReadObj();
3455 const size_t nElements = tbins->GetNoElements();
3456 cout <<
" found tbins vector with length " << nElements << endl;
3457 m_rdata = std::vector<double>(nElements,0.);
3458 m_erdata = std::vector<double>(nElements,0.);
3459 m_tdata = std::vector<double>(nElements,0.);
3460 m_etdata = std::vector<double>(nElements,0.);
3464 for (
int ihist = 0; ihist < tbins->GetNoElements(); ihist++)
3467 TH1D *reshist =
nullptr;
3470 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_bar", ihist));
3472 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_trt", ihist));
3474 reshist = (TH1D *)binhist->Get(Form(
"res_tbin%i_%i", ihist,
det));
3476 if (reshist !=
nullptr)
3478 double lolim = -0.1;
3481 if (reshist->Fit(&
ff,
"Q",
"", lolim, hilim) + 1)
3485 m_tdata[ipoint] = (*tbins)[ihist];
3495 cout <<
" succesfully fitted " << ipoint <<
" histograms " << endl;
3496 for (
int ip = 0;
ip < ipoint;
ip++)
3507 cout <<
" draw t-binned residual graph " << endl;
3508 string detstr[8] = {
"endcap A",
"barrel A",
"",
"barrel C",
"endcap C",
"",
"whole barrel",
"whole TRT"};
3511 m_thegraph.SetTitle(Form(
"t-binned absolute residual (%s)", detstr[
det + 2].c_str()));
3513 m_thegraph.GetYaxis()->SetTitle(
"|r|-|r_{track}| /mm");
3514 m_thegraph.GetYaxis()->SetRangeUser(-0.150, 0.150);
3518 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: