test
CMS 3D CMS Logo

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

#include <CondDBCmsTrackerConstruction.h>

Public Member Functions

 CondDBCmsTrackerConstruction ()
 
const GeometricDetconstruct (const PGeometricDet &pgd)
 

Detailed Description

High level class to build a tracker. It will only build subdets, then call subdet builders

Definition at line 17 of file CondDBCmsTrackerConstruction.h.

Constructor & Destructor Documentation

CondDBCmsTrackerConstruction::CondDBCmsTrackerConstruction ( )

Definition at line 12 of file CondDBCmsTrackerConstruction.cc.

12 { }

Member Function Documentation

const GeometricDet * CondDBCmsTrackerConstruction::construct ( const PGeometricDet pgd)

Definition at line 14 of file CondDBCmsTrackerConstruction.cc.

References PGeometricDet::pgeomdets_, GeometricDet::Tracker, and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by TrackerGeometricDetESModule::produce().

14  {
15  //std::cout << "In CondDBCmsTrackerConstruction::construct with pgd.pgeomdets_.size() == " << pgd.pgeomdets_.size() << std::endl;
17 
18  size_t detMax = pgd.pgeomdets_.size();
19  size_t tri = 1;
20  std::vector<GeometricDet*> hier;
21  int lev=1;
22  GeometricDet* subdet = tracker;
23  hier.push_back(subdet);
24  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 1 ) {
25  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
26  //std::cout << lev << " type " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
27  ++tri;
28  hier.back()->addComponent(subdet);
29  hier.push_back(subdet);
30  ++lev;
31  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 2 ) {
32  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
33  //std::cout << lev << "\ttype " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
34  ++tri;
35  hier.back()->addComponent(subdet);
36  hier.push_back(subdet);
37  ++lev;
38  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 3 ) {
39  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
40  //std::cout << lev << "\t\ttype " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
41  ++tri;
42  hier.back()->addComponent(subdet);
43  hier.push_back(subdet);
44  ++lev;
45  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 4 ) {
46  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
47  //std::cout << lev << "\t\t\ttype " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
48  ++tri;
49  hier.back()->addComponent(subdet);
50  hier.push_back(subdet);
51  ++lev;
52  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 5 ) {
53  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
54  //std::cout << lev << "\t\t\t\ttype " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
55  ++tri;
56  hier.back()->addComponent(subdet);
57  hier.push_back(subdet);
58  ++lev;
59  while ( tri < detMax && pgd.pgeomdets_[tri]._level == 6 ) {
60  subdet = new GeometricDet(pgd.pgeomdets_[tri], GeometricDet::GDEnumType(pgd.pgeomdets_[tri]._type));
61  //std::cout << lev << "\t\t\t\t\ttype " << pgd.pgeomdets_[tri]._type << " " << subdet->geographicalId() << std::endl;
62  ++tri;
63  hier.back()->addComponent(subdet);
64  }
65  --lev;
66  hier.pop_back();
67  }
68  --lev;
69  hier.pop_back();
70  }
71  --lev;
72  hier.pop_back();
73  }
74  --lev;
75  hier.pop_back();
76  }
77  --lev;
78  hier.pop_back();
79  }
80 // std::cout << "Before \"deep components\" test I want to see if I can iterate to 6 layers by myself..." << std::endl;
81 // std::vector<const GeometricDet*> l0 = tracker->components();
82 // std::vector<const GeometricDet*>::const_iterator i0 = l0.begin();
83 // std::vector<const GeometricDet*>::const_iterator e0 = l0.end();
84 // int count=0; // count only the leaves.
85 // for ( ; i0 != e0 ; ++i0) {
86 // std::cout << lev << " type " << (*i0)->type() << " " << int((*i0)->geographicalId()) << std::endl;
87 // std::vector<const GeometricDet*> l1 = (*i0)->components();
88 // if ( l1.size() == 0 ) ++count;
89 // std::vector<const GeometricDet*>::const_iterator i1 = l1.begin();
90 // std::vector<const GeometricDet*>::const_iterator e1 = l1.end();
91 // ++lev;
92 // for ( ; i1 != e1 ; ++i1) {
93 // std::cout << lev << "\ttype " << (*i1)->type() << " " << int((*i1)->geographicalId()) << std::endl;
94 // std::vector<const GeometricDet*> l2 = (*i1)->components();
95 // if ( l2.size() == 0 ) ++count;
96 // std::vector<const GeometricDet*>::const_iterator i2 = l1.begin();
97 // std::vector<const GeometricDet*>::const_iterator e2 = l1.end();
98 // ++lev;
99 // for ( ; i2 != e2 ; ++i2) {
100 // std::cout << lev << "\t\ttype " << (*i2)->type() << " " << int((*i2)->geographicalId()) << std::endl;
101 // std::vector<const GeometricDet*> l3 = (*i2)->components();
102 // if ( l3.size() == 0 ) ++count;
103 // std::vector<const GeometricDet*>::const_iterator i3 = l3.begin();
104 // std::vector<const GeometricDet*>::const_iterator e3 = l3.end();
105 // ++lev;
106 // for ( ; i3 != e3 ; ++i3) {
107 // std::cout << lev << "\t\t\ttype " << (*i3)->type() << " " << int((*i3)->geographicalId()) << std::endl;
108 // std::vector<const GeometricDet*> l4 = (*i3)->components();
109 // if ( l4.size() == 0 ) ++count;
110 // std::vector<const GeometricDet*>::const_iterator i4 = l4.begin();
111 // std::vector<const GeometricDet*>::const_iterator e4 = l4.end();
112 // ++lev;
113 // for ( ; i4 != e4 ; ++i4) {
114 // std::cout << lev << "\t\t\t\ttype " << (*i4)->type() << " " << int((*i4)->geographicalId()) << std::endl;
115 // std::vector<const GeometricDet*> l5 = (*i4)->components();
116 // if ( l5.size() == 0 ) ++count;
117 // std::vector<const GeometricDet*>::const_iterator i5 = l5.begin();
118 // std::vector<const GeometricDet*>::const_iterator e5 = l5.end();
119 // ++lev;
120 // for ( ; i5 != e5 ; ++i5) {
121 // std::cout << lev << "\t\t\t\t\ttype " << (*i5)->type() << " " << int((*i5)->geographicalId()) << std::endl;
122 // ++count;
123 // // std::vector<const GeometricDet*> l6 = (*i0)->components();
124 // // std::vector<const GeometricDet*>::const_iterator i6 = l6.begin();
125 // // std::vector<const GeometricDet*>::const_iterator e6 = l6.end();
126 // // for ( ; i6 != e6 ; ++i6) {
127 // // std::cout << lev << " type " << (*i6)->type() << " " << int((*i6)->geographicalId()) << std::endl;
128 // // std::vector<const GeometricDet*> l1 = (*i0)->components();
129 // // std::vector<const GeometricDet*>::const_iterator i1 = l1.begin();
130 // // std::vector<const GeometricDet*>::const_iterator e1 = l1.end();
131 // // }
132 // }
133 // --lev;
134 // }
135 // --lev;
136 // }
137 // --lev;
138 // }
139 // --lev;
140 // }
141 // --lev;
142 // }
143 // std::cout << "done... count = " << count << std::endl;
144 // std::cout << "about to try to see what the \"deep components\" are" << std::endl;
145 // std::cout << "done with the \"deep components\" check, there are: " << tracker->deepComponents().size() << std::endl;
146  return tracker;
147 }
std::vector< Item > pgeomdets_
Definition: PGeometricDet.h:50