14 template <
class FilteredView>
16 return (Panel1->
phi() < Panel2->
phi());
19 template <
class FilteredView>
21 std::vector<GeometricDet const*>::iterator begin, std::vector<GeometricDet const*>::iterator end) {
26 std::vector<const GeometricDet*> theCompsPosNeg;
28 double theRmin = (**begin).rho();
29 double theRmax = theRmin;
30 for (vector<const GeometricDet*>::const_iterator it = begin; it != end; it++) {
31 if ((**it).phi() >= 0)
32 theCompsPosNeg.emplace_back(*it);
33 theRmin =
std::min(theRmin, (**it).rho());
34 theRmax =
std::max(theRmax, (**it).rho());
36 for (vector<const GeometricDet*>::const_iterator it = begin; it != end; it++) {
38 theCompsPosNeg.emplace_back(*it);
44 double radius_split = 100.;
45 std::vector<const GeometricDet*> theCompsInnerOuter;
46 unsigned int num_inner = 0;
47 for (vector<const GeometricDet*>::const_iterator it = theCompsPosNeg.begin(); it != theCompsPosNeg.end(); it++) {
48 if ((**it).rho() <= radius_split) {
49 theCompsInnerOuter.emplace_back(*it);
54 for (vector<const GeometricDet*>::const_iterator it = theCompsPosNeg.begin(); it != theCompsPosNeg.end(); it++) {
55 if ((**it).rho() > radius_split)
56 theCompsInnerOuter.emplace_back(*it);
61 if (num_inner < theCompsInnerOuter.size()) {
62 std::rotate(theCompsInnerOuter.begin() + num_inner, theCompsInnerOuter.end() - 1, theCompsInnerOuter.end());
66 theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner);
71 "CmsTrackerPhase1DiskBuilder. num_inner == 0. The split of modules by radius is probably not doing what you " 72 "expect: inner-radius group is empty.");
74 if (num_inner == theCompsInnerOuter.size()) {
76 "CmsTrackerPhase1DiskBuilder. num_inner == theCompsInnerOuter.size(). The split of modules by radius is " 77 "probably not doing what you expect: outer-radius group is empty.");
80 std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin);
83 template <
class FilteredView>
95 theCmsTrackerPanelBuilder.
build(fv, subdet,
s);
101 g->addComponent(subdet);
104 template <
class FilteredView>
110 PhiPosNegSplit_innerOuter(
comp.begin(),
comp.end());
114 <<
"ERROR - wrong SubDet to sort..... " << det->
components().front()->type();
120 uint32_t totalblade =
comp.size() / 2;
123 zminpanels.reserve(totalblade);
124 zmaxpanels.reserve(totalblade);
125 for (uint32_t
j = 0;
j < totalblade;
j++) {
127 zmaxpanels.emplace_back(det->
component(2 *
j));
128 zminpanels.emplace_back(det->
component(2 *
j + 1));
131 zmaxpanels.emplace_back(det->
component(2 *
j + 1));
132 zminpanels.emplace_back(det->
component(2 *
j));
134 edm::LogWarning(
"CmsTrackerPhase1DiskBuilder") <<
"WARNING - The Z of both panels are equal! ";
138 for (uint32_t
fn = 0;
fn < zminpanels.size();
fn++) {
139 uint32_t blade =
fn + 1;
141 uint32_t
temp = (blade << 2) | panel;
142 zminpanels[
fn]->setGeographicalID(
temp);
145 for (uint32_t bn = 0; bn < zmaxpanels.size(); bn++) {
146 uint32_t blade = bn + 1;
148 uint32_t
temp = (blade << 2) | panel;
149 zmaxpanels[bn]->setGeographicalID(
temp);
std::vector< GeometricDet * > GeometricDetContainer
void buildComponent(FilteredView &, GeometricDet *, const std::string &) override
Log< level::Error, false > LogError
static bool PhiSort(const GeometricDet *Panel1, const GeometricDet *Panel2)
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
ConstGeometricDetContainer & components()
void sortNS(FilteredView &, GeometricDet *) override
Abs< T >::type abs(const T &t)
GeometricDet * component(size_t index)
std::vector< GeometricDet const * > ConstGeometricDetContainer
void PhiPosNegSplit_innerOuter(std::vector< GeometricDet const *>::iterator begin, std::vector< GeometricDet const *>::iterator end)
void addComponents(GeometricDetContainer const &cont)
Log< level::Warning, false > LogWarning
def rotate(angle, cx=0, cy=0)