1 #ifndef RecoTracker_MkFitCMS_interface_LayerNumberConverter_h 2 #define RecoTracker_MkFitCMS_interface_LayerNumberConverter_h 29 return 16 + lay - 1 + (posZ ? 0 : 22);
31 return 4 + (2 * (lay - 1)) + isStereo;
33 return 16 + 12 + (2 * (lay - 1)) + isStereo + (posZ ? 0 : 22);
34 throw std::runtime_error(
"bad subDet");
37 if (det == 1 || det == 3 || det == 5) {
49 disk += 25 + 2 * lOffset;
56 if (det == 1 || det == 2)
58 if (det == 4 || det == 5)
60 throw std::runtime_error(
"bad subDet");
62 if (det == 3 || det == 5) {
63 return lay == 1 || lay == 2;
65 if (det == 4 || det == 6) {
75 if (cmsswdet == 2 || cmsswdet == 4 || cmsswdet == 6)
82 if (cmsswlay == 1 && isStereo == -1)
84 else if (cmsswlay == 2 && isStereo == -1)
86 else if (cmsswlay == 3 && isStereo == 0)
88 else if (cmsswlay == 4 && isStereo == 0)
92 else if (cmsswdet == 5) {
93 if (cmsswlay == 1 && isStereo == -1)
95 else if (cmsswlay == 2 && isStereo == -1)
97 else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
98 return 6 + cmsswlay + lOffset;
104 if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
105 return 1 + cmsswlay * 2 + isStereo + lOffset;
106 }
else if (cmsswlay == 3 && isStereo == 0)
108 else if (cmsswlay == 4 && isStereo == 0)
112 else if (cmsswdet == 5) {
113 if ((cmsswlay == 1 || cmsswlay == 2) && (isStereo == 0 || isStereo == 1)) {
114 return 7 + cmsswlay * 2 + isStereo + lOffset;
115 }
else if (cmsswlay >= 3 && cmsswlay <= 6 && isStereo == 0)
116 return 10 + cmsswlay + lOffset;
122 if (cmsswdet == 1 || cmsswdet == 3 || cmsswdet == 5)
125 return cmsswdisk - 1;
132 if ((isStereo != 0 && isStereo != 1) || cmsswdisk < 1)
135 if (cmsswdet == 4 && cmsswdisk <= 3)
136 return cmsswdisk * 2 + isStereo + lOffset;
138 else if (cmsswdet == 6 && cmsswdisk <= 9)
139 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