CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
magneticfield::bSlab Class Reference

#include <bSlab.h>

Public Member Functions

 bSlab (handles::const_iterator startIter, handles::const_iterator endIter, bool debugVal=false)
 Constructor from list of volumes. More...
 
MagBSlabbuildMagBSlab () const
 Construct the MagBSlab upon request. More...
 
Geom::Phi< float > maxPhi () const
 Boundary in phi. More...
 
Geom::Phi< float > minPhi () const
 Boundary in phi. More...
 
const float RN () const
 Distance from center along sector normal. More...
 
 ~bSlab ()=default
 Destructor. More...
 

Private Attributes

bool debug
 
MagBSlabmslab
 
handles volumes
 

Detailed Description

Definition at line 24 of file bSlab.h.

Constructor & Destructor Documentation

bSlab::bSlab ( handles::const_iterator  startIter,
handles::const_iterator  endIter,
bool  debugVal = false 
)

Constructor from list of volumes.

Definition at line 20 of file bSlab.cc.

References gather_cfg::cout, debug, geometryDiff::epsilon, mps_fire::i, precomputed_value_sort(), volumes, Gflash::Zmax, Gflash::Zmin, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.

21  : volumes(begin, end), mslab(nullptr), debug(debugVal) {
22  if (volumes.size() > 1) {
23  // Sort volumes by dphi i.e. phi(j)-phi(i) > 0 if j>1.
25 
26  if (debug)
27  cout << " Slab has " << volumes.size() << " volumes" << endl;
28 
29  // Check that all volumes have the same dZ
30  handles::const_iterator i = volumes.begin();
31  float Zmax = (*i)->surface(zplus).position().z();
32  float Zmin = (*i)->surface(zminus).position().z();
33  for (++i; i != volumes.end(); ++i) {
34  const float epsilon = 0.001;
35  if (fabs(Zmax - (*i)->surface(zplus).position().z()) > epsilon ||
36  fabs(Zmin - (*i)->surface(zminus).position().z()) > epsilon) {
37  if (debug)
38  cout << "*** WARNING: slabs Z coords not matching: D_Zmax = "
39  << fabs(Zmax - (*i)->surface(zplus).position().z())
40  << " D_Zmin = " << fabs(Zmin - (*i)->surface(zminus).position().z()) << endl;
41  }
42  }
43  }
44 }
const double Zmax[kNumberCalorimeter]
#define end
Definition: vmac.h:39
const double Zmin[kNumberCalorimeter]
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
MagBSlab * mslab
Definition: bSlab.h:48
handles volumes
Definition: bSlab.h:47
#define begin
Definition: vmac.h:32
magneticfield::bSlab::~bSlab ( )
default

Destructor.

Member Function Documentation

MagBSlab * bSlab::buildMagBSlab ( ) const

Construct the MagBSlab upon request.

Definition at line 50 of file bSlab.cc.

References mslab, volumes, and SurfaceOrientation::zminus.

Referenced by RN().

50  {
51  if (mslab == nullptr) {
52  vector<MagVolume*> mVols;
53  for (handles::const_iterator vol = volumes.begin(); vol != volumes.end(); ++vol) {
54  mVols.push_back((*vol)->magVolume);
55  }
56  mslab = new MagBSlab(mVols, volumes.front()->surface(zminus).position().z()); //FIXME
57  }
58  return mslab;
59 }
MagBSlab * mslab
Definition: bSlab.h:48
handles volumes
Definition: bSlab.h:47
Geom::Phi< float > bSlab::maxPhi ( ) const

Boundary in phi.

Definition at line 48 of file bSlab.cc.

References volumes.

Referenced by RN().

48 { return volumes.back()->maxPhi(); }
handles volumes
Definition: bSlab.h:47
Geom::Phi< float > bSlab::minPhi ( ) const

Boundary in phi.

Definition at line 46 of file bSlab.cc.

References volumes.

Referenced by RN().

46 { return volumes.front()->minPhi(); }
handles volumes
Definition: bSlab.h:47
const float magneticfield::bSlab::RN ( ) const
inline

Distance from center along sector normal.

Definition at line 33 of file bSlab.h.

References buildMagBSlab(), maxPhi(), minPhi(), and volumes.

33 { return volumes.front()->RN(); }
handles volumes
Definition: bSlab.h:47

Member Data Documentation

bool magneticfield::bSlab::debug
private
MagBSlab* magneticfield::bSlab::mslab
mutableprivate

Definition at line 48 of file bSlab.h.

Referenced by buildMagBSlab().

handles magneticfield::bSlab::volumes
private

Definition at line 47 of file bSlab.h.

Referenced by bSlab(), buildMagBSlab(), maxPhi(), minPhi(), and RN().