Skip to content
Snippets Groups Projects
Commit c7ab5b72 authored by Dominik Smith's avatar Dominik Smith Committed by Florian Uhlig
Browse files

CbmBuildEventsQa: Added 2D histograms that plot correct digis per event (with...

CbmBuildEventsQa: Added 2D histograms that plot correct digis per event (with and without noise) vs. found digis per event.
parent 9e5f79da
No related branches found
No related tags found
1 merge request!581CbmBuildEventsQa: Added 2D histograms that plot correct digis per event (with...
Pipeline #13971 passed
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "TClonesArray.h" #include "TClonesArray.h"
#include "TH1.h" #include "TH1.h"
#include "TH2.h"
#include "TStopwatch.h" #include "TStopwatch.h"
#include <cassert> #include <cassert>
...@@ -108,11 +109,21 @@ InitStatus CbmBuildEventsQa::Init() ...@@ -108,11 +109,21 @@ InitStatus CbmBuildEventsQa::Init()
histFolder->Add(fhNoiseDigiRatioAll); histFolder->Add(fhNoiseDigiRatioAll);
histFolder->Add(fhFoundDigiRatioAll); histFolder->Add(fhFoundDigiRatioAll);
fhCorrectVsFoundAll = new TH2F("fhCorrectVsFoundAll", "Correct digis [pct] vs. Found digis [pct] ", 402, -0.25,
100.25, 402, -0.25, 100.25);
fhCorrectVsFoundAllNoNoise =
new TH2F("fhCorrectVsFoundAllNoNoise", "Correct digis [pct] vs. Found digis [pct], no noise for match ", 402,
-0.25, 100.25, 402, -0.25, 100.25);
histFolder->Add(fhCorrectVsFoundAll);
histFolder->Add(fhCorrectVsFoundAllNoNoise);
for (ECbmModuleId& system : fSystems) { for (ECbmModuleId& system : fSystems) {
TString h1name = "fhCorrectDigiRatio" + CbmModuleList::GetModuleNameCaps(system); TString h1name = "fhCorrectDigiRatio" + CbmModuleList::GetModuleNameCaps(system);
TString h2name = "fhCorrectDigiRatioNoNoise" + CbmModuleList::GetModuleNameCaps(system); TString h2name = "fhCorrectDigiRatioNoNoise" + CbmModuleList::GetModuleNameCaps(system);
TString h3name = "fhNoiseDigiRatio" + CbmModuleList::GetModuleNameCaps(system); TString h3name = "fhNoiseDigiRatio" + CbmModuleList::GetModuleNameCaps(system);
TString h4name = "fhFoundDigiRatio" + CbmModuleList::GetModuleNameCaps(system); TString h4name = "fhFoundDigiRatio" + CbmModuleList::GetModuleNameCaps(system);
TString h5name = "fhCorrectVsFound" + CbmModuleList::GetModuleNameCaps(system);
TString h6name = "fhCorrectVsFoundNoNoise" + CbmModuleList::GetModuleNameCaps(system);
fhMapSystemsCorrectDigi[system] = fhMapSystemsCorrectDigi[system] =
new TH1F(h1name, Form("Correct digis per event, %s [pct]", (CbmModuleList::GetModuleNameCaps(system)).Data()), new TH1F(h1name, Form("Correct digis per event, %s [pct]", (CbmModuleList::GetModuleNameCaps(system)).Data()),
...@@ -132,6 +143,18 @@ InitStatus CbmBuildEventsQa::Init() ...@@ -132,6 +143,18 @@ InitStatus CbmBuildEventsQa::Init()
histFolder->Add(fhMapSystemsCorrectDigiNoNoise[system]); histFolder->Add(fhMapSystemsCorrectDigiNoNoise[system]);
histFolder->Add(fhMapSystemsNoiseDigi[system]); histFolder->Add(fhMapSystemsNoiseDigi[system]);
histFolder->Add(fhMapSystemsFoundDigi[system]); histFolder->Add(fhMapSystemsFoundDigi[system]);
fhMapSystemsCorrectVsFound[system] = new TH2F(
h5name, Form("Correct digis [pct] vs. Found digis [pct], %s", (CbmModuleList::GetModuleNameCaps(system)).Data()),
402, -0.25, 100.25, 402, -0.25, 100.25);
fhMapSystemsCorrectVsFoundNoNoise[system] =
new TH2F(h6name,
Form("Correct digis [pct] vs. Found digis [pct], %s, no noise for match",
(CbmModuleList::GetModuleNameCaps(system)).Data()),
402, -0.25, 100.25, 402, -0.25, 100.25);
histFolder->Add(fhMapSystemsCorrectVsFound[system]);
histFolder->Add(fhMapSystemsCorrectVsFoundNoNoise[system]);
} }
return kSUCCESS; return kSUCCESS;
} }
...@@ -239,36 +262,47 @@ void CbmBuildEventsQa::Exec(Option_t*) ...@@ -239,36 +262,47 @@ void CbmBuildEventsQa::Exec(Option_t*)
// --- QA output // --- QA output
if (0 < nDigis) { if (0 < nDigis) {
const double correctDigisPercent = 100. * Double_t(nDigisCorrect) / Double_t(nDigis);
const double correctDigisPercentNoNoise = 100. * Double_t(nDigisCorrect) / Double_t(nDigis - nDigisNoise);
const double noiseDigisPercent = 100. * Double_t(nDigisNoise) / Double_t(nDigis);
const double foundDigisPercent = 100. * Double_t(nDigisCorrect) / Double_t(totEventDigis);
const double correctLinksPercent = 100. * Double_t(nLinksCorrect) / Double_t(nLinks);
const double correctLinksPercentNoNoise = 100. * Double_t(nLinksCorrect) / Double_t(nLinks - nLinksNoise);
const double noiseLinksPercent = 100. * Double_t(nLinksNoise) / Double_t(nLinks);
LOG(info) << GetName() << ": Detector " << CbmModuleList::GetModuleNameCaps(system); LOG(info) << GetName() << ": Detector " << CbmModuleList::GetModuleNameCaps(system);
LOG(info) << "Correct digis " << nDigisCorrect << " / " << nDigis << " = " LOG(info) << "Correct digis " << nDigisCorrect << " / " << nDigis << " = " << correctDigisPercent << " %";
<< 100. * Double_t(nDigisCorrect) / Double_t(nDigis) << " %";
if (matchedMcEventNr != -1) { if (matchedMcEventNr != -1) {
LOG(info) << "Noise digis " << nDigisNoise << " / " << nDigis << " = " LOG(info) << "Noise digis " << nDigisNoise << " / " << nDigis << " = " << noiseDigisPercent << " %";
<< 100. * Double_t(nDigisNoise) / Double_t(nDigis) << " %";
LOG(info) << "Correct digis, disregarding noise " << nDigisCorrect << " / " << nDigis - nDigisNoise << " = " LOG(info) << "Correct digis, disregarding noise " << nDigisCorrect << " / " << nDigis - nDigisNoise << " = "
<< 100. * Double_t(nDigisCorrect) / Double_t(nDigis - nDigisNoise) << " %"; << correctDigisPercentNoNoise << " %";
} }
LOG(info) << "Correct digi links " << nLinksCorrect << " / " << nLinks << " = " LOG(info) << "Correct digi links " << nLinksCorrect << " / " << nLinks << " = " << correctLinksPercent << " % ";
<< 100. * Double_t(nLinksCorrect) / Double_t(nLinks) << " % ";
if (matchedMcEventNr != -1) { if (matchedMcEventNr != -1) {
LOG(info) << "Noise digi links " << nLinksNoise << " / " << nLinks << " = " LOG(info) << "Noise digi links " << nLinksNoise << " / " << nLinks << " = " << noiseLinksPercent << " % ";
<< 100. * Double_t(nLinksNoise) / Double_t(nLinks) << " % ";
LOG(info) << "Correct digi links, disregarding noise " << nLinksCorrect << " / " << nLinks - nLinksNoise LOG(info) << "Correct digi links, disregarding noise " << nLinksCorrect << " / " << nLinks - nLinksNoise
<< " = " << 100. * Double_t(nLinksCorrect) / Double_t(nLinks - nLinksNoise) << " % "; << " = " << correctLinksPercentNoNoise << " % ";
} }
LOG(info) << "Digi percentage found " << nDigisCorrect << " / " << totEventDigis << " = " LOG(info) << "Digi percentage found " << nDigisCorrect << " / " << totEventDigis << " = " << foundDigisPercent
<< 100. * Double_t(nDigisCorrect) / Double_t(totEventDigis) << " % "; << " % ";
//fill histograms //fill histograms
if (matchedMcEventNr != -1) { //ignore events which are pure noise if (matchedMcEventNr != -1) { //ignore events which are pure noise
fhCorrectDigiRatioAll->Fill(100. * Double_t(nDigisCorrect) / Double_t(nDigis)); fhCorrectDigiRatioAll->Fill(correctDigisPercent);
fhCorrectDigiRatioAllNoNoise->Fill(100. * Double_t(nDigisCorrect) / Double_t(nDigis - nDigisNoise)); fhCorrectDigiRatioAllNoNoise->Fill(correctDigisPercentNoNoise);
fhNoiseDigiRatioAll->Fill(100. * Double_t(nDigisNoise) / Double_t(nDigis)); fhNoiseDigiRatioAll->Fill(noiseDigisPercent);
fhFoundDigiRatioAll->Fill(100. * Double_t(nDigisCorrect) / Double_t(totEventDigis)); fhFoundDigiRatioAll->Fill(foundDigisPercent);
fhMapSystemsCorrectDigi[system]->Fill(100. * Double_t(nDigisCorrect) / Double_t(nDigis));
fhMapSystemsCorrectDigiNoNoise[system]->Fill(100. * Double_t(nDigisCorrect) / Double_t(nDigis - nDigisNoise)); fhCorrectVsFoundAll->Fill(correctDigisPercent, foundDigisPercent);
fhMapSystemsNoiseDigi[system]->Fill(100. * Double_t(nDigisNoise) / Double_t(nDigis)); fhCorrectVsFoundAllNoNoise->Fill(correctDigisPercentNoNoise, foundDigisPercent);
fhMapSystemsFoundDigi[system]->Fill(100. * Double_t(nDigisCorrect) / Double_t(totEventDigis));
fhMapSystemsCorrectDigi[system]->Fill(correctDigisPercent);
fhMapSystemsCorrectDigiNoNoise[system]->Fill(correctDigisPercentNoNoise);
fhMapSystemsNoiseDigi[system]->Fill(noiseDigisPercent);
fhMapSystemsFoundDigi[system]->Fill(foundDigisPercent);
fhMapSystemsCorrectVsFound[system]->Fill(correctDigisPercent, foundDigisPercent);
fhMapSystemsCorrectVsFoundNoNoise[system]->Fill(correctDigisPercentNoNoise, foundDigisPercent);
} }
} }
else { else {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
class TClonesArray; class TClonesArray;
class TH1F; class TH1F;
class TH2F;
class CbmDigiManager; class CbmDigiManager;
class CbmEvent; class CbmEvent;
...@@ -64,10 +65,16 @@ private: ...@@ -64,10 +65,16 @@ private:
TH1F* fhCorrectDigiRatioAllNoNoise = nullptr; /// correct digis per event for all detectors, disregarding noise TH1F* fhCorrectDigiRatioAllNoNoise = nullptr; /// correct digis per event for all detectors, disregarding noise
TH1F* fhNoiseDigiRatioAll = nullptr; /// noise digis per event for all detectors TH1F* fhNoiseDigiRatioAll = nullptr; /// noise digis per event for all detectors
TH1F* fhFoundDigiRatioAll = nullptr; /// digis found per event for all detectors TH1F* fhFoundDigiRatioAll = nullptr; /// digis found per event for all detectors
std::map<ECbmModuleId, TH1F*> fhMapSystemsCorrectDigi; // histograms for subsystems TH2F* fhCorrectVsFoundAll = nullptr; /// correct digis per event vs found digis per event, all detectors
std::map<ECbmModuleId, TH1F*> fhMapSystemsCorrectDigiNoNoise; // histograms for subsystems TH2F* fhCorrectVsFoundAllNoNoise =
std::map<ECbmModuleId, TH1F*> fhMapSystemsNoiseDigi; // histograms for subsystems nullptr; /// correct digis per event vs found digis per event, all detectors, disregarding noise
std::map<ECbmModuleId, TH1F*> fhMapSystemsFoundDigi; // histograms for subsystems
std::map<ECbmModuleId, TH1F*> fhMapSystemsCorrectDigi; // histograms for subsystems
std::map<ECbmModuleId, TH1F*> fhMapSystemsCorrectDigiNoNoise; // histograms for subsystems
std::map<ECbmModuleId, TH1F*> fhMapSystemsNoiseDigi; // histograms for subsystems
std::map<ECbmModuleId, TH1F*> fhMapSystemsFoundDigi; // histograms for subsystems
std::map<ECbmModuleId, TH2F*> fhMapSystemsCorrectVsFound; // histograms for subsystems
std::map<ECbmModuleId, TH2F*> fhMapSystemsCorrectVsFoundNoNoise; // histograms for subsystems
/** Match a reconstructed event to MC events+ /** Match a reconstructed event to MC events+
** @param event Pointer to reconstructed event ** @param event Pointer to reconstructed event
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment