CMS 3D CMS Logo

eLayer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author N. Amapane - INFN Torino
5  */
6 
7 #include "eLayer.h"
10 
12 
13 using namespace SurfaceOrientation;
14 using namespace std;
15 using namespace magneticfield;
16 
17 //The ctor is in charge of finding sectors inside the layer.
18 eLayer::eLayer(handles::const_iterator begin, handles::const_iterator end) : 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 }
29 
30 // double MagGeoBuilderFromDDD::eLayer::minR() const {
31 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
32 // return theVolumes.front()->minR();
33 // }
34 
35 // double MagGeoBuilderFromDDD::eLayer::maxR() const {
36 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
37 // return theVolumes.front()->maxR();
38 // }
39 
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
Definition: MagELayer.h:16
min
T min(T a, T b)
Definition: MathUtil.h:58
eLayer.h
magneticfield
Definition: MagFieldConfig.h:22
magneticfield::eLayer::mlayer
MagELayer * mlayer
Definition: eLayer.h:31
precomputed_value_sort.h
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
MagELayer.h
mps_fire.end
end
Definition: mps_fire.py:242
magneticfield::ExtractR
Definition: BaseVolumeHandle.h:187
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
magneticfield::eLayer::buildMagELayer
MagELayer * buildMagELayer() const
Construct the MagELayer upon request.
Definition: eLayer.cc:40
MagVolume6Faces.h
std
Definition: JetResolutionObject.h:76
magneticfield::eLayer::theVolumes
handles theVolumes
Definition: eLayer.h:30
SurfaceOrientation
Definition: Surface.h:17
precomputed_value_sort
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
Definition: precomputed_value_sort.h:17