15 const std::string& digitization,
16 const std::string& gidentityString,
21 detectorDimensions(dimensions) {
30 std::vector<std::string> identity = gutilities::getStringVectorFromStringWithDelimiter(gidentityString,
",");
32 for (
auto& gid : identity) {
33 std::vector<std::string> identifier = gutilities::getStringVectorFromStringWithDelimiter(gid,
":");
36 const std::string& idName = identifier[0];
37 int idValue = std::stoi(identifier[1]);
39 gidentity.emplace_back(idName, idValue);
47 const std::string& digitization,
48 const std::string& gidentityString,
49 const std::vector<double>& dimensions) : GBase(logger),
53 detectorDimensions(dimensions) {
62 std::vector<std::string> identity = gutilities::getStringVectorFromStringWithDelimiter(gidentityString,
",");
64 for (
auto& gid : identity) {
65 std::vector<std::string> identifier = gutilities::getStringVectorFromStringWithDelimiter(gid,
":");
68 const std::string& idName = identifier[0];
69 int idValue = std::stoi(identifier[1]);
71 gidentity.emplace_back(idName, idValue);
80 if (this->gidentity.size() != that.gidentity.size()) {
81 log->debug(NORMAL,
"Touchable sizes are different");
85 log->debug(NORMAL,
" + Touchable comparison: ");
86 for (
size_t i = 0; i < this->gidentity.size(); ++i) {
87 bool equal = (this->gidentity[i].getValue() == that.gidentity[i].getValue());
88 std::string comparisonResult = equal ?
" ✅" :
" ❌";
89 log->debug(NORMAL,
" ← ", this->gidentity[i],
" → ", that.gidentity[i], comparisonResult);
90 if (!equal) {
return false; }
93 bool typeComparison =
false;
98 switch (this->gType) {
100 typeComparison = this->stepTimeAtElectronicsIndex == that.stepTimeAtElectronicsIndex;
101 result = typeComparison ?
" ✅" :
" ❌";
102 log->debug(NORMAL,
" Touchable type is readout. Time cell comparison: ", this->stepTimeAtElectronicsIndex,
" ", that.stepTimeAtElectronicsIndex,
106 typeComparison = this->trackId == that.trackId;
107 result = typeComparison ?
" ✅" :
" ❌";
108 log->debug(NORMAL,
" Touchable type is flux. Track id comparison: ", this->trackId,
" ", that.trackId,
112 typeComparison = this->trackId == that.trackId;
113 result = typeComparison ?
" ✅" :
" ❌";
114 log->debug(NORMAL,
" Touchable type is dosimeter. Track id comparison: ", this->trackId,
" ", that.trackId,
118 typeComparison =
true;
119 log->debug(NORMAL,
" Touchable type is particleCounter. No additional comparison needed, returning true ✅");
122 return typeComparison;