CMS 3D CMS Logo

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

◆ getPhi()

double CmsTrackerLevelBuilderHelper::getPhi ( const GeometricDet a)
static

◆ getPhiGluedModule()

double CmsTrackerLevelBuilderHelper::getPhiGluedModule ( const GeometricDet a)
static

Definition at line 81 of file CmsTrackerLevelBuilder.cc.

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

References a, funct::abs(), AlCaHLTBitMon_QueryRunRegistry::comp, dqmMemoryStats::float, mps_fire::i, M_PI, phi, and groupFilesInBlocks::temp.

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

◆ getPhiGluedModuleMirror()

double CmsTrackerLevelBuilderHelper::getPhiGluedModuleMirror ( const GeometricDet a)
static

Definition at line 128 of file CmsTrackerLevelBuilder.cc.

128  {
129  double phi = getPhiGluedModule(a); // [0,2pi)
130  phi = (phi <= M_PI ? phi : phi - 2 * M_PI); // (-pi,pi]
131  return (M_PI - phi);
132 }

References a, getPhiGluedModule(), M_PI, and phi.

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

◆ getPhiMirror()

double CmsTrackerLevelBuilderHelper::getPhiMirror ( const GeometricDet a)
static

Definition at line 116 of file CmsTrackerLevelBuilder.cc.

116  {
117  double phi = a->phi();
118  phi = (phi >= 0 ? phi : phi + 2 * M_PI); // (-pi,pi] --> [0,2pi)
119  return ((M_PI - phi) >= 0 ? (M_PI - phi) : (M_PI - phi) + 2 * M_PI); // (-pi,pi] --> [0,2pi)
120 }

References a, M_PI, and phi.

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

◆ getPhiModule()

double CmsTrackerLevelBuilderHelper::getPhiModule ( const GeometricDet a)
static

Definition at line 47 of file CmsTrackerLevelBuilder.cc.

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

References a, funct::abs(), AlCaHLTBitMon_QueryRunRegistry::comp, dqmMemoryStats::float, mps_fire::i, M_PI, phi, and groupFilesInBlocks::temp.

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

◆ getPhiModuleMirror()

double CmsTrackerLevelBuilderHelper::getPhiModuleMirror ( const GeometricDet a)
static

Definition at line 122 of file CmsTrackerLevelBuilder.cc.

122  {
123  double phi = getPhiModule(a); // [0,2pi)
124  phi = (phi <= M_PI ? phi : phi - 2 * M_PI); // (-pi,pi]
125  return (M_PI - phi);
126 }

References a, getPhiModule(), M_PI, and phi.

◆ isLessModZ()

bool CmsTrackerLevelBuilderHelper::isLessModZ ( const GeometricDet a,
const GeometricDet b 
)
static

◆ isLessR()

bool CmsTrackerLevelBuilderHelper::isLessR ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 138 of file CmsTrackerLevelBuilder.cc.

138 { return a->rho() < b->rho(); }

References a, and b.

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

◆ isLessRModule()

bool CmsTrackerLevelBuilderHelper::isLessRModule ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 134 of file CmsTrackerLevelBuilder.cc.

134  {
135  return a->deepComponents().front()->rho() < b->deepComponents().front()->rho();
136 }

References a, and b.

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

◆ isLessZ()

bool CmsTrackerLevelBuilderHelper::isLessZ ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 28 of file CmsTrackerLevelBuilder.cc.

28  {
29  // NP** change for Phase 2 Tracker
30  if (a->translation().z() == b->translation().z()) {
31  return a->translation().rho() < b->translation().rho();
32  } else {
33  // Original version
34  return a->translation().z() < b->translation().z();
35  }
36 }

References a, and b.

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

◆ phiSortNP()

bool CmsTrackerLevelBuilderHelper::phiSortNP ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 18 of file CmsTrackerLevelBuilder.cc.

18  {
19  if (std::abs(a->translation().rho() - b->translation().rho()) < 0.01 &&
20  (std::abs(a->translation().phi() - b->translation().phi()) < 0.01 ||
21  std::abs(a->translation().phi() - b->translation().phi()) > 6.27) &&
22  a->translation().z() * b->translation().z() > 0.0) {
23  return (std::abs(a->translation().z()) < std::abs(b->translation().z()));
24  } else
25  return false;
26 }

References a, funct::abs(), and b.

◆ subDetByType()

bool CmsTrackerLevelBuilderHelper::subDetByType ( const GeometricDet a,
const GeometricDet b 
)
static

Definition at line 10 of file CmsTrackerLevelBuilder.cc.

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

References a, and b.

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

mps_fire.i
i
Definition: mps_fire.py:355
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
CmsTrackerLevelBuilderHelper::getPhiGluedModule
static double getPhiGluedModule(const GeometricDet *a)
Definition: CmsTrackerLevelBuilder.cc:81
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
CmsTrackerLevelBuilderHelper::getPhiModule
static double getPhiModule(const GeometricDet *a)
Definition: CmsTrackerLevelBuilder.cc:47
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
DDAxes::phi
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22