Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:03

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  $Date: 2010/04/30 16:20:08 $
0005  *  $Revision: 1.1 $
0006  *  \author Paolo Ronchese INFN Padova
0007  *
0008  */
0009 
0010 //----------------------
0011 // This Class' Header --
0012 //----------------------
0013 #include "CondFormats/DTObjects/interface/DTSequentialLayerNumber.h"
0014 
0015 //-------------------------------
0016 // Collaborating Class Headers --
0017 //-------------------------------
0018 
0019 //---------------
0020 // C++ Headers --
0021 //---------------
0022 
0023 //-------------------
0024 // Initializations --
0025 //-------------------
0026 
0027 namespace {
0028   constexpr int offsetChamber[] = {0, 0, 12, 24, 36};
0029   constexpr int layersPerSector = 44;
0030   constexpr int layersIn13Sectors = (layersPerSector * 12) + 8;
0031   constexpr int layersPerWheel = layersIn13Sectors + 8;
0032 }  // namespace
0033 
0034 //----------------
0035 // Constructors --
0036 //----------------
0037 DTSequentialLayerNumber::DTSequentialLayerNumber() {}
0038 
0039 //--------------
0040 // Destructor --
0041 //--------------
0042 DTSequentialLayerNumber::~DTSequentialLayerNumber() {}
0043 
0044 int DTSequentialLayerNumber::id(int wheel, int station, int sector, int superlayer, int layer) {
0045   wheel += 3;
0046   if (wheel <= 0)
0047     return -1;
0048   if (station <= 0)
0049     return -2;
0050   if (sector <= 0)
0051     return -3;
0052   if (superlayer <= 0)
0053     return -4;
0054   if (layer <= 0)
0055     return -5;
0056 
0057   int seqLayerNum = 0;
0058 
0059   if (wheel > 5)
0060     return -1;
0061   seqLayerNum += (wheel - 1) * layersPerWheel;
0062 
0063   if (sector > 14)
0064     return -2;
0065   if (sector > 12 && station < 4)
0066     return -2;
0067   if (sector > 13)
0068     seqLayerNum += layersIn13Sectors;
0069   else
0070     seqLayerNum += (sector - 1) * layersPerSector;
0071 
0072   if (station > 4)
0073     return -3;
0074   if (sector < 13)
0075     seqLayerNum += offsetChamber[station];
0076 
0077   if (superlayer > 3)
0078     return -4;
0079   if (layer > 4)
0080     return -5;
0081   if (superlayer != 2) {
0082     if (superlayer == 3)
0083       layer += 4;
0084   } else {
0085     if (station == 4)
0086       return -4;
0087     layer += 8;
0088   }
0089 
0090   return seqLayerNum + layer;
0091 }
0092 
0093 int DTSequentialLayerNumber::max() { return 5 * layersPerWheel; }