1 #ifndef Geometry_TrackerNumberingBuilder_CmsTrackerLevelBuilder_H
2 #define Geometry_TrackerNumberingBuilder_CmsTrackerLevelBuilder_H
13 typedef std::unary_function<const GeometricDet*, double>
uFcn;
44 const double pi = 3.141592653592;
46 return( phi>= 0 ? phi:phi+2*pi);
52 const double pi = 3.141592653592;
53 std::vector<const GeometricDet*>
const &
comp = a->
components().back()->components();
57 for(
unsigned int i=0;
i<comp.size();
i++){
58 if(fabs(comp[
i]->
phi())>pi/2.) {
65 for(
unsigned int i=0;
i<comp.size();
i++){
69 double temp = phi/float(comp.size()) < 0. ?
70 2*pi + phi/
float(comp.size()):
71 phi/
float(comp.size());
75 for(
unsigned int i=0;
i<comp.size();
i++){
76 double phi1 = comp[
i]->phi() >= 0 ? comp[
i]->phi():
81 double com = comp.front()->phi() >= 0 ? comp.front()->phi():
82 2*pi + comp.front()->phi();
83 double temp = fabs(phi/
float(comp.size()) - com) > 2. ?
84 pi - phi/float(comp.size()):
85 phi/
float(comp.size());
86 temp = temp >= 0? temp:2*pi+
temp;
94 const double pi = 3.141592653592;
95 std::vector<const GeometricDet*>
comp;
100 for(
unsigned int i=0;
i<comp.size();
i++){
101 if(fabs(comp[
i]->
phi())>pi/2.) {
108 for(
unsigned int i=0;
i<comp.size();
i++){
109 phi+= comp[
i]->phi();
112 double temp = phi/float(comp.size()) < 0. ?
113 2*pi + phi/
float(comp.size()):
114 phi/
float(comp.size());
118 for(
unsigned int i=0;
i<comp.size();
i++){
119 double phi1 = comp[
i]->phi() >= 0 ? comp[
i]->phi():
120 comp[
i]->translation().phi()+2*
pi;
124 double com = comp.front()->phi() >= 0 ? comp.front()->phi():
125 2*pi + comp.front()->phi();
126 double temp = fabs(phi/
float(comp.size()) - com) > 2. ?
127 pi - phi/float(comp.size()):
128 phi/
float(comp.size());
129 temp = temp >= 0? temp:2*pi+
temp;
137 const double pi = 3.141592653592;
139 phi = (phi>= 0 ? phi : phi+2*
pi);
140 return ( (pi-phi) >= 0 ? (pi-
phi) : (pi-phi)+2*
pi );
146 const double pi = 3.141592653592;
148 phi = ( phi <= pi ? phi : phi-2*
pi );
155 const double pi = 3.141592653592;
157 phi = ( phi <= pi ? phi : phi-2*
pi );
173 return a->
rho() < b->
rho();
virtual void sortNS(DDFilteredView &, GeometricDet *)
CmsTrackerStringToEnum _CmsTrackerStringToEnum
virtual void build(DDFilteredView &, GeometricDet *, std::string)
bool operator()(const GeometricDet *a, const GeometricDet *b) const
bool operator()(const GeometricDet *a, const GeometricDet *b) const
DDTranslation const & translation() const
bool operator()(const GeometricDet *a, const GeometricDet *b) const
bool operator()(const GeometricDet *a, const GeometricDet *b) const
bool operator()(const GeometricDet *a, const GeometricDet *b) const
ConstGeometricDetContainer deepComponents() const
GeometricDetContainer & components()
std::unary_function< const GeometricDet *, double > uFcn
virtual ~CmsTrackerLevelBuilder()
GeometricEnumType type() const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
virtual void buildComponent(DDFilteredView &, GeometricDet *, std::string)=0