#include <MagESector.h>
Public Member Functions | |
MagVolume * | findVolume (const GlobalPoint &gp, double tolerance) const |
Find the volume containing a point, with a given tolerance. | |
MagESector (std::vector< MagELayer * > &layers, Geom::Phi< float > phiMin) | |
Constructor. | |
Geom::Phi< float > | minPhi () const |
Phi of sector start. | |
virtual | ~MagESector () |
Destructor. | |
Private Attributes | |
std::vector< MagELayer * > | theLayers |
Geom::Phi< float > | thePhiMin |
A sector of volumes in the endcap. One sector is composed of several layers (MagELayer)
Definition at line 20 of file MagESector.h.
MagESector::~MagESector | ( | ) | [virtual] |
Destructor.
Definition at line 26 of file MagESector.cc.
References theLayers.
{ for (vector<MagELayer *>::const_iterator ilay = theLayers.begin(); ilay != theLayers.end(); ++ilay) { delete (*ilay); } }
MagVolume * MagESector::findVolume | ( | const GlobalPoint & | gp, |
double | tolerance | ||
) | const |
Find the volume containing a point, with a given tolerance.
Definition at line 34 of file MagESector.cc.
References query::result, theLayers, Gflash::Z, and PV3DBase< T, PVType, FrameType >::z().
{ MagVolume * result = 0; float Z = gp.z(); // int count = 0; // FIXME : use a binfinder for(vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin(); ilay != theLayers.rend(); ++ilay) { if (Z+tolerance>(*ilay)->minZ()) { if (Z-tolerance<(*ilay)->maxZ()) { // if (verbose.debugOut) cout << " Trying layer at Z " << (*ilay)->minZ() // << " " << Z << endl ; result = (*ilay)->findVolume(gp, tolerance); // if (verbose.debugOut) { // cout << "***In elayer " << count << " " // << (result==0? " failed " : " OK ") <<endl; // ++count; // } } else { // break; // FIXME: OK if sorted by maxZ } } if (result!=0) return result; } return 0; }
Geom::Phi<float> MagESector::minPhi | ( | ) | const [inline] |
Phi of sector start.
Definition at line 32 of file MagESector.h.
References thePhiMin.
{return thePhiMin;}
std::vector<MagELayer*> MagESector::theLayers [private] |
Definition at line 35 of file MagESector.h.
Referenced by findVolume(), and ~MagESector().
Geom::Phi<float> MagESector::thePhiMin [private] |
Definition at line 36 of file MagESector.h.
Referenced by minPhi().