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 50 of file CmsTrackerLevelBuilder.h.

Member Function Documentation

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

Definition at line 51 of file CmsTrackerLevelBuilder.h.

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

51  {
52  const double pi = 3.141592653592;
53  std::vector<const GeometricDet*> const & comp = a->components().back()->components();
54  float phi = 0.;
55  bool sum = true;
56 
57  for(unsigned int i=0;i<comp.size();i++){
58  if(fabs(comp[i]->phi())>pi/2.) {
59  sum = false;
60  break;
61  }
62  }
63 
64  if(sum){
65  for(unsigned int i=0;i<comp.size();i++){
66  phi+= comp[i]->phi();
67  }
68 
69  double temp = phi/float(comp.size()) < 0. ?
70  2*pi + phi/float(comp.size()):
71  phi/float(comp.size());
72  return temp;
73 
74  }else{
75  for(unsigned int i=0;i<comp.size();i++){
76  double phi1 = comp[i]->phi() >= 0 ? comp[i]->phi():
77  comp[i]->phi()+2*pi;
78  phi+= phi1;
79  }
80 
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;
87  return temp;
88  }
89  }
int i
Definition: DBlmapReader.cc:9
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:169
double pi
Definition: DDAxes.h:10