CMS 3D CMS Logo

CmsTrackerWheelBuilder.cc
Go to the documentation of this file.
11 
12 #include <vector>
13 #include <bitset>
14 
15 template <class FilteredView>
17  CmsTrackerRingBuilder<FilteredView> theCmsTrackerRingBuilder;
18  CmsTrackerPetalBuilder<FilteredView> theCmsTrackerPetalBuilder;
19 
20  GeometricDet* subdet = new GeometricDet(&fv,
25  case GeometricDet::ring:
26  theCmsTrackerRingBuilder.build(fv, subdet, s);
27  break;
29  theCmsTrackerPetalBuilder.build(fv, subdet, s);
30  break;
31  default:
32  edm::LogError("CmsTrackerWheelBuilder") << " ERROR - I was expecting a Ring or Petal, I got a "
34  }
35  g->addComponent(subdet);
36 }
37 
38 template <class FilteredView>
41 
42  if (!comp.empty()) {
43  if (comp.front()->type() == GeometricDet::petal) {
46  compfw.clear();
47  compbw.clear();
48  for (uint32_t i = 0; i < comp.size(); i++) {
49  if (std::abs(comp[i]->translation().z()) < std::abs(det->translation().z())) {
50  compfw.emplace_back(det->component(i));
51  } else {
52  compbw.emplace_back(det->component(i));
53  }
54  }
55 
58 
59  //
60  // TEC
61  // Wheel Part: 3 bits [back:1 front:2]
62  // Petal Number: 4 bits [1,...,8]
63  //
64  for (uint32_t i = 0; i < compbw.size(); i++) {
65  uint32_t temp = i + 1;
66  temp |= (1 << 4);
67  compbw[i]->setGeographicalID(DetId(temp));
68  }
69  for (uint32_t i = 0; i < compfw.size(); i++) {
70  uint32_t temp = i + 1;
71  temp |= (2 << 4);
72  compfw[i]->setGeographicalID(DetId(temp));
73  }
74 
75  det->clearComponents();
76  det->addComponents(compfw);
77  det->addComponents(compbw);
78 
79  } else {
80  std::stable_sort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::isLessRModule);
81 
82  // TID
83  // Disk Number: 2 bits [1,2,3]
84  for (uint32_t i = 0; i < comp.size(); i++) {
85  det->component(i)->setGeographicalID(DetId(i + 1));
86  }
87  }
88  } else {
89  edm::LogError("CmsTrackerWheelBuilder") << "Where are the Petals or Rings?";
90  }
91 }
92 
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
static std::string getString(const std::string &, FilteredView *)
void clearComponents()
Definition: GeometricDet.h:162
void setGeographicalID(DetId id)
Definition: GeometricDet.h:99
Log< level::Error, false > LogError
void build(FilteredView &, GeometricDet *, const std::string &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
float float float z
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:151
const Translation & translation() const
Definition: GeometricDet.h:102
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricDet * component(size_t index)
Definition: GeometricDet.h:147
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
static double getPhiModule(const GeometricDet *a)
Definition: DetId.h:17
void addComponents(GeometricDetContainer const &cont)
void sortNS(FilteredView &, GeometricDet *) override
static bool isLessRModule(const GeometricDet *a, const GeometricDet *b)
void buildComponent(FilteredView &, GeometricDet *, const std::string &) override