CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  * $Date: 2007/02/03 16:19:08 $
7  * $Revision: 1.3 $
8  * \author N. Amapane - INFN Torino
9  */
10 
14 
16 
17 using namespace SurfaceOrientation;
18 using namespace std;
19 
20 //The ctor is in charge of finding sectors inside the layer.
22  handles::const_iterator end) :
23  theVolumes(begin,end),
24  mlayer(0)
25 {
26  // bool debug=MagGeoBuilderFromDDD::debug;
27 
28  // Sort in R
30 
31 // if (debug) {
32 // cout << " elements: " << theVolumes.size() << " unique volumes: ";
33 // volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
34 // }
35 }
36 
38 
39 // double MagGeoBuilderFromDDD::eLayer::minR() const {
40 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
41 // return theVolumes.front()->minR();
42 // }
43 
44 // double MagGeoBuilderFromDDD::eLayer::maxR() const {
45 // // ASSUMPTION: a layer is only 1 volume thick (by construction).
46 // return theVolumes.front()->maxR();
47 // }
48 
50  if (mlayer==0) {
51  //FIXME not guaranteed that all volumes in layer have the same zmin
52  // and zmax!
53  double zmin = 1e19;
54  double zmax = -1e19;
55  vector<MagVolume*> mVols;
56  for (handles::const_iterator vol = theVolumes.begin();
57  vol!=theVolumes.end(); ++vol) {
58  mVols.push_back((*vol)->magVolume);
59  zmin = min(zmin, (*vol)->minZ());
60  zmax = max(zmax, (*vol)->maxZ());
61  }
62  mlayer = new MagELayer(mVols, zmin, zmax);
63  }
64  return mlayer;
65 }
66 
MagELayer * buildMagELayer() const
Construct the MagELayer upon request.
Definition: eLayer.cc:49
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
#define end
Definition: vmac.h:38
eLayer(handles::const_iterator begin, handles::const_iterator end)
Constructor from list of volumes.
Definition: eLayer.cc:21
#define begin
Definition: vmac.h:31
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
~eLayer()
Destructor.
Definition: eLayer.cc:37