CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TPBNameSpace.h
Go to the documentation of this file.
1 #ifndef Alignment_TrackerAlignment_TPBNameSpace_H
2 #define Alignment_TrackerAlignment_TPBNameSpace_H
3 
18 
19 namespace align
20 {
21  namespace tpb
22  {
24  const unsigned int lpqc[] = {5, 8, 11};
25 
27  inline unsigned int moduleNumber(align::ID, const TrackerTopology*);
28 
31  inline unsigned int ladderNumber(align::ID, const TrackerTopology*);
32 
34  inline unsigned int layerNumber(align::ID, const TrackerTopology*);
35 
37  inline unsigned int halfBarrelNumber(align::ID, const TrackerTopology*);
38  }
39 }
40 
41 unsigned int align::tpb::moduleNumber(align::ID id, const TrackerTopology* tTopo)
42 {
43  return tTopo->pxbModule(id);
44 }
45 
46 unsigned int align::tpb::ladderNumber(align::ID id, const TrackerTopology* tTopo)
47 {
48 
49 
50  unsigned int l = tTopo->pxbLadder(id); // increases with phi
51  unsigned int c = tTopo->pxbLayer(id) - 1;
52 
53 // Ladder in 1st quadrant: number = lpqc + 1 - l (1 to lpqc)
54 // Ladder in 2nd quadrant: number = l - lpqc (1 to lpqc)
55 // Ladder in 3rd quadrant: number = l - lpqc (lpqc + 1 to 2 * lpqc)
56 // Ladder in 4th quadrant: number = 5 * lpqc + 1 - l (lpqc + 1 to 2 * lpqc)
57 
58  return l > 3 * lpqc[c] ? // ladder in 4th quadrant
59  5 * lpqc[c] + 1 - l :
60  (l > lpqc[c] ? // ladder not in 1st quadrant
61  l - lpqc[c] : lpqc[c] + 1 - l);
62 }
63 
64 unsigned int align::tpb::layerNumber(align::ID id, const TrackerTopology* tTopo)
65 {
66  return tTopo->pxbLayer(id);
67 }
68 
70 {
71 
72 
73  unsigned int l = tTopo->pxbLadder(id); // increases with phi
74  unsigned int c = tTopo->pxbLayer(id) - 1;
75 
76  return l > lpqc[c] && l <= 3 * lpqc[c] ? 1 : 2;
77 }
78 
79 #endif
uint32_t ID
Definition: Definitions.h:26
unsigned int pxbLadder(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
unsigned int moduleNumber(align::ID, const TrackerTopology *)
Module number increases with z from 1 to 8.
Definition: TPBNameSpace.h:41
unsigned int layerNumber(align::ID, const TrackerTopology *)
Layer number increases with rho from 1 to 3.
Definition: TPBNameSpace.h:64
const unsigned int lpqc[]
Number of ladders for each quarter cylinder.
Definition: TPBNameSpace.h:24
unsigned int pxbLayer(const DetId &id) const
unsigned int halfBarrelNumber(align::ID, const TrackerTopology *)
Half barrel number is 1 at left side (-x) and 2 at right side (+x).
Definition: TPBNameSpace.h:69
unsigned int ladderNumber(align::ID, const TrackerTopology *)
Definition: TPBNameSpace.h:46