CMS 3D CMS Logo

MagGeoBuilderFromDDD::bSlab Class Reference

One or more slabs constitute a barrel rod. More...

#include <MagneticField/GeomBuilder/src/bSlab.h>

List of all members.

Public Member Functions

 bSlab (handles::const_iterator begin, handles::const_iterator end)
 Constructor from list of volumes.
MagBSlabbuildMagBSlab () const
 Construct the MagBSlab upon request.
Geom::Phi< float > maxPhi () const
 Boundary in phi.
Geom::Phi< float > minPhi () const
 Boundary in phi.
const float RN () const
 Distance from center along sector normal.
 ~bSlab ()
 Destructor.

Private Attributes

MagBSlabmslab
handles volumes


Detailed Description

One or more slabs constitute a barrel rod.

In most cases, a slab is a single volume, but in few cases it consists in several volumes contiguous in phi.

Date
2007/02/03 16:18:13
Revision
1.3
Author:
N. Amapane - INFN Torino

Definition at line 20 of file bSlab.h.


Constructor & Destructor Documentation

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

Constructor from list of volumes.

Definition at line 21 of file bSlab.cc.

References GenMuonPlsPt100GeV_cfg::cout, MagGeoBuilderFromDDD::debug, lat::endl(), geometryDiff::epsilon, i, precomputed_value_sort(), volumes, Gflash::Zmax, Gflash::Zmin, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.

00021                                                                                        :
00022   volumes(begin, end),
00023   mslab(0)
00024 {
00025   if (volumes.size() > 1) {
00026     // Sort volumes by dphi i.e. phi(j)-phi(i) > 0 if j>1.
00027     precomputed_value_sort(volumes.begin(), volumes.end(),
00028                            ExtractPhiMax(), LessDPhi());
00029 
00030   if (MagGeoBuilderFromDDD::debug) cout << "        Slab has " << volumes.size()
00031                   << " volumes" << endl;
00032 
00033     // Check that all volumes have the same dZ
00034     handles::const_iterator i = volumes.begin();
00035     float Zmax = (*i)->surface(zplus).position().z();
00036     float Zmin= (*i)->surface(zminus).position().z();
00037     for (++i; i != volumes.end(); ++i){
00038       const float epsilon = 0.001;      
00039       if (fabs(Zmax - (*i)->surface(zplus).position().z()) > epsilon ||
00040           fabs(Zmin - (*i)->surface(zminus).position().z()) > epsilon) {
00041         if (MagGeoBuilderFromDDD::debug) cout << "*** WARNING: slabs Z coords not matching: D_Zmax = "
00042                         << fabs(Zmax - (*i)->surface(zplus).position().z())
00043                         << " D_Zmin = " 
00044                         << fabs(Zmin - (*i)->surface(zminus).position().z())
00045                         << endl;
00046       }
00047     }
00048   }
00049 }

MagGeoBuilderFromDDD::bSlab::~bSlab (  ) 

Destructor.

Definition at line 19 of file bSlab.cc.

00019 {}


Member Function Documentation

MagBSlab * MagGeoBuilderFromDDD::bSlab::buildMagBSlab (  )  const

Construct the MagBSlab upon request.

Definition at line 60 of file bSlab.cc.

References mslab, volumes, and SurfaceOrientation::zminus.

00060                                                           {
00061   if (mslab==0) {
00062     vector<MagVolume*> mVols;
00063     for (handles::const_iterator vol = volumes.begin();
00064          vol!=volumes.end(); ++vol) {
00065       mVols.push_back((*vol)->magVolume);
00066     }
00067     mslab = new MagBSlab(mVols, volumes.front()->surface(zminus).position().z()); //FIXME
00068   }
00069   return mslab;
00070 }

Geom::Phi< float > MagGeoBuilderFromDDD::bSlab::maxPhi (  )  const

Boundary in phi.

Definition at line 55 of file bSlab.cc.

References volumes.

00055                                                         {
00056   return volumes.back()->maxPhi();
00057 }

Geom::Phi< float > MagGeoBuilderFromDDD::bSlab::minPhi (  )  const

Boundary in phi.

Definition at line 51 of file bSlab.cc.

References volumes.

00051                                                        {
00052   return volumes.front()->minPhi();
00053 }

const float MagGeoBuilderFromDDD::bSlab::RN (  )  const [inline]

Distance from center along sector normal.

Definition at line 29 of file bSlab.h.

References volumes.

00029                          {
00030     return volumes.front()->RN();
00031   }


Member Data Documentation

MagBSlab* MagGeoBuilderFromDDD::bSlab::mslab [mutable, private]

Definition at line 46 of file bSlab.h.

Referenced by buildMagBSlab().

handles MagGeoBuilderFromDDD::bSlab::volumes [private]

Definition at line 45 of file bSlab.h.

Referenced by bSlab(), buildMagBSlab(), maxPhi(), minPhi(), and RN().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:57 2009 for CMSSW by  doxygen 1.5.4