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::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 ( 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)
string end
Definition: dataset.py:937
magneticfield::eLayer::~eLayer ( )
default

Destructor.

Member Function Documentation

MagELayer * eLayer::buildMagELayer ( ) const

Construct the MagELayer upon request.

Definition at line 40 of file eLayer.cc.

References SiStripPI::max, min(), mlayer, and theVolumes.

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
T min(T a, T b)
Definition: MathUtil.h:58

Member Data Documentation

MagELayer* magneticfield::eLayer::mlayer
mutableprivate

Definition at line 31 of file eLayer.h.

Referenced by buildMagELayer().

handles magneticfield::eLayer::theVolumes
private

Definition at line 30 of file eLayer.h.

Referenced by buildMagELayer(), and eLayer().