CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TIBNameSpace.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignment_TIBNameSpace_H
2 #define Alignment_CommonAlignment_TIBNameSpace_H
3 
17 
18 namespace align
19 {
20  namespace tib
21  {
23  const unsigned int sphs[] = {13, 15, 17, 19, 22, 23, 26, 28};
24 
26  inline unsigned int moduleNumber( align::ID );
27 
30  inline unsigned int stringNumber( align::ID );
31 
33  inline unsigned int surfaceNumber( align::ID );
34 
36  inline unsigned int halfShellNumber( align::ID );
37 
39  inline unsigned int layerNumber( align::ID );
40 
42  inline unsigned int halfBarrelNumber( align::ID );
43  }
44 }
45 
47 {
48  return TIBDetId(id).module();
49 }
50 
52 {
53  TIBDetId detId(id);
54 
55  std::vector<unsigned int> s = detId.string();
56  // s[1]: surface lower = 1, upper = 2
57  // s[2]: string no. increases with phi
58 
59  unsigned int l = 2 * (detId.layer() - 1) + s[1] - 1;
60 
61 // String on +y surface: number = s (1 to sphs)
62 // String in -y surface: number = 2 * sphs + 1 - s (1 to sphs)
63 
64  return s[2] > sphs[l] ? 2 * sphs[l] + 1 - s[2] : s[2];
65 }
66 
68 {
69  return TIBDetId(id).string()[1];
70 }
71 
73 {
74  TIBDetId detId(id);
75 
76  std::vector<unsigned int> s = detId.string();
77  // s[1]: surface lower = 1, upper = 2
78  // s[2]: string no. increases with phi
79 
80  unsigned int l = 2 * (detId.layer() - 1) + s[1] - 1;
81 
82  return s[2] > sphs[l] ? 1 : 2;
83 }
84 
86 {
87  return TIBDetId(id).layer();
88 }
89 
91 {
92  return TIBDetId(id).string()[0];
93 }
94 
95 #endif
unsigned int halfBarrelNumber(align::ID)
Half barrel number is 1 at -z side and 2 at +z side.
Definition: TIBNameSpace.h:90
unsigned int halfShellNumber(align::ID)
Half shell number is 1 for bottom (-y) and 2 for top (+y).
Definition: TIBNameSpace.h:72
uint32_t ID
Definition: Definitions.h:26
unsigned int layerNumber(align::ID)
Layer number increases with rho from 1 to 8.
Definition: TIBNameSpace.h:85
unsigned int surfaceNumber(align::ID)
Surface number is 1 for inner and 2 for outer.
Definition: TIBNameSpace.h:67
unsigned int moduleNumber(align::ID)
Module number increases with |z| from 1 to 3.
Definition: TIBNameSpace.h:46
std::vector< unsigned int > string() const
string id
Definition: TIBDetId.h:53
const unsigned int sphs[]
Number of strings for each surface of a half shell.
Definition: TIBNameSpace.h:23
unsigned int module() const
detector id
Definition: TIBDetId.h:61
unsigned int stringNumber(align::ID)
Definition: TIBNameSpace.h:51
unsigned int layer() const
layer id
Definition: TIBDetId.h:41