18 using namespace SurfaceOrientation;
29 handles::const_iterator
end) :
34 <<
volumes.back()->center().phi() << endl;
38 cout <<
" Rod at: 0 elements: " << end-begin
39 <<
" unique volumes: ";
57 float phiMin = -(float) resolution;
66 for (handles::const_iterator
i=first;
i!=
last; ++
i){
67 hisPhi.
fill((*i)->maxPhi()-phi0);
69 vector<float> phiClust = hisPhi.
clusterize(resolution);
74 handles::const_iterator rodStart =
first;
75 handles::const_iterator separ =
first;
77 float DZ = (*max_element(first,last,
LessZ()))->
maxZ() -
78 (*min_element(first,last,
LessZ()))->minZ();
81 for (
unsigned int i=0;
i<phiClust.size(); ++
i) {
83 if (
i<phiClust.size()-1) {
84 phiSepar = (phiClust[
i] + phiClust[
i+1])/2.
f;
89 <<
" phisepar " << phiSepar <<endl;
90 while (separ < last && (*separ)->maxPhi()-phi0 < phiSepar ) {
91 DZ1 += ((*separ)->maxZ() - (*separ)->minZ());
93 << (*separ)->maxPhi()-phi0 <<
" "
94 << (*separ)->maxZ() <<
" " << (*separ)->minZ() <<
" "
101 if (fabs(DZ-DZ1) > 0.001 && fabs(DZ-DZ1) < 0.5) {
103 <<
" " << DZ <<
" " << DZ1 << endl;
106 if (fabs(DZ-DZ1) > 0.25 ) {
108 << DZ <<
" " << DZ1 <<
" " << DZ-DZ1 << endl;
111 }
else if (DZ1>DZ+0.05) {
112 cout <<
" *** ERROR: bSector finding messed up." << endl;
117 cout <<
" Rod at: " << phiClust[
i] <<
" elements: "
118 << separ-rodStart <<
" unique volumes: ";
122 rods.push_back(
bRod(rodStart, separ));
136 vector<MagBRod*> mRods;
137 for (vector<bRod>::const_iterator rod = rods.begin();
138 rod!=rods.end(); ++rod) {
139 mRods.push_back((*rod).buildMagBRod());
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)