CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
CmsTrackerLevelBuilder::ExtractPhiModule Struct Reference

#include <CmsTrackerLevelBuilder.h>

Inheritance diagram for CmsTrackerLevelBuilder::ExtractPhiModule:

Public Member Functions

double operator() (const GeometricDet *a) const
 

Detailed Description

Definition at line 70 of file CmsTrackerLevelBuilder.h.

Member Function Documentation

double CmsTrackerLevelBuilder::ExtractPhiModule::operator() ( const GeometricDet a) const
inline

Definition at line 71 of file CmsTrackerLevelBuilder.h.

References AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::components(), i, phi, pi, and groupFilesInBlocks::temp.

71  {
72  const double pi = 3.141592653592;
73  std::vector<const GeometricDet*> const & comp = a->components().back()->components();
74  float phi = 0.;
75  bool sum = true;
76 
77  for(unsigned int i=0;i<comp.size();i++){
78  if(fabs(comp[i]->phi())>pi/2.) {
79  sum = false;
80  break;
81  }
82  }
83 
84  if(sum){
85  for(unsigned int i=0;i<comp.size();i++){
86  phi+= comp[i]->phi();
87  }
88 
89  double temp = phi/float(comp.size()) < 0. ?
90  2*pi + phi/float(comp.size()):
91  phi/float(comp.size());
92  return temp;
93 
94  }else{
95  for(unsigned int i=0;i<comp.size();i++){
96  double phi1 = comp[i]->phi() >= 0 ? comp[i]->phi():
97  comp[i]->phi()+2*pi;
98  phi+= phi1;
99  }
100 
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;
107  return temp;
108  }
109  }
int i
Definition: DBlmapReader.cc:9
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
const Double_t pi