CMS 3D CMS Logo

eLayer.cc
Go to the documentation of this file.
1 // #include "Utilities/Configuration/interface/Architecture.h"
2 
3 /*
4  * See header file for a description of this class.
5  *
6  * \author N. Amapane - INFN Torino
7  */
8 
12 
14 
15 using namespace SurfaceOrientation;
16 using namespace std;
17 
18 //The ctor is in charge of finding sectors inside the layer.
20  handles::const_iterator end) :
21  theVolumes(begin,end),
22  mlayer(nullptr)
23 {
24  // bool debug=MagGeoBuilderFromDDD::debug;
25 
26  // Sort in R
28 
29 // if (debug) {
30 // cout << " elements: " << theVolumes.size() << " unique volumes: ";
31 // volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
32 // }
33 }
34 
36 
37 // double MagGeoBuilderFromDDD::eLayer::minR() const {
38 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
39 // return theVolumes.front()->minR();
40 // }
41 
42 // double MagGeoBuilderFromDDD::eLayer::maxR() const {
43 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
44 // return theVolumes.front()->maxR();
45 // }
46 
48  if (mlayer==nullptr) {
49  //FIXME not guaranteed that all volumes in layer have the same zmin
50  // and zmax!
51  double zmin = 1e19;
52  double zmax = -1e19;
53  vector<MagVolume*> mVols;
54  for (handles::const_iterator vol = theVolumes.begin();
55  vol!=theVolumes.end(); ++vol) {
56  mVols.push_back((*vol)->magVolume);
57  zmin = min(zmin, (*vol)->minZ());
58  zmax = max(zmax, (*vol)->maxZ());
59  }
60  mlayer = new MagELayer(mVols, zmin, zmax);
61  }
62  return mlayer;
63 }
64 
MagELayer * buildMagELayer() const
Construct the MagELayer upon request.
Definition: eLayer.cc:47
#define nullptr
#define end
Definition: vmac.h:39
T min(T a, T b)
Definition: MathUtil.h:58
eLayer(handles::const_iterator begin, handles::const_iterator end)
Constructor from list of volumes.
Definition: eLayer.cc:19
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr, const Compare &comp)
#define begin
Definition: vmac.h:32
~eLayer()
Destructor.
Definition: eLayer.cc:35