CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MagBSlab Class Reference

#include <MagBSlab.h>

Public Member Functions

const MagVolumefindVolume (const GlobalPoint &gp, double tolerance) const
 Find the volume containing a point, with a given tolerance. More...
 
 MagBSlab (const std::vector< MagVolume *> &volumes, double zMin)
 Constructor. More...
 
double minZ () const
 Lower Z bound. More...
 
virtual ~MagBSlab ()
 Destructor. More...
 

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.

Author
N. Amapane - INFN Torino

Definition at line 23 of file MagBSlab.h.

Constructor & Destructor Documentation

◆ MagBSlab()

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

Constructor.

Definition at line 18 of file MagBSlab.cc.

◆ ~MagBSlab()

MagBSlab::~MagBSlab ( )
virtual

Destructor.

Definition at line 20 of file MagBSlab.cc.

References theVolumes.

20  {
21  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
22  delete (*ivol);
23  }
24 }
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38

Member Function Documentation

◆ findVolume()

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

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

Definition at line 26 of file MagBSlab.cc.

References runTauDisplay::gp, LogTrace, theVolumes, and tolerance.

26  {
27  for (vector<MagVolume*>::const_iterator ivol = theVolumes.begin(); ivol != theVolumes.end(); ++ivol) {
28  // FIXME : use a binfinder
29  LogTrace("MagGeometry") << " Trying volume " << (static_cast<MagVolume6Faces*>(*ivol))->volumeNo << endl;
30  if ((*ivol)->inside(gp, tolerance))
31  return (*ivol);
32  }
33 
34  return nullptr;
35 }
const double tolerance
#define LogTrace(id)
std::vector< MagVolume * > theVolumes
Definition: MagBSlab.h:38

◆ minZ()

double MagBSlab::minZ ( ) const
inline

Lower Z bound.

Definition at line 35 of file MagBSlab.h.

References theZMin.

35 { return theZMin; }
double theZMin
Definition: MagBSlab.h:39

Member Data Documentation

◆ theVolumes

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

Definition at line 38 of file MagBSlab.h.

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

◆ theZMin

double MagBSlab::theZMin
private

Definition at line 39 of file MagBSlab.h.

Referenced by minZ().