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::MagESector ( std::vector< MagELayer * > &  layers,
Geom::Phi< float >  phiMin 
)

Constructor.

Definition at line 18 of file MagESector.cc.

◆ ~MagESector()

MagESector::~MagESector ( )
virtual

Destructor.

Definition at line 20 of file MagESector.cc.

20  {
21  for (vector<MagELayer*>::const_iterator ilay = theLayers.begin(); ilay != theLayers.end(); ++ilay) {
22  delete (*ilay);
23  }
24 }

References theLayers.

Member Function Documentation

◆ findVolume()

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

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

Definition at line 26 of file MagESector.cc.

26  {
27  const MagVolume* result = nullptr;
28  float Z = gp.z();
29 
30  // FIXME : use a binfinder
31  for (vector<MagELayer*>::const_reverse_iterator ilay = theLayers.rbegin(); ilay != theLayers.rend(); ++ilay) {
32  if (Z + tolerance > (*ilay)->minZ()) {
33  if (Z - tolerance < (*ilay)->maxZ()) {
34  LogTrace("MagGeometry") << " Trying elayer at Z " << (*ilay)->minZ() << " " << Z << endl;
35  result = (*ilay)->findVolume(gp, tolerance);
36  LogTrace("MagGeometry") << "***In elayer " << (result == nullptr ? " failed " : " OK ") << endl;
37  } else {
38  // break; // FIXME: OK if sorted by maxZ
39  }
40  }
41  if (result != nullptr)
42  return result;
43  }
44 
45  return nullptr;
46 }

References runTauDisplay::gp, LogTrace, mps_fire::result, theLayers, tolerance, and BeamSpotPI::Z.

◆ minPhi()

Geom::Phi<float> MagESector::minPhi ( ) const
inline

Phi of sector start.

Definition at line 30 of file MagESector.h.

30 { return thePhiMin; }

References thePhiMin.

Member Data Documentation

◆ theLayers

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

Definition at line 33 of file MagESector.h.

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

◆ thePhiMin

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

Definition at line 34 of file MagESector.h.

Referenced by minPhi().

MagESector::theLayers
std::vector< MagELayer * > theLayers
Definition: MagESector.h:33
MagESector::thePhiMin
Geom::Phi< float > thePhiMin
Definition: MagESector.h:34
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MagVolume
Definition: MagVolume.h:13
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:26
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:32
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8