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::bSlab Class Reference

#include <bSlab.h>

Public Member Functions

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

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.

Author
N. Amapane - INFN Torino

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

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

19  :
20  volumes(begin, end),
21  mslab(0)
22 {
23  if (volumes.size() > 1) {
24  // Sort volumes by dphi i.e. phi(j)-phi(i) > 0 if j>1.
25  precomputed_value_sort(volumes.begin(), volumes.end(),
26  ExtractPhiMax(), LessDPhi());
27 
28  if (MagGeoBuilderFromDDD::debug) cout << " Slab has " << volumes.size()
29  << " volumes" << endl;
30 
31  // Check that all volumes have the same dZ
32  handles::const_iterator i = volumes.begin();
33  float Zmax = (*i)->surface(zplus).position().z();
34  float Zmin= (*i)->surface(zminus).position().z();
35  for (++i; i != volumes.end(); ++i){
36  const float epsilon = 0.001;
37  if (fabs(Zmax - (*i)->surface(zplus).position().z()) > epsilon ||
38  fabs(Zmin - (*i)->surface(zminus).position().z()) > epsilon) {
39  if (MagGeoBuilderFromDDD::debug) cout << "*** WARNING: slabs Z coords not matching: D_Zmax = "
40  << fabs(Zmax - (*i)->surface(zplus).position().z())
41  << " D_Zmin = "
42  << fabs(Zmin - (*i)->surface(zminus).position().z())
43  << endl;
44  }
45  }
46  }
47 }
int i
Definition: DBlmapReader.cc:9
const double Zmax[kNumberCalorimeter]
#define end
Definition: vmac.h:37
const double Zmin[kNumberCalorimeter]
#define begin
Definition: vmac.h:30
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
tuple cout
Definition: gather_cfg.py:145
MagGeoBuilderFromDDD::bSlab::~bSlab ( )

Destructor.

Definition at line 17 of file bSlab.cc.

17 {}

Member Function Documentation

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

Construct the MagBSlab upon request.

Definition at line 58 of file bSlab.cc.

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

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

Boundary in phi.

Definition at line 53 of file bSlab.cc.

References autoMagneticFieldProducer_cfi::volumes.

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

Boundary in phi.

Definition at line 49 of file bSlab.cc.

References autoMagneticFieldProducer_cfi::volumes.

49  {
50  return volumes.front()->minPhi();
51 }
const float MagGeoBuilderFromDDD::bSlab::RN ( ) const
inline

Distance from center along sector normal.

Definition at line 27 of file bSlab.h.

References volumes.

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

Member Data Documentation

MagBSlab* MagGeoBuilderFromDDD::bSlab::mslab
mutableprivate

Definition at line 44 of file bSlab.h.

handles MagGeoBuilderFromDDD::bSlab::volumes
private

Definition at line 43 of file bSlab.h.

Referenced by bSlab(), and RN().