CMS 3D CMS Logo

CmsTrackerDiskBuilder.cc
Go to the documentation of this file.
10 
11 #include <vector>
12 #include <algorithm>
13 
14 using namespace std;
15 
16 template <class FilteredView>
18  CmsTrackerPanelBuilder<FilteredView> theCmsTrackerPanelBuilder;
19  GeometricDet* subdet = new GeometricDet(&fv,
22 
26  theCmsTrackerPanelBuilder.build(fv, subdet, s);
27  break;
28  default:
29  edm::LogError("CmsTrackerDiskBuilder")
30  << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD<FilteredView>::getString(s, &fv);
31  }
32  g->addComponent(subdet);
33 }
34 
35 template <class FilteredView>
38 
39  switch (det->components().front()->type()) {
42  break;
43  default:
44  edm::LogError("CmsTrackerDiskBuilder")
45  << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
46  }
47 
48  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
49  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
50 
51  uint32_t totalblade = comp.size() / 2;
52  // std::cout << "pixel_disk " << pixel_disk << endl;
53 
54  zminpanels.reserve(totalblade);
55  zmaxpanels.reserve(totalblade);
56  for (uint32_t j = 0; j < totalblade; j++) {
57  if (std::abs(comp[2 * j]->translation().z()) > std::abs(comp[2 * j + 1]->translation().z())) {
58  zmaxpanels.emplace_back(det->component(2 * j));
59  zminpanels.emplace_back(det->component(2 * j + 1));
60 
61  } else if (std::abs(comp[2 * j]->translation().z()) < std::abs(comp[2 * j + 1]->translation().z())) {
62  zmaxpanels.emplace_back(det->component(2 * j + 1));
63  zminpanels.emplace_back(det->component(2 * j));
64  } else {
65  edm::LogWarning("CmsTrackerDiskBuilder") << "WARNING - The Z of both panels are equal! ";
66  }
67  }
68 
69  for (uint32_t fn = 0; fn < zminpanels.size(); fn++) {
70  uint32_t blade = fn + 1;
71  uint32_t panel = 1;
72  uint32_t temp = (blade << 2) | panel;
73  zminpanels[fn]->setGeographicalID(temp);
74  }
75 
76  for (uint32_t bn = 0; bn < zmaxpanels.size(); bn++) {
77  uint32_t blade = bn + 1;
78  uint32_t panel = 2;
79  uint32_t temp = (blade << 2) | panel;
80  zmaxpanels[bn]->setGeographicalID(temp);
81  }
82 
83  det->clearComponents();
84  det->addComponents(zminpanels);
85  det->addComponents(zmaxpanels);
86 }
87 
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
static std::string getString(const std::string &, FilteredView *)
void clearComponents()
Definition: GeometricDet.h:162
void buildComponent(FilteredView &, GeometricDet *, const std::string &) override
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
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:151
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)
void sortNS(FilteredView &, GeometricDet *) override
void addComponents(GeometricDetContainer const &cont)
Log< level::Warning, false > LogWarning
static double getPhi(const GeometricDet *a)