Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:20

0001 #ifndef Alignment_TwoBodyDecay_TwoBodyDecay_h
0002 #define Alignment_TwoBodyDecay_TwoBodyDecay_h
0003 
0004 #include "Alignment/TwoBodyDecay/interface/TwoBodyDecayParameters.h"
0005 #include "Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h"
0006 
0007 /** /class TwoBodyDecay
0008  *
0009  *  Container-class for all information associated with a two-body decay
0010  * (estimated parameters, chi2 of the fit, validity-flag).
0011  *
0012  *  /author Edmund Widl
0013  */
0014 
0015 class TwoBodyDecay {
0016 public:
0017   typedef TwoBodyDecayParameters::ParameterName ParameterName;
0018 
0019   TwoBodyDecay(void)
0020       : theDecayParameters(), theChi2(0.), theValidityFlag(false), thePrimaryMass(0.), thePrimaryWidth(0.) {}
0021 
0022   TwoBodyDecay(const TwoBodyDecayParameters &param, double chi2, bool valid, const TwoBodyDecayVirtualMeasurement &vm)
0023       : theDecayParameters(param),
0024         theChi2(chi2),
0025         theValidityFlag(valid),
0026         thePrimaryMass(vm.primaryMass()),
0027         thePrimaryWidth(vm.primaryWidth()) {}
0028 
0029   ~TwoBodyDecay(void) {}
0030 
0031   inline const TwoBodyDecayParameters &decayParameters(void) const { return theDecayParameters; }
0032 
0033   inline const AlgebraicVector &parameters(void) const { return theDecayParameters.parameters(); }
0034   inline const AlgebraicSymMatrix &covariance(void) const { return theDecayParameters.covariance(); }
0035 
0036   /// Get specified decay parameter.
0037   inline double operator[](ParameterName name) const { return theDecayParameters[name]; }
0038 
0039   /// Get specified decay parameter.
0040   inline double operator()(ParameterName name) const { return theDecayParameters(name); }
0041 
0042   inline bool hasError(void) const { return theDecayParameters.hasError(); }
0043 
0044   inline double chi2(void) const { return theChi2; }
0045 
0046   inline bool isValid(void) const { return theValidityFlag; }
0047   inline void setInvalid(void) { theValidityFlag = false; }
0048 
0049   inline double primaryMass(void) const { return thePrimaryMass; }
0050   inline double primaryWidth(void) const { return thePrimaryWidth; }
0051 
0052 private:
0053   TwoBodyDecayParameters theDecayParameters;
0054   double theChi2;
0055   bool theValidityFlag;
0056   double thePrimaryMass;
0057   double thePrimaryWidth;
0058 };
0059 
0060 #endif