35 #include "TClonesArray.h"
51 #include <boost/assign/list_of.hpp>
52 #include <boost/property_tree/ptree.hpp>
53 #include <boost/property_tree/json_parser.hpp>
56 using boost::assign::list_of;
57 using boost::property_tree::ptree;
62 fRichDetectorType(
"standard"),
70 fRichRingMatches(NULL),
87 fhNofPhotonsPerHit(NULL),
100 fhRadiusVsNofHits(NULL),
101 fhAaxisVsNofHits(NULL),
102 fhBaxisVsNofHits(NULL),
105 fhDiffXcEllipse(NULL),
106 fhDiffYcEllipse(NULL),
107 fhDiffXcCircle(NULL),
108 fhDiffYcCircle(NULL),
122 fhNofHitsCircleFit(NULL),
123 fhNofHitsEllipseFit(NULL),
124 fhNofHitsCircleFitEff(NULL),
125 fhNofHitsEllipseFitEff(NULL),
138 fhNofPointsXYZ(NULL),
177 cout <<
"CbmRichGeoTest::Init"<<endl;
179 if (NULL == ioman) { Fatal(
"CbmRichGeoTest::Init",
"RootManager not instantised!"); }
187 if (NULL == det) cout <<
" -I no RICH Geo Node found !!!!! " << endl;
196 fTheta = TMath::ASin(fdetR(7));
197 fPhi = -1.*TMath::ASin(fdetR(2));
201 if ( NULL ==
fRichHits) { Fatal(
"CbmRichGeoTest::Init",
"No RichHit array!"); }
204 if ( NULL ==
fRichRings) { Fatal(
"CbmRichGeoTest::Init",
"No RichRing array!"); }
207 if ( NULL ==
fRichPoints) { Fatal(
"CbmRichGeoTest::Init",
"No RichPoint array!"); }
210 if ( NULL ==
fMCTracks) { Fatal(
"CbmRichGeoTest::Init",
"No MCTrack array!"); }
213 if ( NULL ==
fRichRingMatches) { Fatal(
"CbmRichGeoTest::Init",
"No RichRingMatch array!"); }
227 cout <<
"CbmRichGeoTest, event No. " <<
fEventNum << endl;
250 fhHitsXY =
new TH2D(
"fhHitsXY",
"fhHitsXY;X [cm];Y [cm];Counter", nBinsX, xMin, xMax, nBinsY, yMin, yMax);
252 fhPointsXY =
new TH2D(
"fhPointsXY",
"fhPointsXY;X [cm];Y [cm];Counter", nBinsX, xMin, xMax, nBinsY, yMin, yMax);
265 for (Int_t i = 0; i < 2; i++){
267 if (i == 0) ss <<
"_hits";
268 if (i == 1) ss <<
"_points";
270 fhNofHits[i] =
new TH1D((
"fhNofHits"+t).c_str(), (
"fhNofHits"+t+
";Nof hits in ring;Yield").c_str(), 300, -.5, 299.5);
273 fhBoverA[i] =
new TH1D((
"fhBoverA"+t).c_str(), (
"fhBoverA"+t+
";B/A;Yield").c_str(), 50, 0, 1);
275 fhXcYcEllipse[i] =
new TH2D((
"fhXcYcEllipse"+t).c_str(), (
"fhXcYcEllipse"+t+
";x [cm];y [cm];Yield").c_str(), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
277 fhBaxisVsMom[i] =
new TH2D((
"fhBaxisVsMom"+t).c_str(), (
"fhBaxisVsMom"+t+
";p [GeV/c];B axis [cm];Yield").c_str(), 100, 0., 10, 200, 0., 10.);
279 fhAaxisVsMom[i] =
new TH2D((
"fhAaxisVsMom"+t).c_str(), (
"fhAaxisVsMom"+t+
";p [GeV/c];A axis [cm];Yield").c_str(), 100, 0., 10, 200, 0., 10.);
281 fhChi2EllipseVsMom[i] =
new TH2D((
"fhChi2EllipseVsMom"+t).c_str(), (
"fhChi2EllipseVsMom"+t+
";p [GeV/c];#Chi^{2};Yield").c_str(), 100, 0., 10., 50, 0., 0.5);
284 fhXcYcCircle[i] =
new TH2D((
"fhXcYcCircle"+t).c_str(), (
"fhXcYcCircle"+t+
";x [cm];y [cm];Yield").c_str(), nBinsX, xMin, xMax, nBinsY, yMin, yMax);
286 fhRadiusVsMom[i] =
new TH2D((
"fhRadiusVsMom"+t).c_str(), (
"fhRadiusVsMom"+t+
";p [GeV/c];Radius [cm];Yield").c_str(), 100, 0., 10, 200, 0., 10.);
288 fhChi2CircleVsMom[i] =
new TH2D((
"fhChi2CircleVsMom"+t).c_str(), (
"fhChi2CircleVsMom"+t+
";p [GeV/c];#Chi^{2};Yield").c_str(), 100, 0., 10., 50, 0., .5);
290 fhDRVsMom[i] =
new TH2D((
"fhDRVsMom"+t).c_str(), (
"fhDRVsMom"+t+
";p [GeV/c];dR [cm];Yield").c_str(), 100, 0, 10, 100, -1., 1.);
294 fhNofPhotonsPerHit =
new TH1D(
"fhNofPhotonsPerHit",
"fhNofPhotonsPerHit;Number of photons per hit;Yield", 10, -0.5, 9.5);
297 fhDiffAaxis =
new TH2D(
"fhDiffAaxis",
"fhDiffAaxis;Nof hits in ring;A_{point}-A_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
299 fhDiffBaxis =
new TH2D(
"fhDiffBaxis",
"fhDiffBaxis;Nof hits in ring;B_{point}-B_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
301 fhDiffXcEllipse =
new TH2D(
"fhDiffXcEllipse",
"fhDiffXcEllipse;Nof hits in ring;Xc_{point}-Xc_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
303 fhDiffYcEllipse =
new TH2D(
"fhDiffYcEllipse",
"fhDiffYcEllipse;Nof hits in ring;Yc_{point}-Yc_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
305 fhDiffXcCircle =
new TH2D(
"fhDiffXcCircle",
"fhDiffXcCircle;Nof hits in ring;Xc_{point}-Xc_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
307 fhDiffYcCircle =
new TH2D(
"fhDiffYcCircle",
"fhDiffYcCircle;Nof hits in ring;Yc_{point}-Yc_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
309 fhDiffRadius =
new TH2D(
"fhDiffRadius",
"fhDiffRadius;Nof hits in ring;Radius_{point}-Radius_{hit} [cm];Yield", 40, 0., 40., 100, -1.5, 1.5);
313 fhRadiusVsNofHits =
new TH2D(
"fhRadiusVsNofHits",
"fhRadiusVsNofHits;Nof hits in ring;Radius [cm];Yield", 40, 0., 40., 100, 0., 10.);
314 fhAaxisVsNofHits =
new TH2D(
"fhAaxisVsNofHits",
"fhAaxisVsNofHits;Nof hits in ring;A axis [cm];Yield", 40, 0., 40., 100, 0., 10.);
315 fhBaxisVsNofHits =
new TH2D(
"fhBaxisVsNofHits",
"fhBaxisVsNofHits;Nof hits in ring;B axis [cm];Yield", 40, 0., 40., 100, 0., 10.);
318 fhDiffXhit =
new TH1D(
"fhDiffXhit",
"fhDiffXhit;Y_{point}-Y_{hit} [cm];Yield", 200, -1., 1.);
320 fhDiffYhit =
new TH1D(
"fhDiffYhit",
"fhDiffYhit;Y_{point}-Y_{hit} [cm];Yield", 200, -1., 1.);
324 fhNofHitsAll =
new TH1D(
"fhNofHitsAll",
"fhNofHitsAll;Nof hits in ring;Yield", 50, 0., 50.);
326 fhNofHitsCircleFit =
new TH1D(
"fhNofHitsCircleFit",
"fhNofHitsCircleFit;Nof hits in ring;Yield", 50, 0., 50.);
328 fhNofHitsEllipseFit =
new TH1D(
"fhNofHitsEllipseFit",
"fhNofHitsEllipseFit;Nof hits in ring;Yield", 50, 0., 50.);
330 fhNofHitsCircleFitEff =
new TH1D(
"fhNofHitsCircleFitEff",
"fhNofHitsCircleFitEff;Nof hits in ring;Efficiency [%]", 50, 0., 50.);
332 fhNofHitsEllipseFitEff =
new TH1D(
"fhNofHitsEllipseFitEff",
"fhNofHitsEllipseFitEff;Nof hits in ring;Efficiency [%]", 50, 0., 50.);
336 fh_mc_mom_el =
new TH1D(
"fh_mc_mom_el",
"fh_mc_mom_el;p [GeV/c];Yield", 24, 0., 12.);
338 fh_mc_pty_el =
new TH2D(
"fh_mc_pty_el",
"fh_mc_pty_el;Rapidity;P_{t} [GeV/c];Yield", 25, 0., 4., 20, 0., 3.);
340 fh_acc_mom_el =
new TH1D(
"fh_acc_mom_el",
"fh_acc_mom_el;p [GeV/c];Yield", 24, 0., 12.);
342 fh_acc_pty_el =
new TH2D(
"fh_acc_pty_el",
"fh_acc_pty_el;Rapidity;P_{t} [GeV/c];Yield",25, 0., 4., 20, 0., 3.);
345 fh_mc_mom_pi =
new TH1D(
"fh_mc_mom_pi",
"fh_mc_mom_pi;p [GeV/c];Yield", 24, 0., 12.);
347 fh_mc_pty_pi =
new TH2D(
"fh_mc_pty_pi",
"fh_mc_pty_pi;Rapidity;P_{t} [GeV/c];Yield", 25, 0., 4., 20, 0., 3.);
349 fh_acc_mom_pi =
new TH1D(
"fh_acc_mom_pi",
"fh_acc_mom_pi;p [GeV/c];Yield", 24, 0., 12.);
351 fh_acc_pty_pi =
new TH2D(
"fh_acc_pty_pi",
"fh_acc_pty_pi;Rapidity;P_{t} [GeV/c];Yield", 25, 0., 4., 20, 0., 3.);
355 fhNofHitsXYZ =
new TH3D(
"fhNofHitsXY",
"fhNofHitsXY;X [cm];Y [cm];Nof hits in ring", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 50, 0., 50);
357 fhNofPointsXYZ =
new TH3D(
"fhNofPointsXYZ",
"fhNofPointsXYZ;X [cm];Y [cm];Nof points in ring", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 50, 100., 300.);
359 fhBoverAXYZ =
new TH3D(
"fhBoverAXYZ",
"fhBoverAXYZ;X [cm];Y [cm];B/A", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 50, 0., 1.);
361 fhBaxisXYZ =
new TH3D(
"fhBaxisXYZ",
"fhBaxisXYZ;X [cm];Y [cm];B axis [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80, 3., 7.);
363 fhAaxisXYZ =
new TH3D(
"fhAaxisXYZ",
"fhAaxisXYZ;X [cm];Y [cm];A axis [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80, 3., 7.);
365 fhRadiusXYZ =
new TH3D(
"fhRadiusXYZ",
"fhRadiusXYZ;X [cm];Y [cm];Radius [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 80, 3., 7.);
367 fhdRXYZ =
new TH3D(
"fhdRXYZ",
"fhdRXYZ;X [cm];Y [cm];dR [cm]", nBinsX, xMin, xMax, nBinsY, yMin, yMax, 100, -1., 1.);
374 TCanvas *
c1 =
CreateCanvas(
"chi2_mean_fit_vs_bfield_scale",
"chi2_mean_fit_vs_bfield_scale", 600, 600);
375 Double_t
x[6]={0.2, 0.5, 0.7, 1., 1.5, 2.0};
376 Double_t y1[6]={0.023, 0.031, 0.034, 0.039, 0.039, 0.045};
377 TGraph* gr1 =
new TGraph(6, x, y1);
378 gr1->GetXaxis()->SetTitle(
"Field scales");
379 gr1->GetYaxis()->SetTitle(
"a_{fit}^{#Chi^{2}.mean}");
380 TF1 *f1 =
new TF1(
"f1",
"[0]*x+[1]", 0., 2.1);
381 f1->SetLineColor(kBlack);
382 gr1->GetXaxis()->SetRangeUser(0.1, 2.1);
384 gr1->SetMarkerColor(4);
385 gr1->SetMarkerSize(2.5);
386 gr1->SetMarkerStyle(21);
388 gr1->GetXaxis()->SetRangeUser(0.1, 2.1);
389 f1->SetLineColor(kBlack);
390 double p0 = f1->GetParameter(0);
391 double p1 = f1->GetParameter(1);
395 TLegend*
leg =
new TLegend(0.15, 0.9, 0.85, 0.99);
396 leg->AddEntry(
new TH2D(), ss.str().c_str(),
"");
397 leg->SetFillColor(kWhite);
398 leg->SetFillStyle(0);
399 leg->SetBorderSize(0);
403 TCanvas *
c2 =
CreateCanvas(
"dr_rms_fit_vs_bfield_scale",
"dr_rms_fit_vs_bfield_scale", 600, 600);
404 Double_t
x2[6]={0.2, 0.5, 0.7, 1., 1.5, 2.0};
405 Double_t y2[6]={0.027, 0.04, 0.05, 0.057, 0.074, 0.08};
406 TGraph* gr2 =
new TGraph(6, x2, y2);
407 gr2->GetXaxis()->SetTitle(
"Field scales");
408 gr2->GetYaxis()->SetTitle(
"a_{fit}^{dR.RMS}");
409 TF1 *
f2 =
new TF1(
"f2",
"[0]*x+[1]", 0., 2.1);
410 f2->SetLineColor(kBlack);
412 gr2->SetMarkerColor(4);
413 gr2->SetMarkerSize(2.5);
414 gr2->SetMarkerStyle(21);
416 gr2->GetXaxis()->SetRange(0., 2.1);
417 f2->SetLineColor(kBlack);
418 double p10 = f2->GetParameter(0);
419 double p11 = f2->GetParameter(1);
422 TLegend* leg2 =
new TLegend(0.15, 0.9, 0.85, 0.99);
423 leg2->AddEntry(
new TH2D(), ss2.str().c_str(),
"");
424 leg2->SetFillColor(kWhite);
425 leg2->SetFillStyle(0);
426 leg2->SetBorderSize(0);
432 for (Int_t i = 0; i <
fMCTracks->GetEntriesFast(); i++){
434 if (!mcTrack)
continue;
438 if (pdg == 11 && motherId == -1){
443 if (pdg == 211 && motherId == -1){
452 Int_t nofRings =
fRichRings->GetEntriesFast();
453 for (Int_t iR = 0; iR < nofRings; iR++){
455 if (NULL == ring)
continue;
457 if (NULL == ringMatch)
continue;
460 if (mcTrackId < 0)
continue;
462 if (!mcTrack)
continue;
466 Double_t pt = mcTrack->
GetPt();
471 if (pdg == 11 && motherId == -1){
475 if (pdg == 211 && motherId == -1){
481 if (pdg != 11 || motherId != -1)
continue;
485 for (
int iPoint = 0; iPoint < nofRichPoints; iPoint++){
487 if (NULL == richPoint)
continue;
489 if (trackId < 0)
continue;
491 if (NULL == mcTrackRich)
continue;
493 if (motherIdRich == mcTrackId){
543 for (
int iH = 0; iH < ringHit.
GetNofHits(); iH++){
546 double dr = r - sqrt((xc - xh)*(xc - xh) + (yc - yh)*(yc - yh));
565 fhBoverA[histIndex]->Fill(axisB/axisA);
592 for (
int iH = 0; iH < ring->
GetNofHits(); iH++){
595 double dr = radius - sqrt((xcCircle - xh)*(xcCircle - xh) + (ycCircle - yh)*(ycCircle - yh));
596 fhDRVsMom[histIndex]->Fill(momentum, dr);
629 Int_t nofHits =
fRichHits->GetEntriesFast();
630 for (Int_t iH = 0; iH < nofHits; iH++){
632 if ( hit == NULL )
continue;
634 if (pointInd < 0)
continue;
636 if ( point == NULL )
continue;
640 TVector3 inPos(point->
GetX(), point->
GetY(), point->
GetZ());
649 for (Int_t iP = 0; iP < nofPoints; iP++){
651 if ( point == NULL )
continue;
652 TVector3 inPos(point->
GetX(), point->
GetY(), point->
GetZ());
666 TCanvas *
c =
CreateCanvas(ss.str().c_str(), ss.str().c_str(), 500, 500);
667 c->SetGrid(
true,
true);
668 TH2D* pad =
new TH2D(
"pad",
";X [cm];Y [cm]", 1, -15., 15., 1, -15., 15);
669 pad->SetStats(
false);
675 for (
int i = 0; i < ringHit->
GetNofHits(); i++){
676 double hitX = ringHit->
GetHit(i).
fX;
677 double hitY = ringHit->
GetHit(i).
fY;
678 if (xmin > hitX) xmin = hitX;
683 double xCur = (xmin +
xmax) / 2.;
687 TEllipse* circle =
new TEllipse(ringHit->
GetCenterX() - xCur,
689 circle->SetFillStyle(0);
690 circle->SetLineWidth(3);
692 TEllipse* center =
new TEllipse(ringHit->
GetCenterX() - xCur, ringHit->
GetCenterY() - yCur, .5);
696 for (
int i = 0; i < ringHit->
GetNofHits(); i++){
697 TEllipse* hitDr =
new TEllipse(ringHit->
GetHit(i).
fX - xCur, ringHit->
GetHit(i).
fY - yCur, .5);
698 hitDr->SetFillColor(kRed);
703 for (
int i = 0; i < ringPoint->
GetNofHits(); i++){
704 TEllipse* pointDr =
new TEllipse(ringPoint->
GetHit(i).
fX - xCur, ringPoint->
GetHit(i).
fY - yCur, 0.15);
705 pointDr->SetFillColor(kBlue);
711 ss2 <<
"(r, n)=(" << setprecision(3) << ringHit->
GetRadius() <<
", " << ringHit->
GetNofHits()<<
")";
712 TLatex* latex =
new TLatex(-8., 8., ss2.str().c_str());
719 TH1D* hist = (TH1D*)
fhNofHits[0]->Clone(
"fhAccVsMinNofHitsHist");
720 hist->GetXaxis()->SetTitle(
"Required min nof hits in ring");
721 hist->GetYaxis()->SetTitle(
"Detector acceptance [%]");
723 for (
int i = hist->GetNbinsX(); i > 1 ; i--){
725 hist->SetBinContent(i, 100. * sum / nofMc);
735 *meanHist = (TH1D*)hist->ProjectionX( (
string(hist->GetName()) +
"_mean").c_str() )->Clone();
736 (*meanHist)->GetYaxis()->SetTitle( (
"Mean and RMS. " +
string(hist->GetYaxis()->GetTitle()) ).c_str());
737 *rmsHist = (TH1D*)hist->ProjectionX((
string(hist->GetName()) +
"_rms").c_str() )->Clone();
738 (*rmsHist)->GetYaxis()->SetTitle( (
"RMS. "+
string(hist->GetYaxis()->GetTitle()) ).c_str());
739 for (Int_t i = 1; i <= hist->GetXaxis()->GetNbins(); i++){
741 ss << string(hist->GetName()) <<
"_py" << i;
742 TH1D* pr = hist->ProjectionY(ss.str().c_str(), i, i);
743 if (*meanHist == NULL || pr == NULL)
continue;
744 (*meanHist)->SetBinContent(i, pr->GetMean());
745 (*meanHist)->SetBinError(i, pr->GetRMS());
746 (*rmsHist)->SetBinContent(i, pr->GetRMS());
752 const string& canvasName)
777 TCanvas *
c1 =
CreateCanvas((canvasName+
"_py").c_str(), (canvasName+
"_py").c_str(), 800, 800);
778 TH1D* py = hist->ProjectionY( (
string(hist->GetName())+
"_py" ).c_str() );
779 py->Scale(1./py->Integral());
780 py->GetYaxis()->SetTitle(
"Yield");
782 string txt1 = lit::NumberToString<Double_t>(py->GetMean(), 2) +
" / " + lit::NumberToString<Double_t>(py->GetRMS(), 2);
784 text.SetTextAlign(21);
785 text.SetTextSize(0.05);
786 text.DrawTextNDC(0.5, 0.92, txt1.c_str());
789 TCanvas *
c2 =
CreateCanvas((canvasName+
"_mean").c_str(), (canvasName+
"_mean").c_str(), 800, 800);
792 TCanvas *
c3 =
CreateCanvas((canvasName+
"_rms").c_str(), (canvasName+
"_rms").c_str(), 800, 800);
800 hist->GetYaxis()->SetTitle(
"Yield");
802 hist->Scale(1./ hist->Integral());
803 hist->GetXaxis()->SetRangeUser(2., 8.);
804 hist->Fit(
"gaus",
"Q");
805 TF1*
func = hist->GetFunction(
"gaus");
806 if (func == NULL)
return;
807 func->SetLineColor(kBlack);
808 double m = func->GetParameter(1);
809 double s = func->GetParameter(2);
810 string txt1 = lit::NumberToString<double>(
m, 2) +
" / " + lit::NumberToString<double>(s, 2);
812 text.SetTextAlign(21);
813 text.SetTextSize(0.06);
814 text.DrawTextNDC(0.5, 0.92, txt1.c_str());
824 const string& canvasName)
826 for (
int i = 1; i < hist->GetNbinsX() - 1;i++){
827 double c0 = hist->GetBinContent(i);
828 double c1 = hist->GetBinContent(i+1);
829 if (c0 > 0 && c0 <= c1){
830 xMinFit = hist->GetBinCenter(i+1);
836 TCanvas *cDrRmsFit =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 600, 600);
837 TF1 *f1 =
new TF1(
"f1",
"[0]/x+[1]", xMinFit, xMaxFit);
838 f1->SetLineColor(kBlack);
841 hist->GetXaxis()->SetRangeUser(xMin, xMax);
842 f1->SetLineColor(kBlack);
844 double p0 = f1->GetParameter(0);
845 double p1 = f1->GetParameter(1);
849 TLegend*
leg =
new TLegend(0.15, 0.9, 0.85, 0.99);
850 leg->AddEntry(
new TH2D(), ss.str().c_str(),
"");
851 leg->SetFillColor(kWhite);
852 leg->SetFillStyle(0);
853 leg->SetBorderSize(0);
861 TCanvas *cHitsXY =
CreateCanvas(
"richgeo_hits_xy",
"richgeo_hits_xy", 800, 800);
864 TCanvas *cPointsXY =
CreateCanvas(
"richgeo_points_xy",
"richgeo_points_xy", 800, 800);
867 for (
int i = 0; i < 2; i++){
869 if (i == 0) ss <<
"richgeo_hits_";
870 if (i == 1) ss <<
"richgeo_points_";
871 TCanvas *cEllipseBoa =
CreateCanvas((ss.str()+
"ellipse_boa").c_str(), (ss.str()+
"ellipse_boa").c_str(), 800, 800);
874 cout << (ss.str()+
"ellipse_boa_mean") <<
fhBoverA[i]->GetMean() << endl;
877 TCanvas *cEllipseXcYc =
CreateCanvas((ss.str()+
"ellipse_xc_yc").c_str(), (ss.str()+
"ellipse_xc_yc").c_str(), 800, 800);
884 TCanvas *cCircle =
CreateCanvas((ss.str()+
"circle").c_str(), (ss.str()+
"circle").c_str(), 800, 400);
885 cCircle->Divide(2,1);
888 cout <<
"Number of hits/points = " <<
fhNofHits[i]->GetMean() << endl;
897 TH1D* meanDr, *rmsDr;
899 FitH1OneOverX(rmsDr, 0.1, 2.9, 0.0, 3.0, ss.str() +
"dr_rms_vs_mom_fit");
901 TH1D* meanChi2, *rmsChi2;
903 FitH1OneOverX(meanChi2, 0.1, 2.9, 0.0, 3.0, ss.str() +
"chi2_circle_mean_vs_mom_fit");
906 TCanvas* cNofPhotons =
CreateCanvas(
"richgeo_nof_photons_per_hit",
"richgeo_nof_photons_per_hit", 800, 800);
910 TCanvas *cDiff2DEllipse =
CreateCanvas(
"richgeo_diff2d_ellipse",
"richgeo_diff2d_ellipse", 800, 800);
911 cDiff2DEllipse->Divide(2,2);
912 cDiff2DEllipse->cd(1);
914 cDiff2DEllipse->cd(2);
916 cDiff2DEllipse->cd(3);
918 cDiff2DEllipse->cd(4);
921 TCanvas *cDiff2DCircle =
CreateCanvas(
"richgeo_diff2d_circle",
"richgeo_diff2d_circle", 1200, 400);
922 cDiff2DCircle->Divide(3,1);
923 cDiff2DCircle->cd(1);
925 cDiff2DCircle->cd(2);
927 cDiff2DCircle->cd(3);
930 TCanvas *cDiff1DEllipse =
CreateCanvas(
"richgeo_diff1d_ellipse",
"richgeo_diff1d_ellipse", 800, 800);
931 cDiff1DEllipse->Divide(2,2);
932 cDiff1DEllipse->cd(1);
935 cDiff1DEllipse->cd(2);
938 cDiff1DEllipse->cd(3);
941 cDiff1DEllipse->cd(4);
945 TCanvas *cDiff1DCircle =
CreateCanvas(
"richgeo_diff1d_circle",
"richgeo_diff1d_circle", 1200, 400);
946 cDiff1DCircle->Divide(3,1);
947 cDiff1DCircle->cd(1);
950 cDiff1DCircle->cd(2);
953 cDiff1DCircle->cd(3);
957 TCanvas *cHits =
CreateCanvas(
"richgeo_hits",
"richgeo_hits", 1200, 600);
964 TCanvas *cFitEff =
CreateCanvas(
"richgeo_fit_eff",
"richgeo_fit_eff", 1200, 400);
965 cFitEff->Divide(3,1);
968 list_of(
"All")(
"Circle fit")(
"Ellipse fit"),
kLinear,
kLog,
true, 0.7, 0.7, 0.99, 0.99);
974 circleFitEffTxt->Draw();
978 ellipseFitEffTxt->Draw();
980 TCanvas *cAccEff =
CreateCanvas(
"richgeo_acc_eff_el",
"richgeo_acc_eff_el", 1200, 800);
981 cAccEff->Divide(3,2);
993 TCanvas *cAccEff_mom =
CreateCanvas(
"richgeo_acc_eff_el_mom",
"richgeo_acc_eff_el_mom", 800, 800);
997 TCanvas *cAccEff_pty =
CreateCanvas(
"richgeo_acc_eff_el_pty",
"richgeo_acc_eff_el_pty", 800, 800);
1001 TCanvas *cAccEffPi =
CreateCanvas(
"richgeo_acc_eff_pi",
"richgeo_acc_eff_pi", 1200, 800);
1002 cAccEffPi->Divide(3,2);
1010 TH2D* pyzPiEff =
DivideH2((TH1D*)
fh_acc_pty_pi->Clone(), (TH1D*)
fh_mc_pty_pi->Clone(),
"pyzPiEff",
"",
"Rapidity",
"P_{t} [GeV/c]",
"Geometrical acceptance [%]");
1012 TCanvas *cAccEffPi_mom =
CreateCanvas(
"richgeo_acc_eff_pi_mom",
"richgeo_acc_eff_pi_mom", 800, 800);
1017 TCanvas *cAccEffPi_pty =
CreateCanvas(
"richgeo_acc_eff_pi_pty",
"richgeo_acc_eff_pi_pty", 800, 800);
1019 pyzPiEff->GetZaxis()->SetRangeUser(0, 100);
1021 TCanvas *cAccEffElPi_mom =
CreateCanvas(
"richgeo_acc_eff_el_pi_mom",
"richgeo_acc_eff_el_pi_mom", 800, 800);
1022 DrawH1(list_of(pxEff)(pxPiEff), list_of(
"e^{#pm}")(
"#pi^{#pm}"),
kLinear,
kLinear,
true, 0.7, 0.5, 0.87, 0.7);
1025 TCanvas *cAccEffZoom =
CreateCanvas(
"richgeo_acc_eff_el_zoom",
"richgeo_acc_eff_el_zoom", 1000, 500);
1026 cAccEffZoom->Divide(2,1);
1030 fh_mc_mom_clone->GetXaxis()->SetRangeUser(0., 3.);
1031 fh_acc_mom_clone->GetXaxis()->SetRangeUser(0., 3.);
1032 fh_mc_mom_clone->SetMinimum(0.);
1033 DrawH1(list_of(fh_mc_mom_clone)(fh_acc_mom_clone), list_of(
"MC")(
"ACC"),
kLinear, kLog,
true, 0.8, 0.8, 0.99, 0.99);
1034 gPad->SetLogy(
false);
1036 TH1D* px_eff_clone = (TH1D*) pxEff->Clone();
1037 px_eff_clone->GetXaxis()->SetRangeUser(0., 3.);
1038 px_eff_clone->SetMinimum(0.);
1048 DrawH3(
fhdRXYZ,
"richgeo_numbers_vs_xy_dr",
"dR [cm]", -.1, .1);
1050 TCanvas *cAccVsMinNofHits =
CreateCanvas(
"richgeo_acc_vs_min_nof_hits",
"richgeo_acc_vs_min_nof_hits", 600, 600);
1052 h->GetXaxis()->SetRangeUser(0., 40.0);
1059 TCanvas* cHitsRAB =
CreateCanvas(
"richgeo_hits_rab",
"richgeo_hits_rab", 1500, 600);
1060 cHitsRAB->Divide(3, 1);
1071 const string& cName,
1072 const string& zAxisTitle,
1077 int nBinsX = h->GetNbinsX();
1078 int nBinsY = h->GetNbinsY();
1079 TH2D* h2Mean = (TH2D*)h->Project3D(
"yx")->Clone();
1080 TH2D* h2Rms = (TH2D*)h->Project3D(
"yx")->Clone();
1083 if (doFit) canvas =
new TCanvas (
"fit_func",
"fit_func");
1085 for (
int x = 1;
x <= nBinsX;
x++){
1086 for (
int y = 1;
y <= nBinsY;
y++){
1088 ss << h->GetName() <<
"_z_" <<
x <<
"_" <<
y;
1089 TH1D*
hz = h->ProjectionZ(ss.str().c_str(),
x,
x,
y,
y);
1093 hz->Fit(
"gaus",
"QO");
1094 TF1*
func = hz->GetFunction(
"gaus");
1096 m = func->GetParameter(1);
1097 s = func->GetParameter(2);
1103 h2Mean->SetBinContent(x, y, m);
1104 h2Rms->SetBinContent(x, y, s);
1108 TCanvas *mean =
CreateCanvas(
string(cName+
"_mean").c_str(),
string(cName+
"_mean").c_str(), 800, 800);
1109 h2Mean->GetZaxis()->SetTitle(
string(
"Mean."+zAxisTitle).c_str());
1110 h2Mean->GetZaxis()->SetRangeUser(zMin, zMax);
1112 TCanvas *rms =
CreateCanvas(
string(cName+
"_rms").c_str(),
string(cName+
"_rms").c_str(), 800, 800);
1113 h2Rms->GetZaxis()->SetTitle(
string(
"RMS."+zAxisTitle).c_str());
1117 TCanvas* cHitsRAB =
CreateCanvas(
string(cName+
"_local_xy").c_str(),
string(cName+
"_local_xy").c_str(), 800, 800);
1118 int x = h->GetXaxis()->FindBin(20);
1119 int y = h->GetYaxis()->FindBin(120);
1120 cout << x <<
" " << y << endl;
1121 TH1D*
hz = h->ProjectionZ((
string(h->GetName())+
"_local_xy").c_str(),
x,
x,
y,
y);
1126 if (canvas != NULL)
delete canvas;
1131 const string&
title,
1132 const vector<string>& fileNames,
1133 const vector<string>& studyNames,
1134 const string& outputDir)
1136 if (outputDir !=
"") gSystem->mkdir(outputDir.c_str(),
true);
1140 cout <<
"Report can be found here: " << outputDir << endl;
1141 report->
Create(fileNames, studyNames, outputDir);
1148 for (Int_t i = 0; i <
fHists.size(); i++){
1161 if (histAcc->GetEntries() == 0) {
return "0.0"; }
1163 Double_t eff = Double_t(histRec->GetEntries()) / Double_t(histAcc->GetEntries());
1176 const string&
title,
1177 const string& axisX,
1178 const string& axisY)
1182 TH1D* h3 =
new TH1D(name.c_str(), string(title +
";"+axisX+
";"+ axisY).c_str(),
1183 h1->GetNbinsX(), h1->GetXaxis()->GetXmin(),h1->GetXaxis()->GetXmax());
1184 h3->Divide(h1, h2, 100., 1.,
"B");
1192 const string&
title,
1193 const string& axisX,
1194 const string& axisY,
1195 const string& axisZ)
1199 TH2D* h3 =
new TH2D(name.c_str(), string(title +
";"+axisX+
";"+ axisY+
";"+axisZ).c_str(),
1200 h1->GetNbinsX(), h1->GetXaxis()->GetXmin(),h1->GetXaxis()->GetXmax(),
1201 h1->GetNbinsY(), h1->GetYaxis()->GetXmin(),h1->GetYaxis()->GetXmax());
1202 h3->Divide(h1, h2, 100., 1.,
"B");
1208 const string&
title,
1212 TCanvas*
c =
new TCanvas(name.c_str(), title.c_str(),
width, height);
1219 for (
int i = 0; i <
fCanvas.size(); i++)