CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Static Public Member Functions
CmsTrackerLevelBuilderHelper Class Reference

#include <CmsTrackerLevelBuilder.h>

Static Public Member Functions

static double getPhi (const GeometricDet *a)
 
static double getPhiGluedModule (const GeometricDet *a)
 
static double getPhiGluedModuleMirror (const GeometricDet *a)
 
static double getPhiMirror (const GeometricDet *a)
 
static double getPhiModule (const GeometricDet *a)
 
static double getPhiModuleMirror (const GeometricDet *a)
 
static bool isLessModZ (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessR (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessRModule (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessZ (const GeometricDet *a, const GeometricDet *b)
 
static bool phiSortNP (const GeometricDet *a, const GeometricDet *b)
 
static bool subDetByType (const GeometricDet *a, const GeometricDet *b)
 

Detailed Description

Definition at line 11 of file CmsTrackerLevelBuilder.h.

Member Function Documentation

double CmsTrackerLevelBuilderHelper::getPhi ( const GeometricDet a)
static
double CmsTrackerLevelBuilderHelper::getPhiGluedModule ( const GeometricDet a)
static

Definition at line 83 of file CmsTrackerLevelBuilder.cc.

References funct::abs(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::deepComponents(), mps_fire::i, M_PI, phi, and groupFilesInBlocks::temp.

Referenced by getPhiGluedModuleMirror(), CmsTrackerRingBuilder< FilteredView >::sortNS(), and CmsTrackerOTRingBuilder< FilteredView >::sortNS().

83  {
84  std::vector<const GeometricDet*> comp;
85  a->deepComponents(comp);
86  float phi = 0.;
87  bool sum = true;
88 
89  for (auto& i : comp) {
90  if (std::abs(i->phi()) > M_PI / 2.) {
91  sum = false;
92  break;
93  }
94  }
95 
96  if (sum) {
97  for (auto& i : comp) {
98  phi += i->phi();
99  }
100 
101  double temp = phi / float(comp.size()) < 0. ? 2 * M_PI + phi / float(comp.size()) : phi / float(comp.size());
102  return temp;
103 
104  } else {
105  for (auto& i : comp) {
106  double phi1 = i->phi() >= 0 ? i->phi() : i->translation().phi() + 2 * M_PI;
107  phi += phi1;
108  }
109 
110  double com = comp.front()->phi() >= 0 ? comp.front()->phi() : 2 * M_PI + comp.front()->phi();
111  double temp =
112  std::abs(phi / float(comp.size()) - com) > 2. ? M_PI - phi / float(comp.size()) : phi / float(comp.size());
113  temp = temp >= 0 ? temp : 2 * M_PI + temp;
114  return temp;
115  }
116 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
ConstGeometricDetContainer deepComponents() const
double CmsTrackerLevelBuilderHelper::getPhiGluedModuleMirror ( const GeometricDet a)
static

Definition at line 130 of file CmsTrackerLevelBuilder.cc.

References getPhiGluedModule(), M_PI, and phi.

Referenced by CmsTrackerRingBuilder< FilteredView >::sortNS().

130  {
131  double phi = getPhiGluedModule(a); // [0,2pi)
132  phi = (phi <= M_PI ? phi : phi - 2 * M_PI); // (-pi,pi]
133  return (M_PI - phi);
134 }
#define M_PI
static double getPhiGluedModule(const GeometricDet *a)
double CmsTrackerLevelBuilderHelper::getPhiMirror ( const GeometricDet a)
static

Definition at line 118 of file CmsTrackerLevelBuilder.cc.

References M_PI, phi, and GeometricDet::phi().

Referenced by CmsTrackerRingBuilder< FilteredView >::sortNS().

118  {
119  double phi = a->phi();
120  phi = (phi >= 0 ? phi : phi + 2 * M_PI); // (-pi,pi] --> [0,2pi)
121  return ((M_PI - phi) >= 0 ? (M_PI - phi) : (M_PI - phi) + 2 * M_PI); // (-pi,pi] --> [0,2pi)
122 }
#define M_PI
double phi() const
Definition: GeometricDet.h:102
double CmsTrackerLevelBuilderHelper::getPhiModule ( const GeometricDet a)
static

Definition at line 49 of file CmsTrackerLevelBuilder.cc.

References funct::abs(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::components(), mps_fire::i, M_PI, phi, and groupFilesInBlocks::temp.

Referenced by getPhiModuleMirror(), and CmsTrackerWheelBuilder< FilteredView >::sortNS().

49  {
50  std::vector<const GeometricDet*> const& comp = a->components().back()->components();
51  float phi = 0.;
52  bool sum = true;
53 
54  for (auto i : comp) {
55  if (std::abs(i->phi()) > M_PI / 2.) {
56  sum = false;
57  break;
58  }
59  }
60 
61  if (sum) {
62  for (auto i : comp) {
63  phi += i->phi();
64  }
65 
66  double temp = phi / float(comp.size()) < 0. ? 2 * M_PI + phi / float(comp.size()) : phi / float(comp.size());
67  return temp;
68 
69  } else {
70  for (auto i : comp) {
71  double phi1 = i->phi() >= 0 ? i->phi() : i->phi() + 2 * M_PI;
72  phi += phi1;
73  }
74 
75  double com = comp.front()->phi() >= 0 ? comp.front()->phi() : 2 * M_PI + comp.front()->phi();
76  double temp =
77  std::abs(phi / float(comp.size()) - com) > 2. ? M_PI - phi / float(comp.size()) : phi / float(comp.size());
78  temp = temp >= 0 ? temp : 2 * M_PI + temp;
79  return temp;
80  }
81 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
double CmsTrackerLevelBuilderHelper::getPhiModuleMirror ( const GeometricDet a)
static

Definition at line 124 of file CmsTrackerLevelBuilder.cc.

References getPhiModule(), M_PI, and phi.

124  {
125  double phi = getPhiModule(a); // [0,2pi)
126  phi = (phi <= M_PI ? phi : phi - 2 * M_PI); // (-pi,pi]
127  return (M_PI - phi);
128 }
#define M_PI
static double getPhiModule(const GeometricDet *a)
bool CmsTrackerLevelBuilderHelper::isLessModZ ( const GeometricDet a,
const GeometricDet b 
)
static
bool CmsTrackerLevelBuilderHelper::isLessR ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 140 of file CmsTrackerLevelBuilder.cc.

References GeometricDet::rho().

Referenced by CmsTrackerPanelBuilder< FilteredView >::sortNS(), and CmsTrackerSubStrctBuilder< FilteredView >::sortNS().

140 { return a->rho() < b->rho(); }
double rho() const
Definition: GeometricDet.h:101
bool CmsTrackerLevelBuilderHelper::isLessRModule ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 136 of file CmsTrackerLevelBuilder.cc.

References GeometricDet::deepComponents().

Referenced by CmsTrackerPetalBuilder< FilteredView >::sortNS(), and CmsTrackerWheelBuilder< FilteredView >::sortNS().

136  {
137  return a->deepComponents().front()->rho() < b->deepComponents().front()->rho();
138 }
ConstGeometricDetContainer deepComponents() const
bool CmsTrackerLevelBuilderHelper::isLessZ ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 30 of file CmsTrackerLevelBuilder.cc.

References GeometricDet::translation().

Referenced by CmsTrackerLadderBuilder< FilteredView >::sortNS(), and CmsTrackerOTLayerBuilder< FilteredView >::sortNS().

30  {
31  // NP** change for Phase 2 Tracker
32  if (a->translation().z() == b->translation().z()) {
33  return a->translation().rho() < b->translation().rho();
34  } else {
35  // Original version
36  return a->translation().z() < b->translation().z();
37  }
38 }
const Translation & translation() const
Definition: GeometricDet.h:100
bool CmsTrackerLevelBuilderHelper::phiSortNP ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 20 of file CmsTrackerLevelBuilder.cc.

References funct::abs(), and GeometricDet::translation().

20  {
21  if (std::abs(a->translation().rho() - b->translation().rho()) < 0.01 &&
22  (std::abs(a->translation().phi() - b->translation().phi()) < 0.01 ||
23  std::abs(a->translation().phi() - b->translation().phi()) > 6.27) &&
24  a->translation().z() * b->translation().z() > 0.0) {
25  return (std::abs(a->translation().z()) < std::abs(b->translation().z()));
26  } else
27  return false;
28 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const Translation & translation() const
Definition: GeometricDet.h:100
bool CmsTrackerLevelBuilderHelper::subDetByType ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 12 of file CmsTrackerLevelBuilder.cc.

References GeometricDet::type().

Referenced by CmsTrackerBuilder< FilteredView >::sortNS().

12  {
13  // it relies on the fact that the GeometricDet::GDEnumType enumerators used
14  // to identify the subdetectors in the upgrade geometries are equal to the
15  // ones of the present detector + n*100
16  return a->type() % 100 < b->type() % 100;
17 }
const GeometricEnumType & type() const
Definition: GeometricDet.h:91