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)
 
 GeometricSearchTrackerBuilder ()
 
 ~GeometricSearchTrackerBuilder ()
 

Detailed Description

GeometricSearchTrackerBuilder implementation

Definition at line 13 of file GeometricSearchTrackerBuilder.h.

Constructor & Destructor Documentation

GeometricSearchTrackerBuilder::GeometricSearchTrackerBuilder ( )
inline

Definition at line 16 of file GeometricSearchTrackerBuilder.h.

16 {};
GeometricSearchTrackerBuilder::~GeometricSearchTrackerBuilder ( )
inline

Definition at line 17 of file GeometricSearchTrackerBuilder.h.

17 {};

Member Function Documentation

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

Definition at line 22 of file GeometricSearchTrackerBuilder.cc.

References b, TIBLayerBuilder::build(), TOBLayerBuilder::build(), PixelForwardLayerBuilder::build(), TIDLayerBuilder::build(), PixelBarrelLayerBuilder::build(), TECLayerBuilder::build(), GeometricDet::components(), gather_cfg::cout, TrackerGeometry::detUnits(), alignCSCRings::e, i, edm::Trie< T >::insert(), prof2calltree::last, edm::Trie< T >::node(), AlCaHLTBitMon_ParallelJobs::p, GeometricDet::PixelBarrel, GeometricDet::PixelEndCap, alignCSCRings::s, GeometricDet::TEC, GeometricDet::TIB, GeometricDet::TID, GeometricDet::TOB, trackerHierarchy(), and cms::Exception::what().

Referenced by TrackerRecoGeometryESProducer::produce().

