CMS 3D CMS Logo

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

#include <eLayer.h>

Public Member Functions

MagELayerbuildMagELayer () const
 Construct the MagELayer upon request. More...
 
 eLayer (handles::const_iterator begin, handles::const_iterator end)
 Constructor from list of volumes. More...
 
 ~eLayer ()=default
 Destructor. More...
 

Private Attributes

MagELayermlayer
 
handles theVolumes
 

Detailed Description

Definition at line 15 of file eLayer.h.

Constructor & Destructor Documentation

◆ eLayer()

eLayer::eLayer ( handles::const_iterator  begin,
handles::const_iterator  end 
)

Constructor from list of volumes.

Definition at line 18 of file eLayer.cc.

References precomputed_value_sort(), and theVolumes.

18  : theVolumes(begin, end), mlayer(nullptr) {
19  // bool debug=MagGeoBuilderFromDDD::debug;
20 
21  // Sort in R
23 
24  // if (debug) {
25  // cout << " elements: " << theVolumes.size() << " unique volumes: ";
26  // volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
27  // }
28 }
MagELayer * mlayer
Definition: eLayer.h:31
handles theVolumes
Definition: eLayer.h:30
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)

◆ ~eLayer()

magneticfield::eLayer::~eLayer ( )
default

Destructor.

Member Function Documentation

◆ buildMagELayer()

MagELayer * eLayer::buildMagELayer ( ) const

Construct the MagELayer upon request.

Definition at line 40 of file eLayer.cc.

References WZElectronSkims53X_cff::max, SiStripPI::min, mlayer, theVolumes, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

40  {
41  if (mlayer == nullptr) {
42  //FIXME not guaranteed that all volumes in layer have the same zmin
43  // and zmax!
44  double zmin = 1e19;
45  double zmax = -1e19;
46  vector<MagVolume*> mVols;
47  for (handles::const_iterator vol = theVolumes.begin(); vol != theVolumes.end(); ++vol) {
48  mVols.push_back((*vol)->magVolume);
49  zmin = min(zmin, (*vol)->minZ());
50  zmax = max(zmax, (*vol)->maxZ());
51  }
52  mlayer = new MagELayer(mVols, zmin, zmax);
53  }
54  return mlayer;
55 }
MagELayer * mlayer
Definition: eLayer.h:31
handles theVolumes
Definition: eLayer.h:30

Member Data Documentation

◆ mlayer

MagELayer* magneticfield::eLayer::mlayer
mutableprivate

Definition at line 31 of file eLayer.h.

Referenced by buildMagELayer().

◆ theVolumes

handles magneticfield::eLayer::theVolumes
private

Definition at line 30 of file eLayer.h.

Referenced by buildMagELayer(), and eLayer().