CMS 3D CMS Logo

Public Member Functions | Private Attributes

MagGeoBuilderFromDDD::eLayer Class Reference

#include <eLayer.h>

List of all members.

Public Member Functions

MagELayerbuildMagELayer () const
 Construct the MagELayer upon request.
 eLayer (handles::const_iterator begin, handles::const_iterator end)
 Constructor from list of volumes.
 ~eLayer ()
 Destructor.

Private Attributes

MagELayermlayer
handles theVolumes

Detailed Description

A layer of volumes in an endcap sector.

Date:
2005/09/27 15:15:52
Revision:
1.2
Author:
N. Amapane - INFN Torino

Definition at line 18 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 21 of file eLayer.cc.

References precomputed_value_sort(), and theVolumes.

                                                                   :
  theVolumes(begin,end),
  mlayer(0) 
{
  //  bool debug=MagGeoBuilderFromDDD::debug;

  // Sort in R  
  precomputed_value_sort(theVolumes.begin(), theVolumes.end(), ExtractR());

//   if (debug) {
//     cout << " elements: " << theVolumes.size() << " unique volumes: ";
//     volumeHandle::printUniqueNames(theVolumes.begin(), theVolumes.end());
//   }
}
MagGeoBuilderFromDDD::eLayer::~eLayer ( )

Destructor.

Definition at line 37 of file eLayer.cc.

{}

Member Function Documentation

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

Construct the MagELayer upon request.

Definition at line 49 of file eLayer.cc.

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

                                                             {
  if (mlayer==0) {
    //FIXME not guaranteed that all volumes in layer have the same zmin
    // and zmax!
    double zmin = 1e19;
    double zmax = -1e19;
    vector<MagVolume*> mVols;
    for (handles::const_iterator vol = theVolumes.begin();
         vol!=theVolumes.end(); ++vol) {
      mVols.push_back((*vol)->magVolume);
      zmin = min(zmin, (*vol)->minZ());
      zmax = max(zmax, (*vol)->maxZ());
    }
    mlayer = new MagELayer(mVols, zmin, zmax);
  }
  return mlayer;
}

Member Data Documentation

Definition at line 34 of file eLayer.h.

Definition at line 33 of file eLayer.h.

Referenced by eLayer().