3 #include "AnalysisTree/DataHeader.hpp"
4 #include "AnalysisTree/TaskManager.hpp"
7 #include "TGeoManager.h"
23 std::map<std::string, void*> unused_map {};
30 task->Init(unused_map);
45 std::make_pair(
task->GetOutputBranchName(),
task->GetOutIndexesMap()));
52 TDirectory* old_dir = gDirectory;
73 std::cout <<
"ReadDataHeader" << std::endl;
78 const int psd_node_id = 6;
79 const char* module_name_prefix =
"module";
81 auto* geoMan = gGeoManager;
82 auto* caveNode = geoMan->GetTopNode();
83 auto* psdNode = caveNode->GetDaughter(psd_node_id);
84 std::cout <<
"-I- " << psdNode->GetName() << std::endl;
86 auto psdGeoMatrix = psdNode->GetMatrix();
87 auto psdBox = (TGeoBBox*) psdNode->GetVolume()->GetShape();
88 TVector3 frontFaceLocal(0, 0, -psdBox->GetDZ());
90 TVector3 frontFaceGlobal;
91 psdGeoMatrix->LocalToMaster(&frontFaceLocal[0], &frontFaceGlobal[0]);
93 for (
int i_d = 0; i_d < psdNode->GetNdaughters(); ++i_d) {
94 auto* daughter = psdNode->GetDaughter(i_d);
95 TString daughterName(daughter->GetName());
96 if (daughterName.BeginsWith(module_name_prefix)) {
98 auto geoMatrix = daughter->GetMatrix();
99 TVector3 translation(geoMatrix->GetTranslation());
101 int modID = daughter->GetNumber();
102 double x = translation.X();
103 double y = translation.Y();
105 std::cout <<
"mod" << modID <<
" : " << Form(
"(%.3f, %3f)",
x,
y)
108 auto* module = psd_mod_pos.AddChannel();
109 module->SetPosition(
x,
y, frontFaceGlobal[2]);
113 TDirectory* curr = gDirectory;
114 TFile* currentFile = gFile;