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

#include <FiducialVolume.h>

Public Member Functions

void addActivePoint (const GlobalPoint &point)
 add a point that belongs to the active volume More...
 
void determinInnerDimensions ()
 
 FiducialVolume (double tolerance=1.0)
 
bool isValid () const
 check whether the volume is properly defined More...
 
double maxR (bool withTolerance=true) const
 
double maxZ (bool withTolerance=true) const
 
double minR (bool withTolerance=true) const
 
double minZ (bool withTolerance=true) const
 
void reset ()
 invalidate the volume More...
 

Private Attributes

double maxR_
 
double maxZ_
 
double minR_
 
double minZ_
 
double tolerance_
 

Detailed Description

The detector active volume is determined estimated as a non-zero thickness cylinder with outter dimensions maxZ and maxR. The inner dimensions are found as minimum R and Z for two cases "barrel" (|eta|<1) and "endcap" (|eta|>1.7) correspondingly

Definition at line 25 of file FiducialVolume.h.

Constructor & Destructor Documentation

FiducialVolume::FiducialVolume ( double  tolerance = 1.0)
inline

Definition at line 27 of file FiducialVolume.h.

References reset().

27  :
28  tolerance_(tolerance) { reset(); }
void reset()
invalidate the volume

Member Function Documentation

void FiducialVolume::addActivePoint ( const GlobalPoint point)

add a point that belongs to the active volume

Definition at line 24 of file FiducialVolume.cc.

References PV3DBase< T, PVType, FrameType >::eta(), maxR_, maxZ_, minR_, minZ_, PV3DBase< T, PVType, FrameType >::perp(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by DetIdAssociator::buildMap().

25 {
26  if ( point.perp() > maxR_ ) maxR_ = point.perp();
27  if ( fabs(point.eta()) < 1 && point.perp() < minR_) minR_ = point.perp();
28  if ( fabs(point.z()) > maxZ_ ) maxZ_ = fabs(point.z());
29  if ( fabs(point.eta()) > 1.7 && fabs(point.z()) < minZ_) minZ_ = fabs(point.z());
30 }
T perp() const
Definition: PV3DBase.h:72
T z() const
Definition: PV3DBase.h:64
T eta() const
Definition: PV3DBase.h:76
void FiducialVolume::determinInnerDimensions ( )

finilize dimension calculations, fixes dimensions in a case of missing barrel or endcap

Definition at line 40 of file FiducialVolume.cc.

References maxR_, maxZ_, minR_, and minZ_.

Referenced by DetIdAssociator::buildMap().

41 {
42  if ( maxR_ > 0 && maxR_ < minR_ ) minR_ = maxR_;
43  if ( maxZ_ > 0 && maxZ_ < minZ_ ) minZ_ = maxZ_;
44 }
bool FiducialVolume::isValid ( void  ) const

check whether the volume is properly defined

Definition at line 19 of file FiducialVolume.cc.

References minR_, and minZ_.

Referenced by CachedTrajectory::getTrajectory(), and core.AutoHandle.AutoHandle::ReallyLoad().

20 {
21  return minR_<1e4 && maxR_ >= minR_ && minZ_<1e4 && maxZ_ >= minZ_;
22 }
double FiducialVolume::maxR ( bool  withTolerance = true) const
inline

Definition at line 45 of file FiducialVolume.h.

References maxR_, and tolerance_.

Referenced by DetIdAssociator::buildMap(), BetaCalculatorECAL::calcEcalDeposit(), and CachedTrajectory::getTrajectory().

46  {
47  if (withTolerance)
48  return maxR_+tolerance_;
49  else
50  return maxR_;
51  }
double FiducialVolume::maxZ ( bool  withTolerance = true) const
inline

Definition at line 59 of file FiducialVolume.h.

References maxZ_, and tolerance_.

Referenced by DetIdAssociator::buildMap(), BetaCalculatorECAL::calcEcalDeposit(), and CachedTrajectory::getTrajectory().

60  {
61  if (withTolerance)
62  return maxZ_+tolerance_;
63  else
64  return maxZ_;
65  }
double FiducialVolume::minR ( bool  withTolerance = true) const
inline

Definition at line 38 of file FiducialVolume.h.

References minR_, and tolerance_.

Referenced by DetIdAssociator::buildMap(), BetaCalculatorECAL::calcEcalDeposit(), CachedTrajectory::getTrajectory(), and TrackExtrapolator::propagateTrackToVolume().

39  {
40  if (withTolerance && minR_>tolerance_)
41  return minR_-tolerance_;
42  else
43  return minR_;
44  }
double FiducialVolume::minZ ( bool  withTolerance = true) const
inline

Definition at line 52 of file FiducialVolume.h.

References minZ_, and tolerance_.

Referenced by DetIdAssociator::buildMap(), BetaCalculatorECAL::calcEcalDeposit(), CachedTrajectory::getTrajectory(), and TrackExtrapolator::propagateTrackToVolume().

53  {
54  if (withTolerance && minZ_>tolerance_)
55  return minZ_-tolerance_;
56  else
57  return minZ_;
58  }
void FiducialVolume::reset ( void  )

invalidate the volume

Definition at line 32 of file FiducialVolume.cc.

References maxR_, maxZ_, minR_, and minZ_.

Referenced by FiducialVolume().

33 {
34  minR_ = 1e5;
35  maxR_ = -1;
36  minZ_ = 1e5;
37  maxZ_ = -1;
38 }

Member Data Documentation

double FiducialVolume::maxR_
private

Definition at line 68 of file FiducialVolume.h.

Referenced by addActivePoint(), determinInnerDimensions(), maxR(), and reset().

double FiducialVolume::maxZ_
private

Definition at line 70 of file FiducialVolume.h.

Referenced by addActivePoint(), determinInnerDimensions(), maxZ(), and reset().

double FiducialVolume::minR_
private

Definition at line 67 of file FiducialVolume.h.

Referenced by addActivePoint(), determinInnerDimensions(), isValid(), minR(), and reset().

double FiducialVolume::minZ_
private

Definition at line 69 of file FiducialVolume.h.

Referenced by addActivePoint(), determinInnerDimensions(), isValid(), minZ(), and reset().

double FiducialVolume::tolerance_
private

Definition at line 71 of file FiducialVolume.h.

Referenced by maxR(), maxZ(), minR(), and minZ().