12 #include "FairLogger.h"
13 #include "FairRootManager.h"
14 #include "TClonesArray.h"
15 #include "TStopwatch.h"
26 : FairTask(
"BuildEventsQA")
28 , fStsDigiMatches(nullptr)
48 Int_t nEvents =
fEvents->GetEntriesFast();
49 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
54 Int_t mcEventNr =
event->GetMatch()->GetMatchedLink().GetEntry();
55 LOG(info) << GetName() <<
": Event " <<
event->GetNumber()
56 <<
", data objects : " <<
event->GetNofData()
57 <<
", links: " <<
event->GetMatch()->GetNofLinks()
58 <<
", matched MC event number " << mcEventNr;
62 Int_t nDigiCorrect = 0;
64 Int_t nLinksCorrect = 0;
65 nMCEvents +=
event->GetMatch()->GetNofLinks();
68 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
78 for (Int_t iLink = 0; iLink < digiMatch->
GetNofLinks(); iLink++) {
81 if (entry == mcEventNr) nLinksCorrect++;
88 LOG(info) << GetName() <<
": correct digis " << nDigiCorrect <<
" / "
90 << 100. * Double_t(nDigiCorrect) / Double_t(nDigis)
91 <<
" %, correct digi links " << nLinksCorrect <<
" / " << nLinks
92 <<
" = " << 100. * Double_t(nLinksCorrect) / Double_t(nLinks)
103 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Entry " << setw(6) << right
104 <<
fNofEntries <<
", real time " << fixed << setprecision(6)
105 << timer.RealTime() <<
" s, events: " <<
fEvents->GetEntriesFast()
106 <<
", MC events: " << nMCEvents;
115 FairRootManager* ioman = FairRootManager::Instance();
119 fEvents = (TClonesArray*) ioman->GetObject(
"Event");
123 fStsDigis = (TClonesArray*) ioman->GetObject(
"StsDigi");
139 CbmMatch* match =
event->GetMatch();
142 event->SetMatch(match);
157 for (Int_t iLink = 0; iLink < digiMatch->
GetNofLinks(); iLink++) {
161 match->
AddLink(weight, 0, entry, file);