CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
Phase2OTECRingBuilder Class Reference

#include <Phase2OTECRingBuilder.h>

Public Member Functions

Phase2OTECRingbuild (const GeometricDet *aPhase2OTECRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTECRingBuilder ()
 

Detailed Description

A concrete builder for Phase2OTECRing

Definition at line 15 of file Phase2OTECRingBuilder.h.

Constructor & Destructor Documentation

Phase2OTECRingBuilder::Phase2OTECRingBuilder ( )
inline

Definition at line 17 of file Phase2OTECRingBuilder.h.

17 {};

Member Function Documentation

Phase2OTECRing * Phase2OTECRingBuilder::build ( const GeometricDet aPhase2OTECRing,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 6 of file Phase2OTECRingBuilder.cc.

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

Referenced by Phase2OTECRingedLayerBuilder::build().

8 {
9  vector<const GeometricDet*> theGeometricDets = aPhase2OTECRing->components();
10  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
11 
12 
13  vector<const GeomDet*> innerGeomDets;
14  vector<const GeomDet*> outerGeomDets;
15  vector<const GeomDet*> innerGeomDetBrothers;
16  vector<const GeomDet*> outerGeomDetBrothers;
17 
18  //---- to evaluate meanZ
19  double meanZ = 0;
20  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
21  it!=theGeometricDets.end();it++){
22  meanZ = meanZ + (*it)->positionBounds().z();
23  }
24  meanZ = meanZ/theGeometricDets.size();
25  //----
26 
27  unsigned int counter=0;
28  for(vector<const GeometricDet*>::const_iterator it=theGeometricDets.begin();
29  it!=theGeometricDets.end();it++,counter++){
30 
31  if(counter%2 == 0) {
32 
33  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
34 
35  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
36  innerGeomDets.push_back(theGeomDet);
37 
38  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
39  outerGeomDets.push_back(theGeomDet);
40  }
41  else {
42 
43  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
44 
45  if( std::abs( (*it)->positionBounds().z() ) < std::abs(meanZ))
46  innerGeomDetBrothers.push_back(theGeomDet);
47 
48  if( std::abs( (*it)->positionBounds().z() ) > std::abs(meanZ))
49  outerGeomDetBrothers.push_back(theGeomDet);
50  }
51  }
52 
53  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
54  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
55 
56  return new Phase2OTECRing(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers);
57 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static std::atomic< unsigned int > counter
virtual const TrackerGeomDet * idToDet(DetId) const