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: RooGaussModel.h,v 1.21 2007/05/11 09:13:07 verkerke 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_GAUSS_MODEL
0017 #define ROO_GAUSS_MODEL
0018 
0019 #include "RooResolutionModel.h"
0020 #include "RooRealProxy.h"
0021 
0022 #include <cmath>
0023 #include <complex>
0024 
0025 class RooGaussModel : public RooResolutionModel {
0026 public:
0027   // Constructors, assignment etc
0028   RooGaussModel() = default;
0029   RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
0030       RooAbsReal& mean, RooAbsReal& sigma) ;
0031   RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
0032       RooAbsReal& mean, RooAbsReal& sigma, RooAbsReal& msSF) ;
0033   RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
0034       RooAbsReal& mean, RooAbsReal& sigma, RooAbsReal& meanSF, RooAbsReal& sigmaSF) ;
0035   RooGaussModel(const RooGaussModel& other, const char* name=nullptr);
0036   TObject* clone(const char* newname) const override { return new RooGaussModel(*this,newname) ; }
0037 
0038   Int_t basisCode(const char* name) const override ;
0039   Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const override ;
0040   double analyticalIntegral(Int_t code, const char* rangeName) const override ;
0041 
0042   Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override;
0043   void generateEvent(Int_t code) override;
0044 
0045   void advertiseFlatScaleFactorIntegral(bool flag) { _flatSFInt = flag ; }
0046 
0047   void advertiseAymptoticIntegral(bool flag) { _asympInt = flag ; }  // added FMV,07/24/03
0048 
0049   void doEval(RooFit::EvalContext &) const override;
0050 
0051   bool canComputeBatchWithCuda() const override;
0052 
0053 protected:
0054 
0055   double evaluate() const override ;
0056   static double evaluate(double x, double mean, double sigma, double param1, double param2, int basisCode);
0057 
0058   // Calculate common normalization factors
0059   std::complex<double> evalCerfInt(double sign, double wt, double tau, double umin, double umax, double c) const;
0060 
0061 private:
0062   bool _flatSFInt = false;
0063 
0064   bool _asympInt = false;  // added FMV,07/24/03
0065 
0066   RooRealProxy mean ;
0067   RooRealProxy sigma ;
0068   RooRealProxy msf ;
0069   RooRealProxy ssf ;
0070 
0071   ClassDefOverride(RooGaussModel,1) // Gaussian Resolution Model
0072 };
0073 
0074 #endif