11 #include "FairRootManager.h"
15 #include "TClonesArray.h"
90 , RadiusVsPForClone(0)
93 , RadiusVsDistanceClone(0)
94 , NHitsRecoVsNHitsMC(0)
98 Chi2Ghost =
new TH1F(
"Chi2 for Ghost",
"Chi2 for Ghost", 100, 0.
f, 1.
f);
99 Chi2Ghost->SetXTitle(
"Chi2 Ghost");
100 Chi2Ghost->SetYTitle(
"Enteric");
102 Chi2Ref =
new TH1F(
"Ref Chi2",
"Ref Chi2", 100, 0.
f, 1.
f);
103 Chi2Ref->SetXTitle(
"Chi2 Ref");
104 Chi2Ref->SetYTitle(
"Enteric");
106 Chi2All =
new TH1F(
"Chi2 for reconstructed rings",
107 "Chi2 for reconstructed rings",
111 Chi2All->SetXTitle(
"Chi2 reco rings");
112 Chi2All->SetYTitle(
"Enteric");
114 Chi2Clone =
new TH1F(
"Clone Chi2",
"Clone Chi2", 100, 0.
f, 1.
f);
115 Chi2Clone->SetXTitle(
"Chi2 Clone");
116 Chi2Clone->SetYTitle(
"Enteric");
118 Chi2NhitsGhost =
new TH2F(
119 "Chi2 Ghost vs Nhits",
"Chi2 vs Nhits", 30, 4.5
f, 34.5
f, 100, 0.
f, 1.
f);
120 Chi2NhitsGhost->SetXTitle(
"Ghost Nhits");
121 Chi2NhitsGhost->SetYTitle(
"Ghost Chi2");
123 Chi2NhitsAll =
new TH2F(
124 "Chi2 All vs Nhits",
"Chi2 vs Nhits", 30, 4.5
f, 34.5
f, 100, 0.
f, 1.
f);
125 Chi2NhitsAll->SetXTitle(
"Nhits All");
126 Chi2NhitsAll->SetYTitle(
"Chi2 All");
128 REl =
new TH1F(
"REl",
"REl", 100, 0.
f, 7.
f);
129 RPi =
new TH1F(
"RPi",
"RPi", 100, 0.
f, 7.
f);
130 RGhost =
new TH1F(
"RGhost",
"RGhost", 100, 0.
f, 7.
f);
132 Chi2NhitsPi =
new TH2F(
133 "Chi2 Pi vs Nhits",
"Chi2 Pi vs Nhits", 30, 4.5
f, 34.5
f, 100, 0.
f, 1.
f);
134 Chi2NhitsPi->SetXTitle(
"Nhits Pi");
135 Chi2NhitsPi->SetYTitle(
"Chi2 Pi");
137 Chi2NhitsEll =
new TH2F(
138 "Chi2 Ell vs Nhits",
"Chi2 Ell vs Nhits", 30, 4.5
f, 34.5
f, 100, 0.
f, 1.
f);
139 Chi2NhitsEll->SetXTitle(
"Nhits Ell");
140 Chi2NhitsEll->SetYTitle(
"Chi2 Ell");
142 RNhitsGhost =
new TH2F(
143 "R Ghost vs Nhits",
"R Ghost vs Nhits", 30, 4.5
f, 34.5
f, 100, 2.
f, 8.
f);
144 RNhitsGhost->SetXTitle(
"Nhits Ghost");
145 RNhitsGhost->SetYTitle(
"R Ghost");
148 new TH2F(
"R Pi vs Nhits",
"R Pi vs Nhits", 30, 4.5
f, 34.5
f, 100, 2.
f, 8.
f);
149 RNhitsPi->SetXTitle(
"Nhits Pi");
150 RNhitsPi->SetYTitle(
"R Pi");
152 RNhitsEll =
new TH2F(
153 "R Ell vs Nhits",
"R Ell vs Nhits", 30, 4.5
f, 34.5
f, 100, 2.
f, 8.
f);
154 RNhitsEll->SetXTitle(
"Nhits electrons");
155 RNhitsEll->SetYTitle(
"R electrons");
157 RChi2Ghost =
new TH2F(
158 "R Ghost vs Chi2",
"R Ghost vs Chi2", 100, 0.
f, 1.
f, 100, 2.
f, 8.
f);
159 RChi2Ghost->SetXTitle(
"Chi2 Ghost");
160 RChi2Ghost->SetYTitle(
"R Ghost");
163 new TH2F(
"R Pi vs Chi2",
"R Pi vs Chi2", 100, 0.
f, 1.
f, 100, 2.
f, 8.
f);
164 RChi2Pi->SetXTitle(
"Chi2 Pi");
165 RChi2Pi->SetYTitle(
"R Pi");
168 new TH2F(
"R Ell vs Chi2",
"R Ell vs Chi2", 100, 0.
f, 1.
f, 100, 2.
f, 8.
f);
169 RChi2Ell->SetXTitle(
"Chi2 Electrons");
170 RChi2Ell->SetYTitle(
"R Electrons");
172 NHitsMC =
new TH1F(
"MC Hits %",
"MC Hits %", 100, 0.
f, 1.
f);
173 NHitsMC->SetXTitle(
"MC hits found, %");
174 NHitsMC->SetYTitle(
"Entries");
176 NSameHits =
new TH1F(
"Same Hits",
"Same Hits", 100, 0.
f, 30.
f);
177 NSameHits->SetXTitle(
"N Same Hits");
178 NSameHits->SetYTitle(
"Enteric");
180 NSameHitsVsP =
new TH2F(
181 "MC Hits % vs P(MC)",
"MC Hits % vs P(MC)", 100, 0.
f, 10.
f, 100, 0.
f, 1.
f);
182 NSameHitsVsP->SetXTitle(
"P MC");
183 NSameHitsVsP->SetYTitle(
"MC Hits, %");
185 NHitsVsMCP =
new TH2F(
186 "Same Hits vs P(MC)",
"Same Hits vs P(MC)", 100, 0.
f, 20.
f, 100, 0.
f, 30.
f);
187 NHitsVsMCP->SetXTitle(
"P MC");
188 NHitsVsMCP->SetYTitle(
"Same Hits");
191 new TH2F(
" Radius Vs P ",
" Radius Vs P ", 100, 0.
f, 12.
f, 100, 0.
f, 3.
f);
192 RadiusVsPForClone->SetXTitle(
"P Clone");
193 RadiusVsPForClone->SetYTitle(
"R1-R2");
195 DistanceVsPClone =
new TH2F(
196 " Distance Vs P ",
" Distance Vs P ", 100, 0.
f, 12.
f, 100, 0.
f, 5.
f);
197 DistanceVsPClone->SetXTitle(
"P Clone");
198 DistanceVsPClone->SetYTitle(
"Distance");
201 new TH2F(
" Chi2 Vs P ",
" Chi2 Vs P ", 100, 0.
f, 12.
f, 100, 0.
f, 1.
f);
202 Chi2VsPClone->SetXTitle(
"P Clone");
203 Chi2VsPClone->SetYTitle(
"Chi2");
205 RadiusVsDistanceClone =
new TH2F(
" Radius Vs Distance ",
206 " Radius Vs Distance ",
213 RadiusVsDistanceClone->SetXTitle(
"Distance");
214 RadiusVsDistanceClone->SetYTitle(
"R1-R2");
216 NHitsRecoVsNHitsMC =
new TH2F(
" N Hits Reco Vs N Hits MC ",
217 " N Hits Reco Vs N Hits MC ",
224 NHitsRecoVsNHitsMC->SetXTitle(
"N Hits MC");
225 NHitsRecoVsNHitsMC->SetYTitle(
"N Hits Reco");
236 FairRootManager* ioman = FairRootManager::Instance();
238 cout <<
"-E- CbmL1RichRingQa::Init: "
239 <<
"RootManager not instantised!" << endl;
244 fHitArray = L1_DYNAMIC_CAST<TClonesArray*>(ioman->GetObject(
"RichHit"));
246 cout <<
"-W- CbmL1RichRingQa::Init: No RichHit array!" << endl;
250 fRingArray = L1_DYNAMIC_CAST<TClonesArray*>(ioman->GetObject(
"RichRing"));
252 cout <<
"-E- CbmL1RichRingQa::Init: No RichRing array!" << endl;
257 fMCPointArray = L1_DYNAMIC_CAST<TClonesArray*>(ioman->GetObject(
"RichPoint"));
259 cout <<
"-E- CbmL1RichRingQa::Init: No RichPoint array!" << endl;
264 fMCTrackArray = L1_DYNAMIC_CAST<TClonesArray*>(ioman->GetObject(
"MCTrack"));
266 cout <<
"-E- CbmL1RichRingQa::Init: No MCTrack array!" << endl;
277 Double_t S[8] = {0, 0, 0, 0, 0, 0, 0, 0};
279 for (list<pair<Double_t, Double_t>>::iterator
i = P.begin();
i != P.end();
281 Double_t&
x =
i->first;
282 Double_t&
y =
i->second;
283 Double_t r2 =
x *
x +
y *
y;
294 Double_t s0 = S[6] * S[0] - S[2] * S[5];
295 Double_t s1 = S[0] * S[1] - S[2] * S[2];
296 Double_t s2 = S[0] * S[4] - S[2] * S[3];
298 if (
fabs(s0) < 1.E-6 ||
fabs(s1) < 1.E-6)
return;
299 Double_t tmp = s1 * (S[5] * S[5] - n * S[0]) + s0 * s0;
300 Double_t A = ((S[0] * S[7] - S[3] * S[5]) * s1 - s2 * s0) / tmp;
301 *Y = (s2 + s0 * A) / s1 / 2;
302 *X = (S[3] + S[5] * A - S[2] * (*Y) * 2) / S[0] / 2;
303 Double_t R2 = (*X) * (*X) + (*Y) * (*Y) - A;
311 map<void*, int> pHitIndex;
312 map<Int_t, MCRing> MCRingMap;
314 Int_t NRecoEx = 0, NRecoG = 0, NGostmy = 0, NMC = 0, NMC37 = 0;
316 static Int_t niv = 0;
317 Double_t ArrRingX[
fRingArray->GetEntriesFast()];
318 Double_t ArrRingY[
fRingArray->GetEntriesFast()];
319 Double_t ArrRingR[
fRingArray->GetEntriesFast()];
324 Double_t HitArrX[
fHitArray->GetEntriesFast()];
325 Double_t HitArrY[
fHitArray->GetEntriesFast()];
326 Double_t NoiseHitArrX[
fHitArray->GetEntriesFast()];
327 Double_t NoiseHitArrY[
fHitArray->GetEntriesFast()];
329 Int_t NpiMC = 0, NeMC = 0;
332 std::stringstream out;
337 TCanvas* Up =
new TCanvas(
"Up",
"Up", 0, 0, 240, 180);
338 Up->SetFillColor(kWhite);
342 Up->Range(-110, 110, 110, 180);
343 gPad->DrawFrame(-110, 110, 110, 180);
345 Up->Range(-110, -180, 110, -110);
346 gPad->DrawFrame(-110, -180, 110, -110);
349 for (Int_t hit = 0; hit <
fHitArray->GetEntriesFast(); hit++) {
352 HitArrX[hit] = (phit->
GetX());
353 HitArrY[hit] = -1 * (phit->
GetY());
355 NoiseHitArrX[NfakeHits] = (phit->
GetX());
356 NoiseHitArrY[NfakeHits] = -1 * (phit->
GetY());
374 TArc* AllRingsUp =
new TArc(ArrRingX[
i], ArrRingY[
i], ArrRingR[
i], 0, 360);
375 AllRingsUp->SetLineWidth(1);
376 AllRingsUp->SetLineColor(1);
377 AllRingsUp->SetFillStyle(0);
378 AllRingsUp->Draw(
"*");
388 new TArc(ArrRingX[
i], ArrRingY[
i], ArrRingR[
i], 0, 360);
389 AllRingsDown->SetLineWidth(1);
390 AllRingsDown->SetLineColor(1);
391 AllRingsDown->SetFillStyle(0);
392 AllRingsDown->Draw(
"*");
405 static TH1F *h_MC_radius, *h_MC_nhits, *h_MC_primary_nhits, *h_MC_momentum,
406 *h_MC_primary_momentum, *h_MC_resolution, *h_MC_ref_resolution,
407 *h_MC_extra_resolution, *h_ghost_nhits;
409 static TH2F* h_MC_primary_res_vs_momentum;
411 static TProfile *p_ref_eff_vs_nhits, *p_extra_eff_vs_nhits;
413 static TList* listHisto;
414 static bool first_call_performance = 1;
416 if (first_call_performance) {
417 first_call_performance = 0;
418 TDirectory* curdir = gDirectory;
419 TDirectory* histodir = gROOT->mkdir(
"CbmL1RichRingQaHisto");
422 h_MC_radius =
new TH1F(
"h_MC_radius",
"MC ring radius (cm)", 100, 0.0, 10.);
423 h_MC_nhits =
new TH1F(
"h_MC_nhits",
"Hits per MC ring", 50, 0.0, 50.);
425 new TH1F(
"h_MC_primary_nhits",
"Hits per primary MC ring", 50, 0.0, 50.);
427 new TH1F(
"h_MC_momentum",
"MC track momentum (GeV)", 100, 0.0, 15.);
428 h_MC_primary_momentum =
new TH1F(
"h_MC_primary_momentum",
429 "MC primary track momentum (GeV)",
433 h_MC_resolution =
new TH1F(
434 "h_MC_resolution",
"Hit deviation from MC ring (cm)", 500, -5.0, 5.0);
435 h_MC_ref_resolution =
new TH1F(
"h_MC_ref_resolution",
436 "Hit deviation from REF MC ring (cm)",
440 h_MC_extra_resolution =
new TH1F(
"h_MC_extra_resolution",
441 "Hit deviation from EXTRA MC ring (cm)",
447 new TH1F(
"h_ghost_nhits",
"Hits per ghost ring", 50, 0.0, 50.);
449 h_MC_primary_res_vs_momentum =
450 new TH2F(
"h_MC_primary_res_vs_momentum",
451 "Hit deviation from ptimary MC ring (cm) vs P",
459 p_ref_eff_vs_nhits =
new TProfile(
"p_ref_eff_vs_nhits",
460 "Refset efficiency vs N Hits",
467 p_extra_eff_vs_nhits =
new TProfile(
"p_extra_eff_vs_nhits",
468 "Extraset efficiency vs N Hits",
476 listHisto = gDirectory->GetList();
490 for (Int_t
i = 0;
i < NHits;
i++) {
500 pHitIndex.insert(pair<void*, int>(phit,
i));
501 hit.
x = phit->
GetX();
502 hit.
y = phit->
GetY();
504 if (pointID < 0)
continue;
507 if (!point)
continue;
508 Int_t trackID = point->GetTrackID();
509 if (trackID < 0)
continue;
512 if (!track || track->
GetPdgCode() != 50000050)
523 for (
int ih = 0; ih < NHits; ih++) {
525 if (
ID >= 0 && MCRingMap.find(
ID) == MCRingMap.end()) {
528 MCRingMap.insert(pair<Int_t, MCRing>(
ID, tmp));
530 MCRingMap[
ID].NHits++;
531 MCRingMap[
ID].Hits.push_back(ih);
532 MCRingMap[
ID].NHitsBestReco = 0;
533 MCRingMap[
ID].BestReco = 0;
534 MCRingMap[
ID].NHitsBestvsNHitsMC = 0.;
539 for (map<Int_t, MCRing>::iterator
i = MCRingMap.begin();
i != MCRingMap.end();
544 TH2F* h_e =
new TH2F(
"MC ring radius (cm) vs MC track momentum (GeV)",
552 h_e->SetXTitle(
"MC track momentum (GeV)");
553 h_e->SetYTitle(
"MC ring R1/R2");
555 for (map<Int_t, MCRing>::iterator
i = MCRingMap.begin();
i != MCRingMap.end();
557 vector<Double_t> hitX;
558 vector<Double_t> hitY;
589 list<pair<Double_t, Double_t>> L;
591 for (vector<int>::iterator j = ring.
Hits.begin(); j != ring.
Hits.end();
593 L.push_back(pair<Double_t, Double_t>(Hits[(*j)].
x, Hits[(*j)].
y));
594 hitX.push_back(Hits[(*j)].
x);
595 hitY.push_back(Hits[(*j)].
y);
632 if (ring.
r > 3. && ring.
r < 7. && ring.
NHits >= 7 ) {
642 TArc* MCUp =
new TArc(ring.
x, -ring.
y, ring.
r, 0, 360);
643 MCUp->SetLineWidth(2);
644 if (ring.
PDG == 11 || ring.
PDG == -11) {
645 MCUp->SetLineColor(2);
646 if (ring.
kind != 0) NeMC++;
647 }
else if (ring.
PDG == 211 || ring.
PDG == -211 || ring.
PDG == 111) {
648 MCUp->SetLineColor(28);
649 if (ring.
kind != 0) NpiMC++;
651 MCUp->SetLineColor(5);
652 MCUp->SetFillStyle(0);
654 if (ring.
kind == 0) {
655 MCUp->SetLineStyle(3);
656 MCUp->SetLineWidth(1);
658 MCUp->SetLineStyle(1);
684 TArc* MCDown =
new TArc(ring.
x, -ring.
y, ring.
r, 0, 360);
685 MCDown->SetLineWidth(2);
686 if (ring.
PDG == 11 || ring.
PDG == -11)
687 MCDown->SetLineColor(2);
688 else if (ring.
PDG == 211 || ring.
PDG == -211)
689 MCDown->SetLineColor(28);
691 MCDown->SetLineColor(5);
692 MCDown->SetFillStyle(0);
693 if (ring.
kind == 0) {
694 MCDown->SetLineStyle(3);
695 MCDown->SetLineWidth(1);
697 MCDown->SetLineStyle(1);
700 for (Int_t i1 = 0; i1 <
fRingArray->GetEntriesFast(); i1++) {
702 if (((
sqrt((ArrRingX[i1] - ring.
x) * (ArrRingX[i1] - ring.
x)
703 + (ArrRingY[i1] + ring.
y) * (ArrRingY[i1] + ring.
y))
705 && (
sqrt((ArrRingR[i1] - ring.
r) * (ArrRingR[i1] - ring.
r))
708 || ((
sqrt((ArrRingX[i1] - ring.
x) * (ArrRingX[i1] - ring.
x)
709 + (ArrRingY[i1] + ring.
y) * (ArrRingY[i1] + ring.
y))
711 && (
sqrt((ArrRingR[i1] - ring.
r) * (ArrRingR[i1] - ring.
r))
716 new TArc(ArrRingX[i1], ArrRingY[i1], ArrRingR[i1], 0, 360);
719 if (ring.
r > 3 && ring.
r < 7 && ring.
NHits >= 5) NRecoG++;
720 RecoRingUp->SetLineWidth(1);
721 RecoRingUp->SetLineColor(4);
722 if (ring.
r < 3 || ring.
r > 7 || ring.
NHits < 5)
723 RecoRingUp->SetLineColor(5);
724 RecoRingUp->SetFillStyle(0);
725 RecoRingUp->Draw(
"*");
728 new TArc(ArrRingX[i1], ArrRingY[i1], ArrRingR[i1], 0, 360);
729 RecoRingDown->SetLineWidth(1);
730 RecoRingDown->SetLineColor(4);
731 if (ring.
r < 3 || ring.
r > 7 || ring.
NHits < 5)
732 RecoRingDown->SetLineColor(5);
733 RecoRingDown->SetFillStyle(0);
734 RecoRingDown->Draw(
"*");
737 if (
sqrt((ArrRingX[i1] - ring.
x) * (ArrRingX[i1] - ring.
x)
738 + (ArrRingY[i1] + ring.
y) * (ArrRingY[i1] + ring.
y))
740 &&
sqrt((ArrRingR[i1] - ring.
r) * (ArrRingR[i1] - ring.
r))
744 if (ring.
k == 1) NRecoG--;
745 if (ring.
r > 3 && ring.
r < 7 && ring.
NHits >= 5) NRecoEx++;
746 TArc* GoodRecoRingUp =
747 new TArc(ArrRingX[i1], ArrRingY[i1], ArrRingR[i1], 0, 360);
748 GoodRecoRingUp->SetLineWidth(1);
749 GoodRecoRingUp->SetLineColor(3);
750 if (ring.
r < 3 || ring.
r > 7 || ring.
NHits < 5)
751 GoodRecoRingUp->SetLineColor(5);
752 GoodRecoRingUp->SetFillStyle(0);
754 GoodRecoRingUp->Draw(
"*");
756 TArc* GoodRecoRingDown =
757 new TArc(ArrRingX[i1], ArrRingY[i1], ArrRingR[i1], 0, 360);
758 GoodRecoRingDown->SetLineWidth(1);
759 GoodRecoRingDown->SetLineColor(3);
760 if (ring.
r < 3 || ring.
r > 7 || ring.
NHits < 5)
761 GoodRecoRingDown->SetLineColor(5);
762 GoodRecoRingDown->SetFillStyle(0);
763 GoodRecoRingDown->Draw(
"*");
776 Int_t MCRecoCor[NReco];
778 for (Int_t ir = 0; ir < NReco; ir++) {
780 map<Int_t, Int_t> hitmap;
786 for (
int ih = 0; ih < nh; ih++) {
789 Int_t jh = pHitIndex[
h];
791 if (hitmap.find(
ID) == hitmap.end())
792 hitmap.insert(pair<Int_t, Int_t>(
ID, 0));
796 Int_t CurrentMCTrack;
797 for (map<Int_t, Int_t>::iterator j = hitmap.begin(); j != hitmap.end();
799 if ((
static_cast<Double_t
>(j->second)) < 0.7 * nh)
continue;
800 CurrentMCTrack = j->first;
801 MCRecoCor[ir] = MCRingMap[j->first].MCTrackID;
802 MCRingMap[j->first].Reconstructed++;
803 if ((
static_cast<Int_t
>(j->second)) > MCRingMap[j->first].NHitsBestReco) {
804 MCRingMap[j->first].NHitsBestReco = (
static_cast<Int_t
>(j->second));
805 MCRingMap[j->first].NHitsBestvsNHitsMC =
806 (
static_cast<Double_t
>(j->second)) / MCRingMap[j->first].NHits;
812 h_ghost_nhits->Fill(nh);
822 MCRing& ring_mc = MCRingMap[CurrentMCTrack];
824 if (ring_mc.
PDG == 11 || ring_mc.
PDG == -11) {
825 REl->Fill(ring_mc.
r);
829 }
else if (ring_mc.
PDG == 211 || ring_mc.
PDG == -211
830 || ring_mc.
PDG == 111) {
831 RPi->Fill(ring_mc.
r);
840 for (Int_t i1 = 0; i1 < NReco; i1++) {
844 for (Int_t i2 = 0; i2 < NReco; i2++) {
845 if (MCRecoCor[i1] != MCRecoCor[i2])
continue;
849 for (Int_t j1 = 0; j1 < nh1; j1++) {
850 for (Int_t j2 = 0; j2 < nh2; j2++) {
856 NHitsVsMCP->Fill(MCRingMap[MCRecoCor[i1]].P, NSame);
861 Int_t CloneFlag[NReco];
862 for (Int_t
i = 0;
i < NReco;
i++) {
865 for (Int_t
i = 0;
i < NReco;
i++) {
867 if (MCRecoCor[
i] == -1)
continue;
868 for (Int_t j =
i + 1; j < NReco; j++) {
870 if (MCRecoCor[j] == -1)
continue;
871 if (MCRecoCor[
i] == MCRecoCor[j]) {
872 CloneFlag[
i] = MCRecoCor[
i];
873 CloneFlag[j] = MCRecoCor[j];
886 for (map<Int_t, MCRing>::iterator MC = MCRingMap.begin();
887 MC != MCRingMap.end();
889 MCRing& ring = MC->second;
904 for (Int_t
i = 0;
i < NReco;
i++) {
905 if (CloneFlag[
i] == 0)
continue;
907 for (map<Int_t, MCRing>::iterator MC = MCRingMap.begin();
908 MC != MCRingMap.end();
910 MCRing& ring = MC->second;
911 if (CloneFlag[
i] != 0) {
914 TArc* MCringUp =
new TArc(ring.
x, -ring.
y, ring.
r, 0, 360);
915 MCringUp->SetLineWidth(1);
916 MCringUp->SetLineColor(2);
917 MCringUp->SetFillStyle(0);
920 TArc* MCringDown =
new TArc(ring.
x, -ring.
y, ring.
r, 0, 360);
921 MCringDown->SetLineWidth(1);
922 MCringDown->SetLineColor(2);
923 MCringDown->SetFillStyle(0);
929 CloneUp->SetLineWidth(1);
930 CloneUp->SetLineColor(7);
931 CloneUp->SetFillStyle(0);
936 CloneDown->SetLineWidth(1);
937 CloneDown->SetLineColor(7);
938 CloneDown->SetFillStyle(0);
939 CloneDown->Draw(
"*");
945 Int_t NAll = 0, NRef = 0, NExtra = 0, NAllReco = 0, NRefReco = 0,
946 NExtraReco = 0, NClone = 0;
947 for (map<Int_t, MCRing>::iterator
i = MCRingMap.begin();
i != MCRingMap.end();
954 if (ring.
kind == 0) {
961 if (ring.
kind == 1) NExtra++;
962 if (ring.
kind == 2) NRef++;
966 NClone +=
i->second.Reconstructed - 1;
977 TGraph* U1 =
new TGraph(
fHitArray->GetEntriesFast(), HitArrX, HitArrY);
978 U1->SetMarkerColor(kBlue);
979 U1->SetMarkerStyle(20);
980 U1->SetMarkerSize(0.3);
982 TGraph* U2 =
new TGraph(NfakeHits, NoiseHitArrX, NoiseHitArrY);
983 U2->SetMarkerColor(7);
984 U2->SetMarkerStyle(20);
985 U2->SetMarkerSize(0.3);
988 TGraph* U =
new TGraph(
fHitArray->GetEntriesFast(), HitArrX, HitArrY);
989 U->SetMarkerColor(kBlue);
990 U->SetMarkerStyle(20);
991 U->SetMarkerSize(0.3);
993 TGraph* U3 =
new TGraph(NfakeHits, NoiseHitArrX, NoiseHitArrY);
994 U3->SetMarkerColor(7);
995 U3->SetMarkerStyle(20);
996 U3->SetMarkerSize(0.3);
1002 static Int_t S_NAll = 0, S_NRef = 0, S_NExtra = 0, S_NReco = 0,
1003 S_NAllReco = 0, S_NRefReco = 0, S_NExtraReco = 0, S_NClone = 0,
1004 S_NGhost = 0, S_NEvents = 0;
1010 S_NAllReco += NAllReco;
1011 S_NRefReco += NRefReco;
1012 S_NExtraReco += NExtraReco;
1021 cout.setf(ios::fixed);
1022 cout.setf(ios::showpoint);
1026 Double_t p_all = (NAll > 0) ?
static_cast<Double_t
>(NAllReco) / NAll : 0.;
1027 Double_t p_ref = (NRef > 0) ?
static_cast<Double_t
>(NRefReco) / NRef : 0.;
1029 (NExtra > 0) ?
static_cast<Double_t
>(NExtraReco) / NExtra : 0.;
1030 Double_t p_clone = (NReco > 0) ?
static_cast<Double_t
>(NClone) / NReco : 0.;
1031 Double_t p_ghost = (NReco > 0) ?
static_cast<Double_t
>(NGhost) / NReco : 0.;
1035 cout <<
"L1ENN PER EVENT STAT : " << endl;
1036 cout <<
"MC Refset : " << NRef << endl;
1037 cout <<
"MC Extras : " << NExtra << endl;
1038 cout <<
"ALL SIMULATED : " << NAll << endl;
1040 cout <<
"RC Refset : " << NRefReco << endl;
1041 cout <<
"RC Extras : " << NExtraReco << endl;
1042 cout <<
"clones : " << NClone << endl;
1043 cout <<
"ghosts : " << NGhost << endl;
1044 cout <<
"ALL RECONSTRUCTED : " << NAllReco << endl;
1046 cout <<
"Refset efficiency : " << p_ref << endl;
1047 cout <<
"Allset efficiency : " << p_all << endl;
1048 cout <<
"Extra efficiency : " << p_extra << endl;
1049 cout <<
"clone probability : " << p_clone << endl;
1050 cout <<
"ghost probability : " << p_ghost << endl;
1055 std::string MC_Refset;
1056 std::stringstream out1;
1058 MC_Refset = out.str();
1061 TString name =
"2_" + s +
".pdf";
1069 (S_NAll > 0) ?
static_cast<Double_t
>(S_NAllReco) / S_NAll : 0.;
1071 (S_NRef > 0) ?
static_cast<Double_t
>(S_NRefReco) / S_NRef : 0.;
1072 Double_t S_p_extra =
1073 (S_NExtra > 0) ?
static_cast<Double_t
>(S_NExtraReco) / S_NExtra : 0.;
1074 Double_t S_p_clone =
1075 (S_NReco > 0) ?
static_cast<Double_t
>(S_NClone) / S_NReco : 0.;
1076 Double_t S_p_ghost =
1077 (S_NReco > 0) ?
static_cast<Double_t
>(S_NGhost) / S_NReco : 0.;
1079 cout <<
"ACCUMULATED STAT : " << S_NEvents <<
" EVENTS " << endl << endl;
1087 cout <<
"Refset efficiency : " << S_p_ref <<
" | " << S_NRefReco <<
" | "
1089 cout <<
"Allset efficiency : " << S_p_all <<
" | " << S_NAllReco <<
" | "
1091 cout <<
"Extra efficiency : " << S_p_extra <<
" | " << S_NExtraReco
1092 <<
" | " << S_NExtra << endl;
1093 cout <<
"clone probability : " << S_p_clone <<
" | " << S_NClone << endl;
1094 cout <<
"ghost probability : " << S_p_ghost <<
" | " << S_NGhost << endl;
1095 cout <<
"MC rings/event found : "
1096 << Int_t(
static_cast<Double_t
>(S_NAllReco)
1097 /
static_cast<Double_t
>(S_NEvents))
1100 cout <<
"Reco time (ms) : " << 0. * 1000. / S_NEvents << endl;
1107 for (map<Int_t, MCRing>::iterator
i = MCRingMap.begin();
i != MCRingMap.end();
1111 h_MC_radius->Fill(ring.
r);
1112 h_MC_nhits->Fill(ring.
NHits);
1113 h_MC_momentum->Fill(ring.
P);
1115 h_MC_primary_nhits->Fill(ring.
NHits);
1116 h_MC_primary_momentum->Fill(ring.
P);
1119 for (vector<int>::iterator j = ring.
Hits.begin(); j != ring.
Hits.end();
1121 Double_t dx = Hits[(*j)].
x - ring.
x;
1122 Double_t dy = Hits[(*j)].
y - ring.
y;
1123 Double_t res =
sqrt(dx * dx + dy * dy) - ring.
r;
1124 h_MC_resolution->Fill(res);
1125 if (ring.
kind == 1) h_MC_extra_resolution->Fill(res);
1126 if (ring.
kind == 2) h_MC_ref_resolution->Fill(res);
1127 if (ring.
primary) h_MC_primary_res_vs_momentum->Fill(ring.
P, res);
1130 if (ring.
kind == 1) p_extra_eff_vs_nhits->Fill(ring.
NHits, entry);
1131 if (ring.
kind == 2) p_ref_eff_vs_nhits->Fill(ring.
NHits, entry);
1135 TDirectory* curr = gDirectory;
1136 TFile* outfile =
new TFile(
"L1RingQaHisto.root",
"RECREATE");
1138 TIter hiter(listHisto);
1139 while (TObject* obj = hiter())
1146 TStyle plain(
"Plain",
"Plain Style(no colors/fill areas)");
1147 plain.SetPadColor(0);
1148 plain.SetCanvasColor(0);
1149 plain.SetTitleColor(0);
1150 plain.SetStatColor(0);
1151 plain.SetOptFit(1111);
1152 plain.SetStatW(0.225);
1153 plain.SetOptStat(0);
1154 plain.SetPalette(1);
1157 TCanvas* Chi2Histos =
new TCanvas(
"Chi2Histos",
"Chi2Histos", 0, 0, 240, 270);
1158 Chi2Histos->SetFillColor(kWhite);
1159 Chi2Histos->Divide(2, 2);
1170 Chi2Histos->SaveAs(
"Chi2.pdf");
1171 TCanvas* All =
new TCanvas(
"All",
"All", 0, 0, 240, 270);
1172 All->SetFillColor(kWhite);
1192 All->SaveAs(
"All.pdf");
1194 TCanvas* MCNHits =
new TCanvas(
"MCNHits",
"MCNHits", 0, 0, 240, 270);
1195 MCNHits->SetFillColor(kWhite);
1196 MCNHits->Divide(2, 2);
1206 MCNHits->SaveAs(
"MCHits.pdf");
1208 TCanvas* CloneToEll =
new TCanvas(
"CloneToEll",
"CloneToEll", 0, 0, 240, 270);
1209 CloneToEll->SetFillColor(kWhite);
1210 CloneToEll->Divide(2, 2);
1220 CloneToEll->SaveAs(
"CloneToEll.pdf");
1222 TCanvas* RecoVsMC =
new TCanvas(
"RecoVsMC",
"RecoVsMC", 0, 0, 240, 270);
1223 RecoVsMC->SetFillColor(kWhite);
1226 RecoVsMC->SaveAs(
"RecoVsMC.pdf");