00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 #include "RooRarFit/rarVersion.hh"
00014 
00015 #include "Riostream.h"
00016 
00017 #include "RooRarFit/RooCruijff.hh"
00018 #include "RooFitCore/RooRealVar.hh"
00019 #include "RooFitCore/RooRealConstant.hh"
00020 
00021 ClassImp(RooCruijff)
00022 
00023 RooCruijff::RooCruijff(const char *name, const char *title,
00024                        RooAbsReal& _x, RooAbsReal& _m0, 
00025                        RooAbsReal& _sigmaL, RooAbsReal& _sigmaR,
00026                        RooAbsReal& _alphaL, RooAbsReal& _alphaR)
00027   :
00028   RooAbsPdf(name, title),
00029   x("x", "x", this, _x),
00030   m0("m0", "m0", this, _m0),
00031   sigmaL("sigmaL", "sigmaL", this, _sigmaL),
00032   sigmaR("sigmaR", "sigmaR", this, _sigmaR),
00033   alphaL("alphaL", "alphaL", this, _alphaL),
00034   alphaR("alphaR", "alphaR", this, _alphaR)
00035 {
00036 }
00037 
00038 RooCruijff::RooCruijff(const RooCruijff& other, const char* name) :
00039   RooAbsPdf(other, name), 
00040   x("x", this, other.x), 
00041   m0("m0", this, other.m0),
00042   sigmaL("sigmaL", this, other.sigmaL), 
00043   sigmaR("sigmaR", this, other.sigmaR), 
00044   alphaL("alphaL", this, other.alphaL), 
00045   alphaR("alphaR", this, other.alphaR)
00046 {
00047 }
00048 
00049 Double_t RooCruijff::evaluate() const 
00050 {
00051   
00052   double sigma = 0.0;
00053   double alpha = 0.0;
00054   double dx = (x - m0);
00055   if(dx<0){
00056     sigma = sigmaL;
00057     alpha = alphaL;
00058   } else {
00059     sigma = sigmaR;
00060     alpha = alphaR;
00061   }
00062   double f = 2*sigma*sigma + alpha*dx*dx ;
00063   return exp(-dx*dx/f) ;
00064 }