Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitModels                                                     *
0004  *    File: $Id: RooVoigtian.h,v 1.7 2007/07/12 20:30:49 wouter Exp $
0005  * Authors:                                                                  *
0006  *   TS, Thomas Schietinger, SLAC,          schieti@slac.stanford.edu        *
0007  *                                                                           *
0008  * Copyright (c) 2000-2005, Regents of the University of California          *
0009  *                          and Stanford University. All rights reserved.    *
0010  *                                                                           *
0011  * Redistribution and use in source and binary forms,                        *
0012  * with or without modification, are permitted according to the terms        *
0013  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0014  *****************************************************************************/
0015 
0016 #ifndef ROO_VOIGTIAN
0017 #define ROO_VOIGTIAN
0018 
0019 #include <RooAbsPdf.h>
0020 #include <RooRealProxy.h>
0021 
0022 class RooVoigtian : public RooAbsPdf {
0023 public:
0024   RooVoigtian() {}
0025   RooVoigtian(const char *name, const char *title,
0026          RooAbsReal& _x, RooAbsReal& _mean,
0027               RooAbsReal& _width, RooAbsReal& _sigma,
0028               bool doFast = false);
0029   RooVoigtian(const RooVoigtian& other, const char* name=nullptr) ;
0030   TObject* clone(const char* newname) const override { return new RooVoigtian(*this,newname); }
0031 
0032   /// Enable the fast evaluation of the complex error function using look-up
0033   /// tables (default is the "slow" CERNlib algorithm).
0034   inline void selectFastAlgorithm()    { _doFast = true;  }
0035 
0036   /// Disable the fast evaluation of the complex error function using look-up
0037   /// tables (default is the "slow" CERNlib algorithm).
0038   inline void selectDefaultAlgorithm() { _doFast = false; }
0039 
0040 protected:
0041 
0042   RooRealProxy x ;
0043   RooRealProxy mean ;
0044   RooRealProxy width ;
0045   RooRealProxy sigma ;
0046 
0047   double evaluate() const override ;
0048   void doEval(RooFit::EvalContext &) const override;
0049   inline bool canComputeBatchWithCuda() const override { return true; }
0050 
0051 private:
0052 
0053   bool _doFast = false;
0054   ClassDefOverride(RooVoigtian,2) // Voigtian PDF (Gauss (x) BreitWigner)
0055 };
0056 
0057 #endif
0058