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.

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.

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

Destructor.

Definition at line 19 of file bSlab.cc.

19 {}

Member Function Documentation

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

Construct the MagBSlab upon request.

Definition at line 60 of file bSlab.cc.

References SurfaceOrientation::zminus.

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

Boundary in phi.

Definition at line 55 of file bSlab.cc.

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

Boundary in phi.

Definition at line 51 of file bSlab.cc.

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

Distance from center along sector normal.

Definition at line 29 of file bSlab.h.

References volumes.

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

Member Data Documentation

MagBSlab* MagGeoBuilderFromDDD::bSlab::mslab
mutableprivate

Definition at line 46 of file bSlab.h.

handles MagGeoBuilderFromDDD::bSlab::volumes
private

Definition at line 45 of file bSlab.h.

Referenced by bSlab(), and RN().