24 {
25  PixelBarrelLayerBuilder aPixelBarrelLayerBuilder;
26  PixelForwardLayerBuilder aPixelForwardLayerBuilder;
27  TIBLayerBuilder aTIBLayerBuilder;
28  TOBLayerBuilder aTOBLayerBuilder;
29  TIDLayerBuilder aTIDLayerBuilder;
30  TECLayerBuilder aTECLayerBuilder;
31 
32  vector<BarrelDetLayer*> thePxlBarLayers;
33  vector<BarrelDetLayer*> theTIBLayers;
34  vector<BarrelDetLayer*> theTOBLayers;
35  vector<ForwardDetLayer*> theNegPxlFwdLayers;
36  vector<ForwardDetLayer*> thePosPxlFwdLayers;
37  vector<ForwardDetLayer*> theNegTIDLayers;
38  vector<ForwardDetLayer*> thePosTIDLayers;
39  vector<ForwardDetLayer*> theNegTECLayers;
40  vector<ForwardDetLayer*> thePosTECLayers;
41 
42  using namespace trackerTrie;
43 
44  //-- future code
45  // create a Trie
46  DetTrie trie(0);
47 
48  // to be moved elsewhere
49  {
50  const TrackingGeometry::DetUnitContainer& modules = theGeomDetGeometry->detUnits();
51  typedef TrackingGeometry::DetUnitContainer::const_iterator Iter;
52  Iter b=modules.begin();
53  Iter e=modules.end();
54  Iter last;
55  try {
56  for(;b!=e; ++b) {
57  last = b;
58  unsigned int rawid = (*b)->geographicalId().rawId();
59  trie.insert(trackerHierarchy(rawid), *b);
60  }
61  }
62  catch(edm::Exception const & e) {
63  std::cout << "in filling " << e.what() << std::endl;
64  unsigned int rawid = (*last)->geographicalId().rawId();
65  int subdetid = (*last)->geographicalId().subdetId();
66  std::cout << rawid << " " << subdetid << std::endl;
67  }
68  }
69 
70  // layers "ids"
71  unsigned int layerId[] = {1,3,5,21,22,41,42,61,62};
72  // boost::function<void(trackerTrie::Node const &)> fun[9];
73  /*
74  thePxlBarLayers.push_back( aPixelBarrelLayerBuilder.build(*p) );
75  theTIBLayers.push_back( aTIBLayerBuilder.build(*p) );
76  theTOBLayers.push_back( aTOBLayerBuilder.build(*p) );
77  theNegPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*p) );
78  thePosPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*p) );
79  theNegTIDLayers.push_back( aTIDLayerBuilder.build(*p) );
80  thePosTIDLayers.push_back( aTIDLayerBuilder.build(*p) );
81  theNegTECLayers.push_back( aTECLayerBuilder.build(*p) );
82  thePosTECLayers.push_back( aTECLayerBuilder.build(*p) );
83  */
84 
85 
86  for (int i=0;i<9;i++) {
87  std::string s;
88  if (layerId[i]>9) s+=char(layerId[i]/10);
89  s+=char(layerId[i]%10);
91  node_iterator p(trie.node(s));
92  for (;p!=e;++p) {
93  // fun[i](*p);
94  }
95  }
96 
97 
98  // current code
99  vector<const GeometricDet*> theGeometricDetLayers = theGeometricTracker->components();
100  for(vector<const GeometricDet*>::const_iterator it=theGeometricDetLayers.begin();
101  it!=theGeometricDetLayers.end(); it++){
102 
103  if( (*it)->type() == GeometricDet::PixelBarrel) {
104  vector<const GeometricDet*> thePxlBarGeometricDetLayers = (*it)->components();
105  for(vector<const GeometricDet*>::const_iterator it2=thePxlBarGeometricDetLayers.begin();
106  it2!=thePxlBarGeometricDetLayers.end(); it2++){
107  thePxlBarLayers.push_back( aPixelBarrelLayerBuilder.build(*it2,theGeomDetGeometry) );
108  }
109  }
110 
111  if( (*it)->type() == GeometricDet::TIB) {
112  vector<const GeometricDet*> theTIBGeometricDetLayers = (*it)->components();
113  for(vector<const GeometricDet*>::const_iterator it2=theTIBGeometricDetLayers.begin();
114  it2!=theTIBGeometricDetLayers.end(); it2++){
115  theTIBLayers.push_back( aTIBLayerBuilder.build(*it2,theGeomDetGeometry) );
116  }
117  }
118 
119  if( (*it)->type() == GeometricDet::TOB) {
120  vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components();
121  for(vector<const GeometricDet*>::const_iterator it2=theTOBGeometricDetLayers.begin();
122  it2!=theTOBGeometricDetLayers.end(); it2++){
123  theTOBLayers.push_back( aTOBLayerBuilder.build(*it2,theGeomDetGeometry) );
124  }
125  }
126 
127 
128  if( (*it)->type() == GeometricDet::PixelEndCap){
129  vector<const GeometricDet*> thePxlFwdGeometricDetLayers = (*it)->components();
130  for(vector<const GeometricDet*>::const_iterator it2=thePxlFwdGeometricDetLayers.begin();
131  it2!=thePxlFwdGeometricDetLayers.end(); it2++){
132  if((*it2)->positionBounds().z() < 0)
133  theNegPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
134  if((*it2)->positionBounds().z() > 0)
135  thePosPxlFwdLayers.push_back( aPixelForwardLayerBuilder.build(*it2,theGeomDetGeometry) );
136  }
137  }
138 
139 
140 
141  if( (*it)->type() == GeometricDet::TID){
142  vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components();
143  for(vector<const GeometricDet*>::const_iterator it2=theTIDGeometricDetLayers.begin();
144  it2!=theTIDGeometricDetLayers.end(); it2++){
145  if((*it2)->positionBounds().z() < 0)
146  theNegTIDLayers.push_back( aTIDLayerBuilder.build(*it2,theGeomDetGeometry) );
147  if((*it2)->positionBounds().z() > 0)
148  thePosTIDLayers.push_back( aTIDLayerBuilder.build(*it2,theGeomDetGeometry) );
149  }
150  }
151 
152  if( (*it)->type() == GeometricDet::TEC) {
153  vector<const GeometricDet*> theTECGeometricDetLayers = (*it)->components();
154  for(vector<const GeometricDet*>::const_iterator it2=theTECGeometricDetLayers.begin();
155  it2!=theTECGeometricDetLayers.end(); it2++){
156  if((*it2)->positionBounds().z() < 0)
157  theNegTECLayers.push_back( aTECLayerBuilder.build(*it2,theGeomDetGeometry) );
158  if((*it2)->positionBounds().z() > 0)
159  thePosTECLayers.push_back( aTECLayerBuilder.build(*it2,theGeomDetGeometry) );
160  }
161  }
162 
163 
164  }
165 
166 
167  return new GeometricSearchTracker(thePxlBarLayers,theTIBLayers,theTOBLayers,
168  theNegPxlFwdLayers,theNegTIDLayers,theNegTECLayers,
169  thePosPxlFwdLayers,thePosTIDLayers,thePosTECLayers);
170 }
virtual char const * what() const
Definition: Exception.cc:141
PixelBarrelLayer * build(const GeometricDet *aPixelBarrelLayer, const TrackerGeometry *theGeomDetGeometry)
int i
Definition: DBlmapReader.cc:9
std::string trackerHierarchy(unsigned int id)
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
TECLayer * build(const GeometricDet *aTECLayer, const TrackerGeometry *theGeomDetGeometry)
TIBLayer * build(const GeometricDet *aTIBLayer, const TrackerGeometry *theGeomDetGeometry)
TOBLayer * build(const GeometricDet *aTOBLayer, const TrackerGeometry *theGeomDetGeometry)
PixelForwardLayer * build(const GeometricDet *aPixelForwardLayer, const TrackerGeometry *theGeomDetGeometry)
std::vector< GeomDetUnit * > DetUnitContainer
double b
Definition: hdecay.h:120
GeometricDetContainer & components()
Definition: GeometricDet.h:163
TIDLayer * build(const GeometricDet *aTIDLayer, const TrackerGeometry *theGeomDetGeometry)
tuple cout
Definition: gather_cfg.py:121