CMS 3D CMS Logo

Phase2OTBarrelRodBuilder.cc
Go to the documentation of this file.
3 
4 using namespace edm;
5 using namespace std;
6 
8  const TrackerGeometry* theGeomDetGeometry) {
9  vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components();
10  vector<const GeometricDet*> compGeometricDets;
11  LogDebug("TkDetLayers") << "Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl;
12 
13  vector<const GeomDet*> innerGeomDets;
14  vector<const GeomDet*> outerGeomDets;
15  vector<const GeomDet*> innerGeomDetBrothers;
16  vector<const GeomDet*> outerGeomDetBrothers;
17 
18  double meanR = 0;
19  double meanRBrothers = 0;
20  for (vector<const GeometricDet*>::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) {
21  compGeometricDets = (*it)->components();
22  if (compGeometricDets.size() != 2) {
23  LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl;
24  } else {
25  //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl;
26  //LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().perp() << std::endl;
27  meanR = meanR + compGeometricDets[0]->positionBounds().perp();
28  meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp();
29  }
30  }
31  meanR = meanR / allGeometricDets.size();
32  meanRBrothers = meanRBrothers / allGeometricDets.size();
33  LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl;
34  LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl;
35 
36  for (vector<const GeometricDet*>::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) {
37  compGeometricDets = (*it)->components();
38  const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID());
39  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl;
40 
41  if (compGeometricDets[0]->positionBounds().perp() < meanR)
42  innerGeomDets.push_back(theGeomDet);
43 
44  if (compGeometricDets[0]->positionBounds().perp() > meanR)
45  outerGeomDets.push_back(theGeomDet);
46 
47  const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID());
48  LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl;
49  if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers)
50  innerGeomDetBrothers.push_back(theGeomDetBrother);
51 
52  if (compGeometricDets[1]->positionBounds().perp() > meanRBrothers)
53  outerGeomDetBrothers.push_back(theGeomDetBrother);
54  }
55 
56  LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size();
57  LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size();
58  LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size();
59  LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size();
60 
61  return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers);
62 }
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
MessageLogger.h
GeomDet
Definition: GeomDet.h:27
edm
HLT enums.
Definition: AlignableModifier.h:19
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
Phase2OTBarrelRod
Definition: Phase2OTBarrelRod.h:14
Phase2OTBarrelRodBuilder.h
GeometricDet
Definition: GeometricDet.h:30
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
std
Definition: JetResolutionObject.h:76
Phase2OTBarrelRodBuilder::build
Phase2OTBarrelRod * build(const GeometricDet *thePhase2OTBarrelRod, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: Phase2OTBarrelRodBuilder.cc:7
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TrackerGeometry
Definition: TrackerGeometry.h:14