test
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 // C++ Headers --
21 //---------------
22 namespace {
23  constexpr int cellsInTheta = 58;
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 );
28  constexpr int cellsInMB4 = cellsPerLayer[4] * 8;
29 
30  constexpr int offsetChamber[] = {0,
31  0,
32  cellsInMB1,
33  cellsInMB1 + cellsInMB2,
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 //--------------
42 // Operations --
43 //--------------
45  int station,
46  int sector,
47  int superlayer,
48  int layer,
49  int cell ) {
50 
51  wheel += 3;
52  if ( wheel <= 0 ) return -1;
53  if ( station <= 0 ) return -2;
54  if ( sector <= 0 ) return -3;
55  if ( superlayer <= 0 ) return -4;
56  if ( layer <= 0 ) return -5;
57  if ( cell <= 0 ) return -6;
58 
59  int seqWireNum = 0;
60 
61  if ( wheel > 5 ) return -1;
62  seqWireNum += ( wheel - 1 ) * cellsPerWheel;
63 
64  if ( sector > 14 ) return -2;
65  if ( sector > 12 &&
66  station < 4 ) return -2;
67  if ( sector > 13 ) seqWireNum += cellsIn13Sectors;
68  else
69  seqWireNum += ( sector - 1 ) * cellsPerSector;
70 
71  if ( station > 4 ) return -3;
72  if ( sector < 13 )
73  seqWireNum += offsetChamber[station];
74 
75  if ( superlayer > 3 ) return -4;
76  if ( layer > 4 ) return -5;
77  if ( superlayer != 2 ) {
78  if ( cell > cellsPerLayer[station] ) return -6;
79  if ( superlayer == 3 ) layer += 4;
80  seqWireNum += ( layer - 1 ) * cellsPerLayer[station];
81  }
82  else {
83  if ( station == 4 ) return -4;
84  if ( cell > cellsInTheta ) return -6;
85  seqWireNum += ( 8 * cellsPerLayer[station] ) +
86  ( ( layer - 1 ) * cellsInTheta );
87  }
88 
89  return seqWireNum + cell;
90 
91 }
92 
93 
95  return 5 * cellsPerWheel;
96 }
#define constexpr
static int id(int wheel, int station, int sector, int superlayer, int layer, int cell)