00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_2DKEYS
00017 #define ROO_2DKEYS
00018
00019 #include "RooAbsPdf.h"
00020 #include "RooRealProxy.h"
00021 #include "RooAbsReal.h"
00022 #include "RooDataSet.h"
00023
00024
00025 class Roo2DKeysPdf : public RooAbsPdf
00026 {
00027 public:
00028 Roo2DKeysPdf(const char *name, const char *title,
00029 RooAbsReal& xx, RooAbsReal &yy, RooDataSet& data, TString options = "a", Double_t widthScaleFactor = 1.0);
00030 Roo2DKeysPdf(const Roo2DKeysPdf& other, const char* name=0);
00031 virtual TObject* clone(const char* newname) const { return new Roo2DKeysPdf(*this,newname); }
00032
00033 virtual ~Roo2DKeysPdf();
00034
00035
00036
00037 Int_t loadDataSet(RooDataSet& data, TString options);
00038
00039
00040
00041
00042
00043
00044
00045
00046 void setOptions(TString options);
00047 void getOptions(void) const;
00048
00049
00050
00051
00052
00053
00054
00055
00056 inline void setWidthScaleFactor(Double_t widthScaleFactor);
00057
00058
00059
00060
00061 Int_t calculateBandWidth(Int_t kernel = -999);
00062
00063 Int_t getBandWidthType() const;
00064 Double_t getMean(const char * axis) const;
00065 Double_t getSigma(const char * axis) const;
00066
00067
00068 void PrintInfo(ostream &) const;
00069
00070
00071
00072
00073
00074 void writeToFile(char * outputFile, const char * name) const;
00075 void writeHistToFile(char * outputFile, const char * histName) const;
00076 void writeNTupleToFile(char * outputFile, const char * name) const;
00077
00078 RooRealProxy x;
00079 RooRealProxy y;
00080
00081 Double_t evaluate() const;
00082
00083 protected:
00084
00085 private:
00086
00087 Double_t evaluateFull(Double_t thisX, Double_t thisY) const;
00088 Double_t g(Double_t var1, Double_t * _var1, Double_t sigma1, Double_t var2,
00089 Double_t * _var2, Double_t sigma2) const;
00090
00091
00092 Double_t highBoundaryCorrection(Double_t thisVar, Double_t thisH, Double_t high, Double_t tVar) const;
00093 Double_t lowBoundaryCorrection(Double_t thisVar, Double_t thisH, Double_t low, Double_t tVar) const;
00094
00095 Double_t * _x;
00096 Double_t * _hx;
00097 Double_t * _y;
00098 Double_t * _hy;
00099 Double_t _norm;
00100 Double_t _xMean;
00101 Double_t _xSigma;
00102 Double_t _yMean;
00103 Double_t _ySigma;
00104 Double_t _n;
00105 Double_t _n16;
00106 Double_t _sqrt2pi;
00107 Double_t _2pi;
00108 Double_t _lox,_hix;
00109 Double_t _loy,_hiy;
00110 Double_t _xoffset;
00111 Double_t _yoffset;
00112 Double_t _widthScaleFactor;
00113
00114 Int_t _nEvents;
00115 Int_t _BandWidthType;
00116 Int_t _MirrorAtBoundary;
00117 Int_t _debug;
00118 Int_t _verbosedebug;
00119 Int_t _vverbosedebug;
00120
00121 ClassDef(Roo2DKeysPdf,0)
00122 };
00123
00124 inline void Roo2DKeysPdf::setWidthScaleFactor(Double_t widthScaleFactor) { _widthScaleFactor = widthScaleFactor; }
00125
00126 #endif
00127
00128
00129