CMS 3D CMS Logo

Public Member Functions | Private Attributes

MagGeoBuilderFromDDD::bSlab Class Reference

#include <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 gather_cfg::cout, MagGeoBuilderFromDDD::debug, epsilon, i, precomputed_value_sort(), volumes, Gflash::Zmax, Gflash::Zmin, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.

                                                                                       :
  volumes(begin, end),
  mslab(0)
{
  if (volumes.size() > 1) {
    // Sort volumes by dphi i.e. phi(j)-phi(i) > 0 if j>1.
    precomputed_value_sort(volumes.begin(), volumes.end(),
                           ExtractPhiMax(), LessDPhi());

  if (MagGeoBuilderFromDDD::debug) cout << "        Slab has " << volumes.size()
                  << " volumes" << endl;

    // Check that all volumes have the same dZ
    handles::const_iterator i = volumes.begin();
    float Zmax = (*i)->surface(zplus).position().z();
    float Zmin= (*i)->surface(zminus).position().z();
    for (++i; i != volumes.end(); ++i){
      const float epsilon = 0.001;      
      if (fabs(Zmax - (*i)->surface(zplus).position().z()) > epsilon ||
          fabs(Zmin - (*i)->surface(zminus).position().z()) > epsilon) {
        if (MagGeoBuilderFromDDD::debug) cout << "*** WARNING: slabs Z coords not matching: D_Zmax = "
                        << fabs(Zmax - (*i)->surface(zplus).position().z())
                        << " D_Zmin = " 
                        << fabs(Zmin - (*i)->surface(zminus).position().z())
                        << endl;
      }
    }
  }
}
MagGeoBuilderFromDDD::bSlab::~bSlab ( )

Destructor.

Definition at line 19 of file bSlab.cc.

{}

Member Function Documentation

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

Construct the MagBSlab upon request.

Definition at line 60 of file bSlab.cc.

References autoMagneticFieldProducer_cfi::volumes, and SurfaceOrientation::zminus.

                                                          {
  if (mslab==0) {
    vector<MagVolume*> mVols;
    for (handles::const_iterator vol = volumes.begin();
         vol!=volumes.end(); ++vol) {
      mVols.push_back((*vol)->magVolume);
    }
    mslab = new MagBSlab(mVols, volumes.front()->surface(zminus).position().z()); //FIXME
  }
  return mslab;
}
Geom::Phi< float > MagGeoBuilderFromDDD::bSlab::maxPhi ( ) const

Boundary in phi.

Definition at line 55 of file bSlab.cc.

References autoMagneticFieldProducer_cfi::volumes.

                                                        {
  return volumes.back()->maxPhi();
}
Geom::Phi< float > MagGeoBuilderFromDDD::bSlab::minPhi ( ) const

Boundary in phi.

Definition at line 51 of file bSlab.cc.

References autoMagneticFieldProducer_cfi::volumes.

                                                       {
  return volumes.front()->minPhi();
}
const float MagGeoBuilderFromDDD::bSlab::RN ( ) const [inline]

Distance from center along sector normal.

Definition at line 29 of file bSlab.h.

References volumes.

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

Member Data Documentation

Definition at line 46 of file bSlab.h.

Definition at line 45 of file bSlab.h.

Referenced by bSlab(), and RN().