4 #include "TClonesArray.h"
6 #include "FairRootManager.h"
8 #include "AnalysisTree/DataHeader.hpp"
9 #include "AnalysisTree/Detector.hpp"
17 assert(!in_branches_.empty() && !out_branch_.empty() && out_config_
19 auto* ioman = FairRootManager::Instance();
20 assert(ioman !=
nullptr);
23 AnalysisTree::BranchConfig psd_branch(out_branch_,
24 AnalysisTree::DetType::kModule);
25 out_config_->AddBranchConfig(std::move(psd_branch));
26 psd_modules_ =
new AnalysisTree::ModuleDetector(out_config_->GetLastId());
28 out_branch_.c_str(),
"AnalysisTree::ModuleDetector", &
psd_modules_);
36 Float_t psd_energy {0.};
41 const int n_psd_modules =
42 data_header_->GetModulePositions(0).GetNumberOfChannels();
44 for (
int i = 0;
i < n_psd_modules; ++
i) {
46 module->SetSignal(0.
f);
50 for (
int i = 0;
i < nPsdHits; ++
i) {
52 if (hit ==
nullptr)
continue;
53 auto& module =
psd_modules_->GetChannel(hit->GetModuleID() - 1);
54 module.SetNumber(
i + 1);
55 module.SetSignal(hit->GetEdep());
56 psd_energy += hit->GetEdep();