#include <MagBLayer.h>
Public Member Functions | |
MagVolume * | findVolume (const GlobalPoint &gp, double tolerance) const |
Find the volume containing a point, with a given tolerance. | |
MagBLayer (std::vector< MagBSector * > §ors, double rMin) | |
Constructor. | |
MagBLayer (MagVolume *aVolume, double rMin) | |
Constructor for a trivial layer consisting of one single volume. | |
double | minR () const |
Lowest radius of the layer. | |
virtual | ~MagBLayer () |
Destructor. | |
Private Attributes | |
PeriodicBinFinderInPhi< float > * | theBinFinder |
double | theRMin |
std::vector< MagBSector * > | theSectors |
MagVolume * | theSingleVolume |
A barrel layer (MagBLayer) groups volumes at the same distance to the origin. It consists of either 1 single volume (a cylinder) or 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.
Definition at line 25 of file MagBLayer.h.
MagBLayer::MagBLayer | ( | std::vector< MagBSector * > & | sectors, |
double | rMin | ||
) |
Constructor.
MagBLayer::MagBLayer | ( | MagVolume * | aVolume, |
double | rMin | ||
) |
Constructor for a trivial layer consisting of one single volume.
Definition at line 38 of file MagBLayer.cc.
: theSingleVolume(0), theRMin(rMin), theBinFinder(0) { // TOFIX // if (verbose.debugOut) cout << "Building MagBLayer with " << 0 // << " sectors, minR " << theRMin << endl; }
MagBLayer::~MagBLayer | ( | ) | [virtual] |
Destructor.
Definition at line 50 of file MagBLayer.cc.
References theBinFinder, theSectors, and theSingleVolume.
{ delete theBinFinder; delete theSingleVolume; for (vector<MagBSector *>::const_iterator isec = theSectors.begin(); isec != theSectors.end(); ++isec) { delete (*isec); } }
MagVolume * MagBLayer::findVolume | ( | const GlobalPoint & | gp, |
double | tolerance | ||
) | const |
Find the volume containing a point, with a given tolerance.
Definition at line 62 of file MagBLayer.cc.
References newFWLiteAna::bin, PeriodicBinFinderInPhi< T >::binIndex(), gather_cfg::cout, verbose::debugOut, MagVolume::inside(), PV3DBase< T, PVType, FrameType >::phi(), phi, query::result, theBinFinder, theSectors, and theSingleVolume.
{ MagVolume * result = 0; //In case the layer is composed of a single volume... if (theSingleVolume) { // TOFIX // if (verbose.debugOut) cout << " Trying the unique volume " << endl; if (theSingleVolume->inside(gp, tolerance)) { result = theSingleVolume; // TOFIX // if (verbose.debugOut) cout << "***In unique bsector" // << (result==0? " failed " : " OK ") <<endl; } return result; } // Normal cases - query the sectors. Geom::Phi<float> phi = gp.phi(); // FIXME assume sectors are sorted in phi! int bin= theBinFinder->binIndex(phi); // TOFIX if (verbose::debugOut) cout << " Trying sector at phi " << theSectors[bin]->minPhi() << " " << phi << endl ; result = theSectors[bin]->findVolume(gp, tolerance); // TOFIX if (verbose::debugOut) cout << "***In guessed bsector" << (result==0? " failed " : " OK ") <<endl; if (result==0) { // If fails, can be in previous bin. // TOFIX if (verbose::debugOut) cout << " Trying sector at phi " << theSectors[theBinFinder->binIndex(bin-1)]->minPhi() << " " << phi << endl ; result = theSectors[theBinFinder->binIndex(bin-1)]->findVolume(gp, tolerance); // TOFIX if (verbose::debugOut) cout << "***In previous bsector" << (result==0? " failed " : " OK ") <<endl; } return result; }
double MagBLayer::minR | ( | ) | const [inline] |
Lowest radius of the layer.
Definition at line 40 of file MagBLayer.h.
References theRMin.
{return theRMin;}
PeriodicBinFinderInPhi<float>* MagBLayer::theBinFinder [private] |
Definition at line 50 of file MagBLayer.h.
Referenced by findVolume(), and ~MagBLayer().
double MagBLayer::theRMin [private] |
Definition at line 48 of file MagBLayer.h.
Referenced by minR().
std::vector<MagBSector*> MagBLayer::theSectors [private] |
Definition at line 46 of file MagBLayer.h.
Referenced by findVolume(), and ~MagBLayer().
MagVolume* MagBLayer::theSingleVolume [private] |
Definition at line 47 of file MagBLayer.h.
Referenced by findVolume(), and ~MagBLayer().