CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSequentialCellNumber.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2010/05/06 16:23:00 $
5  * $Revision: 1.1 $
6  * \author Paolo Ronchese INFN Padova
7  *
8  */
9 
10 //----------------------
11 // This Class' Header --
12 //----------------------
14 
15 //-------------------------------
16 // Collaborating Class Headers --
17 //-------------------------------
18 
19 
20 //---------------
21 // C++ Headers --
22 //---------------
24 constexpr int cellsPerLayer[] = {0, 50, 60, 72, 96};
25 constexpr int cellsInMB1 = ( cellsPerLayer[1] * 8 ) + ( cellsInTheta * 4 );
26 constexpr int cellsInMB2 = ( cellsPerLayer[2] * 8 ) + ( cellsInTheta * 4 );
27 constexpr int cellsInMB3 = ( cellsPerLayer[3] * 8 ) + ( cellsInTheta * 4 );
29 
31  0,
32  cellsInMB1,
34  cellsInMB1 + cellsInMB2 + cellsInMB3
35  };
36 constexpr int cellsPerSector = cellsInMB1 + cellsInMB2 + cellsInMB3 + cellsInMB4;
37 constexpr int cellsIn13Sectors = ( cellsPerSector * 12 ) + cellsInMB4;
38 constexpr int cellsPerWheel = cellsIn13Sectors + cellsInMB4;
39 
40 //--------------
41 // Operations --
42 //--------------
44  int station,
45  int sector,
46  int superlayer,
47  int layer,
48  int cell ) {
49 
50  wheel += 3;
51  if ( wheel <= 0 ) return -1;
52  if ( station <= 0 ) return -2;
53  if ( sector <= 0 ) return -3;
54  if ( superlayer <= 0 ) return -4;
55  if ( layer <= 0 ) return -5;
56  if ( cell <= 0 ) return -6;
57 
58  int seqWireNum = 0;
59 
60  if ( wheel > 5 ) return -1;
61  seqWireNum += ( wheel - 1 ) * cellsPerWheel;
62 
63  if ( sector > 14 ) return -2;
64  if ( sector > 12 &&
65  station < 4 ) return -2;
66  if ( sector > 13 ) seqWireNum += cellsIn13Sectors;
67  else
68  seqWireNum += ( sector - 1 ) * cellsPerSector;
69 
70  if ( station > 4 ) return -3;
71  if ( sector < 13 )
72  seqWireNum += offsetChamber[station];
73 
74  if ( superlayer > 3 ) return -4;
75  if ( layer > 4 ) return -5;
76  if ( superlayer != 2 ) {
77  if ( cell > cellsPerLayer[station] ) return -6;
78  if ( superlayer == 3 ) layer += 4;
79  seqWireNum += ( layer - 1 ) * cellsPerLayer[station];
80  }
81  else {
82  if ( station == 4 ) return -4;
83  if ( cell > cellsInTheta ) return -6;
84  seqWireNum += ( 8 * cellsPerLayer[station] ) +
85  ( ( layer - 1 ) * cellsInTheta );
86  }
87 
88  return seqWireNum + cell;
89 
90 }
91 
92 
94  return 5 * cellsPerWheel;
95 }
constexpr int offsetChamber[]
constexpr int cellsInMB2
constexpr int cellsIn13Sectors
constexpr int cellsInMB3
constexpr int cellsInMB4
static int id(int wheel, int station, int sector, int superlayer, int layer, int cell)
constexpr int cellsPerWheel
constexpr int cellsPerSector
constexpr int cellsInMB1
constexpr int cellsInTheta
constexpr int cellsPerLayer[]
#define constexpr