Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:22

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitModels                                                     *
0004  *    File: $Id: RooGaussian.h,v 1.16 2007/07/12 20:30:49 wouter Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.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_GAUSSIAN
0017 #define ROO_GAUSSIAN
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 
0022 class RooAbsReal;
0023 
0024 class RooGaussian : public RooAbsPdf {
0025 public:
0026   RooGaussian() { };
0027   // Original constructor without RooAbsReal::Ref for backwards compatibility.
0028   inline RooGaussian(const char *name, const char *title,
0029          RooAbsReal& _x, RooAbsReal& _mean, RooAbsReal& _sigma)
0030       : RooGaussian{name, title, RooAbsReal::Ref{_x}, RooAbsReal::Ref{_mean}, RooAbsReal::Ref{_sigma}} {}
0031   RooGaussian(const char *name, const char *title,
0032          RooAbsReal::Ref _x, RooAbsReal::Ref _mean, RooAbsReal::Ref _sigma);
0033   RooGaussian(const RooGaussian& other, const char* name=nullptr);
0034   TObject* clone(const char* newname) const override {
0035     return new RooGaussian(*this,newname);
0036   }
0037 
0038   Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const override;
0039   double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const override;
0040 
0041   Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override;
0042   void generateEvent(Int_t code) override;
0043 
0044   /// Get the x variable.
0045   RooAbsReal const& getX() const { return x.arg(); }
0046 
0047   /// Get the mean parameter.
0048   RooAbsReal const& getMean() const { return mean.arg(); }
0049 
0050   /// Get the sigma parameter.
0051   RooAbsReal const& getSigma() const { return sigma.arg(); }
0052 
0053   void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0054   std::string
0055   buildCallToAnalyticIntegral(Int_t code, const char *rangeName, RooFit::Detail::CodeSquashContext &ctx) const override;
0056 
0057 protected:
0058 
0059   RooRealProxy x ;
0060   RooRealProxy mean ;
0061   RooRealProxy sigma ;
0062 
0063   double evaluate() const override;
0064   void doEval(RooFit::EvalContext &) const override;
0065   inline bool canComputeBatchWithCuda() const override { return true; }
0066 
0067 private:
0068 
0069   ClassDefOverride(RooGaussian,1) // Gaussian PDF
0070 };
0071 
0072 #endif