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 23 of file bSlab.h.

Constructor & Destructor Documentation

◆ bSlab()

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

Constructor from list of volumes.

Definition at line 19 of file bSlab.cc.

20  : volumes(begin, end), mslab(nullptr), debug(debugVal) {
21  if (volumes.size() > 1) {
22  // Sort volumes by dphi i.e. phi(j)-phi(i) > 0 if j>1.
24 
25  if (debug)
26  cout << " Slab has " << volumes.size() << " volumes" << endl;
27 
28  // Check that all volumes have the same dZ
29  handles::const_iterator i = volumes.begin();
30  float Zmax = (*i)->surface(zplus).position().z();
31  float Zmin = (*i)->surface(zminus).position().z();
32  for (++i; i != volumes.end(); ++i) {
33  const float epsilon = 0.001;
34  if (fabs(Zmax - (*i)->surface(zplus).position().z()) > epsilon ||
35  fabs(Zmin - (*i)->surface(zminus).position().z()) > epsilon) {
36  if (debug)
37  cout << "*** WARNING: slabs Z coords not matching: D_Zmax = "
38  << fabs(Zmax - (*i)->surface(zplus).position().z())
39  << " D_Zmin = " << fabs(Zmin - (*i)->surface(zminus).position().z()) << endl;
40  }
41  }
42  }
43 }

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

◆ ~bSlab()

magneticfield::bSlab::~bSlab ( )
default

Destructor.

Member Function Documentation

◆ buildMagBSlab()

MagBSlab * bSlab::buildMagBSlab ( ) const

Construct the MagBSlab upon request.

Definition at line 49 of file bSlab.cc.

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

References mslab, volumes, and SurfaceOrientation::zminus.

◆ maxPhi()

Geom::Phi< float > bSlab::maxPhi ( ) const

Boundary in phi.

Definition at line 47 of file bSlab.cc.

47 { return volumes.back()->maxPhi(); }

References volumes.

◆ minPhi()

Geom::Phi< float > bSlab::minPhi ( ) const

Boundary in phi.

Definition at line 45 of file bSlab.cc.

45 { return volumes.front()->minPhi(); }

References volumes.

◆ RN()

const float magneticfield::bSlab::RN ( ) const
inline

Distance from center along sector normal.

Definition at line 32 of file bSlab.h.

32 { return volumes.front()->RN(); }

References volumes.

Member Data Documentation

◆ debug

bool magneticfield::bSlab::debug
private

◆ mslab

MagBSlab* magneticfield::bSlab::mslab
mutableprivate

Definition at line 47 of file bSlab.h.

Referenced by buildMagBSlab().

◆ volumes

handles magneticfield::bSlab::volumes
private

Definition at line 46 of file bSlab.h.

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

mps_fire.i
i
Definition: mps_fire.py:428
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MagBSlab
Definition: MagBSlab.h:23
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
magneticfield::bSlab::mslab
MagBSlab * mslab
Definition: bSlab.h:47
Gflash::Zmax
const double Zmax[kNumberCalorimeter]
Definition: GflashNameSpace.h:29
mps_fire.end
end
Definition: mps_fire.py:242
SurfaceOrientation::zminus
Definition: Surface.h:19
magneticfield::LessDPhi
Definition: BaseVolumeHandle.h:200
Gflash::Zmin
const double Zmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:28
magneticfield::ExtractPhiMax
Definition: BaseVolumeHandle.h:178
SurfaceOrientation::zplus
Definition: Surface.h:19
magneticfield::bSlab::volumes
handles volumes
Definition: bSlab.h:46
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17
magneticfield::bSlab::debug
bool debug
Definition: bSlab.h:48