29 cout <<
" Sector at Phi " <<
volumes.front()->center().phi() <<
" " <<
volumes.back()->center().phi() << endl;
33 cout <<
" Rod at: 0 elements: " << end - begin <<
" unique volumes: ";
54 float phiTmp =
static_cast<float>(
volumes.back()->maxPhi()) - static_cast<float>(phi0) +
resolution;
59 cout <<
", phi0 = " << phi0 <<
", volumes.back()->maxPhi() = " <<
volumes.back()->maxPhi();
60 cout <<
", phiMin = " << phiMin << endl <<
"phiMax = " <<
phiMax;
61 cout <<
", int((phiMax - phiMin) / resolution) + 1 = " <<
int((phiMax - phiMin) / resolution) + 1 << endl;
68 for (handles::const_iterator
i = first;
i !=
last; ++
i) {
69 hisPhi.
fill((*i)->maxPhi() - phi0);
71 vector<float> phiClust = hisPhi.
clusterize(resolution);
74 cout <<
" Found " << phiClust.size() <<
" clusters in Phi, " 77 handles::const_iterator rodStart =
first;
78 handles::const_iterator separ =
first;
80 float DZ = (*max_element(first, last,
LessZ()))->
maxZ() - (*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 cout <<
" cluster " <<
i <<
" phisepar " << phiSepar << endl;
92 while (separ < last && (*separ)->maxPhi() - phi0 < phiSepar) {
93 DZ1 += ((*separ)->maxZ() - (*separ)->minZ());
95 cout <<
" " << (*separ)->name <<
" " << (*separ)->maxPhi() - phi0 <<
" " << (*separ)->maxZ() <<
" " 96 << (*separ)->minZ() <<
" " << DZ1 << endl;
102 if (fabs(DZ - DZ1) > 0.001 && fabs(DZ - DZ1) < 0.5) {
104 cout <<
"*** WARNING: Z lenght mismatch by " << DZ - DZ1 <<
" " << DZ <<
" " << DZ1 << endl;
106 if (fabs(DZ - DZ1) > 0.25) {
108 cout <<
" Incomplete, use also next cluster: " << 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: " << separ - rodStart <<
" unique volumes: ";
128 cout <<
" *** ERROR: bSector has no rods " << DZ <<
" " << DZ1 << endl;
130 cout <<
"-----------------------" << endl;
136 vector<MagBRod*> mRods;
137 for (vector<bRod>::const_iterator rod =
rods.begin(); rod !=
rods.end(); ++rod) {
138 mRods.push_back((*rod).buildMagBRod());
void printUniqueNames(handles::const_iterator begin, handles::const_iterator end, bool uniq=true)
Just for debugging...
std::vector< float > clusterize(float resolution)
MagBSector * buildMagBSector() const
Construct the MagBSector upon request.
bSector()
Default ctor is needed to have arrays.
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
constexpr valType make0To2pi(valType angle)