ROOT   6.08/07 Reference Guide
Roo2DMomentMorphFunction.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * author: Max Baak (mbaak@cern.ch) *
4  *****************************************************************************/
5
6 // Written by Max Baak (mbaak@cern.ch)
7 // 2-dimensional morph function between a list of input functions (varlist) as a function of one input parameter (m).
8 // The vector mrefpoints assigns an m-number to each function in the function list.
9 // For example: varlist can contain MC histograms (or single numbers) of a reconstructed mass, for certain
10 // true Higgs masses indicated in mrefpoints. the input parameter m is the true (continous) Higgs mass.
11 // Morphing can be set to be linear or non-linear, or mixture of the two.
12
13 #ifndef ROO2DMOMENTMORPHFUNCTION
14 #define ROO2DMOMENTMORPHFUNCTION
15
16 #include "RooAbsReal.h"
17 #include "RooRealProxy.h"
18 #include "RooCategoryProxy.h"
19 #include "RooAbsReal.h"
20 #include "RooAbsCategory.h"
21
22 #include "TMatrix.h"
23 #include "TVectorD.h"
24
25 #include <vector>
26 #include <string>
27
29
30  public:
31
33
35
36  Roo2DMomentMorphFunction( const char *name, const char *title,
37  RooAbsReal& _m1, RooAbsReal& _m2,
38  const TMatrixD& mrefpoints, const Setting& setting = Linear, const Bool_t& verbose=false ) ;
39
40  Roo2DMomentMorphFunction( const char *name, const char *title,
41  RooAbsReal& _m1, RooAbsReal& _m2,
42  const Int_t& nrows, const Double_t* dm1arr, const Double_t* dm2arr, const Double_t* dvalarr,
43  const Setting& setting = Linear, const Bool_t& verbose=false ) ;
44
45  Roo2DMomentMorphFunction( const Roo2DMomentMorphFunction& other, const char* name=0 );
46
47  virtual TObject* clone( const char* newname ) const { return new Roo2DMomentMorphFunction(*this,newname); }
48  virtual ~Roo2DMomentMorphFunction() ;
49
50  void setMode( const Setting& setting ) { _setting=setting; }
51
52  void Summary() const;
53
54  protected:
55
56  Double_t evaluate() const ;
57
58  void initialize();
60
63
68
69  mutable TMatrixD _mref;
70  mutable TMatrixD _MSqr;
71  mutable TVectorD _frac;
72
74  mutable int _squareIdx[4];
75
76  private:
77
78  Bool_t findSquare(const double& x, const double& y) const;
79  Bool_t onSameSide(const double& p1x, const double& p1y, const double& p2x, const double& p2y, const double& ax, const double& ay, const double& bx, const double& by) const ;
80  Bool_t pointInSquare(const double& px, const double& py, const double& ax, const double& ay, const double& bx, const double& by, const double& cx, const double& cy, const double& dx, const double& dy) const;
81  Bool_t pointInTriangle(const double& px, const double& py, const double& ax, const double& ay, const double& bx, const double& by, const double& cx, const double& cy) const ;
82  Double_t myCrossProduct(const double& ax, const double& ay, const double& bx, const double& by) const ;
83  Bool_t isAcceptableSquare(const double& ax, const double& ay, const double& bx, const double& by, const double& cx, const double& cy, const double& dx, const double& dy) const;
84
85  struct SorterL2H {
86  bool operator() (const std::pair<int,double>& p1, const std::pair<int,double>& p2) {
87  return (p1.second<p2.second);
88  }
89  };
90
91  private:
93
94 };
95
96 #endif
97
virtual ~Roo2DMomentMorphFunction()
Destructor.
Bool_t pointInTriangle(const double &px, const double &py, const double &ax, const double &ay, const double &bx, const double &by, const double &cx, const double &cy) const
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void setMode(const Setting &setting)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
static double p2(double t, double a, double b, double c)
Double_t myCrossProduct(const double &ax, const double &ay, const double &bx, const double &by) const
2-dimensional morph function between a list of function-numbers as a function of two input parameters...
Bool_t findSquare(const double &x, const double &y) const
Bool_t isAcceptableSquare(const double &ax, const double &ay, const double &bx, const double &by, const double &cx, const double &cy, const double &dx, const double &dy) const
Reject kinked shapes.
bool verbose
virtual TObject * clone(const char *newname) const
static double p1(double t, double a, double b)
bool operator()(const std::pair< int, double > &p1, const std::pair< int, double > &p2)
void calculateFractions(Bool_t verbose=kTRUE) const
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
Bool_t onSameSide(const double &p1x, const double &p1y, const double &p2x, const double &p2y, const double &ax, const double &ay, const double &bx, const double &by) const
Returns true if p1 and p2 are on same side of line b-a.
Double_t y[n]
Definition: legend1.C:17
Mother of all ROOT objects.
Definition: TObject.h:37
RooRealProxy is the concrete proxy for RooAbsReal objects A RooRealProxy is the general mechanism to ...
Definition: RooRealProxy.h:23
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t pointInSquare(const double &px, const double &py, const double &ax, const double &ay, const double &bx, const double &by, const double &cx, const double &cy, const double &dx, const double &dy) const
char name[80]
Definition: TGX11.cxx:109