9 #include "TClonesArray.h"
13 #include "FairRootManager.h"
20 #include "FairLogger.h"
28 : FairTask(
"Ideal Psd Hit Producer", 1)
60 fhModXNewEn =
new TH1F(
"hModXNewEn",
"X distr, En", 300, -150., 150.);
64 FairRootManager* ioman = FairRootManager::Instance();
67 <<
"-W- CbmPsdHitProducer::Init: RootManager not instantised!";
76 LOG(error) << GetName() <<
": No PsdDigi input array present; "
77 <<
"task will be inactive.";
83 fHitArray =
new TClonesArray(
"CbmPsdHit", 1000);
85 "PsdHit",
"PSD",
fHitArray, IsOutputBranchPersistent(
"PsdHit"));
88 cout <<
"-I- CbmPsdHitProducer: Intialisation successfull " << kSUCCESS
100 cout <<
" CbmPsdHitProducer::Exec(Option_t* /*opt*/) " << endl;
114 std::map<int, Double_t> edepmap;
118 cout <<
" nDigits " << nDigi << endl;
120 for (Int_t idig = 0; idig < nDigi; idig++) {
125 Double_t eDep = (Double_t) dig->
GetEdep();
128 auto insert_result = edepmap.insert(std::make_pair(mod, eDep));
129 if (!insert_result.second) {
130 (*insert_result.first).second += eDep;
136 for (
auto edep_entry : edepmap) {
137 int modID = edep_entry.first;
138 Double_t eDep = edep_entry.second;
158 cout <<
"-I- CbmPsdHitProducer: " <<
fNHits <<
" CbmPsdHits created." << endl;
162 cout <<
" CbmPsdHitProducer::Finish() " << endl;
163 TFile* outfile =
new TFile(
"EdepHistos.root",
"RECREATE");