File indexing completed on 2024-04-06 12:31:35
0001 #ifndef TrackAssociator_FiducialVolume_h
0002 #define TrackAssociator_FiducialVolume_h 1
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0023 #include <vector>
0024
0025 class FiducialVolume {
0026 public:
0027 FiducialVolume(double tolerance = 1.0) : tolerance_(tolerance) { reset(); }
0028
0029
0030 void determinInnerDimensions();
0031
0032 bool isValid() const;
0033
0034 void addActivePoint(const GlobalPoint& point);
0035
0036 void reset();
0037 double minR(bool withTolerance = true) const {
0038 if (withTolerance && minR_ > tolerance_)
0039 return minR_ - tolerance_;
0040 else
0041 return minR_;
0042 }
0043 double maxR(bool withTolerance = true) const {
0044 if (withTolerance)
0045 return maxR_ + tolerance_;
0046 else
0047 return maxR_;
0048 }
0049 double minZ(bool withTolerance = true) const {
0050 if (withTolerance && minZ_ > tolerance_)
0051 return minZ_ - tolerance_;
0052 else
0053 return minZ_;
0054 }
0055 double maxZ(bool withTolerance = true) const {
0056 if (withTolerance)
0057 return maxZ_ + tolerance_;
0058 else
0059 return maxZ_;
0060 }
0061
0062 private:
0063 double minR_;
0064 double maxR_;
0065 double minZ_;
0066 double maxZ_;
0067 double tolerance_;
0068 };
0069 #endif