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

Member Function Documentation

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

Definition at line 113 of file CmsTrackerLevelBuilder.h.

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

113  {
114  const double pi = 3.141592653592;
115  std::vector<const GeometricDet*> comp;
116  a->deepComponents(comp);
117  float phi = 0.;
118  bool sum = true;
119 
120  for(unsigned int i=0;i<comp.size();i++){
121  if(fabs(comp[i]->phi())>pi/2.) {
122  sum = false;
123  break;
124  }
125  }
126 
127  if(sum){
128  for(unsigned int i=0;i<comp.size();i++){
129  phi+= comp[i]->phi();
130  }
131 
132  double temp = phi/float(comp.size()) < 0. ?
133  2*pi + phi/float(comp.size()):
134  phi/float(comp.size());
135  return temp;
136 
137  }else{
138  for(unsigned int i=0;i<comp.size();i++){
139  double phi1 = comp[i]->phi() >= 0 ? comp[i]->phi():
140  comp[i]->translation().phi()+2*pi;
141  phi+= phi1;
142  }
143 
144  double com = comp.front()->phi() >= 0 ? comp.front()->phi():
145  2*pi + comp.front()->phi();
146  double temp = fabs(phi/float(comp.size()) - com) > 2. ?
147  pi - phi/float(comp.size()):
148  phi/float(comp.size());
149  temp = temp >= 0? temp:2*pi+temp;
150  return temp;
151  }
152  }
int i
Definition: DBlmapReader.cc:9
const Double_t pi
ConstGeometricDetContainer deepComponents() const