CMS 3D CMS Logo

Public Member Functions | Private Attributes

MagBSlab Class Reference

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

Private Attributes

std::vector< MagVolume * > theVolumes
double theZMin

Detailed Description

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.

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

Definition at line 25 of file MagBSlab.h.


Constructor & Destructor Documentation

MagBSlab::MagBSlab ( std::vector< MagVolume * >  volumes,
double  zMin 
)

Constructor.

Definition at line 20 of file MagBSlab.cc.

                                                          :
  theVolumes(volumes),
  theZMin(zMin)
{}
MagBSlab::~MagBSlab ( ) [virtual]

Destructor.

Definition at line 25 of file MagBSlab.cc.

References theVolumes.

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

Member Function Documentation

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

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

Definition at line 33 of file MagBSlab.cc.

References gather_cfg::cout, verbose::debugOut, mergeVDriftHistosByStation::name, and 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 MagBSlab::minZ ( ) const [inline]

Lower Z bound.

Definition at line 37 of file MagBSlab.h.

References theZMin.

{ return theZMin;}

Member Data Documentation

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

Definition at line 40 of file MagBSlab.h.

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

double MagBSlab::theZMin [private]

Definition at line 41 of file MagBSlab.h.

Referenced by minZ().