#include <MagBRod.h>
Public Member Functions | |
MagVolume * | findVolume (const GlobalPoint &gp, double tolerance) const |
Find the volume containing a point, with a given tolerance. | |
MagBRod (std::vector< MagBSlab * > &slabs, Geom::Phi< float > phiMin) | |
Constructor. | |
Geom::Phi< float > | minPhi () const |
Phi of rod start. | |
virtual | ~MagBRod () |
Destructor. | |
Private Attributes | |
MagBinFinders::GeneralBinFinderInZ < double > * | theBinFinder |
Geom::Phi< float > | thePhiMin |
std::vector< MagBSlab * > | theSlabs |
A container of volumes in the barrel. It is part of the hierarchical organisation of barrel volumes:
A barrel layer (MagBLayer) groups volumes at the same distance to the origin. It consists of 12 sectors in phi (MagBSector). Each sector consists of one or more rods (MagBRods) of equal width in phi. Rods consist of one or more slabs (MagBSlab); each one consisting of one or, in few cases, several volumes with the same lenght in Z.
Constructor.
Definition at line 20 of file MagBRod.cc.
References gather_cfg::cout, verbose::debugOut, theBinFinder, and theSlabs.
: theSlabs(slabs), thePhiMin(phiMin), theBinFinder(0) { // TOFIX // if (verbose.debugOut) cout << "Building MagBRod with " << theSlabs.size() // << " slabs, minPhi " << thePhiMin << endl; if (theSlabs.size()>1) { // Set the binfinder vector<double> zBorders; for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) { // TOFIX if (verbose::debugOut) cout << (*islab)->minZ() <<endl; //FIXME assume layers are already sorted in Z zBorders.push_back((*islab)->minZ()); } theBinFinder = new MagBinFinders::GeneralBinFinderInZ<double>(zBorders); } }
MagBRod::~MagBRod | ( | ) | [virtual] |
Destructor.
Definition at line 42 of file MagBRod.cc.
References theBinFinder, and theSlabs.
{ delete theBinFinder; for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) { delete (*islab); } }
MagVolume * MagBRod::findVolume | ( | const GlobalPoint & | gp, |
double | tolerance | ||
) | const |
Find the volume containing a point, with a given tolerance.
Definition at line 51 of file MagBRod.cc.
References newFWLiteAna::bin, MagBinFinders::GeneralBinFinderInZ< T >::binIndex(), gather_cfg::cout, verbose::debugOut, query::result, theBinFinder, theSlabs, PV3DBase< T, PVType, FrameType >::z(), and Gflash::Z.
{ MagVolume * result = 0; float Z = gp.z(); int bin = 0; if (theBinFinder!=0) { // true if there is > 1 bin bin = theBinFinder->binIndex(Z); } // TOFIX if (verbose::debugOut) cout << " Trying slab at Z " << theSlabs[bin]->minZ() << " " << Z << endl ; result = theSlabs[bin]->findVolume(gp, tolerance); // TOFIX if (verbose::debugOut) cout << "***In guessed bslab" << (result==0? " failed " : " OK ") <<endl; return result; }
Geom::Phi<float> MagBRod::minPhi | ( | ) | const [inline] |
MagBinFinders::GeneralBinFinderInZ<double>* MagBRod::theBinFinder [private] |
Definition at line 44 of file MagBRod.h.
Referenced by findVolume(), MagBRod(), and ~MagBRod().
Geom::Phi<float> MagBRod::thePhiMin [private] |
std::vector<MagBSlab*> MagBRod::theSlabs [private] |
Definition at line 42 of file MagBRod.h.
Referenced by findVolume(), MagBRod(), and ~MagBRod().