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
TECWedgeBuilder Class Reference

#include <TECWedgeBuilder.h>

Public Member Functions

TECWedgebuild (const GeometricDet *aTECWedge, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 TECWedgeBuilder ()
 

Detailed Description

A concrete builder for TECWedge

Definition at line 15 of file TECWedgeBuilder.h.

Constructor & Destructor Documentation

TECWedgeBuilder::TECWedgeBuilder ( )
inline

Definition at line 17 of file TECWedgeBuilder.h.

17 {};

Member Function Documentation

TECWedge * TECWedgeBuilder::build ( const GeometricDet aTECWedge,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 8 of file TECWedgeBuilder.cc.

References funct::abs(), GeometricDet::components(), and TrackerGeometry::idToDet().

Referenced by TECPetalBuilder::build().

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 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const TrackerGeomDet * idToDet(DetId) const