#include <Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.h>
Public Member Functions | |
double | operator() (const GeometricDet *a) const |
Definition at line 92 of file CmsTrackerLevelBuilder.h.
double CmsTrackerLevelBuilder::ExtractPhiGluedModule::operator() | ( | const GeometricDet * | a | ) | const [inline] |
Definition at line 93 of file CmsTrackerLevelBuilder.h.
References GeometricDet::deepComponents(), i, phi, pi, sum(), and pyDBSRunClass::temp.
00093 { 00094 const double pi = 3.141592653592; 00095 std::vector<const GeometricDet*> comp; 00096 a->deepComponents(comp); 00097 float phi = 0.; 00098 bool sum = true; 00099 00100 for(unsigned int i=0;i<comp.size();i++){ 00101 if(fabs(comp[i]->phi())>pi/2.) { 00102 sum = false; 00103 break; 00104 } 00105 } 00106 00107 if(sum){ 00108 for(unsigned int i=0;i<comp.size();i++){ 00109 phi+= comp[i]->phi(); 00110 } 00111 00112 double temp = phi/float(comp.size()) < 0. ? 00113 2*pi + phi/float(comp.size()): 00114 phi/float(comp.size()); 00115 return temp; 00116 00117 }else{ 00118 for(unsigned int i=0;i<comp.size();i++){ 00119 double phi1 = comp[i]->phi() >= 0 ? comp[i]->phi(): 00120 comp[i]->translation().phi()+2*pi; 00121 phi+= phi1; 00122 } 00123 00124 double com = comp.front()->phi() >= 0 ? comp.front()->phi(): 00125 2*pi + comp.front()->phi(); 00126 double temp = fabs(phi/float(comp.size()) - com) > 2. ? 00127 pi - phi/float(comp.size()): 00128 phi/float(comp.size()); 00129 temp = temp >= 0? temp:2*pi+temp; 00130 return temp; 00131 } 00132 }