CMS 3D CMS Logo

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  GeometricTimingDet* subdet = mtd.get();
17  hier.emplace_back(subdet);
18  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 1) {
19  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
20  ++tri;
21  hier.back()->addComponent(subdet);
22  hier.emplace_back(subdet);
23  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 2) {
24  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
25  ++tri;
26  hier.back()->addComponent(subdet);
27  hier.emplace_back(subdet);
28  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 3) {
29  subdet =
30  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
31  ++tri;
32  hier.back()->addComponent(subdet);
33  hier.emplace_back(subdet);
34  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 4) {
35  subdet =
36  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
37  ++tri;
38  hier.back()->addComponent(subdet);
39  hier.emplace_back(subdet);
40  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 5) {
41  subdet =
42  new GeometricTimingDet(pgd.pgeomdets_[tri], GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
43  ++tri;
44  hier.back()->addComponent(subdet);
45  hier.emplace_back(subdet);
46  while (tri < detMax && pgd.pgeomdets_[tri].level_ == 6) {
47  subdet = new GeometricTimingDet(pgd.pgeomdets_[tri],
48  GeometricTimingDet::GTDEnumType(pgd.pgeomdets_[tri].type_));
49  ++tri;
50  hier.back()->addComponent(subdet);
51  }
52  hier.pop_back();
53  }
54  hier.pop_back();
55  }
56  hier.pop_back();
57  }
58  hier.pop_back();
59  }
60  hier.pop_back();
61  }
62  return mtd;
63 }
std::vector< Item > pgeomdets_
Namespace of DDCMS conversion namespace.
static std::unique_ptr< GeometricTimingDet > construct(const PGeometricTimingDet &pgd)