Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:01

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  *
0008  ****************************************************************************/
0009 
0010 #ifndef DataFormats_CTPPSReco_CTPPSDiamondRecHit
0011 #define DataFormats_CTPPSReco_CTPPSDiamondRecHit
0012 
0013 #include "DataFormats/CTPPSDigi/interface/HPTDCErrorFlags.h"
0014 #include "DataFormats/CTPPSReco/interface/CTPPSTimingRecHit.h"
0015 
0016 /// Reconstructed hit in diamond detectors.
0017 class CTPPSDiamondRecHit : public CTPPSTimingRecHit {
0018 public:
0019   CTPPSDiamondRecHit() : CTPPSTimingRecHit(), tot_(0), tPrecision_(0), tsIndex_(0), hptdcErr_(0), mh_(false) {}
0020   CTPPSDiamondRecHit(float x,
0021                      float xWidth,
0022                      float y,
0023                      float yWidth,
0024                      float z,
0025                      float zWidth,
0026                      float t,
0027                      float tot,
0028                      float tPrecision,
0029                      int ootIdx,
0030                      const HPTDCErrorFlags &hptdcErr,
0031                      const bool mh)
0032       : CTPPSTimingRecHit(x, xWidth, y, yWidth, z, zWidth, t),
0033         tot_(tot),
0034         tPrecision_(tPrecision),
0035         tsIndex_(ootIdx),
0036         hptdcErr_(hptdcErr),
0037         mh_(mh) {}
0038 
0039   static constexpr int TIMESLICE_WITHOUT_LEADING = -10;
0040 
0041   inline void setToT(float tot) { tot_ = tot; }
0042   inline float toT() const { return tot_; }
0043 
0044   inline void setTPrecision(float tPrecision) { tPrecision_ = tPrecision; }
0045   inline float tPrecision() const { return tPrecision_; }
0046 
0047   inline void setOOTIndex(int i) { tsIndex_ = i; }
0048   inline int ootIndex() const { return tsIndex_; }
0049 
0050   inline void setMultipleHits(bool mh) { mh_ = mh; }
0051   inline bool multipleHits() const { return mh_; }
0052 
0053   inline void setHPTDCErrorFlags(const HPTDCErrorFlags &err) { hptdcErr_ = err; }
0054   inline HPTDCErrorFlags hptdcErrorFlags() const { return hptdcErr_; }
0055 
0056 private:
0057   /// Time over threshold
0058   float tot_;
0059   /// Expected timing precision
0060   float tPrecision_;
0061   /// Time slice index
0062   int tsIndex_;
0063   /// List of error flags encountered by the HPTDC
0064   HPTDCErrorFlags hptdcErr_;
0065   /// Multiple hits detected
0066   bool mh_;
0067 };
0068 
0069 #endif