Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 09:09:04

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitModels                                                     *
0004  *    File: $Id: RooCBShape.h,v 1.11 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_CB_SHAPE
0017 #define ROO_CB_SHAPE
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooRealProxy.h"
0021 
0022 class RooRealVar;
0023 
0024 class RooCBShape : public RooAbsPdf {
0025 public:
0026   RooCBShape() {}
0027   RooCBShape(const char *name, const char *title, RooAbsReal& _m,
0028         RooAbsReal& _m0, RooAbsReal& _sigma,
0029         RooAbsReal& _alpha, RooAbsReal& _n);
0030 
0031   RooCBShape(const RooCBShape& other, const char *name = nullptr);
0032   TObject* clone(const char* newname=nullptr) const override { return new RooCBShape(*this,newname); }
0033 
0034   Int_t getAnalyticalIntegral( RooArgSet& allVars,  RooArgSet& analVars, const char* rangeName=nullptr ) const override;
0035   double analyticalIntegral(Int_t, const char *rangeName = nullptr) const override;
0036 
0037   // Optimized accept/reject generator support
0038   Int_t getMaxVal(const RooArgSet& vars) const override ;
0039   double maxVal(Int_t code) const override ;
0040 
0041   RooAbsReal const& getM() const { return m.arg(); }
0042   RooAbsReal const& getM0() const { return m0.arg(); }
0043   RooAbsReal const& getSigma() const { return sigma.arg(); }
0044   RooAbsReal const& getAlpha() const { return alpha.arg(); }
0045   RooAbsReal const& getN() const { return n.arg(); }
0046 
0047 protected:
0048 
0049   double ApproxErf(double arg) const ;
0050 
0051   RooRealProxy m;
0052   RooRealProxy m0;
0053   RooRealProxy sigma;
0054   RooRealProxy alpha;
0055   RooRealProxy n;
0056 
0057   double evaluate() const override;
0058   void doEval(RooFit::EvalContext &) const override;
0059   inline bool canComputeBatchWithCuda() const override { return true; }
0060 
0061 
0062 private:
0063 
0064   ClassDefOverride(RooCBShape,1) // Crystal Ball lineshape PDF
0065 };
0066 
0067 #endif