//////////////////////////////////////////////////////////////////////// /// \class RAT::PCABits /// /// \brief This class initializes the PCA status words /// /// \author Freija Descamps /// /// REVISION HISTORY:\n /// 15 Feb 2013 : F. Descamps V1 - first version \n /// 14 Oct 2014 : F. Descamps - Small cppcheck fix /// 10 Nov 2016 : F. Descamps - Add BeginOfRun for DB access /// /// \details This class defines the bits in the various status words /// used in the PCAProc processor. It also contains the packer /// function which is used to pack the PCAProc results in /// unsigned integers. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_PCABits__ #define __RAT_PCABits__ #include #include #include namespace RAT { class PCABits { public: typedef enum { PACK=1, UNPACK=2 } Direction; typedef enum { QTINTERPOLATION=1, GRADIENT_INTERCEPT=2 } DataType; PCABits(); virtual ~PCABits(); /// Initialise the PCA status words void BeginOfRun( DS::Run& ); void InitialiseStatusWords(); /// Pack or unpack the TW interpolation points and the fitresults // for the high-Q tail // direction: 1=pack; 2=unpack // datattype: 1=(Q,T) interpolation point, // 2=(gradient,intercept) fit to high Q tail int PCAPacker(Direction direction, ///< pack or unpack DataType datatype, ///< point or fit int & packeddata, ///< the packed data double & point1, ///< the first point to pack double & point2 ///< the second point to pack ); std::vector fOverallMask; ///< Def of bits in overall status std::vector fPMTTWMask; ///< Def of bits in PMT TW status std::vector fPMTGFMask; ///< Def of bits in PMT GF status protected: int fQbits; int fTbits; int fIbits; int fRbits; int fQfact; int fTfact; int fIfact; int fRfact; }; } // namespace RAT #endif