Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooGaussModel.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitModels *
4 * File: $Id: RooGaussModel.h,v 1.21 2007/05/11 09:13:07 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_GAUSS_MODEL
17#define ROO_GAUSS_MODEL
18
19#include "RooResolutionModel.h"
20#include "RooRealProxy.h"
21
22#include <cmath>
23#include <complex>
24
26public:
27
37 enum BasisSign { Both=0, Plus=+1, Minus=-1 } ;
38
39 // Constructors, assignment etc
40 inline RooGaussModel() : _flatSFInt(false), _asympInt(false) { }
41 RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
43 RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
45 RooGaussModel(const char *name, const char *title, RooAbsRealLValue& x,
46 RooAbsReal& mean, RooAbsReal& sigma, RooAbsReal& meanSF, RooAbsReal& sigmaSF) ;
47 RooGaussModel(const RooGaussModel& other, const char* name=nullptr);
48 TObject* clone(const char* newname) const override { return new RooGaussModel(*this,newname) ; }
49 ~RooGaussModel() override;
50
51 Int_t basisCode(const char* name) const override ;
52 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=nullptr) const override ;
53 double analyticalIntegral(Int_t code, const char* rangeName) const override ;
54
55 Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, bool staticInitOK=true) const override;
56 void generateEvent(Int_t code) override;
57
58 void advertiseFlatScaleFactorIntegral(bool flag) { _flatSFInt = flag ; }
59
60 void advertiseAymptoticIntegral(bool flag) { _asympInt = flag ; } // added FMV,07/24/03
61
62 void computeBatch(double* output, size_t size, RooFit::Detail::DataMap const&) const override;
63
64 bool canComputeBatchWithCuda() const override { return getBasisType(_basisCode) == expBasis; }
65
66protected:
67
68 double evaluate() const override ;
69 static double evaluate(double x, double mean, double sigma, double param1, double param2, int basisCode);
70
71 // Calculate common normalization factors
72 std::complex<double> evalCerfInt(double sign, double wt, double tau, double umin, double umax, double c) const;
73
74private:
75
77 {
78 return static_cast<BasisType>(basisCode == 0 ? 0 : (basisCode / 10) + 1);
79 }
80
82
83 bool _asympInt ; // added FMV,07/24/03
84
89
90 ClassDefOverride(RooGaussModel,1) // Gaussian Resolution Model
91};
92
93#endif
#define c(i)
Definition RSha256.hxx:101
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Class RooGaussModel implements a RooResolutionModel that models a Gaussian distribution.
RooRealProxy sigma
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
std::complex< double > evalCerfInt(double sign, double wt, double tau, double umin, double umax, double c) const
TObject * clone(const char *newname) const override
RooRealProxy msf
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
void advertiseFlatScaleFactorIntegral(bool flag)
~RooGaussModel() override
Destructor.
void generateEvent(Int_t code) override
Interface for generation of an event using the algorithm corresponding to the specified code.
void advertiseAymptoticIntegral(bool flag)
bool canComputeBatchWithCuda() const override
Int_t basisCode(const char *name) const override
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, bool staticInitOK=true) const override
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
void computeBatch(double *output, size_t size, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
RooRealProxy mean
double analyticalIntegral(Int_t code, const char *rangeName) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
RooRealProxy ssf
static BasisType getBasisType(int basisCode)
RooResolutionModel is the base class for PDFs that represent a resolution model that can be convolute...
Int_t _basisCode
Identifier code for selected basis function.
RooTemplateProxy< RooAbsRealLValue > x
Dependent/convolution variable.
Mother of all ROOT objects.
Definition TObject.h:41
static void output()