test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MagGeoBuilderFromDDD::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 ()
 Destructor. More...
 

Private Attributes

MagELayermlayer
 
handles theVolumes
 

Detailed Description

A layer of volumes in an endcap sector.

Author
N. Amapane - INFN Torino

Definition at line 16 of file eLayer.h.

Constructor & Destructor Documentation

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

Constructor from list of volumes.

Definition at line 19 of file eLayer.cc.

References precomputed_value_sort(), and theVolumes.

20  :
22  mlayer(0)
23 {
24  // bool debug=MagGeoBuilderFromDDD::debug;
25 
26  // Sort in R
27  precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractR());
28 
29 // if (debug) {
30 // cout << " elements: " << theVolumes.size() << " unique volumes: ";
31 // volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
32 // }
33 }
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
MagGeoBuilderFromDDD::eLayer::~eLayer ( )

Destructor.

Definition at line 35 of file eLayer.cc.

35 {}

Member Function Documentation

MagELayer * MagGeoBuilderFromDDD::eLayer::buildMagELayer ( ) const

Construct the MagELayer upon request.

Definition at line 47 of file eLayer.cc.

References bookConverter::max, min(), SiStripMonitorClusterAlca_cfi::zmax, and SiStripMonitorClusterAlca_cfi::zmin.

47  {
48  if (mlayer==0) {
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 }
T min(T a, T b)
Definition: MathUtil.h:58

Member Data Documentation

MagELayer* MagGeoBuilderFromDDD::eLayer::mlayer
mutableprivate

Definition at line 32 of file eLayer.h.

handles MagGeoBuilderFromDDD::eLayer::theVolumes
private

Definition at line 31 of file eLayer.h.

Referenced by eLayer().