CMS 3D CMS Logo

MagESector Class Reference

A sector of volumes in the endcap. More...

#include <MagneticField/Layers/interface/MagESector.h>

List of all members.

Public Member Functions

MagVolumefindVolume (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


Detailed Description

A sector of volumes in the endcap.

One sector is composed of several layers (MagELayer)

Date
2007/02/03 16:08:50
Revision
1.2
Author:
N. Amapane - INFN Torino

Definition at line 20 of file MagESector.h.


Constructor & Destructor Documentation

MagESector::MagESector ( std::vector< MagELayer * > &  layers,
Geom::Phi< float >  phiMin 
)

Constructor.

MagESector::~MagESector (  )  [virtual]

Destructor.

Definition at line 26 of file MagESector.cc.

References theLayers.

00026                        {
00027   for (vector<MagELayer *>::const_iterator ilay = theLayers.begin();
00028        ilay != theLayers.end(); ++ilay) {
00029     delete (*ilay);
00030   }
00031 }


Member Function Documentation

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 HLT_VtxMuL3::result, theLayers, and PV3DBase< T, PVType, FrameType >::z().

00034                                                                                  {
00035   MagVolume * result = 0;
00036   float Z = gp.z();
00037 
00038   //  int count = 0;
00039 
00040   // FIXME : use a binfinder
00041   for(vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin();
00042         ilay != theLayers.rend(); ++ilay) {
00043 
00044     if (Z+tolerance>(*ilay)->minZ()) {
00045       if (Z-tolerance<(*ilay)->maxZ()) {
00046 //      if (verbose.debugOut) cout << "  Trying layer at Z " << (*ilay)->minZ()
00047 //                      << " " << Z << endl ;
00048         result = (*ilay)->findVolume(gp, tolerance);
00049 //      if (verbose.debugOut) {
00050 //        cout << "***In elayer " << count << " " 
00051 //             << (result==0? " failed " : " OK ") <<endl;
00052 //        ++count;
00053 //      }
00054       } else {
00055         // break;  // FIXME: OK if sorted by maxZ
00056       }
00057     }
00058     if (result!=0) return result;
00059   }
00060 
00061   return 0;
00062 }

Geom::Phi<float> MagESector::minPhi (  )  const [inline]

Phi of sector start.

Definition at line 32 of file MagESector.h.

References thePhiMin.

00032 {return thePhiMin;}


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:56 2009 for CMSSW by  doxygen 1.5.4