CMS 3D CMS Logo

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

#include <MagBRod.h>

Public Member Functions

const 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.

Author
N. Amapane - INFN Torino

Definition at line 25 of file MagBRod.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file MagBRod.cc.

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

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

Destructor.

Definition at line 40 of file MagBRod.cc.

References theBinFinder, and theSlabs.

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

Member Function Documentation

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

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

Definition at line 49 of file MagBRod.cc.

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

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

Phi of rod start.

Definition at line 37 of file MagBRod.h.

References thePhiMin.

37 {return thePhiMin;}
Geom::Phi< float > thePhiMin
Definition: MagBRod.h:41

Member Data Documentation

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

Definition at line 42 of file MagBRod.h.

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

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

Definition at line 41 of file MagBRod.h.

Referenced by minPhi().

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

Definition at line 40 of file MagBRod.h.

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