18 return( Panel1->
phi() < Panel2->
phi());
23 std::vector< GeometricDet const *>::iterator
end )
26 std::sort( begin, end, PhiSort );
29 std::vector<const GeometricDet*> theCompsPosNeg;
30 theCompsPosNeg.empty();
31 theCompsPosNeg.clear();
33 double theRmin = (**begin).rho();
34 double theRmax = theRmin;
35 for(vector<const GeometricDet*>::const_iterator it=begin;
37 if((**it).phi() >= 0) theCompsPosNeg.emplace_back(*it);
38 theRmin =
std::min( theRmin, (**it).rho());
39 theRmax =
std::max( theRmax, (**it).rho());
41 for(vector<const GeometricDet*>::const_iterator it=begin;
43 if((**it).phi() < 0) theCompsPosNeg.emplace_back(*it);
49 double radius_split = 100.;
50 std::vector<const GeometricDet*> theCompsInnerOuter;
51 theCompsInnerOuter.empty();
52 theCompsInnerOuter.clear();
53 unsigned int num_inner = 0;
54 for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
55 it!=theCompsPosNeg.end();it++){
56 if((**it).rho() <= radius_split) {
57 theCompsInnerOuter.emplace_back(*it);
62 for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
63 it!=theCompsPosNeg.end();it++){
64 if((**it).rho() > radius_split) theCompsInnerOuter.emplace_back(*it);
69 std::rotate(theCompsInnerOuter.begin()+num_inner,theCompsInnerOuter.end()-1,theCompsInnerOuter.end());
70 std::rotate(theCompsInnerOuter.begin(),theCompsInnerOuter.begin()+num_inner-1,theCompsInnerOuter.begin()+num_inner);
71 std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(),
begin);
83 theCmsTrackerPanelBuilder.
build( fv, subdet, s );
101 PhiPosNegSplit_innerOuter( comp.begin(), comp.end());
104 edm::LogError(
"CmsTrackerPhase1DiskBuilder" ) <<
"ERROR - wrong SubDet to sort..... " << det->
components().front()->type();
110 uint32_t totalblade = comp.size()/2;
113 zminpanels.reserve( totalblade );
114 zmaxpanels.reserve( totalblade );
115 for( uint32_t j = 0; j < totalblade; j++ )
117 if(
std::abs( comp[2*j]->translation().z()) >
std::abs( comp[ 2*j +1 ]->translation().z()))
119 zmaxpanels.emplace_back( det->
component(2*j) );
120 zminpanels.emplace_back( det->
component(2*j+1) );
123 else if(
std::abs( comp[2*j]->translation().z()) <
std::abs( comp[ 2*j +1 ]->translation().z()))
125 zmaxpanels.emplace_back( det->
component(2*j+1) );
126 zminpanels.emplace_back( det->
component(2*j) );
130 edm::LogWarning(
"CmsTrackerPhase1DiskBuilder" ) <<
"WARNING - The Z of both panels are equal! ";
134 for( uint32_t fn = 0; fn < zminpanels.size(); fn++ )
136 uint32_t blade = fn + 1;
138 uint32_t
temp = ( blade << 2 ) | panel;
139 zminpanels[fn]->setGeographicalID( temp );
142 for( uint32_t bn = 0; bn < zmaxpanels.size(); bn++)
144 uint32_t blade = bn + 1;
146 uint32_t
temp = ( blade << 2) | panel;
147 zmaxpanels[bn]->setGeographicalID( temp );
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
std::vector< GeometricDet * > GeometricDetContainer
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
void buildComponent(DDFilteredView &, GeometricDet *, std::string) override
ConstGeometricDetContainer & components()
Abs< T >::type abs(const T &t)
GeometricDet * component(size_t index)
void sortNS(DDFilteredView &, GeometricDet *) override
static bool PhiSort(const GeometricDet *Panel1, const GeometricDet *Panel2)
std::vector< GeometricDet const * > ConstGeometricDetContainer
void addComponents(GeometricDetContainer const &cont)
def rotate(angle, cx=0, cy=0)
void PhiPosNegSplit_innerOuter(std::vector< GeometricDet const * >::iterator begin, std::vector< GeometricDet const * >::iterator end)