CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( handles::const_iterator  startIter,
handles::const_iterator  endIter,
bool  debugVal = false 
)

Constructor from list of volumes.

Definition at line 19 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.

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 }
const double Zmax[kNumberCalorimeter]
const double Zmin[kNumberCalorimeter]
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
MagBSlab * mslab
Definition: bSlab.h:47
handles volumes
Definition: bSlab.h:46
string end
Definition: dataset.py:937
tuple cout
Definition: gather_cfg.py:144
magneticfield::bSlab::~bSlab ( )
default

Destructor.

Member Function Documentation

MagBSlab * bSlab::buildMagBSlab ( ) const

Construct the MagBSlab upon request.

Definition at line 49 of file bSlab.cc.

References mslab, volumes, and SurfaceOrientation::zminus.

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 }
MagBSlab * mslab
Definition: bSlab.h:47
handles volumes
Definition: bSlab.h:46
Geom::Phi< float > bSlab::maxPhi ( ) const

Boundary in phi.

Definition at line 47 of file bSlab.cc.

References volumes.

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

Boundary in phi.

Definition at line 45 of file bSlab.cc.

References volumes.

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

Distance from center along sector normal.

Definition at line 32 of file bSlab.h.

References volumes.

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

Member Data Documentation

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

Definition at line 47 of file bSlab.h.

Referenced by buildMagBSlab().

handles magneticfield::bSlab::volumes
private

Definition at line 46 of file bSlab.h.

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