1 #ifndef RecoTracker_MkFitCMS_interface_LayerNumberConverter_h 2 #define RecoTracker_MkFitCMS_interface_LayerNumberConverter_h 31 return 16 + lay - 1 + (posZ ? 0 : 22);
33 return 4 + (2 * (lay - 1)) + isStereo;
35 return 16 + 12 + (2 * (lay - 1)) + isStereo + (posZ ? 0 : 22);
36 throw std::runtime_error(
"bad subDet");
39 if (det == 1 || det == 3 || det == 5) {
51 disk += 25 + 2 * lOffset;
58 if (det == 1 || det == 2)
60 if (det == 4 || det == 5)
62 throw std::runtime_error(
"bad subDet");
64 if (det == 3 || det == 5) {
65 return lay == 1 || lay == 2;
67 if (det == 4 || det == 6) {
77 if (cmsswdet == 2 || cmsswdet == 4 || cmsswdet == 6)
84 if (cmsswlay == 1 && isStereo == -1)
86 else if (cmsswlay == 2 && isStereo == -1)
88 else if (cmsswlay == 3 && isStereo == 0)
90 else if (cmsswlay == 4 && isStereo == 0)
94 else if (cmsswdet == 5) {
95 if (cmsswlay == 1 && isStereo == -1)
97 else if (cmsswlay == 2 && isStereo == -1)
99 else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
100 return 6 + cmsswlay + lOffset;
106 if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
107 return 1 + cmsswlay * 2 + isStereo + lOffset;
108 }
else if (cmsswlay == 3 && isStereo == 0)
110 else if (cmsswlay == 4 && isStereo == 0)
114 else if (cmsswdet == 5) {
115 if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
116 return 7 + cmsswlay * 2 + isStereo + lOffset;
117 }
else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
118 return 10 + cmsswlay + lOffset;
124 if (cmsswdet == 1 || cmsswdet == 3 || cmsswdet == 5)
127 return cmsswdisk - 1;
134 if ((isStereo != 0 && isStereo != 1) || cmsswdisk < 1)
137 if (cmsswdet == 4 && cmsswdisk <= 3)
138 return cmsswdisk * 2 + isStereo + lOffset;
140 else if (cmsswdet == 6 && cmsswdisk <= 9)
141 return 6 + cmsswdisk * 2 + isStereo + lOffset;
constexpr bool useMatched
int convertDiskNumber(int cmsswdet, int cmsswdisk, bool useMatched, int isStereo) const
bool doesHaveStereo(int det, int lay) const
unsigned int nLayers() const
void reset(TkLayout layout)
LayerNumberConverter(TkLayout layout)
int convertBarrelLayerNumber(int cmsswdet, int cmsswlay, bool useMatched, int isStereo) const
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const