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::MagBRod ( std::vector< MagBSlab *> &  slabs,
Geom::Phi< float >  phiMin 
)

Constructor.

Definition at line 18 of file MagBRod.cc.

References LogTrace, theBinFinder, and theSlabs.

19  : theSlabs(slabs), thePhiMin(phiMin), theBinFinder(nullptr) {
20  // LogTrace("MagGeometry") << "Building MagBRod with " << theSlabs.size()
21  // << " slabs, minPhi " << thePhiMin << endl;
22 
23  if (theSlabs.size() > 1) { // Set the binfinder
24  vector<double> zBorders;
25  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) {
26  LogTrace("MagGeoBuilder") << " MagBSlab minZ=" << (*islab)->minZ() << endl;
27  //FIXME assume layers are already sorted in Z
28  zBorders.push_back((*islab)->minZ());
29  }
31  }
32 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:42
#define LogTrace(id)
Geom::Phi< float > thePhiMin
Definition: MagBRod.h:41
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:40

◆ ~MagBRod()

MagBRod::~MagBRod ( )
virtual

Destructor.

Definition at line 34 of file MagBRod.cc.

References theBinFinder, and theSlabs.

34  {
35  delete theBinFinder;
36 
37  for (vector<MagBSlab *>::const_iterator islab = theSlabs.begin(); islab != theSlabs.end(); ++islab) {
38  delete (*islab);
39  }
40 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:42
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:40

Member Function Documentation

◆ findVolume()

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

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

Definition at line 42 of file MagBRod.cc.

References newFWLiteAna::bin, MagBinFinders::GeneralBinFinderInZ< T >::binIndex(), runTauDisplay::gp, LogTrace, mps_fire::result, theBinFinder, theSlabs, tolerance, and beamSpotPI::Z.

42  {
43  const MagVolume *result = nullptr;
44  float Z = gp.z();
45 
46  int bin = 0;
47  if (theBinFinder != nullptr) { // true if there is > 1 bin
49  }
50 
51  LogTrace("MagGeometry") << " Trying slab at Z " << theSlabs[bin]->minZ() << " " << Z << endl;
52  result = theSlabs[bin]->findVolume(gp, tolerance);
53  LogTrace("MagGeometry") << "***In guessed bslab" << (result == nullptr ? " failed " : " OK ") << endl;
54 
55  return result;
56 }
MagBinFinders::GeneralBinFinderInZ< double > * theBinFinder
Definition: MagBRod.h:42
const double tolerance
#define LogTrace(id)
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
std::vector< MagBSlab * > theSlabs
Definition: MagBRod.h:40

◆ minPhi()

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

◆ theBinFinder

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

Definition at line 42 of file MagBRod.h.

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

◆ thePhiMin

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

Definition at line 41 of file MagBRod.h.

Referenced by minPhi().

◆ theSlabs

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

Definition at line 40 of file MagBRod.h.

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