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.

19  : theSlabs(slabs), thePhiMin(phiMin), theBinFinder(nullptr) {
20  // TOFIX
21  // if (verbose.debugOut) cout << "Building MagBRod with " << theSlabs.size()
22  // << " slabs, minPhi " << thePhiMin << endl;
23 
24  if (theSlabs.size() > 1) { // Set the binfinder
25  vector<double> zBorders;
26  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) {
27  // TOFIX
29  cout << (*islab)->minZ() << endl;
30  //FIXME assume layers are already sorted in Z
31  zBorders.push_back((*islab)->minZ());
32  }
34  }
35 }
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 37 of file MagBRod.cc.

References theBinFinder, and theSlabs.

37  {
38  delete theBinFinder;
39 
40  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) {
41  delete (*islab);
42  }
43 }
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 45 of file MagBRod.cc.

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

45  {
46  const MagVolume *result = nullptr;
47  float Z = gp.z();
48 
49  int bin = 0;
50  if (theBinFinder != nullptr) { // true if there is > 1 bin
51  bin = theBinFinder->binIndex(Z);
52  }
53 
54  // TOFIX
56  cout << " Trying slab at Z " << theSlabs[bin]->minZ() << " " << Z << endl;
57  result = theSlabs[bin]->findVolume(gp, tolerance);
58  // TOFIX
60  cout << "***In guessed bslab" << (result == nullptr ? " failed " : " OK ") << endl;
61 
62  return result;
63 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:42
const double tolerance
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
T z() const
Definition: PV3DBase.h:61
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().