20 using namespace SurfaceOrientation;
31 handles::const_iterator
end) :
36 <<
volumes.back()->center().phi() << endl;
40 cout <<
" Rod at: 0 elements: " << end-begin
41 <<
" unique volumes: ";
59 float phiMin = -(float) resolution;
68 for (handles::const_iterator
i=first;
i!=
last; ++
i){
69 hisPhi.
fill((*i)->maxPhi()-phi0);
71 vector<float> phiClust = hisPhi.
clusterize(resolution);
76 handles::const_iterator rodStart =
first;
77 handles::const_iterator separ =
first;
79 float DZ = (*max_element(first,last,
LessZ()))->
maxZ() -
80 (*min_element(first,last,
LessZ()))->
minZ();
83 for (
unsigned int i=0;
i<phiClust.size(); ++
i) {
85 if (
i<phiClust.size()-1) {
86 phiSepar = (phiClust[
i] + phiClust[
i+1])/2.
f;
91 <<
" phisepar " << phiSepar <<endl;
92 while (separ < last && (*separ)->maxPhi()-phi0 < phiSepar ) {
93 DZ1 += ((*separ)->maxZ() - (*separ)->minZ());
95 << (*separ)->maxPhi()-phi0 <<
" "
96 << (*separ)->maxZ() <<
" " << (*separ)->minZ() <<
" "
103 if (fabs(DZ-DZ1) > 0.001 && fabs(DZ-DZ1) < 0.5) {
105 <<
" " << DZ <<
" " << DZ1 << endl;
108 if (fabs(DZ-DZ1) > 0.25 ) {
110 << DZ <<
" " << DZ1 <<
" " << DZ-DZ1 << endl;
113 }
else if (DZ1>DZ+0.05) {
114 cout <<
" *** ERROR: bSector finding messed up." << endl;
119 cout <<
" Rod at: " << phiClust[
i] <<
" elements: "
120 << separ-rodStart <<
" unique volumes: ";
124 rods.push_back(
bRod(rodStart, separ));
138 vector<MagBRod*> mRods;
139 for (vector<bRod>::const_iterator rod = rods.begin();
140 rod!=rods.end(); ++rod) {
141 mRods.push_back((*rod).buildMagBRod());
143 msector =
new MagBSector(mRods, volumes.front()->minPhi());
static void printUniqueNames(handles::const_iterator begin, handles::const_iterator end)
Just for debugging...
std::vector< float > clusterize(float resolution)
bSector()
Default ctor is needed to have arrays.
MagBSector * buildMagBSector() const
Construct the MagBSector upon request.
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)