CMS 3D CMS Logo

Public Member Functions | Private Attributes

MagBRod Class Reference

#include <MagBRod.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.
 MagBRod (std::vector< MagBSlab * > &slabs, Geom::Phi< float > phiMin)
 Constructor.
Geom::Phi< float > minPhi () const
 Phi of rod start.
virtual ~MagBRod ()
 Destructor.

Private Attributes

MagBinFinders::GeneralBinFinderInZ
< double > * 
theBinFinder
Geom::Phi< float > thePhiMin
std::vector< MagBSlab * > theSlabs

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 27 of file MagBRod.h.


Constructor & Destructor Documentation

MagBRod::MagBRod ( std::vector< MagBSlab * > &  slabs,
Geom::Phi< float >  phiMin 
)

Constructor.

Definition at line 20 of file MagBRod.cc.

References gather_cfg::cout, verbose::debugOut, theBinFinder, and theSlabs.

                                                                :
  theSlabs(slabs),
  thePhiMin(phiMin),
  theBinFinder(0)
{
  // TOFIX
//   if (verbose.debugOut) cout << "Building MagBRod with " << theSlabs.size()
//                << " slabs, minPhi " << thePhiMin << endl;
  
  if (theSlabs.size()>1) { // Set the binfinder
    vector<double> zBorders;
    for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin();
         islab != theSlabs.end(); ++islab) {
  // TOFIX
      if (verbose::debugOut) cout << (*islab)->minZ() <<endl;
      //FIXME assume layers are already sorted in Z
      zBorders.push_back((*islab)->minZ());
    }
    theBinFinder = new MagBinFinders::GeneralBinFinderInZ<double>(zBorders);
  }
}
MagBRod::~MagBRod ( ) [virtual]

Destructor.

Definition at line 42 of file MagBRod.cc.

References theBinFinder, and theSlabs.

                  {
  delete theBinFinder;
  
  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin();
       islab != theSlabs.end(); ++islab) {
    delete (*islab);
  }
}

Member Function Documentation

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

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

Definition at line 51 of file MagBRod.cc.

References newFWLiteAna::bin, MagBinFinders::GeneralBinFinderInZ< T >::binIndex(), gather_cfg::cout, verbose::debugOut, query::result, theBinFinder, theSlabs, PV3DBase< T, PVType, FrameType >::z(), and Gflash::Z.

                                                                              {
  MagVolume * result = 0;
  float Z = gp.z();

  int bin = 0;
  if (theBinFinder!=0) { // true if there is > 1 bin
    bin = theBinFinder->binIndex(Z);
  }
  
  // TOFIX
  if (verbose::debugOut) cout << "       Trying slab at Z " << theSlabs[bin]->minZ()
                              << " " << Z << endl ;
  result = theSlabs[bin]->findVolume(gp, tolerance);
  // TOFIX
  if (verbose::debugOut) cout << "***In guessed bslab"
                              << (result==0? " failed " : " OK ") <<endl;  

  return result;
}
Geom::Phi<float> MagBRod::minPhi ( ) const [inline]

Phi of rod start.

Definition at line 39 of file MagBRod.h.

References thePhiMin.

{return thePhiMin;}

Member Data Documentation

Definition at line 44 of file MagBRod.h.

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

Geom::Phi<float> MagBRod::thePhiMin [private]

Definition at line 43 of file MagBRod.h.

Referenced by minPhi().

std::vector<MagBSlab*> MagBRod::theSlabs [private]

Definition at line 42 of file MagBRod.h.

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