59 Double_t pmtHeight = 5.2;
60 Double_t pmtWidth = 5.2;
61 TGeoVolume* pmtVolume = gGeoManager->FindVolumeFast(
"pmt");
62 if (pmtVolume ==
nullptr) pmtVolume = gGeoManager->FindVolumeFast(
"pmt_vol_0");
63 if (pmtVolume !=
nullptr) {
64 const TGeoBBox*
shape = (
const TGeoBBox*) (pmtVolume->GetShape());
65 if (
shape !=
nullptr) {
66 pmtHeight = 2. *
shape->GetDY();
67 pmtWidth = 2. *
shape->GetDX();
71 TGeoIterator geoIterator(gGeoManager->GetTopNode()->GetVolume());
72 geoIterator.SetTopName(
"/cave_1");
75 TString pixelNameStr(
"pmt_pixel");
77 while ((curNode = geoIterator())) {
78 TString nodeName(curNode->GetName());
80 if (TString(curNode->GetVolume()->GetName()).Contains(pixelNameStr)) {
81 geoIterator.GetPath(nodePath);
82 const TGeoMatrix* curMatrix = geoIterator.GetCurrentMatrix();
83 const Double_t* curNodeTr = curMatrix->GetTranslation();
84 string path = string(nodePath.Data());
86 size_t pmtInd = path.find_last_of(
"/");
87 if (string::npos == pmtInd)
continue;
88 string pmtPath = path.substr(0, pmtInd + 1);
90 Int_t channel = std::stoul(path.substr(pmtInd + 11));
91 Int_t posAtPmt = channel / 100;
92 channel = channel % 100;
94 size_t pmtVolInd = path.rfind(
"/", pmtInd - 1);
95 if (string::npos == pmtVolInd)
continue;
96 Int_t pmtPosBP = std::stoul(path.substr(pmtVolInd + 11,
97 pmtInd - pmtVolInd - 11));
99 size_t bpInd = path.rfind(
"/", pmtVolInd - 1);
100 if (string::npos == bpInd)
continue;
101 Int_t posBP = std::stoul(path.substr(bpInd + 14,
102 pmtVolInd - bpInd - 14));
104 Int_t
x = (posBP / 10) + ((((pmtPosBP - 1) / 3) + 1) % 2);
105 Int_t
y = (posBP % 10) + (2 - ((pmtPosBP - 1) % 3));
107 Int_t DiRICH_Add = ((7 & 0xF) << 12) + ((
x & 0xF) << 8) + ((
y & 0xF) << 4) + (posAtPmt & 0xF);
108 Int_t pixelUID = ((DiRICH_Add << 16) | (channel & 0x00FF));
109 Int_t pmtUID = ((
x & 0xF) << 4) + (
y & 0xF);
114 pixelData->
fX = curNodeTr[0];
115 pixelData->
fY = curNodeTr[1];
116 pixelData->
fZ = curNodeTr[2];
126 pmtData->
fId = pmtUID;
129 pmtData->
fWidth = pmtWidth;
139 if (pmtData ==
nullptr || pmtId != pmtData->
fId) {
140 LOG(error) <<
"(pmtData == nullptr || pmtId != pmtData->fId) ";
145 LOG(info) <<
"size:" << pmtData->
fPixelAddresses.size() <<
" pmtData->fId:" << pmtData->
fId
146 <<
" pmtPath:" << pmtPath << endl
162 if (pixelData ==
nullptr)
continue;
163 pmtData->
fX += pixelData->
fX;
164 pmtData->
fY += pixelData->
fY;
165 pmtData->
fZ += pixelData->
fZ;
172 LOG(info) <<
"CbmRichMCbmDigiMapManager is initialized";