CMS 3D CMS Logo

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 14 of file TECWedgeBuilder.h.

Constructor & Destructor Documentation

◆ TECWedgeBuilder()

TECWedgeBuilder::TECWedgeBuilder ( )
inline

Definition at line 16 of file TECWedgeBuilder.h.

16 {};

Member Function Documentation

◆ build()

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

Definition at line 8 of file TECWedgeBuilder.cc.

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

Referenced by TECPetalBuilder::build().

8  {
9  vector<const GeometricDet*> theGeometricDets = aTECWedge->components();
10  //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ;
11 
12  if (theGeometricDets.size() == 1) {
13  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(theGeometricDets.front()->geographicalId());
14  return new SimpleTECWedge(theGeomDet);
15  }
16 
17  vector<const GeomDet*> innerGeomDets;
18  vector<const GeomDet*> outerGeomDets;
19 
20  //---- to evaluate meanZ
21  double meanZ = 0;
22  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
23  meanZ = meanZ + (*it)->positionBounds().z();
24  }
25 
26  meanZ = meanZ / theGeometricDets.size();
27  //edm::LogInfo(TkDetLayers) << "meanZ: " << meanZ ;
28  //----
29 
30  for (vector<const GeometricDet*>::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) {
31  //double theGeometricDetRposition = (*it)->positionBounds().perp();
32  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId());
33  //double theGeomDetRposition = theGeomDet->surface().position().perp();
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 
42  //edm::LogInfo(TkDetLayers) << "innerGeomDets.size(): " << innerGeomDets.size() ;
43  //edm::LogInfo(TkDetLayers) << "outerGeomDets.size(): " << outerGeomDets.size() ;
44 
45  return new CompositeTECWedge(innerGeomDets, outerGeomDets);
46 }
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:154
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TrackerGeomDet * idToDet(DetId) const override