CMS 3D CMS Logo

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

#include <TIDRingBuilder.h>

Public Member Functions

TIDRingbuild (const GeometricDet *aTIDRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 TIDRingBuilder ()
 

Detailed Description

A concrete builder for TIDRing

Definition at line 14 of file TIDRingBuilder.h.

Constructor & Destructor Documentation

TIDRingBuilder::TIDRingBuilder ( )
inline

Definition at line 16 of file TIDRingBuilder.h.

16 {};

Member Function Documentation

TIDRing * TIDRingBuilder::build ( const GeometricDet aTIDRing,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 6 of file TIDRingBuilder.cc.

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

Referenced by TIDLayerBuilder::build().

6  {
7  vector<const GeometricDet*> theGeometricDets = aTIDRing->components();
8  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
9 
10  vector<const GeomDet*> innerGeomDets;
11  vector<const GeomDet*> outerGeomDets;
12 
13  //---- to evaluate meanZ
14  double meanZ = 0;
15  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
16  meanZ = meanZ + (*it)->positionBounds().z();
17  }
18  meanZ = meanZ / theGeometricDets.size();
19  //----
20 
21  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
22  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
23 
24  if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ))
25  innerGeomDets.push_back(theGeomDet);
26 
27  if (std::abs((*it)->positionBounds().z()) > std::abs(meanZ))
28  outerGeomDets.push_back(theGeomDet);
29  }
30 
31  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
32  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
33 
34  return new TIDRing(innerGeomDets, outerGeomDets);
35 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TrackerGeomDet * idToDet(DetId) const override