20 bRod::bRod(handles::const_iterator
begin, handles::const_iterator
end,
bool debugVal)
31 std::cout <<
" Z slabs: " << zmin <<
" " << zmax << std::endl;
36 for (handles::const_iterator
i = first;
i !=
last; ++
i) {
37 hisZ.
fill((*i)->center().z());
39 std::vector<float> zClust = hisZ.
clusterize(resolution);
42 std::cout <<
" Found " << zClust.size() <<
" clusters in Z, " 43 <<
" slabs: " << std::endl;
45 handles::const_iterator slabStart =
first;
46 handles::const_iterator separ =
first;
48 for (
unsigned int i = 0;
i < zClust.size() - 1; ++
i) {
49 float zSepar = (zClust[
i] + zClust[
i + 1]) / 2.
f;
50 while ((*separ)->center().z() < zSepar)
53 std::cout <<
" Slab at: " << zClust[
i] <<
" elements: " << separ - slabStart <<
" unique volumes: ";
62 std::cout <<
" Slab at: " << zClust.back() <<
" elements: " << last - separ <<
" unique volumes: ";
69 std::vector<bSlab>::const_iterator
i =
slabs.begin();
72 for (++i; i !=
slabs.end(); ++
i) {
73 if (fabs(phimax - (*i).maxPhi()) > 0.001 || fabs(phimin - (*i).minPhi()) > 0.001) {
75 std::cout <<
"*** WARNING: slabs in this rod have different dphi! minphi " <<
phimin;
76 std::cout <<
" != " << (*i).minPhi() <<
" or maxphi " << phimax <<
" != " << (*i).maxPhi() << std::endl;
83 if (
mrod ==
nullptr) {
84 std::vector<MagBSlab*> mSlabs;
85 for (std::vector<bSlab>::const_iterator slab =
slabs.begin(); slab !=
slabs.end(); ++slab) {
86 mSlabs.push_back((*slab).buildMagBSlab());
void printUniqueNames(handles::const_iterator begin, handles::const_iterator end, bool uniq=true)
Just for debugging...
MagBRod * buildMagBRod() const
Construct the MagBRod upon request.
std::vector< float > clusterize(float resolution)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
std::vector< bSlab > slabs