File indexing completed on 2024-04-06 12:05:25
0001 #include "DetectorDescription/Core/interface/DDComparator.h"
0002
0003 #include <cstddef>
0004 #include <memory>
0005
0006 #include "DetectorDescription/Core/interface/DDBase.h"
0007
0008
0009
0010
0011
0012 bool DDCompareEqual::operator()(const DDGeoHistory&, const DDPartSelection&) { return (*this)(); }
0013
0014 bool DDCompareEqual::operator()() {
0015
0016 bool result(absResult_);
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 while (result && sIndex_ < sMax_) {
0030 sLp_ = partsel_[sIndex_].lp_;
0031 sCopyno_ = partsel_[sIndex_].copyno_;
0032 ddselection_type stype = partsel_[sIndex_].selectionType_;
0033 switch (stype) {
0034 case ddanylogp:
0035 result = nextAnylogp();
0036 break;
0037
0038 case ddanyposp:
0039 result = nextAnyposp();
0040 break;
0041
0042 case ddchildlogp:
0043 result = nextChildlogp();
0044 break;
0045
0046 case ddchildposp:
0047 result = nextChildposp();
0048 break;
0049
0050 case ddanychild:
0051 ++sIndex_;
0052 ++hIndex_;
0053 result = true;
0054 break;
0055
0056
0057 case ddanynode:
0058 result = false;
0059 break;
0060
0061 default:
0062 result = false;
0063
0064 }
0065 ++sIndex_;
0066 }
0067 return result;
0068 }
0069
0070 bool DDCompareEqual::nextAnylogp() {
0071 size_t hi = hIndex_;
0072 while (hi < hMax_) {
0073 if (sLp_ == hist_[hi].logicalPart()) {
0074 hIndex_ = hi + 1;
0075 return true;
0076 }
0077 ++hi;
0078 }
0079 hIndex_ = hi;
0080 return false;
0081 }
0082
0083 bool DDCompareEqual::nextAnyposp() {
0084 bool result(false);
0085 while (hIndex_ < hMax_) {
0086 if (sLp_ == hist_[hIndex_].logicalPart() && sCopyno_ == hist_[hIndex_].copyno()) {
0087 result = true;
0088 ++hIndex_;
0089 break;
0090 }
0091 ++hIndex_;
0092 }
0093 return result;
0094 }
0095
0096 bool DDCompareEqual::nextChildlogp() {
0097 bool result(false);
0098 if (hIndex_ < hMax_) {
0099 if (sLp_ == hist_[hIndex_].logicalPart()) {
0100 ++hIndex_;
0101 result = true;
0102 }
0103 }
0104 return result;
0105 }
0106
0107 bool DDCompareEqual::nextChildposp() {
0108 bool result(false);
0109 if (hIndex_ < hMax_) {
0110 if (sLp_ == hist_[hIndex_].logicalPart() && sCopyno_ == hist_[hIndex_].copyno()) {
0111 ++hIndex_;
0112 result = true;
0113 }
0114 }
0115 return result;
0116 }