CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSequentialLayerNumber.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2010/04/30 16:20:08 $
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 //-------------------
31 
33 
35 
36 
37 //----------------
38 // Constructors --
39 //----------------
41  if ( offsetChamber == 0 ) {
42  offsetChamber = new int[5];
43  offsetChamber[1] = 0;
44  offsetChamber[2] = 12;
45  offsetChamber[3] = 24;
46  offsetChamber[4] = 36;
47  layersPerSector = 44;
48  layersIn13Sectors = ( layersPerSector * 12 ) + 8;
50  }
51 }
52 
53 
54 //--------------
55 // Destructor --
56 //--------------
58 }
59 
60 
62  int station,
63  int sector,
64  int superlayer,
65  int layer ) {
66 
67  wheel += 3;
68  if ( wheel <= 0 ) return -1;
69  if ( station <= 0 ) return -2;
70  if ( sector <= 0 ) return -3;
71  if ( superlayer <= 0 ) return -4;
72  if ( layer <= 0 ) return -5;
73 
74  int seqLayerNum = 0;
75 
76  if ( wheel > 5 ) return -1;
77  seqLayerNum += ( wheel - 1 ) * layersPerWheel;
78 
79  if ( sector > 14 ) return -2;
80  if ( sector > 12 &&
81  station < 4 ) return -2;
82  if ( sector > 13 ) seqLayerNum += layersIn13Sectors;
83  else
84  seqLayerNum += ( sector - 1 ) * layersPerSector;
85 
86  if ( station > 4 ) return -3;
87  if ( sector < 13 )
88  seqLayerNum += offsetChamber[station];
89 
90  if ( superlayer > 3 ) return -4;
91  if ( layer > 4 ) return -5;
92  if ( superlayer != 2 ) {
93  if ( superlayer == 3 ) layer += 4;
94  }
95  else {
96  if ( station == 4 ) return -4;
97  layer += 8;
98  }
99 
100  return seqLayerNum + layer;
101 
102 }
103 
104 
106  return 5 * layersPerWheel;
107 }
108 
109 
DTSequentialLayerNumber DTSequentialLayer
static int id(int wheel, int station, int sector, int superlayer, int layer)