8 #include "TClonesArray.h"
10 #include "FairLogger.h"
11 #include "FairRootManager.h"
26 : FairTask(
"Ideal Psd Digitizer", 1)
49 FairRootManager* ioman = FairRootManager::Instance();
52 <<
"CbmPsdIdealDigitizer::Init: RootManager not instantised!";
57 fPointArray = (TClonesArray*) ioman->GetObject(
"PsdPoint");
59 LOG(fatal) <<
"CbmPsdIdealDigitizer::Init: No PSDPoint array!";
64 fDigiArray =
new TClonesArray(
"CbmPsdDigi", 1000);
66 "PsdDigi",
"PSD",
fDigiArray, IsOutputBranchPersistent(
"PsdDigi"));
68 cout <<
"-I- CbmPsdIdealDigitizer: Intialisation successfull " << kSUCCESS
80 cout <<
" CbmPsdIdealDigitizer::Exec begin " << endl;
82 if (!
fDigiArray) Fatal(
"Exec",
"No PsdDigi array");
102 edep[isec][imod] = 0.;
106 map<pair<int, int>,
double> edepmap;
110 cout <<
" nPoints " << nPoints << endl;
114 for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) {
116 if (!point)
continue;
124 scinID = point->GetDetectorID();
127 sec = (Int_t)((scinID - 1) / 6) + 1;
129 auto insert_result = edepmap.insert(
130 std::make_pair(std::make_pair(modID, sec), point->GetEnergyLoss()));
132 if (!insert_result.second) {
133 (*insert_result.first).second += point->GetEnergyLoss();
164 for (
auto edep_entry : edepmap) {
165 modID = edep_entry.first.first;
166 int secID = edep_entry.first.second;
167 double edep1 = edep_entry.second;
173 cout <<
"-I- CbmPsdIdealDigitizer: " <<
fNDigis <<
" CbmPsdDigi created."