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 14:41:14 $
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 //---------------
23 
24 
25 //-------------------
26 // Initializations --
27 //-------------------
36 
39 
41 
42 
43 //----------------
44 // Constructors --
45 //----------------
47  if ( cellsPerLayer == 0 ) {
48  cellsPerLayer = new int[5];
49  cellsPerLayer[1] = 50;
50  cellsPerLayer[2] = 60;
51  cellsPerLayer[3] = 72;
52  cellsPerLayer[4] = 96;
53  }
54  if ( offsetChamber == 0 ) {
55  offsetChamber = new int[5];
56  cellsInMB1 = ( cellsPerLayer[1] * 8 ) + ( cellsInTheta * 4 );
57  cellsInMB2 = ( cellsPerLayer[2] * 8 ) + ( cellsInTheta * 4 );
58  cellsInMB3 = ( cellsPerLayer[3] * 8 ) + ( cellsInTheta * 4 );
59  cellsInMB4 = cellsPerLayer[4] * 8;
60  offsetChamber[1] = 0;
63  offsetChamber[4] = cellsInMB1 + cellsInMB2 + cellsInMB3;
64  cellsPerSector = cellsInMB1 + cellsInMB2 + cellsInMB3 + cellsInMB4;
65  cellsIn13Sectors = ( cellsPerSector * 12 ) + cellsInMB4;
67  }
68 }
69 
70 
71 //--------------
72 // Destructor --
73 //--------------
75 }
76 
77 
78 //--------------
79 // Operations --
80 //--------------
82  int station,
83  int sector,
84  int superlayer,
85  int layer,
86  int cell ) {
87 
88  wheel += 3;
89  if ( wheel <= 0 ) return -1;
90  if ( station <= 0 ) return -2;
91  if ( sector <= 0 ) return -3;
92  if ( superlayer <= 0 ) return -4;
93  if ( layer <= 0 ) return -5;
94  if ( cell <= 0 ) return -6;
95 
96  int seqWireNum = 0;
97 
98  if ( wheel > 5 ) return -1;
99  seqWireNum += ( wheel - 1 ) * cellsPerWheel;
100 
101  if ( sector > 14 ) return -2;
102  if ( sector > 12 &&
103  station < 4 ) return -2;
104  if ( sector > 13 ) seqWireNum += cellsIn13Sectors;
105  else
106  seqWireNum += ( sector - 1 ) * cellsPerSector;
107 
108  if ( station > 4 ) return -3;
109  if ( sector < 13 )
110  seqWireNum += offsetChamber[station];
111 
112  if ( superlayer > 3 ) return -4;
113  if ( layer > 4 ) return -5;
114  if ( superlayer != 2 ) {
115  if ( cell > cellsPerLayer[station] ) return -6;
116  if ( superlayer == 3 ) layer += 4;
117  seqWireNum += ( layer - 1 ) * cellsPerLayer[station];
118  }
119  else {
120  if ( station == 4 ) return -4;
121  if ( cell > cellsInTheta ) return -6;
122  seqWireNum += ( 8 * cellsPerLayer[station] ) +
123  ( ( layer - 1 ) * cellsInTheta );
124  }
125 
126  return seqWireNum + cell;
127 
128 }
129 
130 
132  return 5 * cellsPerWheel;
133 }
134 
135 
DTSequentialCellNumber DTSequentialCell
static int id(int wheel, int station, int sector, int superlayer, int layer, int cell)