Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /****************************************************************************
0002 *
0003 * This is a part of TOTEM offline software.
0004 * Authors:
0005 *   Hubert Niewiadomski
0006 *   Jan Kašpar (jan.kaspar@gmail.com)
0007 *
0008 ****************************************************************************/
0009 
0010 #ifndef DataFormats_CTPPSReco_TotemRPRecHit
0011 #define DataFormats_CTPPSReco_TotemRPRecHit
0012 
0013 /**
0014  *\brief Reconstructed hit in TOTEM RP.
0015  *
0016  * Basically a cluster (TotemRPCluster), the position of which has been converted into actual geometry (in mm).
0017  **/
0018 class TotemRPRecHit {
0019 public:
0020   TotemRPRecHit(double position = 0, double sigma = 0) : position_(position), sigma_(sigma) {}
0021 
0022   inline double position() const { return position_; }
0023   inline void setPosition(double position) { position_ = position; }
0024 
0025   inline double sigma() const { return sigma_; }
0026   inline void setSigma(double sigma) { sigma_ = sigma; }
0027 
0028 private:
0029   /// position of the hit in mm, wrt detector center (see RPTopology::GetHitPositionInReadoutDirection)
0030   double position_;
0031 
0032   /// position uncertainty, in mm
0033   double sigma_;
0034 };
0035 
0036 //----------------------------------------------------------------------------------------------------
0037 
0038 inline bool operator<(const TotemRPRecHit &l, const TotemRPRecHit &r) {
0039   if (l.position() < r.position())
0040     return true;
0041   if (l.position() > r.position())
0042     return false;
0043 
0044   if (l.sigma() < r.sigma())
0045     return true;
0046 
0047   return false;
0048 }
0049 
0050 #endif