Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:29

0001 #ifndef Alignment_TwoBodyDecay_TwoBodyDecayParameters_h
0002 #define Alignment_TwoBodyDecay_TwoBodyDecayParameters_h
0003 
0004 /** /class TwoBodyDecayParameters
0005  *
0006  *  This class provides the definition and a container for the parameters
0007  *  describing a two-body decay.
0008  *
0009  *  /author Edmund Widl
0010  */
0011 
0012 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0013 
0014 class TwoBodyDecayParameters {
0015 public:
0016   /// Define order of parameters
0017   enum ParameterName { x = 0, y = 1, z = 2, px = 3, py = 4, pz = 5, theta = 6, phi = 7, mass = 8 };
0018 
0019   enum { dimension = 9 };
0020 
0021   TwoBodyDecayParameters(void) : theParameters(AlgebraicVector()), theCovariance(AlgebraicSymMatrix()) {}
0022 
0023   TwoBodyDecayParameters(const AlgebraicVector &param, const AlgebraicSymMatrix &cov)
0024       : theParameters(param), theCovariance(cov) {}
0025 
0026   TwoBodyDecayParameters(const AlgebraicVector &param) : theParameters(param), theCovariance(AlgebraicSymMatrix()) {}
0027 
0028   TwoBodyDecayParameters(const TwoBodyDecayParameters &other)
0029       : theParameters(other.parameters()), theCovariance(other.covariance()) {}
0030 
0031   ~TwoBodyDecayParameters(void) {}
0032 
0033   /// Get decay parameters.
0034   inline const AlgebraicVector &parameters(void) const { return theParameters; }
0035 
0036   /// Get error matrix.
0037   inline const AlgebraicSymMatrix &covariance(void) const { return theCovariance; }
0038 
0039   /// Get specified decay parameter.
0040   inline double operator[](ParameterName name) const { return theParameters[name]; }
0041 
0042   /// Get specified decay parameter.
0043   inline double operator()(ParameterName name) const { return theParameters[name]; }
0044 
0045   /// Get specified range of decay parameters.
0046   inline const AlgebraicVector sub(ParameterName first, ParameterName last) const {
0047     return theParameters.sub(first + 1, last + 1);
0048   }
0049 
0050   inline bool hasError(void) const { return (theCovariance.num_row() != 0); }
0051 
0052 private:
0053   AlgebraicVector theParameters;
0054   AlgebraicSymMatrix theCovariance;
0055 };
0056 
0057 #endif