CMS 3D CMS Logo

Public Member Functions | Private Attributes

MagELayer Class Reference

#include <MagELayer.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.
 MagELayer (const std::vector< MagVolume * > &volumes, double zMin, double zMax)
 Constructor.
double maxZ () const
 Upper Z bound.
double minZ () const
 Lower Z bound.
virtual ~MagELayer ()
 Destructor.

Private Attributes

std::vector< MagVolume * > theVolumes
double theZMax
double theZMin

Detailed Description

A layer of volumes in an endcap sector.

Date:
2013/05/30 21:57:40
Revision:
1.3
Author:
N. Amapane - INFN Torino

Definition at line 18 of file MagELayer.h.


Constructor & Destructor Documentation

MagELayer::MagELayer ( const std::vector< MagVolume * > &  volumes,
double  zMin,
double  zMax 
)

Constructor.

Definition at line 21 of file MagELayer.cc.

                                                                                :
  theVolumes(volumes),
  theZMin(zMin),
  theZMax(zMax)
{}
MagELayer::~MagELayer ( ) [virtual]

Destructor.

Definition at line 27 of file MagELayer.cc.

References theVolumes.

                     {
  for (vector<MagVolume *>::const_iterator ivol = theVolumes.begin();
       ivol != theVolumes.end(); ++ivol) {
    delete (*ivol);
  }
}

Member Function Documentation

MagVolume * MagELayer::findVolume ( const GlobalPoint gp,
double  tolerance 
) const

Find the volume containing a point, with a given tolerance.

Definition at line 36 of file MagELayer.cc.

References theVolumes.

                                                                    {
  for(vector<MagVolume*>::const_iterator ivol = theVolumes.begin();
        ivol != theVolumes.end(); ++ivol) {
    // FIXME : use a binfinder
    // TOFIX
//     if (verbose.debugOut) cout << "        Trying volume "
//                  << (static_cast<MagVolume6Faces*> (*ivol))->name << endl;
    if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
  }

  return 0;
}
double MagELayer::maxZ ( ) const [inline]

Upper Z bound.

Definition at line 33 of file MagELayer.h.

References theZMax.

{return theZMax;}
double MagELayer::minZ ( ) const [inline]

Lower Z bound.

Definition at line 30 of file MagELayer.h.

References theZMin.

{return theZMin;}

Member Data Documentation

std::vector<MagVolume*> MagELayer::theVolumes [private]

Definition at line 36 of file MagELayer.h.

Referenced by findVolume(), and ~MagELayer().

double MagELayer::theZMax [private]

Definition at line 38 of file MagELayer.h.

Referenced by maxZ().

double MagELayer::theZMin [private]

Definition at line 37 of file MagELayer.h.

Referenced by minZ().