CMS 3D CMS Logo

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

#include <GeometricSearchTrackerBuilder.h>

Public Member Functions

GeometricSearchTrackerbuild (const GeometricDet *theGeometricTracker, const TrackerGeometry *theGeomDetGeometry, const TrackerTopology *tTopo) __attribute__((cold))
 
 GeometricSearchTrackerBuilder ()
 
 ~GeometricSearchTrackerBuilder ()
 

Detailed Description

GeometricSearchTrackerBuilder implementation

Definition at line 15 of file GeometricSearchTrackerBuilder.h.

Constructor & Destructor Documentation

GeometricSearchTrackerBuilder::GeometricSearchTrackerBuilder ( )
inline

Definition at line 18 of file GeometricSearchTrackerBuilder.h.

18 {}
GeometricSearchTrackerBuilder::~GeometricSearchTrackerBuilder ( )
inline

Definition at line 19 of file GeometricSearchTrackerBuilder.h.

19 {}

Member Function Documentation

GeometricSearchTracker * GeometricSearchTrackerBuilder::build ( const GeometricDet theGeometricTracker,
const TrackerGeometry theGeomDetGeometry,
const TrackerTopology tTopo 
)

Definition at line 26 of file GeometricSearchTrackerBuilder.cc.

References b, PixelBarrelLayerBuilder::build(), Phase2OTECRingedLayerBuilder::build(), TECLayerBuilder::build(), TIBLayerBuilder::build(), TOBLayerBuilder::build(), Phase2OTBarrelLayerBuilder::build(), TIDLayerBuilder::build(), PixelForwardLayerBuilder< T1, T2 >::build(), hitfit::char, GeometricDet::components(), gather_cfg::cout, TrackerGeometry::detUnits(), alignCSCRings::e, i, edm::Trie< T >::insert(), prof2calltree::last, edmConvertToStreamModule::modules, edm::Trie< T >::node(), GeometricDet::OTPhase2Barrel, GeometricDet::OTPhase2EndCap, AlCaHLTBitMon_ParallelJobs::p, GeometricDet::PixelBarrel, GeometricDet::PixelEndCap, GeometricDet::PixelPhase1Barrel, GeometricDet::PixelPhase1EndCap, GeometricDet::PixelPhase2EndCap, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::TEC, GeometricDet::TIB, GeometricDet::TID, GeometricDet::TOB, trackerHierarchy(), and cms::Exception::what().

Referenced by TrackerRecoGeometryESProducer::produce().

