CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MagESector Class Reference

#include <MagESector.h>

Public Member Functions

const 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)

Author
N. Amapane - INFN Torino

Definition at line 18 of file MagESector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file MagESector.cc.

18  :
20  thePhiMin(phiMin)
21 {}
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
Geom::Phi< float > thePhiMin
Definition: MagESector.h:34
std::vector< MagELayer * > theLayers
Definition: MagESector.h:33
MagESector::~MagESector ( )
virtual

Destructor.

Definition at line 24 of file MagESector.cc.

References theLayers.

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

Member Function Documentation

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

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

Definition at line 32 of file MagESector.cc.

References gather_cfg::cout, mps_fire::result, theLayers, DOFs::Z, and PV3DBase< T, PVType, FrameType >::z().

32  {
33  const MagVolume * result = nullptr;
34  float Z = gp.z();
35 
36  // FIXME : use a binfinder
37  for(vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin();
38  ilay != theLayers.rend(); ++ilay) {
39 
40  if (Z+tolerance>(*ilay)->minZ()) {
41  if (Z-tolerance<(*ilay)->maxZ()) {
42 #ifdef MF_DEBUG
43  cout << " Trying elayer at Z " << (*ilay)->minZ() << " " << Z << endl ;
44 #endif
45  result = (*ilay)->findVolume(gp, tolerance);
46 #ifdef MF_DEBUG
47  cout << "***In elayer " << (result==0? " failed " : " OK ") << endl;
48 #endif
49  } else {
50  // break; // FIXME: OK if sorted by maxZ
51  }
52  }
53  if (result!=nullptr) return result;
54  }
55 
56  return nullptr;
57 }
T z() const
Definition: PV3DBase.h:64
std::vector< MagELayer * > theLayers
Definition: MagESector.h:33
Geom::Phi<float> MagESector::minPhi ( ) const
inline

Phi of sector start.

Definition at line 30 of file MagESector.h.

References thePhiMin.

30 {return thePhiMin;}
Geom::Phi< float > thePhiMin
Definition: MagESector.h:34

Member Data Documentation

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

Definition at line 33 of file MagESector.h.

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

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

Definition at line 34 of file MagESector.h.

Referenced by minPhi().