13 #ifndef PndEventBuilderAnaTask_H_ 14 #define PndEventBuilderAnaTask_H_ 16 #include "TClonesArray.h" 21 #include "FairLogger.h" 22 #include "FairRootManager.h" 36 os << data.
link <<
" : isPrimary " << data.
isPrimary <<
" isFound " << data.
isFound << std::endl;
63 os << FairRootManager::Instance()->GetBranchName(branch.first) << std::endl;
64 for (
auto link : branch.second) {
97 os <<
"Found Points: " << std::endl;
102 os << value.first <<
" : " << value.second <<
"/" << totalNumbersMap[value.first] <<
" = " << percentageMap[value.first] * 100 <<
" %" << std::endl;
104 os <<
"Found Primary Points: " << std::endl;
109 os << value.first <<
" : " << value.second <<
"/" << totalNumbersMap[value.first] <<
" = " << percentageMap[value.first] * 100 <<
" %" << std::endl;
119 void CalculateBranchInfo();
123 LOG(info) <<
" EventInfo for branch: " << FairRootManager::Instance()->GetBranchName(branch.first);
134 fAbsoluteHits =
new TH2D(
"AbsoluteHits" + branchName,
"AbsoluteHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
135 fRelativeHits =
new TH2D(
"RelativeHits" + branchName,
"RelativeHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
136 fAbsolutePrimaryHits =
new TH2D(
"AbsolutePrimaryHits" + branchName,
"AbsolutePrimaryHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
137 fRelativePrimaryHits =
new TH2D(
"RelativePrimaryHits" + branchName,
"RelativePrimaryHits" + branchName, nEvents + 1, -0.5, nEvents + 0.5, nMCEvents + 1, -0.5, nMCEvents + 0.5);
138 fOutsideMC =
new TH1D(
"OutsideMC" + branchName,
"OutsideMC" + branchName, nEvents + 1, -0.5, nEvents + 0.5);
139 fOutsideMCHisto =
new TH1D(
"OutsideMCHisto" + branchName,
"OutsideMCHisto" + branchName, 1000, 0, 10000);
140 fAbsoluteHitsHisto =
new TH1D(
"AbsoluteHitsHisto" + branchName,
"AbsoluteHitsHisto" + branchName, 1000, 0, 1000);
141 fAbsolutePrimaryHitsHisto =
new TH1D(
"AbsolutePrimaryHitsHisto" + branchName,
"AbsolutePrimaryHitsHisto" + branchName, 1000, 0, 1000);
142 fRelativeHitsHisto =
new TH1D(
"RelatvieHitsHisto" + branchName,
"RelatvieHitsHisto" + branchName, 100, 0, 2.0);
143 fRelativePrimaryHitsHisto =
new TH1D(
"RelatviePrimaryHitsHisto" + branchName,
"RelatviePrimaryHitsHisto" + branchName, 100, 0, 2.0);
144 fEventOverlap =
new TH1D(
"EventOverlap" + branchName,
"EventOverlap" + branchName, 100, 0, 100);
149 fAbsoluteHits->Write();
150 fAbsoluteHitsHisto->Write();
151 fRelativeHits->Write();
152 fRelativeHitsHisto->Write();
153 fAbsolutePrimaryHits->Write();
154 fAbsolutePrimaryHitsHisto->Write();
155 fRelativePrimaryHits->Write();
156 fRelativePrimaryHitsHisto->Write();
158 fOutsideMCHisto->Write();
159 fEventOverlap->Write();
181 virtual void SetParContainers();
182 virtual InitStatus Init();
183 virtual InitStatus ReInit();
186 virtual void Exec(Option_t *opt);
187 virtual void FinishEvent();
188 virtual void FinishTask();
192 fMainBranchName = name;
193 fAddHitArray[name] =
nullptr;
199 std::set<int> GetMCEventIDs(TClonesArray *array);
200 void AssignHitsToPoints(TString branchName, TClonesArray *hitArray);
201 MCEvent GetMCInfo(
int entryNr);
207 if (hitbranch.Contains(
"STT"))
209 if (hitbranch.Contains(
"MVD"))
211 if (hitbranch.Contains(
"GEM"))
213 if (hitbranch.Contains(
"SciT"))
215 if (hitbranch.Contains(
"EMC"))
217 if (hitbranch.Contains(
"FTS"))
219 if (hitbranch.Contains(
"Ftof"))
225 TString fMainBranchName;
228 std::map<TString, TClonesArray *> fAddHitArray;
229 std::map<TString, BranchHistos *> fBranchHistos;
231 TClonesArray *fMCArray;
232 std::map<int, TClonesArray *> fMCPointArrays;
233 std::map<int, MCEvent> fMCEvents;
234 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