CMS 3D CMS Logo

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

#include <MagELayer.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

A layer of volumes in an endcap sector.

Author
N. Amapane - INFN Torino

Definition at line 16 of file MagELayer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 19 of file MagELayer.cc.

19  :
20  theVolumes(volumes),
21  theZMin(zMin),
22  theZMax(zMax)
23 {}
double theZMin
Definition: MagELayer.h:35
double theZMax
Definition: MagELayer.h:36
std::vector< MagVolume * > theVolumes
Definition: MagELayer.h:34
MagELayer::~MagELayer ( )
virtual

Destructor.

Definition at line 25 of file MagELayer.cc.

References theVolumes.

25  {
26  for (vector<MagVolume *>::const_iterator ivol = theVolumes.begin();
27  ivol != theVolumes.end(); ++ivol) {
28  delete (*ivol);
29  }
30 }
std::vector< MagVolume * > theVolumes
Definition: MagELayer.h:34

Member Function Documentation

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

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

Definition at line 34 of file MagELayer.cc.

References MagVolume6Faces::copyno, gather_cfg::cout, createfilelist::int, theVolumes, and MagVolume6Faces::volumeNo.

34  {
35  for(vector<MagVolume*>::const_iterator ivol = theVolumes.begin();
36  ivol != theVolumes.end(); ++ivol) {
37  // FIXME : use a binfinder
38 #ifdef MF_DEBUG
39  {
40  MagVolume6Faces* mv = static_cast<MagVolume6Faces*> (*ivol);
41  cout << " Trying volume " << mv->volumeNo << " " << int(mv->copyno) << endl;
42  }
43 #endif
44  if ( (*ivol)->inside(gp,tolerance) ) return (*ivol);
45  }
46 
47  return 0;
48 }
std::vector< MagVolume * > theVolumes
Definition: MagELayer.h:34
double MagELayer::maxZ ( ) const
inline

Upper Z bound.

Definition at line 31 of file MagELayer.h.

References theZMax.

31 {return theZMax;}
double theZMax
Definition: MagELayer.h:36
double MagELayer::minZ ( ) const
inline

Lower Z bound.

Definition at line 28 of file MagELayer.h.

References theZMin.

28 {return theZMin;}
double theZMin
Definition: MagELayer.h:35

Member Data Documentation

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

Definition at line 34 of file MagELayer.h.

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

double MagELayer::theZMax
private

Definition at line 36 of file MagELayer.h.

Referenced by maxZ().

double MagELayer::theZMin
private

Definition at line 35 of file MagELayer.h.

Referenced by minZ().