Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooKeysPdf.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitModels                                                     *
0004  *    File: $Id: RooKeysPdf.h,v 1.10 2007/05/11 09:13:07 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   GR, Gerhard Raven,   UC San Diego,        raven@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_KEYS
0017 #define ROO_KEYS
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 
0022 class RooRealVar;
0023 
0024 class RooKeysPdf : public RooAbsPdf {
0025 public:
0026   enum Mirror { NoMirror, MirrorLeft, MirrorRight, MirrorBoth,
0027       MirrorAsymLeft, MirrorAsymLeftRight,
0028       MirrorAsymRight, MirrorLeftAsymRight,
0029       MirrorAsymBoth };
0030   RooKeysPdf() ;
0031   RooKeysPdf(const char *name, const char *title,
0032              RooAbsReal& x, RooDataSet& data, Mirror mirror= NoMirror,
0033         double rho=1);
0034   RooKeysPdf(const char *name, const char *title,
0035              RooAbsReal& x, RooRealVar& xdata, RooDataSet& data, Mirror mirror= NoMirror,
0036         double rho=1);
0037   RooKeysPdf(const RooKeysPdf& other, const char* name=nullptr);
0038   TObject* clone(const char* newname) const override {return new RooKeysPdf(*this,newname); }
0039   ~RooKeysPdf() override;
0040 
0041   Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars,
0042      const char* rangeName = nullptr) const override;
0043   double analyticalIntegral(Int_t code, const char* rangeName = nullptr) const override;
0044   Int_t getMaxVal(const RooArgSet& vars) const override;
0045   double maxVal(Int_t code) const override;
0046 
0047   void LoadDataSet( RooDataSet& data);
0048 
0049 protected:
0050 
0051   RooRealProxy _x ;
0052   double evaluate() const override;
0053 
0054 private:
0055   // how far you have to go out in a Gaussian until it is smaller than the
0056   // machine precision
0057   static const double _nSigma; //!
0058 
0059   Int_t _nEvents = 0;
0060   double *_dataPts = nullptr;  //[_nEvents]
0061   double *_dataWgts = nullptr; //[_nEvents]
0062   double *_weights = nullptr;  //[_nEvents]
0063   double _sumWgt = 0.0;
0064 
0065   constexpr static int _nPoints{1000};
0066   double _lookupTable[_nPoints+1];
0067 
0068   double g(double x,double sigma) const;
0069 
0070   bool _mirrorLeft = false;
0071   bool _mirrorRight = false;
0072   bool _asymLeft = false;
0073   bool _asymRight = false;
0074 
0075   // cached info on variable
0076   Char_t _varName[128];
0077   double _lo, _hi, _binWidth;
0078   double _rho;
0079 
0080   ClassDefOverride(RooKeysPdf,2) // One-dimensional non-parametric kernel estimation p.d.f.
0081 };
0082 
0083 #endif