Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:35

0001 #ifndef TrackAssociator_FiducialVolume_h
0002 #define TrackAssociator_FiducialVolume_h 1
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    TrackAssociator
0007 // Class:      FiducialVolume
0008 //
0009 /*
0010 
0011  Description: detector active volume described by a closed cylinder with non-zero thickness.
0012 
0013 */
0014 //
0015 // Original Author:  Dmytro Kovalskyi
0016 //
0017 /// The detector active volume is determined estimated as a non-zero thickness
0018 /// cylinder with outter dimensions maxZ and maxR. The inner dimensions are
0019 /// found as minimum R and Z for two cases "barrel" (|eta|<1) and
0020 /// "endcap" (|eta|>1.7) correspondingly
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   /// finilize dimension calculations, fixes dimensions in a
0029   /// case of missing barrel or endcap
0030   void determinInnerDimensions();
0031   /// check whether the volume is properly defined
0032   bool isValid() const;
0033   /// add a point that belongs to the active volume
0034   void addActivePoint(const GlobalPoint& point);
0035   /// invalidate the volume
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