CMS 3D CMS Logo

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

#include <Phase2OTEndcapRingBuilder.h>

Public Member Functions

Phase2OTEndcapRingbuild (const GeometricDet *aPhase2OTEndcapRing, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
 
 Phase2OTEndcapRingBuilder ()
 

Detailed Description

A concrete builder for Phase2OTEndcapRing

Definition at line 15 of file Phase2OTEndcapRingBuilder.h.

Constructor & Destructor Documentation

Phase2OTEndcapRingBuilder::Phase2OTEndcapRingBuilder ( )
inline

Definition at line 17 of file Phase2OTEndcapRingBuilder.h.

17 {};

Member Function Documentation

Phase2OTEndcapRing * Phase2OTEndcapRingBuilder::build ( const GeometricDet aPhase2OTEndcapRing,
const TrackerGeometry theGeomDetGeometry 
)

Definition at line 6 of file Phase2OTEndcapRingBuilder.cc.

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

Referenced by Phase2OTEndcapLayerBuilder::build().

8 {
9  vector<const GeometricDet*> allGeometricDets = aPhase2OTEndcapRing->components();
10  vector<const GeometricDet*> compGeometricDets;
11  LogDebug("TkDetLayers") << "Phase2OTEndcapRingBuilder with #Modules: " << allGeometricDets.size() << std::endl;
12 
13  vector<const GeomDet*> frontGeomDets;
14  vector<const GeomDet*> backGeomDets;
15  vector<const GeomDet*> frontGeomDetBrothers;
16  vector<const GeomDet*> backGeomDetBrothers;
17 
18  //---- to evaluate meanZ
19  double meanZ = 0;
20  double meanZBrothers = 0;
21  for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin(); it!=allGeometricDets.end();it++){
22  compGeometricDets = (*it)->components();
23  if (compGeometricDets.size() != 2){
24  LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl;
25  } else {
26  LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().z() << std::endl;
27  LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().z() << std::endl;
28  meanZ = meanZ + compGeometricDets[0]->positionBounds().z();
29  meanZBrothers = meanZBrothers + compGeometricDets[1]->positionBounds().z();
30  }
31 
32  }
33  meanZ = meanZ/allGeometricDets.size();
34  meanZBrothers = meanZBrothers/allGeometricDets.size();
35  LogDebug("TkDetLayers") << " meanZ Lower " << meanZ << std::endl;
36  LogDebug("TkDetLayers") << " meanZ Upper " << meanZBrothers << std::endl;
37 
38  for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin();
39  it!=allGeometricDets.end();it++){
40  compGeometricDets = (*it)->components();
41  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( compGeometricDets[0]->geographicalID() );
42  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl;
43 
44  if( fabs( compGeometricDets[0]->positionBounds().z() ) < fabs(meanZ))
45  frontGeomDets.push_back(theGeomDet);
46 
47  if( fabs( compGeometricDets[0]->positionBounds().z() ) > fabs(meanZ))
48  backGeomDets.push_back(theGeomDet);
49 
50  const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet( compGeometricDets[1]->geographicalID() );
51  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl;
52 
53  if( fabs( compGeometricDets[1]->positionBounds().z() ) < fabs(meanZ))
54  frontGeomDetBrothers.push_back(theGeomDetBrother);
55 
56  if( fabs( compGeometricDets[1]->positionBounds().z() ) > fabs(meanZ))
57  backGeomDetBrothers.push_back(theGeomDetBrother);
58  }
59 
60  LogDebug("TkDetLayers") << "frontGeomDets.size(): " << frontGeomDets.size() ;
61  LogDebug("TkDetLayers") << "backGeomDets.size(): " << backGeomDets.size() ;
62  LogDebug("TkDetLayers") << "frontGeomDetsBro.size(): " << frontGeomDetBrothers.size() ;
63  LogDebug("TkDetLayers") << "backGeomDetsBro.size(): " << backGeomDetBrothers.size() ;
64 
65  return new Phase2OTEndcapRing(frontGeomDets,backGeomDets,frontGeomDetBrothers,backGeomDetBrothers);
66 
67 }
#define LogDebug(id)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
#define LogTrace(id)
virtual const TrackerGeomDet * idToDet(DetId) const