Skip to content
Snippets Groups Projects
Commit 5d142b2f authored by Martin Beyer's avatar Martin Beyer
Browse files

fallback for channel address and pmt id using previous counter implementation...

fallback for channel address and pmt id using previous counter implementation if rich geo version < v22
parent 195150d2
No related branches found
No related tags found
1 merge request!1968Draft: Rich: Deterministic pixel addresses, introduce CbmRichAddress
......@@ -72,6 +72,7 @@ void CbmRichGeoHandler::Init()
TString nodePath{};
geoIterator.GetPath(nodePath);
fFallback = !(nodePath.Contains("rich_v22") || nodePath.Contains("rich_v23") || nodePath.Contains("rich_v24"));
const std::string path = std::string(nodePath.Data());
auto pmtInd = path.find_last_of('/');
if (std::string::npos == pmtInd) continue;
......@@ -80,6 +81,10 @@ void CbmRichGeoHandler::Init()
// Derive pixel address and pmt Id from node path
switch (GetDetectorSetup(nodePath)) {
case 0: // RICH detector
if (fFallback) {
currentPixelAddress++;
break;
}
if (CreateAddressRich(path, currentPixelAddress, currentPmtId)) {
LOG(error) << "CbmRichGeoHandler::Init: CbmRichGeoHandler::CreateAddressRich failed!";
}
......@@ -105,8 +110,8 @@ void CbmRichGeoHandler::Init()
fPixelAddresses.push_back(currentPixelAddress);
if (fPmtPathToId.count(pmtPath) == 0) {
if (fFallback) currentPmtId++;
fPmtPathToId.insert(std::pair<std::string, Int_t>(pmtPath, currentPmtId));
auto pmtData = std::make_unique<CbmRichPmtData>();
pmtData->fId = currentPmtId;
pmtData->fPixelAddresses.push_back(pixelData->fAddress);
......
......@@ -105,6 +105,8 @@ class CbmRichGeoHandler {
}
private:
bool fFallback{false}; // Fallback mode for deriving CBM RICH
std::map<std::string, Int_t> fPixelPathToAddress{};
std::map<Int_t, std::unique_ptr<CbmRichPixelData>> fPixelAddressToData{};
std::vector<Int_t> fPixelAddresses{};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment