RooNovosibirsk.cxx

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitModels                                                     *
00004  * @(#)root/roofit:$Id: RooNovosibirsk.cxx 24286 2008-06-16 15:47:04Z wouter $
00005  * Authors:                                                                  *
00006  *   DB, Dieter Best,     UC Irvine,         best@slac.stanford.edu          *
00007  *   HT, Hirohisa Tanaka  SLAC               tanaka@slac.stanford.edu        *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 
00017 //////////////////////////////////////////////////////////////////////////////
00018 //
00019 // BEGIN_HTML
00020 // RooNovosibirsk implements the Novosibirsk function 
00021 // END_HTML
00022 //
00023 
00024 
00025 #include "RooFit.h"
00026 
00027 #include <math.h>
00028 #include "TMath.h"
00029 
00030 #include "RooNovosibirsk.h"
00031 #include "RooRealVar.h"
00032 
00033 ClassImp(RooNovosibirsk)
00034 
00035 
00036 
00037 //_____________________________________________________________________________
00038 RooNovosibirsk::RooNovosibirsk(const char *name, const char *title,
00039                              RooAbsReal& _x,     RooAbsReal& _peak,
00040                              RooAbsReal& _width, RooAbsReal& _tail) :
00041   // The two addresses refer to our first dependent variable and
00042   // parameter, respectively, as declared in the rdl file
00043   RooAbsPdf(name, title),
00044   x("x","x",this,_x),
00045   width("width","width",this,_width),
00046   peak("peak","peak",this,_peak),
00047   tail("tail","tail",this,_tail)
00048 {
00049 }
00050 
00051 
00052 //_____________________________________________________________________________
00053 RooNovosibirsk::RooNovosibirsk(const RooNovosibirsk& other, const char *name):
00054   RooAbsPdf(other,name),
00055   x("x",this,other.x),
00056   width("width",this,other.width),
00057   peak("peak",this,other.peak),
00058   tail("tail",this,other.tail)
00059 {
00060 }
00061 
00062 
00063 //_____________________________________________________________________________
00064 Double_t RooNovosibirsk::evaluate() const {
00065   // Put the formula for your PDF's value here. Use the pre-computed
00066   // value of _norm to normalize the result.
00067 
00068   double qa=0,qb=0,qc=0,qx=0,qy=0;
00069 
00070   if(TMath::Abs(tail) < 1.e-7) 
00071     qc = 0.5*TMath::Power(((x-peak)/width),2);
00072   else {
00073     qa = tail*sqrt(log(4.));
00074     qb = sinh(qa)/qa;
00075     qx = (x-peak)/width*qb;
00076     qy = 1.+tail*qx;
00077   
00078     //---- Cutting curve from right side
00079 
00080     if( qy > 1.E-7) 
00081       qc = 0.5*(TMath::Power((log(qy)/tail),2) + tail*tail);
00082     else
00083       qc = 15.0;
00084   }
00085 
00086   //---- Normalize the result
00087 
00088   return exp(-qc);
00089 
00090 }

Generated on Tue Jul 5 14:55:22 2011 for ROOT_528-00b_version by  doxygen 1.5.1