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
MagESector Class Reference

#include <MagESector.h>

Public Member Functions

MagVolumefindVolume (const GlobalPoint &gp, double tolerance) const
 Find the volume containing a point, with a given tolerance. More...
 
 MagESector (std::vector< MagELayer * > &layers, Geom::Phi< float > phiMin)
 Constructor. More...
 
Geom::Phi< float > minPhi () const
 Phi of sector start. More...
 
virtual ~MagESector ()
 Destructor. More...
 

Private Attributes

std::vector< MagELayer * > theLayers
 
Geom::Phi< float > thePhiMin
 

Detailed Description

A sector of volumes in the endcap. One sector is composed of several layers (MagELayer)

Date:
2007/02/03 16:08:50
Revision:
1.2
Author
N. Amapane - INFN Torino

Definition at line 20 of file MagESector.h.

Constructor & Destructor Documentation

MagESector::MagESector ( std::vector< MagELayer * > &  layers,
Geom::Phi< float >  phiMin 
)

Constructor.

Definition at line 20 of file MagESector.cc.

20  :
21  theLayers(layers),
22  thePhiMin(phiMin)
23 {}
Geom::Phi< float > thePhiMin
Definition: MagESector.h:36
std::vector< MagELayer * > theLayers
Definition: MagESector.h:35
MagESector::~MagESector ( )
virtual

Destructor.

Definition at line 26 of file MagESector.cc.

References theLayers.

26  {
27  for (vector<MagELayer *>::const_iterator ilay = theLayers.begin();
28  ilay != theLayers.end(); ++ilay) {
29  delete (*ilay);
30  }
31 }
std::vector< MagELayer * > theLayers
Definition: MagESector.h:35

Member Function Documentation

MagVolume * MagESector::findVolume ( const GlobalPoint gp,
double  tolerance 
) const

Find the volume containing a point, with a given tolerance.

Definition at line 34 of file MagESector.cc.

References query::result, theLayers, Gflash::Z, and PV3DBase< T, PVType, FrameType >::z().

34  {
35  MagVolume * result = 0;
36  float Z = gp.z();
37 
38  // int count = 0;
39 
40  // FIXME : use a binfinder
41  for(vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin();
42  ilay != theLayers.rend(); ++ilay) {
43 
44  if (Z+tolerance>(*ilay)->minZ()) {
45  if (Z-tolerance<(*ilay)->maxZ()) {
46 // if (verbose.debugOut) cout << " Trying layer at Z " << (*ilay)->minZ()
47 // << " " << Z << endl ;
48  result = (*ilay)->findVolume(gp, tolerance);
49 // if (verbose.debugOut) {
50 // cout << "***In elayer " << count << " "
51 // << (result==0? " failed " : " OK ") <<endl;
52 // ++count;
53 // }
54  } else {
55  // break; // FIXME: OK if sorted by maxZ
56  }
57  }
58  if (result!=0) return result;
59  }
60 
61  return 0;
62 }
const double Z[kNumberCalorimeter]
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
std::vector< MagELayer * > theLayers
Definition: MagESector.h:35
Geom::Phi<float> MagESector::minPhi ( ) const
inline

Phi of sector start.

Definition at line 32 of file MagESector.h.

References thePhiMin.

32 {return thePhiMin;}
Geom::Phi< float > thePhiMin
Definition: MagESector.h:36

Member Data Documentation

std::vector<MagELayer*> MagESector::theLayers
private

Definition at line 35 of file MagESector.h.

Referenced by findVolume(), and ~MagESector().

Geom::Phi<float> MagESector::thePhiMin
private

Definition at line 36 of file MagESector.h.

Referenced by minPhi().