Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:56:40

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitModels                                                     *
0004  *    File: $Id: RooExponential.h,v 1.10 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_EXPONENTIAL
0017 #define ROO_EXPONENTIAL
0018 
0019 #include <RooAbsPdf.h>
0020 #include <RooRealProxy.h>
0021 
0022 class RooExponential : public RooAbsPdf {
0023 public:
0024    RooExponential() {}
0025    RooExponential(const char *name, const char *title, RooAbsReal &variable, RooAbsReal &coefficient,
0026                   bool negateCoefficient = false);
0027    RooExponential(const RooExponential &other, const char *name = nullptr);
0028    TObject *clone(const char *newname) const override { return new RooExponential(*this, newname); }
0029 
0030    Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName = nullptr) const override;
0031    double analyticalIntegral(Int_t code, const char *rangeName = nullptr) const override;
0032 
0033    /// Get the x variable.
0034    RooAbsReal const &variable() const { return x.arg(); }
0035 
0036    /// Get the coefficient "c".
0037    RooAbsReal const &coefficient() const { return c.arg(); }
0038 
0039    bool negateCoefficient() const { return _negateCoefficient; }
0040 
0041    void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0042    std::string buildCallToAnalyticIntegral(Int_t code, const char *rangeName,
0043                                            RooFit::Detail::CodeSquashContext &ctx) const override;
0044 
0045 protected:
0046    RooRealProxy x;
0047    RooRealProxy c;
0048    bool _negateCoefficient = false;
0049 
0050    double evaluate() const override;
0051    void computeBatch(double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override;
0052    inline bool canComputeBatchWithCuda() const override { return true; }
0053 
0054 private:
0055    ClassDefOverride(RooExponential, 2) // Exponential PDF
0056 };
0057 
0058 #endif