11 #include "TClonesArray.h"
13 #include "FairLogger.h"
14 #include "FairRootManager.h"
20 #include "TStopwatch.h"
26 using std::setprecision;
40 , fPointArray(NULL) {}
56 FairRootManager* ioman = FairRootManager::Instance();
60 fPointArray = (TClonesArray*) ioman->GetObject(
"PsdPoint");
72 LOG(info) << fName <<
": Initialisation successful " << kSUCCESS;
97 map<pair<int, int>,
double> edepmap;
102 for (Int_t imod = 0; imod <
N_PSD_MODS; imod++)
104 for (Int_t isec = 0; isec <
N_PSD_SECT; isec++) {
105 edep[isec][imod] = 0.;
117 for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) {
119 if (!point)
continue;
122 scinID = point->GetDetectorID();
123 Double_t eLoss = point->GetEnergyLoss();
125 sec = (Int_t)((scinID - 1) / 6) + 1;
126 auto insert_result = edepmap.insert(
127 std::make_pair(std::make_pair(modID, sec), point->GetEnergyLoss()));
129 if (!insert_result.second) {
130 (*insert_result.first).second += point->GetEnergyLoss();
134 if (((sec - 1) >= 0 && (sec - 1) <
N_PSD_SECT)
135 && ((modID - 1) >= 0 && (modID - 1) <
N_PSD_MODS)) {
136 edep[sec - 1][modID - 1] += eLoss;
149 for (
auto edep_entry : edepmap) {
150 modID = edep_entry.first.first;
151 int secID = edep_entry.first.second;
152 Double_t eDep = edep_entry.second;
155 Double_t eLossMIP = eDep / 0.005;
156 Double_t pixPerMIP = 15.;
157 Double_t eLossMIPSmeared =
158 gRandom->Gaus(eLossMIP * pixPerMIP,
sqrt(eLossMIP * pixPerMIP))
160 Double_t eLossSmeared = eLossMIPSmeared * 0.005;
161 Double_t eNoise = gRandom->Gaus(0, 15) / 50. * 0.005;
162 eLossSmeared += eNoise;
169 LOG(debug1) << fName <<
": Digi " << nDigis <<
" Section " << secID
170 <<
" Module " << modID <<
" energy " << eLossSmeared;
181 LOG(info) <<
"+ " << setw(15) << GetName() <<
": Event " << setw(6) << right
184 <<
", digis: " << nDigis <<
". Exec time " << setprecision(6)
185 << timer.RealTime() <<
" s.";
198 std::cout << std::endl;
199 LOG(info) <<
"=====================================";
200 LOG(info) << GetName() <<
": Run summary";
201 LOG(info) <<
"Events processed : " <<
fNofEvents;
202 LOG(info) <<
"PsdPoint / event : " << setprecision(1)
205 LOG(info) <<
"Digis per point : " << setprecision(6)
209 LOG(info) <<
"=====================================";