CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TrackingTools/TrackAssociator/interface/FiducialVolume.h

Go to the documentation of this file.
00001 #ifndef TrackAssociator_FiducialVolume_h
00002 #define TrackAssociator_FiducialVolume_h 1
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    TrackAssociator
00007 // Class:      FiducialVolume
00008 // 
00009 /*
00010 
00011  Description: detector active volume described by a closed cylinder with non-zero thickness.
00012 
00013 */
00014 //
00015 // Original Author:  Dmytro Kovalskyi
00016 // $Id: FiducialVolume.h,v 1.5 2011/04/07 08:17:31 innocent Exp $
00017 //
00022 
00023 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00024 #include <vector>
00025 
00026 class FiducialVolume {
00027  public:
00028    FiducialVolume(double tolerance = 1.0):
00029      tolerance_(tolerance) { reset(); }
00032    void determinInnerDimensions();
00034    bool isValid() const;
00036    void addActivePoint( const GlobalPoint& point );
00038    void reset();
00039    double minR(bool withTolerance = true) const 
00040      { 
00041        if (withTolerance && minR_>tolerance_) 
00042          return minR_-tolerance_;
00043        else
00044          return minR_;
00045      }
00046    double maxR(bool withTolerance = true) const 
00047      { 
00048        if (withTolerance) 
00049          return maxR_+tolerance_;
00050        else
00051          return maxR_;
00052      }
00053    double minZ(bool withTolerance = true) const 
00054      { 
00055        if (withTolerance && minZ_>tolerance_)
00056          return minZ_-tolerance_; 
00057        else
00058          return minZ_;
00059      }
00060    double maxZ(bool withTolerance = true) const 
00061      { 
00062        if (withTolerance)
00063          return maxZ_+tolerance_;
00064        else
00065          return maxZ_; 
00066      }
00067  private:
00068    double minR_;
00069    double maxR_;
00070    double minZ_;
00071    double maxZ_;
00072    double tolerance_;
00073 };
00074 #endif