1 #ifndef Geometry_TrackerNumberingBuilder_CmsTrackerLevelBuilder_H
2 #define Geometry_TrackerNumberingBuilder_CmsTrackerLevelBuilder_H
13 typedef std::unary_function<const GeometricDet*, double>
uFcn;
23 return a->
type()%100 < b->
type()%100;
64 const double pi = 3.141592653592;
66 return( phi>= 0 ? phi:phi+2*pi);
72 const double pi = 3.141592653592;
73 std::vector<const GeometricDet*>
const &
comp = a->
components().back()->components();
77 for(
unsigned int i=0;
i<comp.size();
i++){
78 if(fabs(comp[
i]->
phi())>pi/2.) {
85 for(
unsigned int i=0;
i<comp.size();
i++){
89 double temp = phi/float(comp.size()) < 0. ?
90 2*pi + phi/
float(comp.size()):
91 phi/
float(comp.size());
95 for(
unsigned int i=0;
i<comp.size();
i++){
96 double phi1 = comp[
i]->phi() >= 0 ? comp[
i]->phi():
101 double com = comp.front()->phi() >= 0 ? comp.front()->phi():
102 2*pi + comp.front()->phi();
103 double temp = fabs(phi/
float(comp.size()) - com) > 2. ?
104 pi - phi/float(comp.size()):
105 phi/
float(comp.size());
106 temp = temp >= 0? temp:2*pi+
temp;
114 const double pi = 3.141592653592;
115 std::vector<const GeometricDet*>
comp;
120 for(
unsigned int i=0;
i<comp.size();
i++){
121 if(fabs(comp[
i]->
phi())>pi/2.) {
128 for(
unsigned int i=0;
i<comp.size();
i++){
129 phi+= comp[
i]->phi();
132 double temp = phi/float(comp.size()) < 0. ?
133 2*pi + phi/
float(comp.size()):
134 phi/
float(comp.size());
138 for(
unsigned int i=0;
i<comp.size();
i++){
139 double phi1 = comp[
i]->phi() >= 0 ? comp[
i]->phi():
140 comp[
i]->translation().phi()+2*
pi;
144 double com = comp.front()->phi() >= 0 ? comp.front()->phi():
145 2*pi + comp.front()->phi();
146 double temp = fabs(phi/
float(comp.size()) - com) > 2. ?
147 pi - phi/float(comp.size()):
148 phi/
float(comp.size());
149 temp = temp >= 0? temp:2*pi+
temp;
157 const double pi = 3.141592653592;
159 phi = (phi>= 0 ? phi : phi+2*
pi);
160 return ( (pi-phi) >= 0 ? (pi-
phi) : (pi-phi)+2*
pi );
166 const double pi = 3.141592653592;
168 phi = ( phi <= pi ? phi : phi-2*
pi );
175 const double pi = 3.141592653592;
177 phi = ( phi <= pi ? phi : phi-2*
pi );
193 return a->
rho() < b->
rho();
virtual void sortNS(DDFilteredView &, GeometricDet *)
CmsTrackerStringToEnum _CmsTrackerStringToEnum
bool operator()(const GeometricDet *a, const GeometricDet *b) const
ConstGeometricDetContainer & components()
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
std::unary_function< const GeometricDet *, double > uFcn
virtual ~CmsTrackerLevelBuilder()
GeometricEnumType type() const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
virtual void buildComponent(DDFilteredView &, GeometricDet *, std::string)=0