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);
Log< level::Error, false > LogError
static bool PhiSort(const GeometricDet *Panel1, const GeometricDet *Panel2)
def rotate(angle, cx=0, cy=0)