Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:49:22

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                                                                                    // Position is in mm
0044                                                                                    // FIBRES POSITIONS
0045                                                                                    //
0046                                                                                    // - PLANE 0 -
0047                                                                                    // transverse with respect beam axis
0048 
0049                                                                                    {-16.326, -15.367},  // fibre33
0050                                                                                    {-15.849, -14.889},  // fibre1
0051                                                                                    {-15.326, -14.368},  // fibre34
0052                                                                                    {-14.845, -13.886},  // fibre2
0053                                                                                    {-14.326, -13.367},  // fibre35
0054                                                                                    {-13.843, -12.887},  // fibre3
0055                                                                                    {-13.323, -12.366},  // fibre36
0056                                                                                    {-12.845, -11.883},  // fibre4
0057                                                                                    {-12.322, -11.361},  // fibre37
0058                                                                                    {-11.841, -10.882},  // fibre5
0059                                                                                    {-11.319, -10.359},  // fibre38
0060                                                                                    {-10.836, -9.876},   // fibre6
0061                                                                                    {-10.318, -9.359},   // fibre39
0062                                                                                    {-9.831, -8.873},    // fibre7
0063                                                                                    {-9.318, -8.357},    // fibre40
0064                                                                                    {-8.83, -7.869},     // fibre8
0065                                                                                    {-8.316, -7.359},    // fibre41
0066                                                                                    {-7.826, -6.871},    // fibre9
0067                                                                                    {-7.317, -6.359},    // fibre42
0068                                                                                    {-6.822, -5.867},    // fibre10
0069                                                                                    {-6.32, -5.356},     // fibre43
0070                                                                                    {-5.824, -4.87},     // fibre11
0071                                                                                    {-5.315, -4.357},    // fibre44
0072                                                                                    {-4.824, -3.866},    // fibre12
0073                                                                                    {-4.316, -3.361},    // fibre45
0074                                                                                    {-3.821, -2.867},    // fibre13
0075                                                                                    {-3.318, -2.362},    // fibre46
0076                                                                                    {-2.826, -1.867},    // fibre14
0077                                                                                    {-2.319, -1.354},    // fibre47
0078                                                                                    {-1.825, -0.864},    // fibre15
0079                                                                                    {-1.313, -0.351},    // fibre48
0080                                                                                    {-0.825, 0.136},     // fibre16
0081                                                                                    {-0.31, 0.653},      // fibre49
0082                                                                                    {0.177, 1.135},      // fibre17
0083                                                                                    {0.696, 1.653},      // fibre50
0084                                                                                    {1.176, 2.137},      // fibre18
0085                                                                                    {1.695, 2.652},      // fibre51
0086                                                                                    {2.179, 3.138},      // fibre19
0087                                                                                    {2.694, 3.651},      // fibre52
0088                                                                                    {3.178, 4.136},      // fibre20
0089                                                                                    {3.692, 4.648},      // fibre53
0090                                                                                    {4.179, 5.134},      // fibre21
0091                                                                                    {4.689, 5.651},      // fibre54
0092                                                                                    {5.177, 6.133},      // fibre22
0093                                                                                    {5.697, 6.649},      // fibre55
0094                                                                                    {6.17, 7.134},       // fibre23
0095                                                                                    {6.69, 7.651},       // fibre56
0096                                                                                    {7.176, 8.134},      // fibre24
0097                                                                                    {7.688, 8.652},      // fibre57
0098                                                                                    {8.172, 9.138},      // fibre25
0099                                                                                    {8.691, 9.654},      // fibre58
0100                                                                                    {9.178, 10.13},      // fibre26
0101                                                                                    {9.693, 10.655},     // fibre59
0102                                                                                    {10.173, 11.132},    // fibre27
0103                                                                                    {10.697, 11.66},     // fibre60
0104                                                                                    {11.172, 12.129},    // fibre28
0105                                                                                    {11.701, 12.653},    // fibre61
0106                                                                                    {12.17, 13.128},     // fibre29
0107                                                                                    {12.691, 13.658},    // fibre62
0108                                                                                    {13.168, 14.13},     // fibre30
0109                                                                                    {13.7, 14.656},      // fibre63
0110                                                                                    {14.172, 15.134},    // fibre31
0111                                                                                    {14.697, 15.649},    // fibre64
0112                                                                                    {15.177, 16.13}      // fibre32
0113                                                                                },
0114                                                                                {
0115                                                                                    // FIBRES POSITIONS
0116                                                                                    //
0117                                                                                    // - PLANE 1 -
0118                                                                                    // transverse with respect beam axis
0119 
0120                                                                                    {-16.175, -15.229},  // fibre33
0121                                                                                    {-15.719, -14.772},  // fibre1
0122                                                                                    {-15.185, -14.226},  // fibre34
0123                                                                                    {-14.727, -13.77},   // fibre2
0124                                                                                    {-14.184, -13.235},  // fibre35
0125                                                                                    {-13.727, -12.777},  // fibre3
0126                                                                                    {-13.192, -12.232},  // fibre36
0127                                                                                    {-12.733, -11.77},   // fibre4
0128                                                                                    {-12.191, -11.239},  // fibre37
0129                                                                                    {-11.736, -10.773},  // fibre5
0130                                                                                    {-11.195, -10.242},  // fibre38
0131                                                                                    {-10.735, -9.782},   // fibre6
0132                                                                                    {-10.198, -9.239},   // fibre39
0133                                                                                    {-9.738, -8.783},    // fibre7
0134                                                                                    {-9.206, -8.236},    // fibre40
0135                                                                                    {-8.739, -7.788},    // fibre8
0136                                                                                    {-8.211, -7.239},    // fibre41
0137                                                                                    {-7.74, -6.783},     // fibre9
0138                                                                                    {-7.215, -6.241},    // fibre42
0139                                                                                    {-6.743, -5.781},    // fibre10
0140                                                                                    {-6.207, -5.248},    // fibre43
0141                                                                                    {-5.74, -4.782},     // fibre11
0142                                                                                    {-5.207, -4.247},    // fibre44
0143                                                                                    {-4.743, -3.78},     // fibre12
0144                                                                                    {-4.217, -3.249},    // fibre45
0145                                                                                    {-3.746, -2.78},     // fibre13
0146                                                                                    {-3.214, -2.247},    // fibre46
0147                                                                                    {-2.746, -1.781},    // fibre14
0148                                                                                    {-2.214, -1.249},    // fibre47
0149                                                                                    {-1.742, -0.786},    // fibre15
0150                                                                                    {-1.209, -0.248},    // fibre48
0151                                                                                    {-0.744, 0.207},     // fibre16
0152                                                                                    {-0.21, 0.751},      // fibre49
0153                                                                                    {0.245, 1.208},      // fibre17
0154                                                                                    {0.792, 1.757},      // fibre50
0155                                                                                    {1.248, 2.207},      // fibre18
0156                                                                                    {1.792, 2.756},      // fibre51
0157                                                                                    {2.25, 3.208},       // fibre19
0158                                                                                    {2.793, 3.757},      // fibre52
0159                                                                                    {3.247, 4.209},      // fibre20
0160                                                                                    {3.795, 4.754},      // fibre53
0161                                                                                    {4.244, 5.208},      // fibre21
0162                                                                                    {4.799, 5.752},      // fibre54
0163                                                                                    {5.246, 6.209},      // fibre22
0164                                                                                    {5.792, 6.75},       // fibre55
0165                                                                                    {6.245, 7.215},      // fibre23
0166                                                                                    {6.792, 7.753},      // fibre56
0167                                                                                    {7.253, 8.212},      // fibre24
0168                                                                                    {7.782, 8.753},      // fibre57
0169                                                                                    {8.253, 9.217},      // fibre25
0170                                                                                    {8.781, 9.748},      // fibre58
0171                                                                                    {9.257, 10.22},      // fibre26
0172                                                                                    {9.783, 10.745},     // fibre59
0173                                                                                    {10.255, 11.218},    // fibre27
0174                                                                                    {10.787, 11.746},    // fibre60
0175                                                                                    {11.255, 12.219},    // fibre28
0176                                                                                    {11.786, 12.744},    // fibre61
0177                                                                                    {12.252, 13.222},    // fibre29
0178                                                                                    {12.787, 13.741},    // fibre62
0179                                                                                    {13.248, 14.21},     // fibre30
0180                                                                                    {13.782, 14.735},    // fibre63
0181                                                                                    {14.251, 15.218},    // fibre31
0182                                                                                    {14.779, 15.731},    // fibre64
0183                                                                                    {15.25, 16.209}      // fibre32
0184                                                                                },
0185                                                                                {
0186                                                                                    // FIBRES POSITIONS
0187                                                                                    //
0188                                                                                    // - PLANE 2 -
0189                                                                                    // transverse with respect beam axis
0190 
0191                                                                                    {-16.256, -15.305},  // fibre33
0192                                                                                    {-15.774, -14.818},  // fibre1
0193                                                                                    {-15.264, -14.306},  // fibre34
0194                                                                                    {-14.776, -13.82},   // fibre2
0195                                                                                    {-14.267, -13.32},   // fibre35
0196                                                                                    {-13.779, -12.819},  // fibre3
0197                                                                                    {-13.277, -12.323},  // fibre36
0198                                                                                    {-12.778, -11.815},  // fibre4
0199                                                                                    {-12.286, -11.324},  // fibre37
0200                                                                                    {-11.776, -10.821},  // fibre5
0201                                                                                    {-11.285, -10.324},  // fibre38
0202                                                                                    {-10.779, -9.819},   // fibre6
0203                                                                                    {-10.283, -9.33},    // fibre39
0204                                                                                    {-9.778, -8.826},    // fibre7
0205                                                                                    {-9.284, -8.329},    // fibre40
0206                                                                                    {-8.779, -7.824},    // fibre8
0207                                                                                    {-8.288, -7.329},    // fibre41
0208                                                                                    {-7.785, -6.828},    // fibre9
0209                                                                                    {-7.29, -6.329},     // fibre42
0210                                                                                    {-6.785, -5.831},    // fibre10
0211                                                                                    {-6.289, -5.329},    // fibre43
0212                                                                                    {-5.789, -4.836},    // fibre11
0213                                                                                    {-5.289, -4.332},    // fibre44
0214                                                                                    {-4.791, -3.833},    // fibre12
0215                                                                                    {-4.289, -3.335},    // fibre45
0216                                                                                    {-3.791, -2.837},    // fibre13
0217                                                                                    {-3.294, -2.334},    // fibre46
0218                                                                                    {-2.796, -1.836},    // fibre14
0219                                                                                    {-2.292, -1.34},     // fibre47
0220                                                                                    {-1.792, -0.842},    // fibre15
0221                                                                                    {-1.299, -0.344},    // fibre48
0222                                                                                    {-0.8, 0.158},       // fibre16
0223                                                                                    {-0.306, 0.655},     // fibre49
0224                                                                                    {0.2, 1.156},        // fibre17
0225                                                                                    {0.691, 1.655},      // fibre50
0226                                                                                    {1.196, 2.154},      // fibre18
0227                                                                                    {1.696, 2.653},      // fibre51
0228                                                                                    {2.194, 3.153},      // fibre19
0229                                                                                    {2.694, 3.646},      // fibre52
0230                                                                                    {3.194, 4.144},      // fibre20
0231                                                                                    {3.692, 4.649},      // fibre53
0232                                                                                    {4.185, 5.141},      // fibre21
0233                                                                                    {4.687, 5.647},      // fibre54
0234                                                                                    {5.181, 6.14},       // fibre22
0235                                                                                    {5.691, 6.646},      // fibre55
0236                                                                                    {6.183, 7.138},      // fibre23
0237                                                                                    {6.686, 7.647},      // fibre56
0238                                                                                    {7.178, 8.139},      // fibre24
0239                                                                                    {7.689, 8.649},      // fibre57
0240                                                                                    {8.179, 9.133},      // fibre25
0241                                                                                    {8.687, 9.643},      // fibre58
0242                                                                                    {9.176, 10.133},     // fibre26
0243                                                                                    {9.683, 10.643},     // fibre59
0244                                                                                    {10.173, 11.13},     // fibre27
0245                                                                                    {10.681, 11.637},    // fibre60
0246                                                                                    {11.167, 12.122},    // fibre28
0247                                                                                    {11.678, 12.639},    // fibre61
0248                                                                                    {12.163, 13.119},    // fibre29
0249                                                                                    {12.676, 13.637},    // fibre62
0250                                                                                    {13.16, 14.118},     // fibre30
0251                                                                                    {13.677, 14.636},    // fibre63
0252                                                                                    {14.16, 15.12},      // fibre31
0253                                                                                    {14.675, 15.635},    // fibre64
0254                                                                                    {15.162, 16.119}     // fibre32
0255                                                                                },
0256                                                                                {
0257                                                                                    // FIBRES POSITIONS
0258                                                                                    //
0259                                                                                    // - PLANE 3 -
0260                                                                                    // transverse with respect beam axis
0261 
0262                                                                                    {-16.225, -15.271},  // fibre33
0263                                                                                    {-15.74, -14.782},   // fibre1
0264                                                                                    {-15.227, -14.269},  // fibre34
0265                                                                                    {-14.74, -13.779},   // fibre2
0266                                                                                    {-14.227, -13.264},  // fibre35
0267                                                                                    {-13.738, -12.776},  // fibre3
0268                                                                                    {-13.223, -12.267},  // fibre36
0269                                                                                    {-12.734, -11.77},   // fibre4
0270                                                                                    {-12.234, -11.266},  // fibre37
0271                                                                                    {-11.728, -10.769},  // fibre5
0272                                                                                    {-11.226, -10.268},  // fibre38
0273                                                                                    {-10.73, -9.766},    // fibre6
0274                                                                                    {-10.228, -9.268},   // fibre39
0275                                                                                    {-9.726, -8.762},    // fibre7
0276                                                                                    {-9.228, -8.268},    // fibre40
0277                                                                                    {-8.72, -7.758},     // fibre8
0278                                                                                    {-8.227, -7.266},    // fibre41
0279                                                                                    {-7.713, -6.75},     // fibre9
0280                                                                                    {-7.224, -6.258},    // fibre42
0281                                                                                    {-6.707, -5.747},    // fibre10
0282                                                                                    {-6.22, -5.256},     // fibre43
0283                                                                                    {-5.703, -4.742},    // fibre11
0284                                                                                    {-5.217, -4.254},    // fibre44
0285                                                                                    {-4.703, -3.736},    // fibre12
0286                                                                                    {-4.211, -3.25},     // fibre45
0287                                                                                    {-3.697, -2.735},    // fibre13
0288                                                                                    {-3.208, -2.246},    // fibre46
0289                                                                                    {-2.696, -1.736},    // fibre14
0290                                                                                    {-2.205, -1.242},    // fibre47
0291                                                                                    {-1.696, -0.735},    // fibre15
0292                                                                                    {-1.201, -0.245},    // fibre48
0293                                                                                    {-0.695, 0.267},     // fibre16
0294                                                                                    {-0.199, 0.759},     // fibre49
0295                                                                                    {0.303, 1.266},      // fibre17
0296                                                                                    {0.801, 1.76},       // fibre50
0297                                                                                    {1.308, 2.27},       // fibre18
0298                                                                                    {1.799, 2.761},      // fibre51
0299                                                                                    {2.312, 3.268},      // fibre19
0300                                                                                    {2.803, 3.762},      // fibre52
0301                                                                                    {3.31, 4.263},       // fibre20
0302                                                                                    {3.803, 4.765},      // fibre53
0303                                                                                    {4.308, 5.267},      // fibre21
0304                                                                                    {4.807, 5.768},      // fibre54
0305                                                                                    {5.308, 6.269},      // fibre22
0306                                                                                    {5.807, 6.768},      // fibre55
0307                                                                                    {6.311, 7.272},      // fibre23
0308                                                                                    {6.808, 7.764},      // fibre56
0309                                                                                    {7.315, 8.275},      // fibre24
0310                                                                                    {7.809, 8.771},      // fibre57
0311                                                                                    {8.315, 9.277},      // fibre25
0312                                                                                    {8.812, 9.773},      // fibre58
0313                                                                                    {9.32, 10.279},      // fibre26
0314                                                                                    {9.815, 10.775},     // fibre59
0315                                                                                    {10.323, 11.278},    // fibre27
0316                                                                                    {10.817, 11.778},    // fibre60
0317                                                                                    {11.322, 12.277},    // fibre28
0318                                                                                    {11.821, 12.782},    // fibre61
0319                                                                                    {12.324, 13.276},    // fibre29
0320                                                                                    {12.825, 13.789},    // fibre62
0321                                                                                    {13.321, 14.274},    // fibre30
0322                                                                                    {13.83, 14.789},     // fibre63
0323                                                                                    {14.318, 15.271},    // fibre31
0324                                                                                    {14.829, 15.786},    // fibre64
0325                                                                                    {15.315, 16.264}     // fibre32
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   // Modify the RawPtr class
0343   const CaloCellGeometry* cell(&m_cellVec[index]);
0344   return (m_cellVec.size() < index || nullptr == cell->param() ? nullptr : cell);
0345 }