CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MagBRod Class Reference

#include <MagBRod.h>

Public Member Functions

MagVolumefindVolume (const GlobalPoint &gp, double tolerance) const
 Find the volume containing a point, with a given tolerance. More...
 
 MagBRod (std::vector< MagBSlab * > &slabs, Geom::Phi< float > phiMin)
 Constructor. More...
 
Geom::Phi< float > minPhi () const
 Phi of rod start. More...
 
virtual ~MagBRod ()
 Destructor. More...
 

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.

20  :
21  theSlabs(slabs),
22  thePhiMin(phiMin),
23  theBinFinder(0)
24 {
25  // TOFIX
26 // if (verbose.debugOut) cout << "Building MagBRod with " << theSlabs.size()
27 // << " slabs, minPhi " << thePhiMin << endl;
28 
29  if (theSlabs.size()>1) { // Set the binfinder
30  vector<double> zBorders;
31  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin();
32  islab != theSlabs.end(); ++islab) {
33  // TOFIX
34  if (verbose::debugOut) cout << (*islab)->minZ() <<endl;
35  //FIXME assume layers are already sorted in Z
36  zBorders.push_back((*islab)->minZ());
37  }
39  }
40 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:44
static bool debugOut
Definition: MagVerbosity.h:14
Geom::Phi< float > thePhiMin
Definition: MagBRod.h:43
tuple cout
Definition: gather_cfg.py:121
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:42
MagBRod::~MagBRod ( )
virtual

Destructor.

Definition at line 42 of file MagBRod.cc.

References theBinFinder, and theSlabs.

42  {
43  delete theBinFinder;
44 
45  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin();
46  islab != theSlabs.end(); ++islab) {
47  delete (*islab);
48  }
49 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:44
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:42

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, Gflash::Z, and PV3DBase< T, PVType, FrameType >::z().

51  {
52  MagVolume * result = 0;
53  float Z = gp.z();
54 
55  int bin = 0;
56  if (theBinFinder!=0) { // true if there is > 1 bin
57  bin = theBinFinder->binIndex(Z);
58  }
59 
60  // TOFIX
61  if (verbose::debugOut) cout << " Trying slab at Z " << theSlabs[bin]->minZ()
62  << " " << Z << endl ;
63  result = theSlabs[bin]->findVolume(gp, tolerance);
64  // TOFIX
65  if (verbose::debugOut) cout << "***In guessed bslab"
66  << (result==0? " failed " : " OK ") <<endl;
67 
68  return result;
69 }
const double Z[kNumberCalorimeter]
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:44
virtual int binIndex(T z) const
returns an index in the valid range for the bin closest to Z
static bool debugOut
Definition: MagVerbosity.h:14
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:42
Geom::Phi<float> MagBRod::minPhi ( ) const
inline

Phi of rod start.

Definition at line 39 of file MagBRod.h.

References thePhiMin.

39 {return thePhiMin;}
Geom::Phi< float > thePhiMin
Definition: MagBRod.h:43

Member Data Documentation

MagBinFinders::GeneralBinFinderInZ<double>* MagBRod::theBinFinder
private

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().