CMS 3D CMS Logo

TECWedgeBuilder.cc
Go to the documentation of this file.
1 #include "TECWedgeBuilder.h"
2 #include "CompositeTECWedge.h"
3 #include "SimpleTECWedge.h"
4 
5 using namespace edm;
6 using namespace std;
7 
9  const TrackerGeometry* theGeomDetGeometry)
10 {
11  vector<const GeometricDet*> theGeometricDets = aTECWedge->components();
12  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
13 
14  if(theGeometricDets.size() == 1 ) {
15  const GeomDet* theGeomDet =
16  theGeomDetGeometry->idToDet( theGeometricDets.front()->geographicalID() );
17  return new SimpleTECWedge(theGeomDet);
18  }
19 
20  vector<const GeomDet*> innerGeomDets;
21  vector<const GeomDet*> outerGeomDets;
22 
23  //---- to evaluate meanZ
24  double meanZ = 0;
25  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
26  it!=theGeometricDets.end();it++){
27  meanZ = meanZ + (*it)->positionBounds().z();
28  }
29 
30  meanZ = meanZ/theGeometricDets.size();
31  //edm::LogInfo(TkDetLayers) << "meanZ: " << meanZ ;
32  //----
33 
34  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
35  it!=theGeometricDets.end();it++){
36  //double theGeometricDetRposition = (*it)->positionBounds().perp();
37  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
38  //double theGeomDetRposition = theGeomDet->surface().position().perp();
39 
40  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
41  innerGeomDets.push_back(theGeomDet);
42 
43  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
44  outerGeomDets.push_back(theGeomDet);
45  }
46 
47  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
48  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
49 
50  return new CompositeTECWedge(innerGeomDets,outerGeomDets);
51 }
TECWedge * build(const GeometricDet *aTECWedge, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLT enums.
const TrackerGeomDet * idToDet(DetId) const