113 fhCorrectDigiRatioAll =
new TH1F(
"fhCorrectDigiRatioAll",
"Correct digis per event [pct]", 416, -2, 102);
115 new TH1F(
"fhCorrectDigiRatioAllNoNoise",
"Correct digis per event [pct], disregarding noise", 416, -2, 102);
116 fhNoiseDigiRatioAll =
new TH1F(
"fhNoiseDigiRatioAll",
"Noise digis per event [pct]", 416, -2, 102);
117 fhFoundDigiRatioAll =
new TH1F(
"fhFoundDigiRatioAll",
"Found digis per event [pct]", 416, -2, 102);
118 fhCorrectVsFoundAll =
new TH2I(
"fhCorrectVsFoundAll",
"Correct digis [pct] vs. Found digis [pct]; Correct; Found ",
119 110, -5., 105., 110, -5., 105.);
121 new TH2I(
"fhCorrectVsFoundAllNoNoise",
"Correct digis [pct] vs. Found digis [pct], no noise; Correct; Found ", 110,
122 -5., 105., 110, -5., 105.);
137 TString h1name =
"fhCorrectDigiRatio" + moduleName;
138 TString h2name =
"fhCorrectDigiRatioNoNoise" + moduleName;
139 TString h3name =
"fhNoiseDigiRatio" + moduleName;
140 TString h4name =
"fhFoundDigiRatio" + moduleName;
141 TString h5name =
"fhCorrectVsFound" + moduleName;
142 TString h6name =
"fhCorrectVsFoundNoNoise" + moduleName;
145 new TH1F(h1name, Form(
"Correct digis per event, %s [pct]", moduleName.Data()), 416, -2, 102);
147 new TH1F(h2name, Form(
"Correct digis per event, %s [pct], disregarding noise", moduleName.Data()), 416, -2, 102);
149 new TH1F(h3name, Form(
"Noise digis per event, %s [pct]", moduleName.Data()), 416, -2, 102);
151 new TH1F(h4name, Form(
"Found digis per event, %s [pct]", moduleName.Data()), 416, -2, 102);
153 new TH2I(h5name, Form(
"Correct digis [pct] vs. Found digis [pct], %s; Correct; Found", moduleName.Data()), 110,
154 -5., 105., 110, -5., 105.);
156 h6name, Form(
"Correct digis [pct] vs. Found digis [pct], %s, no noise; Correct; Found", moduleName.Data()), 110,
157 -5., 105., 110, -5., 105.);
167 new CbmQaCanvas(Form(
"c%s", moduleName.Data()), Form(
"%s", moduleName.Data()), 3 * 400, 2 * 400);
183 int nEvents =
fEvents->GetEntriesFast();
184 for (
int iEvent = 0; iEvent < nEvents; iEvent++) {
190 if (event->GetMatch()->GetNofLinks() < 1) {
191 LOG(info) <<
"Warning: No links in this event match object. Skipping event # " <<
event->GetNumber();
194 int matchedMcEventNr =
event->GetMatch()->GetMatchedLink().GetEntry();
197 if (event->GetMatch()->GetNofLinks() > 1 && matchedMcEventNr == -1) {
201 LOG(info) << GetName() <<
": Event " <<
event->GetNumber() <<
", digis in event: " <<
event->GetNofData()
202 <<
", links to MC events: " <<
event->GetMatch()->GetNofLinks()
203 <<
", matched MC event number: " << matchedMcEventNr;
204 if (matchedMcEventNr == -1) {
205 LOG(info) <<
"(event is pure noise)";
208 LOG(info) <<
"Start time: " <<
event->GetStartTime() <<
", end time: " <<
event->GetEndTime()
209 <<
", middle time: " << (
event->GetStartTime() + event->GetEndTime()) / 2.;
211 const std::vector<CbmLink> linkList =
event->GetMatch()->GetLinks();
212 for (
size_t iLink = 0; iLink < linkList.size(); iLink++) {
213 int linkedEvent = linkList.at(iLink).GetEntry();
214 float linkedWeight = linkList.at(iLink).GetWeight();
215 std::string isMatched;
216 if (linkedEvent == matchedMcEventNr) {
217 isMatched =
" (matched)";
222 LOG(info) <<
"Link " << iLink <<
": MC event " << linkedEvent <<
" weight " << linkedWeight << isMatched;
233 int nDigis =
event->GetNofData(
GetDigiType(system));
235 int nDigisCorrect = 0;
238 int nLinksCorrect = 0;
241 for (
int iDigi = 0; iDigi < nDigis; iDigi++) {
242 unsigned int index =
event->GetIndex(
GetDigiType(system), iDigi);
256 for (
int iLink = 0; iLink < digiMatch->
GetNofLinks(); iLink++) {
259 if (entry == matchedMcEventNr) nLinksCorrect++;
260 if (entry == -1) nLinksNoise++;
266 int totEventDigis = 0;
269 for (
int iDigi = 0; iDigi < totDigis; iDigi++) {
280 if (mcEvent == matchedMcEventNr) totEventDigis++;
285 const double correctDigisPercent = 100. * Double_t(nDigisCorrect) / Double_t(nDigis);
286 const double correctDigisPercentNoNoise = 100. * Double_t(nDigisCorrect) / Double_t(nDigis - nDigisNoise);
287 const double noiseDigisPercent = 100. * Double_t(nDigisNoise) / Double_t(nDigis);
288 const double foundDigisPercent = 100. * Double_t(nDigisCorrect) / Double_t(totEventDigis);
289 const double correctLinksPercent = 100. * Double_t(nLinksCorrect) / Double_t(nLinks);
290 const double correctLinksPercentNoNoise = 100. * Double_t(nLinksCorrect) / Double_t(nLinks - nLinksNoise);
291 const double noiseLinksPercent = 100. * Double_t(nLinksNoise) / Double_t(nLinks);
294 LOG(info) <<
"Correct digis " << nDigisCorrect <<
" / " << nDigis <<
" = " << correctDigisPercent <<
" %";
295 if (matchedMcEventNr != -1) {
296 LOG(info) <<
"Noise digis " << nDigisNoise <<
" / " << nDigis <<
" = " << noiseDigisPercent <<
" %";
297 LOG(info) <<
"Correct digis, disregarding noise " << nDigisCorrect <<
" / " << nDigis - nDigisNoise <<
" = "
298 << correctDigisPercentNoNoise <<
" %";
300 LOG(info) <<
"Correct digi links " << nLinksCorrect <<
" / " << nLinks <<
" = " << correctLinksPercent <<
" % ";
301 if (matchedMcEventNr != -1) {
302 LOG(info) <<
"Noise digi links " << nLinksNoise <<
" / " << nLinks <<
" = " << noiseLinksPercent <<
" % ";
303 LOG(info) <<
"Correct digi links, disregarding noise " << nLinksCorrect <<
" / " << nLinks - nLinksNoise
304 <<
" = " << correctLinksPercentNoNoise <<
" % ";
306 LOG(info) <<
"Digi percentage found " << nDigisCorrect <<
" / " << totEventDigis <<
" = " << foundDigisPercent
310 if (matchedMcEventNr != -1) {
330 <<
", no digis in this event";
340 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Entry " << setw(6) << right <<
fNofEntries <<
", real time " << fixed
341 << setprecision(6) << timer.RealTime() <<
" s, events: " <<
fEvents->GetEntriesFast();
348 const std::vector<CbmLink> linkList =
event->GetMatch()->GetLinks();
349 int matchedEvent = -1;
350 float matchedWeight = 0.0;
351 for (
size_t iLink = 0; iLink < linkList.size(); iLink++) {
352 const int linkedEvent = linkList.at(iLink).GetEntry();
353 const float linkedWeight = linkList.at(iLink).GetWeight();
354 if (linkedEvent != -1 && linkedWeight > matchedWeight) {
355 matchedEvent = linkedEvent;
356 matchedWeight = linkedWeight;