CMS 3D CMS Logo

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(), objects.autophobj::float, mps_fire::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(auto i : comp){
78  if(fabs(i->phi())>pi/2.) {
79  sum = false;
80  break;
81  }
82  }
83 
84  if(sum){
85  for(auto i : comp){
86  phi+= 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(auto i : comp){
96  double phi1 = i->phi() >= 0 ? i->phi():
97  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  }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
const Double_t pi