File indexing completed on 2024-04-06 12:14:37
0001 #include "Geometry/EcalTestBeam/interface/EcalTBHodoscopeGeometry.h"
0002 #include "SimDataFormats/EcalTestBeam/interface/HodoscopeDetId.h"
0003
0004 typedef CaloCellGeometry::CCGFloat CCGFloat;
0005
0006 EcalTBHodoscopeGeometry::EcalTBHodoscopeGeometry() : m_cellVec(nPlanes_ * nFibres_) {}
0007
0008 EcalTBHodoscopeGeometry::~EcalTBHodoscopeGeometry() {}
0009
0010 float EcalTBHodoscopeGeometry::getFibreLp(int plane, int fibre) {
0011 if (plane < nPlanes_ && fibre < nFibres_) {
0012 return fibrePos_[plane][fibre].lp;
0013 } else {
0014 return -99999.;
0015 }
0016 }
0017
0018 float EcalTBHodoscopeGeometry::getFibreRp(int plane, int fibre) {
0019 if (plane < nPlanes_ && fibre < nFibres_) {
0020 return fibrePos_[plane][fibre].rp;
0021 } else {
0022 return -99999.;
0023 }
0024 }
0025
0026 int EcalTBHodoscopeGeometry::getNPlanes() { return nPlanes_; }
0027
0028 int EcalTBHodoscopeGeometry::getNFibres() { return nFibres_; }
0029
0030 void EcalTBHodoscopeGeometry::newCell(
0031 const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId) {
0032 const HodoscopeDetId hid(detId);
0033
0034 const unsigned int cellIndex(hid.denseIndex());
0035
0036 m_cellVec[cellIndex] = PreshowerStrip(f1, cornersMgr(), parm);
0037 addValidID(detId);
0038 }
0039
0040 const EcalTBHodoscopeGeometry::fibre_pos EcalTBHodoscopeGeometry::fibrePos_[EcalTBHodoscopeGeometry::nPlanes_]
0041 [EcalTBHodoscopeGeometry::nFibres_] = {
0042 {
0043
0044
0045
0046
0047
0048
0049 {-16.326, -15.367},
0050 {-15.849, -14.889},
0051 {-15.326, -14.368},
0052 {-14.845, -13.886},
0053 {-14.326, -13.367},
0054 {-13.843, -12.887},
0055 {-13.323, -12.366},
0056 {-12.845, -11.883},
0057 {-12.322, -11.361},
0058 {-11.841, -10.882},
0059 {-11.319, -10.359},
0060 {-10.836, -9.876},
0061 {-10.318, -9.359},
0062 {-9.831, -8.873},
0063 {-9.318, -8.357},
0064 {-8.83, -7.869},
0065 {-8.316, -7.359},
0066 {-7.826, -6.871},
0067 {-7.317, -6.359},
0068 {-6.822, -5.867},
0069 {-6.32, -5.356},
0070 {-5.824, -4.87},
0071 {-5.315, -4.357},
0072 {-4.824, -3.866},
0073 {-4.316, -3.361},
0074 {-3.821, -2.867},
0075 {-3.318, -2.362},
0076 {-2.826, -1.867},
0077 {-2.319, -1.354},
0078 {-1.825, -0.864},
0079 {-1.313, -0.351},
0080 {-0.825, 0.136},
0081 {-0.31, 0.653},
0082 {0.177, 1.135},
0083 {0.696, 1.653},
0084 {1.176, 2.137},
0085 {1.695, 2.652},
0086 {2.179, 3.138},
0087 {2.694, 3.651},
0088 {3.178, 4.136},
0089 {3.692, 4.648},
0090 {4.179, 5.134},
0091 {4.689, 5.651},
0092 {5.177, 6.133},
0093 {5.697, 6.649},
0094 {6.17, 7.134},
0095 {6.69, 7.651},
0096 {7.176, 8.134},
0097 {7.688, 8.652},
0098 {8.172, 9.138},
0099 {8.691, 9.654},
0100 {9.178, 10.13},
0101 {9.693, 10.655},
0102 {10.173, 11.132},
0103 {10.697, 11.66},
0104 {11.172, 12.129},
0105 {11.701, 12.653},
0106 {12.17, 13.128},
0107 {12.691, 13.658},
0108 {13.168, 14.13},
0109 {13.7, 14.656},
0110 {14.172, 15.134},
0111 {14.697, 15.649},
0112 {15.177, 16.13}
0113 },
0114 {
0115
0116
0117
0118
0119
0120 {-16.175, -15.229},
0121 {-15.719, -14.772},
0122 {-15.185, -14.226},
0123 {-14.727, -13.77},
0124 {-14.184, -13.235},
0125 {-13.727, -12.777},
0126 {-13.192, -12.232},
0127 {-12.733, -11.77},
0128 {-12.191, -11.239},
0129 {-11.736, -10.773},
0130 {-11.195, -10.242},
0131 {-10.735, -9.782},
0132 {-10.198, -9.239},
0133 {-9.738, -8.783},
0134 {-9.206, -8.236},
0135 {-8.739, -7.788},
0136 {-8.211, -7.239},
0137 {-7.74, -6.783},
0138 {-7.215, -6.241},
0139 {-6.743, -5.781},
0140 {-6.207, -5.248},
0141 {-5.74, -4.782},
0142 {-5.207, -4.247},
0143 {-4.743, -3.78},
0144 {-4.217, -3.249},
0145 {-3.746, -2.78},
0146 {-3.214, -2.247},
0147 {-2.746, -1.781},
0148 {-2.214, -1.249},
0149 {-1.742, -0.786},
0150 {-1.209, -0.248},
0151 {-0.744, 0.207},
0152 {-0.21, 0.751},
0153 {0.245, 1.208},
0154 {0.792, 1.757},
0155 {1.248, 2.207},
0156 {1.792, 2.756},
0157 {2.25, 3.208},
0158 {2.793, 3.757},
0159 {3.247, 4.209},
0160 {3.795, 4.754},
0161 {4.244, 5.208},
0162 {4.799, 5.752},
0163 {5.246, 6.209},
0164 {5.792, 6.75},
0165 {6.245, 7.215},
0166 {6.792, 7.753},
0167 {7.253, 8.212},
0168 {7.782, 8.753},
0169 {8.253, 9.217},
0170 {8.781, 9.748},
0171 {9.257, 10.22},
0172 {9.783, 10.745},
0173 {10.255, 11.218},
0174 {10.787, 11.746},
0175 {11.255, 12.219},
0176 {11.786, 12.744},
0177 {12.252, 13.222},
0178 {12.787, 13.741},
0179 {13.248, 14.21},
0180 {13.782, 14.735},
0181 {14.251, 15.218},
0182 {14.779, 15.731},
0183 {15.25, 16.209}
0184 },
0185 {
0186
0187
0188
0189
0190
0191 {-16.256, -15.305},
0192 {-15.774, -14.818},
0193 {-15.264, -14.306},
0194 {-14.776, -13.82},
0195 {-14.267, -13.32},
0196 {-13.779, -12.819},
0197 {-13.277, -12.323},
0198 {-12.778, -11.815},
0199 {-12.286, -11.324},
0200 {-11.776, -10.821},
0201 {-11.285, -10.324},
0202 {-10.779, -9.819},
0203 {-10.283, -9.33},
0204 {-9.778, -8.826},
0205 {-9.284, -8.329},
0206 {-8.779, -7.824},
0207 {-8.288, -7.329},
0208 {-7.785, -6.828},
0209 {-7.29, -6.329},
0210 {-6.785, -5.831},
0211 {-6.289, -5.329},
0212 {-5.789, -4.836},
0213 {-5.289, -4.332},
0214 {-4.791, -3.833},
0215 {-4.289, -3.335},
0216 {-3.791, -2.837},
0217 {-3.294, -2.334},
0218 {-2.796, -1.836},
0219 {-2.292, -1.34},
0220 {-1.792, -0.842},
0221 {-1.299, -0.344},
0222 {-0.8, 0.158},
0223 {-0.306, 0.655},
0224 {0.2, 1.156},
0225 {0.691, 1.655},
0226 {1.196, 2.154},
0227 {1.696, 2.653},
0228 {2.194, 3.153},
0229 {2.694, 3.646},
0230 {3.194, 4.144},
0231 {3.692, 4.649},
0232 {4.185, 5.141},
0233 {4.687, 5.647},
0234 {5.181, 6.14},
0235 {5.691, 6.646},
0236 {6.183, 7.138},
0237 {6.686, 7.647},
0238 {7.178, 8.139},
0239 {7.689, 8.649},
0240 {8.179, 9.133},
0241 {8.687, 9.643},
0242 {9.176, 10.133},
0243 {9.683, 10.643},
0244 {10.173, 11.13},
0245 {10.681, 11.637},
0246 {11.167, 12.122},
0247 {11.678, 12.639},
0248 {12.163, 13.119},
0249 {12.676, 13.637},
0250 {13.16, 14.118},
0251 {13.677, 14.636},
0252 {14.16, 15.12},
0253 {14.675, 15.635},
0254 {15.162, 16.119}
0255 },
0256 {
0257
0258
0259
0260
0261
0262 {-16.225, -15.271},
0263 {-15.74, -14.782},
0264 {-15.227, -14.269},
0265 {-14.74, -13.779},
0266 {-14.227, -13.264},
0267 {-13.738, -12.776},
0268 {-13.223, -12.267},
0269 {-12.734, -11.77},
0270 {-12.234, -11.266},
0271 {-11.728, -10.769},
0272 {-11.226, -10.268},
0273 {-10.73, -9.766},
0274 {-10.228, -9.268},
0275 {-9.726, -8.762},
0276 {-9.228, -8.268},
0277 {-8.72, -7.758},
0278 {-8.227, -7.266},
0279 {-7.713, -6.75},
0280 {-7.224, -6.258},
0281 {-6.707, -5.747},
0282 {-6.22, -5.256},
0283 {-5.703, -4.742},
0284 {-5.217, -4.254},
0285 {-4.703, -3.736},
0286 {-4.211, -3.25},
0287 {-3.697, -2.735},
0288 {-3.208, -2.246},
0289 {-2.696, -1.736},
0290 {-2.205, -1.242},
0291 {-1.696, -0.735},
0292 {-1.201, -0.245},
0293 {-0.695, 0.267},
0294 {-0.199, 0.759},
0295 {0.303, 1.266},
0296 {0.801, 1.76},
0297 {1.308, 2.27},
0298 {1.799, 2.761},
0299 {2.312, 3.268},
0300 {2.803, 3.762},
0301 {3.31, 4.263},
0302 {3.803, 4.765},
0303 {4.308, 5.267},
0304 {4.807, 5.768},
0305 {5.308, 6.269},
0306 {5.807, 6.768},
0307 {6.311, 7.272},
0308 {6.808, 7.764},
0309 {7.315, 8.275},
0310 {7.809, 8.771},
0311 {8.315, 9.277},
0312 {8.812, 9.773},
0313 {9.32, 10.279},
0314 {9.815, 10.775},
0315 {10.323, 11.278},
0316 {10.817, 11.778},
0317 {11.322, 12.277},
0318 {11.821, 12.782},
0319 {12.324, 13.276},
0320 {12.825, 13.789},
0321 {13.321, 14.274},
0322 {13.83, 14.789},
0323 {14.318, 15.271},
0324 {14.829, 15.786},
0325 {15.315, 16.264}
0326 }};
0327
0328 std::vector<int> EcalTBHodoscopeGeometry::getFiredFibresInPlane(float xtr, int plane) {
0329 std::vector<int> firedFibres;
0330
0331 if (plane > EcalTBHodoscopeGeometry::nPlanes_)
0332 return firedFibres;
0333
0334 for (int i(0); i != nFibres_; ++i) {
0335 if ((xtr >= fibrePos_[plane][i].lp) && (xtr <= fibrePos_[plane][i].rp))
0336 firedFibres.emplace_back(i);
0337 }
0338 return firedFibres;
0339 }
0340
0341 const CaloCellGeometry* EcalTBHodoscopeGeometry::getGeometryRawPtr(uint32_t index) const {
0342
0343 const CaloCellGeometry* cell(&m_cellVec[index]);
0344 return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell);
0345 }