1 #ifndef PndEventBuilderAnaTask_H_ 2 #define PndEventBuilderAnaTask_H_ 4 #include "TClonesArray.h" 9 #include "FairLogger.h" 10 #include "FairRootManager.h" 24 os << data.
link <<
" : isPrimary " << data.
isPrimary <<
" isFound " << data.
isFound << std::endl;
51 os << FairRootManager::Instance()->GetBranchName(branch.first) << std::endl;
52 for (
auto link : branch.second) {
85 os <<
"Found Points: " << std::endl;
90 os << value.first <<
" : " << value.second <<
"/" << totalNumbersMap[value.first] <<
" = " << percentageMap[value.first] * 100 <<
" %" << std::endl;
92 os <<
"Found Primary Points: " << std::endl;
97 os << value.first <<
" : " << value.second <<
"/" << totalNumbersMap[value.first] <<
" = " << percentageMap[value.first] * 100 <<
" %" << std::endl;
107 void CalculateBranchInfo();
111 LOG(info) <<
" EventInfo for branch: " << FairRootManager::Instance()->GetBranchName(branch.first);
122 fAbsoluteHits =
new TH2D(
"AbsoluteHits" + branchName,
"AbsoluteHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
123 fRelativeHits =
new TH2D(
"RelativeHits" + branchName,
"RelativeHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
124 fAbsolutePrimaryHits =
new TH2D(
"AbsolutePrimaryHits" + branchName,
"AbsolutePrimaryHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
125 fRelativePrimaryHits =
new TH2D(
"RelativePrimaryHits" + branchName,
"RelativePrimaryHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
126 fOutsideMC =
new TH1D(
"OutsideMC" + branchName,
"OutsideMC" + branchName, nEvents + 1, -0.5, nEvents + 0.5);
127 fOutsideMCHisto =
new TH1D(
"OutsideMCHisto" + branchName,
"OutsideMCHisto" + branchName, 1000, 0, 10000);
128 fAbsoluteHitsHisto =
new TH1D(
"AbsoluteHitsHisto" + branchName,
"AbsoluteHitsHisto" + branchName, 1000, 0, 1000);
129 fAbsolutePrimaryHitsHisto =
new TH1D(
"AbsolutePrimaryHitsHisto" + branchName,
"AbsolutePrimaryHitsHisto" + branchName, 1000, 0, 1000);
130 fRelativeHitsHisto =
new TH1D(
"RelatvieHitsHisto" + branchName,
"RelatvieHitsHisto" + branchName, 100, 0, 2.0);
131 fRelativePrimaryHitsHisto =
new TH1D(
"RelatviePrimaryHitsHisto" + branchName,
"RelatviePrimaryHitsHisto" + branchName, 100, 0, 2.0);
132 fEventOverlap =
new TH1D(
"EventOverlap" + branchName,
"EventOverlap" + branchName, 100, 0, 100);
137 fAbsoluteHits->Write();
138 fAbsoluteHitsHisto->Write();
139 fRelativeHits->Write();
140 fRelativeHitsHisto->Write();
141 fAbsolutePrimaryHits->Write();
142 fAbsolutePrimaryHitsHisto->Write();
143 fRelativePrimaryHits->Write();
144 fRelativePrimaryHitsHisto->Write();
146 fOutsideMCHisto->Write();
147 fEventOverlap->Write();
169 virtual void SetParContainers();
170 virtual InitStatus Init();
171 virtual InitStatus ReInit();
174 virtual void Exec(Option_t *opt);
175 virtual void FinishEvent();
176 virtual void FinishTask();
180 fMainBranchName = name;
181 fAddHitArray[name] =
nullptr;
187 std::set<int> GetMCEventIDs(TClonesArray *array);
188 void AssignHitsToPoints(TString branchName, TClonesArray *hitArray);
189 MCEvent GetMCInfo(
int entryNr);
195 if (hitbranch.Contains(
"STT"))
197 if (hitbranch.Contains(
"MVD"))
199 if (hitbranch.Contains(
"GEM"))
201 if (hitbranch.Contains(
"SciT"))
203 if (hitbranch.Contains(
"EMC"))
205 if (hitbranch.Contains(
"FTS"))
207 if (hitbranch.Contains(
"Ftof"))
213 TString fMainBranchName;
216 std::map<TString, TClonesArray *> fAddHitArray;
217 std::map<TString, BranchHistos *> fBranchHistos;
219 TClonesArray *fMCArray;
220 std::map<int, TClonesArray *> fMCPointArrays;
221 std::map<int, MCEvent> fMCEvents;
222 std::vector<EventInfo> fEventInfo;
TH2D * fRelativePrimaryHits
BranchHistos(TString branchName, int nEvents, int nMCEvents)
TString GetPointBranch(TString hitbranch)
int fNumberOfPointsOutsideMC
std::map< int, int > fTotalNumberOfPrimaryPoints
number of MCPoints per MCEvent
TH2D * fAbsolutePrimaryHits
friend std::ostream & operator<<(std::ostream &os, const BranchInfo data)
std::map< int, std::vector< MCPoint > > fMCPoints
MCPoints for BranchID.
std::map< int, BranchInfo > fBranchInfo
map<Branch, BranchInfo>
friend std::ostream & operator<<(std::ostream &os, const MCPoint data)
std::map< int, MCEvent > fMCEvents
map<MCEventNumber, MCEvents>
void SetBranchName(TString name)
void AddAdditionalBranches(TString branchName)
friend std::ostream & operator<<(std::ostream &os, const MCEvent data)
std::vector< FairLink > fMCTracks
std::map< int, double > fPercentagePrimaryMCPoints
percentage of found MCPoints per MCEvent
TH1D * fAbsolutePrimaryHitsHisto
std::map< int, int > fNumberOfFoundPrimaryMCPoints
number of found MCPoint per MCEvent
std::map< int, int > fTotalNumberOfPoints
number of MCPoints per MCEvent
TH1D * fRelativePrimaryHitsHisto
TH1D * fAbsoluteHitsHisto
std::map< int, double > fPercentageMCPoints
percentage of found MCPoints per MCEvent
TH1D * fRelativeHitsHisto
friend std::ostream & operator<<(std::ostream &os, const EventInfo data)
std::map< int, int > fNumberOfFoundMCPoints
number of found MCPoint per MCEvent