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::ExtractPhiGluedModule Struct Reference

#include <CmsTrackerLevelBuilder.h>

Inheritance diagram for CmsTrackerLevelBuilder::ExtractPhiGluedModule:

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 AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::deepComponents(), i, phi, pi, and groupFilesInBlocks::temp.

93  {
94  const double pi = 3.141592653592;
95  std::vector<const GeometricDet*> comp;
96  a->deepComponents(comp);
97  float phi = 0.;
98  bool sum = true;
99 
100  for(unsigned int i=0;i<comp.size();i++){
101  if(fabs(comp[i]->phi())>pi/2.) {
102  sum = false;
103  break;
104  }
105  }
106 
107  if(sum){
108  for(unsigned int i=0;i<comp.size();i++){
109  phi+= comp[i]->phi();
110  }
111 
112  double temp = phi/float(comp.size()) < 0. ?
113  2*pi + phi/float(comp.size()):
114  phi/float(comp.size());
115  return temp;
116 
117  }else{
118  for(unsigned int i=0;i<comp.size();i++){
119  double phi1 = comp[i]->phi() >= 0 ? comp[i]->phi():
120  comp[i]->translation().phi()+2*pi;
121  phi+= phi1;
122  }
123 
124  double com = comp.front()->phi() >= 0 ? comp.front()->phi():
125  2*pi + comp.front()->phi();
126  double temp = fabs(phi/float(comp.size()) - com) > 2. ?
127  pi - phi/float(comp.size()):
128  phi/float(comp.size());
129  temp = temp >= 0? temp:2*pi+temp;
130  return temp;
131  }
132  }
int i
Definition: DBlmapReader.cc:9
const Double_t pi
ConstGeometricDetContainer deepComponents() const
Definition: DDAxes.h:10