CMS 3D CMS Logo

GeometricSearchTrackerBuilder.cc
Go to the documentation of this file.
3 
8 #include "TIBLayerBuilder.h"
9 #include "TOBLayerBuilder.h"
10 #include "TIDLayerBuilder.h"
11 #include "TECLayerBuilder.h"
12 
14 
17 
19 #include <boost/function.hpp>
20 #include <boost/bind.hpp>
21 
22 using namespace std;
23 
25  const TrackerGeometry* theGeomDetGeometry,
26  const TrackerTopology* tTopo) {
27  PixelBarrelLayerBuilder aPixelBarrelLayerBuilder;
28  Phase2OTBarrelLayerBuilder aPhase2OTBarrelLayerBuilder;
31  Phase2EndcapLayerBuilder aPhase2EndcapLayerBuilder;
32  TIBLayerBuilder aTIBLayerBuilder;
33  TOBLayerBuilder aTOBLayerBuilder;
34  TIDLayerBuilder aTIDLayerBuilder;
35  TECLayerBuilder aTECLayerBuilder;
36 
37  vector<BarrelDetLayer const*> thePxlBarLayers;
38  vector<BarrelDetLayer const*> theTIBLayers;
39  vector<BarrelDetLayer const*> theTOBLayers;
40  vector<ForwardDetLayer const*> theNegPxlFwdLayers;
41  vector<ForwardDetLayer const*> thePosPxlFwdLayers;
42  vector<ForwardDetLayer const*> theNegTIDLayers;
43  vector<ForwardDetLayer const*> thePosTIDLayers;
44  vector<ForwardDetLayer const*> theNegTECLayers;
45  vector<ForwardDetLayer const*> thePosTECLayers;
46 
47  vector<const GeometricDet*> theGeometricDetLayers = theGeometricTracker->components();
48  for (vector<const GeometricDet*>::const_iterator it = theGeometricDetLayers.begin();
49  it != theGeometricDetLayers.end();
50  it++) {
51  if ((*it)->type() == GeometricDet::PixelBarrel) {
52  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
53  for (vector<const GeometricDet*>::const_iterator it2 = thePxlBarGeometricDetLayers.begin();
54  it2 != thePxlBarGeometricDetLayers.end();
55  it2++) {
56  thePxlBarLayers.push_back(aPixelBarrelLayerBuilder.build(*it2, theGeomDetGeometry));
57  }
58  }
59 
60  if ((*it)->type() == GeometricDet::PixelPhase1Barrel) {
61  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
62  for (vector<const GeometricDet*>::const_iterator it2 = thePxlBarGeometricDetLayers.begin();
63  it2 != thePxlBarGeometricDetLayers.end();
64  it2++) {
65  thePxlBarLayers.push_back(aPixelBarrelLayerBuilder.build(*it2, theGeomDetGeometry));
66  }
67  }
68 
69  if ((*it)->type() == GeometricDet::PixelPhase2Barrel) {
70  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
71  for (vector<const GeometricDet*>::const_iterator it2 = thePxlBarGeometricDetLayers.begin();
72  it2 != thePxlBarGeometricDetLayers.end();
73  it2++) {
74  thePxlBarLayers.push_back(aPixelBarrelLayerBuilder.build(*it2, theGeomDetGeometry));
75  }
76  }
77 
78  if ((*it)->type() == GeometricDet::TIB) {
79  vector<const GeometricDet*> theTIBGeometricDetLayers = (*it)->components();
80  for (vector<const GeometricDet*>::const_iterator it2 = theTIBGeometricDetLayers.begin();
81  it2 != theTIBGeometricDetLayers.end();
82  it2++) {
83  theTIBLayers.push_back(aTIBLayerBuilder.build(*it2, theGeomDetGeometry));
84  }
85  }
86 
87  if ((*it)->type() == GeometricDet::TOB) {
88  vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components();
89  for (vector<const GeometricDet*>::const_iterator it2 = theTOBGeometricDetLayers.begin();
90  it2 != theTOBGeometricDetLayers.end();
91  it2++) {
92  theTOBLayers.push_back(aTOBLayerBuilder.build(*it2, theGeomDetGeometry));
93  }
94  }
95 
96  if ((*it)->type() == GeometricDet::OTPhase2Barrel) {
97  vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components();
98  for (vector<const GeometricDet*>::const_iterator it2 = theTOBGeometricDetLayers.begin();
99  it2 != theTOBGeometricDetLayers.end();
100  it2++) {
101  theTOBLayers.push_back(aPhase2OTBarrelLayerBuilder.build(*it2, theGeomDetGeometry));
102  }
103  }
104 
105  if ((*it)->type() == GeometricDet::PixelEndCap) {
106  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
107  for (vector<const GeometricDet*>::const_iterator it2 = thePxlFwdGeometricDetLayers.begin();
108  it2 != thePxlFwdGeometricDetLayers.end();
109  it2++) {
110  if ((*it2)->positionBounds().z() < 0)
111  theNegPxlFwdLayers.push_back(aPixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
112  if ((*it2)->positionBounds().z() > 0)
113  thePosPxlFwdLayers.push_back(aPixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
114  }
115  }
116 
117  if ((*it)->type() == GeometricDet::PixelPhase1EndCap) {
118  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
119  for (vector<const GeometricDet*>::const_iterator it2 = thePxlFwdGeometricDetLayers.begin();
120  it2 != thePxlFwdGeometricDetLayers.end();
121  it2++) {
122  if ((*it2)->positionBounds().z() < 0)
123  theNegPxlFwdLayers.push_back(aPhase1PixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
124  if ((*it2)->positionBounds().z() > 0)
125  thePosPxlFwdLayers.push_back(aPhase1PixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
126  }
127  }
128 
129  if ((*it)->type() == GeometricDet::PixelPhase2EndCap) {
130  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
131  for (vector<const GeometricDet*>::const_iterator it2 = thePxlFwdGeometricDetLayers.begin();
132  it2 != thePxlFwdGeometricDetLayers.end();
133  it2++) {
134  //FIXME: this is just to keep the compatibility with the PixelPhase1 extension layout
135  //hopefully we can get rid of it soon
136  if ((*it2)->positionBounds().z() < 0) {
137  if ((*it2)->type() == GeometricDet::PixelPhase2FullDisk ||
138  (*it2)->type() == GeometricDet::PixelPhase2ReducedDisk)
139  theNegPxlFwdLayers.push_back(aPhase1PixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
140  else if ((*it2)->type() == GeometricDet::PixelPhase2TDRDisk)
141  theNegPxlFwdLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, false));
142  } else if ((*it2)->positionBounds().z() > 0) {
143  if ((*it2)->type() == GeometricDet::PixelPhase2FullDisk ||
144  (*it2)->type() == GeometricDet::PixelPhase2ReducedDisk)
145  thePosPxlFwdLayers.push_back(aPhase1PixelForwardLayerBuilder.build(*it2, theGeomDetGeometry));
146  else if ((*it2)->type() == GeometricDet::PixelPhase2TDRDisk)
147  thePosPxlFwdLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, false));
148  } else {
149  edm::LogError("TkDetLayers") << "In PixelPhase2EndCap the disks are neither PixelPhase2FullDisk nor "
150  "PixelPhase2ReducedDisk nor PixelPhase2TDRDisk...";
151  }
152  }
153  }
154 
155  if ((*it)->type() == GeometricDet::TID) {
156  vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components();
157  for (vector<const GeometricDet*>::const_iterator it2 = theTIDGeometricDetLayers.begin();
158  it2 != theTIDGeometricDetLayers.end();
159  it2++) {
160  if ((*it2)->positionBounds().z() < 0)
161  theNegTIDLayers.push_back(aTIDLayerBuilder.build(*it2, theGeomDetGeometry));
162  if ((*it2)->positionBounds().z() > 0)
163  thePosTIDLayers.push_back(aTIDLayerBuilder.build(*it2, theGeomDetGeometry));
164  }
165  }
166 
167  if ((*it)->type() == GeometricDet::OTPhase2EndCap) {
168  vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components();
169  for (vector<const GeometricDet*>::const_iterator it2 = theTIDGeometricDetLayers.begin();
170  it2 != theTIDGeometricDetLayers.end();
171  it2++) {
172  if ((*it2)->positionBounds().z() < 0)
173  theNegTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, true));
174  if ((*it2)->positionBounds().z() > 0)
175  thePosTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, true));
176  }
177  }
178 
179  if ((*it)->type() == GeometricDet::TEC) {
180  vector<const GeometricDet*> theTECGeometricDetLayers = (*it)->components();
181  for (vector<const GeometricDet*>::const_iterator it2 = theTECGeometricDetLayers.begin();
182  it2 != theTECGeometricDetLayers.end();
183  it2++) {
184  if ((*it2)->positionBounds().z() < 0)
185  theNegTECLayers.push_back(aTECLayerBuilder.build(*it2, theGeomDetGeometry));
186  if ((*it2)->positionBounds().z() > 0)
187  thePosTECLayers.push_back(aTECLayerBuilder.build(*it2, theGeomDetGeometry));
188  }
189  }
190  }
191 
192  return new GeometricSearchTracker(thePxlBarLayers,
193  theTIBLayers,
194  theTOBLayers,
195  theNegPxlFwdLayers,
196  theNegTIDLayers,
197  theNegTECLayers,
198  thePosPxlFwdLayers,
199  thePosTIDLayers,
200  thePosTECLayers,
201  tTopo);
202 }
trackerHierarchy.h
TIBLayerBuilder::build
TIBLayer * build(const GeometricDet *aTIBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TIBLayerBuilder.cc:10
TOBLayerBuilder.h
GeometricDet::PixelEndCap
Definition: GeometricDet.h:56
MessageLogger.h
GeometricSearchTrackerBuilder::build
GeometricSearchTracker * build(const GeometricDet *theGeometricTracker, const TrackerGeometry *theGeomDetGeometry, const TrackerTopology *tTopo) __attribute__((cold))
Definition: GeometricSearchTrackerBuilder.cc:24
Phase2EndcapLayerBuilder
Definition: Phase2EndcapLayerBuilder.h:14
Trie.h
GeometricDet::PixelPhase2ReducedDisk
Definition: GeometricDet.h:83
PixelForwardLayerBuilder.h
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:139
TrackerTopology
Definition: TrackerTopology.h:16
GeometricDet::TID
Definition: GeometricDet.h:58
PixelBarrelLayerBuilder::build
PixelBarrelLayer * build(const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: PixelBarrelLayerBuilder.cc:7
PixelForwardLayerBuilder::build
ForwardDetLayer * build(const GeometricDet *aPixelForwardLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: PixelForwardLayerBuilder.h:28
GeometricDet::PixelBarrel
Definition: GeometricDet.h:55
PixelBarrelLayerBuilder
Definition: PixelBarrelLayerBuilder.h:14
GeometricDet::OTPhase2Barrel
Definition: GeometricDet.h:76
TrackerTopology.h
GeometricDet::PixelPhase1EndCap
Definition: GeometricDet.h:73
TECLayerBuilder.h
GeometricSearchTrackerBuilder.h
GeometricDet::PixelPhase2Barrel
Definition: GeometricDet.h:79
TIBLayerBuilder
Definition: TIBLayerBuilder.h:14
PixelForwardLayerBuilder
Definition: PixelForwardLayerBuilder.h:20
Phase2EndcapLayerBuilder.h
TIBLayerBuilder.h
GeometricDet
Definition: GeometricDet.h:30
GeometricDet::PixelPhase2TDRDisk
Definition: GeometricDet.h:84
TIDLayerBuilder.h
GeometricDet::PixelPhase2EndCap
Definition: GeometricDet.h:80
edm::LogError
Definition: MessageLogger.h:183
TECLayerBuilder::build
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TECLayerBuilder.cc:7
GeometricDet::PixelPhase1Barrel
Definition: GeometricDet.h:72
GeometricDet::OTPhase2EndCap
Definition: GeometricDet.h:75
GeometricDet::TIB
Definition: GeometricDet.h:57
TOBLayerBuilder::build
TOBLayer * build(const GeometricDet *aTOBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TOBLayerBuilder.cc:10
Phase2EndcapLayerBuilder::build
Phase2EndcapLayer * build(const GeometricDet *aPhase2EndcapLayer, const TrackerGeometry *theGeomDetGeometry, const bool isOuterTracker) __attribute__((cold))
Definition: Phase2EndcapLayerBuilder.cc:7
TIDLayerBuilder
Definition: TIDLayerBuilder.h:14
GeomDet.h
std
Definition: JetResolutionObject.h:76
GeometricDet::PixelPhase2FullDisk
Definition: GeometricDet.h:82
Phase2OTBarrelLayerBuilder::build
Phase2OTBarrelLayer * build(const GeometricDet *aPhase2OTBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: Phase2OTBarrelLayerBuilder.cc:9
GeometricDet::TOB
Definition: GeometricDet.h:59
PixelBarrelLayerBuilder.h
GeometricSearchTracker
Definition: GeometricSearchTracker.h:14
TECLayerBuilder
Definition: TECLayerBuilder.h:14
TIDLayerBuilder::build
TIDLayer * build(const GeometricDet *aTIDLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Definition: TIDLayerBuilder.cc:7
Phase2OTBarrelLayerBuilder.h
TOBLayerBuilder
Definition: TOBLayerBuilder.h:14
Phase2OTBarrelLayerBuilder
Definition: Phase2OTBarrelLayerBuilder.h:14
GeometricDet::TEC
Definition: GeometricDet.h:60
TrackerGeometry
Definition: TrackerGeometry.h:14