CMS 3D CMS Logo

CmsTrackerLevelBuilder::ExtractPhiGluedModule Struct Reference

#include <Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.h>

List of all members.

Public Member Functions

double operator() (const GeometricDet *a) const


Detailed Description

Definition at line 92 of file CmsTrackerLevelBuilder.h.


Member Function Documentation

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     }


The documentation for this struct was generated from the following file:
Generated on Tue Jun 9 18:16:25 2009 for CMSSW by  doxygen 1.5.4