CMS 3D CMS Logo

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

#include <Phase2OTBarrelRodBuilder.h>

Public Member Functions

Phase2OTBarrelRodbuild (const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTBarrelRodBuilder ()
 

Detailed Description

A concrete builder for Phase2OTBarrelRod

Definition at line 15 of file Phase2OTBarrelRodBuilder.h.

Constructor & Destructor Documentation

Phase2OTBarrelRodBuilder::Phase2OTBarrelRodBuilder ( )
inline

Definition at line 17 of file Phase2OTBarrelRodBuilder.h.

17 {};

Member Function Documentation

Phase2OTBarrelRod * Phase2OTBarrelRodBuilder::build ( const GeometricDet thePhase2OTBarrelRod,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 7 of file Phase2OTBarrelRodBuilder.cc.

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

Referenced by Phase2OTBarrelLayerBuilder::build().

9 {
10  vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components();
11 
12  vector<const GeomDet*> innerGeomDets;
13  vector<const GeomDet*> outerGeomDets;
14  vector<const GeomDet*> innerGeomDetBrothers;
15  vector<const GeomDet*> outerGeomDetBrothers;
16 
17  // compute meanR using the first and the third module because of the pt module pairs
18  LogDebug("Phase2OTBarrelRodRadii") << "mean computed with "
19  << allGeometricDets[0]->positionBounds().perp()
20  << " and " << allGeometricDets[2]->positionBounds().perp()
21  << " and " << allGeometricDets[1]->positionBounds().perp()
22  << " and " << allGeometricDets[3]->positionBounds().perp() ;
23  double meanR = (allGeometricDets[0]->positionBounds().perp()+allGeometricDets[2]->positionBounds().perp())/2;
24  double meanRBrothers = (allGeometricDets[1]->positionBounds().perp()+allGeometricDets[3]->positionBounds().perp())/2;
25 
26  unsigned int counter=0;
27  for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin();
28  it!=allGeometricDets.end(); it++,counter++){
29  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*it)->geographicalID() );
30 
31  if(counter%2==0) {
32  if( (*it)->positionBounds().perp() < meanR)
33  innerGeomDets.push_back(theGeomDet);
34 
35  if( (*it)->positionBounds().perp() > meanR)
36  outerGeomDets.push_back(theGeomDet);
37  }
38  else {
39  if( (*it)->positionBounds().perp() < meanRBrothers)
40  innerGeomDetBrothers.push_back(theGeomDet);
41 
42  if( (*it)->positionBounds().perp() > meanRBrothers)
43  outerGeomDetBrothers.push_back(theGeomDet);
44  }
45  }
46 
47  //LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ;
48  //LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ;
49  return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers);
50 }
#define LogDebug(id)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
static std::atomic< unsigned int > counter
virtual const TrackerGeomDet * idToDet(DetId) const