CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CondDBCmsMTDConstruction.cc
Go to the documentation of this file.
7 
8 using namespace cms;
9 
10 std::unique_ptr<GeometricTimingDet> CondDBCmsMTDConstruction::construct(const PGeometricTimingDet& pgd) {
11  auto mtd = std::make_unique<GeometricTimingDet>(pgd.pgeomdets_[0], GeometricTimingDet::MTD);
12 
13  size_t detMax = pgd.pgeomdets_.size();
14  size_t tri = 1;
15  std::vector<GeometricTimingDet*> hier;
16  int lev = 1;
17  GeometricTimingDet* subdet = mtd.get();
18  hier.emplace_back(subdet);
19  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 1) {
20  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
21  ++tri;
22  hier.back()->addComponent(subdet);
23  hier.emplace_back(subdet);
24  ++lev;
25  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 2) {
26  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
27  ++tri;
28  hier.back()->addComponent(subdet);
29  hier.emplace_back(subdet);
30  ++lev;
31  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 3) {
32  subdet =
33  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
34  ++tri;
35  hier.back()->addComponent(subdet);
36  hier.emplace_back(subdet);
37  ++lev;
38  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 4) {
39  subdet =
40  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
41  ++tri;
42  hier.back()->addComponent(subdet);
43  hier.emplace_back(subdet);
44  ++lev;
45  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 5) {
46  subdet =
47  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
48  ++tri;
49  hier.back()->addComponent(subdet);
50  hier.emplace_back(subdet);
51  ++lev;
52  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 6) {
53  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri],
54  GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
55  ++tri;
56  hier.back()->addComponent(subdet);
57  }
58  --lev;
59  hier.pop_back();
60  }
61  --lev;
62  hier.pop_back();
63  }
64  --lev;
65  hier.pop_back();
66  }
67  --lev;
68  hier.pop_back();
69  }
70  --lev;
71  hier.pop_back();
72  }
73  return mtd;
74 }
std::vector< Item > pgeomdets_
static std::unique_ptr< GeometricTimingDet > construct(const PGeometricTimingDet &pgd)