29 {
30  PixelBarrelLayerBuilder aPixelBarrelLayerBuilder;
31  Phase2OTBarrelLayerBuilder aPhase2OTBarrelLayerBuilder;
34  Phase2OTECRingedLayerBuilder aPhase2OTECRingedLayerBuilder;
35  TIBLayerBuilder aTIBLayerBuilder;
36  TOBLayerBuilder aTOBLayerBuilder;
37  TIDLayerBuilder aTIDLayerBuilder;
38  TECLayerBuilder aTECLayerBuilder;
39 
40  vector<BarrelDetLayer const*> thePxlBarLayers;
41  vector<BarrelDetLayer const*> theTIBLayers;
42  vector<BarrelDetLayer const*> theTOBLayers;
43  vector<ForwardDetLayer const*> theNegPxlFwdLayers;
44  vector<ForwardDetLayer const*> thePosPxlFwdLayers;
45  vector<ForwardDetLayer const*> theNegTIDLayers;
46  vector<ForwardDetLayer const*> thePosTIDLayers;
47  vector<ForwardDetLayer const*> theNegTECLayers;
48  vector<ForwardDetLayer const*> thePosTECLayers;
49 
50  using namespace trackerTrie;
51 
52  //-- future code
53  // create a Trie
54  DetTrie trie(0);
55 
56  // to be moved elsewhere
57  {
58  const TrackingGeometry::DetUnitContainer& modules = theGeomDetGeometry->detUnits();
59  typedef TrackingGeometry::DetUnitContainer::const_iterator Iter;
60  Iter b=modules.begin();
61  Iter e=modules.end();
62  Iter last;
63  try {
64  for(;b!=e; ++b) {
65  last = b;
66  unsigned int rawid = (*b)->geographicalId().rawId();
67  trie.insert(trackerHierarchy(rawid), *b);
68  }
69  }
70  catch(edm::Exception const & e) {
71  std::cout << "in filling " << e.what() << std::endl;
72  unsigned int rawid = (*last)->geographicalId().rawId();
73  int subdetid = (*last)->geographicalId().subdetId();
74  std::cout << rawid << " " << subdetid << std::endl;
75  }
76  }
77 
78  // layers "ids"
79  unsigned int layerId[] = {1,3,5,21,22,41,42,61,62};
80  // boost::function<void(trackerTrie::Node const &)> fun[9];
81  /*
82  thePxlBarLayers.push_back( aPixelBarrelLayerBuilder.build(*p) );
83  theTIBLayers.push_back( aTIBLayerBuilder.build(*p) );
84  theTOBLayers.push_back( aTOBLayerBuilder.build(*p) );
85  theNegPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*p) );
86  thePosPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*p) );
87  theNegTIDLayers.push_back( aTIDLayerBuilder.build(*p) );
88  thePosTIDLayers.push_back( aTIDLayerBuilder.build(*p) );
89  theNegTECLayers.push_back( aTECLayerBuilder.build(*p) );
90  thePosTECLayers.push_back( aTECLayerBuilder.build(*p) );
91  */
92 
93 
94  for (int i=0;i<9;i++) {
95  std::string s;
96  if (layerId[i]>9) s+=char(layerId[i]/10);
97  s+=char(layerId[i]%10);
99  node_iterator p(trie.node(s));
100  for (;p!=e;++p) {
101  // fun[i](*p);
102  }
103  }
104 
105 
106  // current code
107  vector<const GeometricDet*> theGeometricDetLayers = theGeometricTracker->components();
108  for(vector<const GeometricDet*>::const_iterator it=theGeometricDetLayers.begin();
109  it!=theGeometricDetLayers.end(); it++){
110 
111  if( (*it)->type() == GeometricDet::PixelBarrel) {
112  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
113  for(vector<const GeometricDet*>::const_iterator it2=thePxlBarGeometricDetLayers.begin();
114  it2!=thePxlBarGeometricDetLayers.end(); it2++){
115  thePxlBarLayers.push_back( aPixelBarrelLayerBuilder.build(*it2,theGeomDetGeometry) );
116  }
117  }
118 
119  if( (*it)->type() == GeometricDet::PixelPhase1Barrel) {
120  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
121  for(vector<const GeometricDet*>::const_iterator it2=thePxlBarGeometricDetLayers.begin();
122  it2!=thePxlBarGeometricDetLayers.end(); it2++){
123  thePxlBarLayers.push_back( aPixelBarrelLayerBuilder.build(*it2,theGeomDetGeometry) );
124  }
125  }
126 
127  if( (*it)->type() == GeometricDet::TIB) {
128  vector<const GeometricDet*> theTIBGeometricDetLayers = (*it)->components();
129  for(vector<const GeometricDet*>::const_iterator it2=theTIBGeometricDetLayers.begin();
130  it2!=theTIBGeometricDetLayers.end(); it2++){
131  theTIBLayers.push_back( aTIBLayerBuilder.build(*it2,theGeomDetGeometry) );
132  }
133  }
134 
135  if( (*it)->type() == GeometricDet::TOB) {
136  vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components();
137  for(vector<const GeometricDet*>::const_iterator it2=theTOBGeometricDetLayers.begin();
138  it2!=theTOBGeometricDetLayers.end(); it2++){
139  theTOBLayers.push_back( aTOBLayerBuilder.build(*it2,theGeomDetGeometry) );
140  }
141  }
142 
143  if( (*it)->type() == GeometricDet::OTPhase2Barrel) {
144  vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components();
145  for(vector<const GeometricDet*>::const_iterator it2=theTOBGeometricDetLayers.begin();
146  it2!=theTOBGeometricDetLayers.end(); it2++){
147  theTOBLayers.push_back( aPhase2OTBarrelLayerBuilder.build(*it2,theGeomDetGeometry) );
148  }
149  }
150 
151  if( (*it)->type() == GeometricDet::PixelEndCap) {
152  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
153  for(vector<const GeometricDet*>::const_iterator it2=thePxlFwdGeometricDetLayers.begin();
154  it2!=thePxlFwdGeometricDetLayers.end(); it2++){
155  if((*it2)->positionBounds().z() < 0)
156  theNegPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
157  if((*it2)->positionBounds().z() > 0)
158  thePosPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
159  }
160  }
161 
162  if( (*it)->type() == GeometricDet::PixelPhase1EndCap ) {
163  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
164  for(vector<const GeometricDet*>::const_iterator it2=thePxlFwdGeometricDetLayers.begin();
165  it2!=thePxlFwdGeometricDetLayers.end(); it2++){
166  if((*it2)->positionBounds().z() < 0)
167  theNegPxlFwdLayers.push_back( aPhase1PixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
168  if((*it2)->positionBounds().z() > 0)
169  thePosPxlFwdLayers.push_back( aPhase1PixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
170  }
171  }
172 
173  if( (*it)->type() == GeometricDet::PixelPhase2EndCap ){
174  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
175  for(vector<const GeometricDet*>::const_iterator it2=thePxlFwdGeometricDetLayers.begin();
176  it2!=thePxlFwdGeometricDetLayers.end(); it2++){
177  if((*it2)->positionBounds().z() < 0)
178  theNegPxlFwdLayers.push_back( aPhase1PixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
179  if((*it2)->positionBounds().z() > 0)
180  thePosPxlFwdLayers.push_back( aPhase1PixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
181  }
182  }
183 
184 
185 
186  if( (*it)->type() == GeometricDet::TID){
187  vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components();
188  for(vector<const GeometricDet*>::const_iterator it2=theTIDGeometricDetLayers.begin();
189  it2!=theTIDGeometricDetLayers.end(); it2++){
190  if((*it2)->positionBounds().z() < 0)
191  theNegTIDLayers.push_back( aTIDLayerBuilder.build(*it2,theGeomDetGeometry) );
192  if((*it2)->positionBounds().z() > 0)
193  thePosTIDLayers.push_back( aTIDLayerBuilder.build(*it2,theGeomDetGeometry) );
194  }
195  }
196 
197  if( (*it)->type() == GeometricDet::OTPhase2EndCap ){
198  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
199  for(vector<const GeometricDet*>::const_iterator it2=thePxlFwdGeometricDetLayers.begin();
200  it2!=thePxlFwdGeometricDetLayers.end(); it2++){
201  if((*it2)->positionBounds().z() < 0)
202  theNegTIDLayers.push_back( aPhase2OTECRingedLayerBuilder.build(*it2,theGeomDetGeometry) );
203  if((*it2)->positionBounds().z() > 0)
204  thePosTIDLayers.push_back( aPhase2OTECRingedLayerBuilder.build(*it2,theGeomDetGeometry) );
205  }
206  }
207 
208  if( (*it)->type() == GeometricDet::TEC) {
209  vector<const GeometricDet*> theTECGeometricDetLayers = (*it)->components();
210  for(vector<const GeometricDet*>::const_iterator it2=theTECGeometricDetLayers.begin();
211  it2!=theTECGeometricDetLayers.end(); it2++){
212  if((*it2)->positionBounds().z() < 0)
213  theNegTECLayers.push_back( aTECLayerBuilder.build(*it2,theGeomDetGeometry) );
214  if((*it2)->positionBounds().z() > 0)
215  thePosTECLayers.push_back( aTECLayerBuilder.build(*it2,theGeomDetGeometry) );
216  }
217  }
218 
219 
220  }
221 
222 
223  return new GeometricSearchTracker(thePxlBarLayers,theTIBLayers,theTOBLayers,
224  theNegPxlFwdLayers,theNegTIDLayers,theNegTECLayers,
225  thePosPxlFwdLayers,thePosTIDLayers,thePosTECLayers, tTopo);
226 }
virtual char const * what() const
Definition: Exception.cc:141
int i
Definition: DBlmapReader.cc:9
TIBLayer * build(const GeometricDet *aTIBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
TOBLayer * build(const GeometricDet *aTOBLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
PixelBarrelLayer * build(const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
TIDLayer * build(const GeometricDet *aTIDLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Phase2OTECRingedLayer * build(const GeometricDet *aPhase2OTECRingedLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
Phase2OTBarrelLayer * build(const GeometricDet *aPhase2OTBarrelLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))
std::string trackerHierarchy(unsigned int id)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
double b
Definition: hdecay.h:120
tuple cout
Definition: gather_cfg.py:121
std::vector< GeomDetUnit const * > DetUnitContainer
ForwardDetLayer * build(const GeometricDet *aPixelForwardLayer, const TrackerGeometry *theGeomDetGeometry) __attribute__((cold))