Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:12

0001 /****************************************************************************
0002  *
0003  * This is a part of CTPPS offline software.
0004  * Authors:
0005  *   Laurent Forthomme (laurent.forthomme@cern.ch)
0006  *   Nicola Minafra (nicola.minafra@cern.ch)
0007  *   Mateusz Szpyrka (mateusz.szpyrka@cern.ch)
0008  *
0009  ****************************************************************************/
0010 
0011 #ifndef DataFormats_CTPPSReco_CTPPSTimingLocalTrack
0012 #define DataFormats_CTPPSReco_CTPPSTimingLocalTrack
0013 
0014 #include "DataFormats/Math/interface/Point3D.h"
0015 #include "DataFormats/CTPPSReco/interface/CTPPSTimingRecHit.h"
0016 
0017 //----------------------------------------------------------------------------------------------------
0018 
0019 class CTPPSTimingLocalTrack {
0020 public:
0021   CTPPSTimingLocalTrack();
0022   CTPPSTimingLocalTrack(const math::XYZPoint& pos0, const math::XYZPoint& pos0_sigma, float t, float t_sigma);
0023 
0024   enum class CheckDimension { x, y, all };
0025   bool containsHit(const CTPPSTimingRecHit& recHit,
0026                    float tolerance = 0.1f,
0027                    CheckDimension check = CheckDimension::all) const;
0028 
0029   //--- spatial get'ters
0030 
0031   inline float x0() const { return pos0_.x(); }
0032   inline float x0Sigma() const { return pos0_sigma_.x(); }
0033 
0034   inline float y0() const { return pos0_.y(); }
0035   inline float y0Sigma() const { return pos0_sigma_.y(); }
0036 
0037   inline float z0() const { return pos0_.z(); }
0038   inline float z0Sigma() const { return pos0_sigma_.z(); }
0039 
0040   inline int numberOfHits() const { return num_hits_; }
0041   inline int numberOfPlanes() const { return num_planes_; }
0042 
0043   //--- spatial set'ters
0044 
0045   inline void setPosition(const math::XYZPoint& pos0) { pos0_ = pos0; }
0046   inline void setPositionSigma(const math::XYZPoint& pos0_sigma) { pos0_sigma_ = pos0_sigma; }
0047 
0048   inline void setNumOfHits(int num_hits) { num_hits_ = num_hits; }
0049   inline void setNumOfPlanes(int num_planes) { num_planes_ = num_planes; }
0050 
0051   //--- validity related members
0052 
0053   inline bool isValid() const { return valid_; }
0054   inline void setValid(bool valid) { valid_ = valid; }
0055 
0056   //--- temporal get'ters
0057 
0058   inline float time() const { return t_; }
0059   inline float timeSigma() const { return t_sigma_; }
0060 
0061   //--- temporal set'ters
0062 
0063   inline void setTime(float t) { t_ = t; }
0064   inline void setTimeSigma(float t_sigma) { t_sigma_ = t_sigma; }
0065 
0066 private:
0067   //--- spatial information
0068 
0069   /// initial track position
0070   math::XYZPoint pos0_;
0071   /// error on the initial track position
0072   math::XYZPoint pos0_sigma_;
0073 
0074   /// number of hits participating in the track
0075   int num_hits_;
0076 
0077   /// number of planes participating in the track
0078   int num_planes_;
0079 
0080   /// fit valid?
0081   bool valid_;
0082 
0083   //--- timing information
0084   float t_;
0085   float t_sigma_;
0086 };
0087 
0088 /// Comparison operator
0089 bool operator<(const CTPPSTimingLocalTrack& lhs, const CTPPSTimingLocalTrack& rhs);
0090 
0091 #endif