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 *   Jan Kašpar (jan.kaspar@gmail.com)
0006 *
0007 ****************************************************************************/
0008 
0009 #ifndef DataFormats_CTPPSReco_TotemRPUVPattern
0010 #define DataFormats_CTPPSReco_TotemRPUVPattern
0011 
0012 #include "DataFormats/Common/interface/DetSet.h"
0013 #include "DataFormats/Common/interface/DetSetVector.h"
0014 #include "DataFormats/CTPPSReco/interface/TotemRPRecHit.h"
0015 
0016 /**
0017  *\brief A linear pattern in U or V projection.
0018  * The intercept b is taken at the middle of a RP:
0019  *     (geometry->GetRPDevice(RPId)->translation().z())
0020  * The global coordinate system is used (wrt. the beam). This is the same convention
0021  * as for the 1-RP track fits.
0022  **/
0023 class TotemRPUVPattern {
0024 public:
0025   enum ProjectionType { projInvalid, projU, projV };
0026 
0027   TotemRPUVPattern() : projection_(projInvalid), a_(0.), b_(0.), w_(0.), fittable_(false) {}
0028 
0029   ProjectionType projection() const { return projection_; }
0030   void setProjection(ProjectionType type) { projection_ = type; }
0031 
0032   double a() const { return a_; }
0033   void setA(double a) { a_ = a; }
0034 
0035   double b() const { return b_; }
0036   void setB(double b) { b_ = b; }
0037 
0038   double w() const { return w_; }
0039   void setW(double w) { w_ = w; }
0040 
0041   bool fittable() const { return fittable_; }
0042   void setFittable(bool fittable) { fittable_ = fittable; }
0043 
0044   void addHit(edm::det_id_type detId, const TotemRPRecHit &hit) { hits_.find_or_insert(detId).push_back(hit); }
0045 
0046   const edm::DetSetVector<TotemRPRecHit> &hits() const { return hits_; }
0047 
0048   friend bool operator<(const TotemRPUVPattern &l, const TotemRPUVPattern &r);
0049 
0050 private:
0051   ProjectionType projection_;  ///< projection
0052   double a_;                   ///< slope in rad
0053   double b_;                   ///< intercept in mm
0054   double w_;                   ///< weight
0055   bool fittable_;              ///< whether this pattern is worth including in track fits
0056 
0057   edm::DetSetVector<TotemRPRecHit> hits_;  ///< hits associated with the pattern
0058 };
0059 
0060 //----------------------------------------------------------------------------------------------------
0061 
0062 extern bool operator<(const TotemRPUVPattern &l, const TotemRPUVPattern &r);
0063 
0064 #endif