Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooJohnson.h
Go to the documentation of this file.
1 // Author: Stephan Hageboeck, CERN, May 2019
2 /*****************************************************************************
3  * Project: RooFit *
4  * Authors: *
5  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
6  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
7  * *
8  * Copyright (c) 2000-2005, Regents of the University of California *
9  * and Stanford University. All rights reserved. *
10  * *
11  * Redistribution and use in source and binary forms, *
12  * with or without modification, are permitted according to the terms *
13  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
14  *****************************************************************************/
15 #ifndef ROO_JOHNSON
16 #define ROO_JOHNSON
17 
18 #include "RooAbsPdf.h"
19 #include "RooRealProxy.h"
20 #include "RooConstVar.h"
21 
22 class RooRealVar;
23 
24 class RooJohnson final : public RooAbsPdf {
25 public:
26  RooJohnson() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
27 
28  RooJohnson(const char *name, const char *title,
29  RooAbsReal& mass, RooAbsReal& mu, RooAbsReal& lambda,
30  RooAbsReal& gamma, RooAbsReal& delta,
31  double massThreshold = -std::numeric_limits<double>::max());
32 
33  RooJohnson(const RooJohnson& other, const char* newName = nullptr);
34 
35  virtual ~RooJohnson() = default;
36 
37  TObject* clone(const char* newname) const override {
38  return new RooJohnson(*this,newname);
39  }
40 
41  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const override;
42  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const override;
43 
44  Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const override;
45  void generateEvent(Int_t code) override;
46 
47 private:
48  enum AnaInt_t {kMass = 1, kMean, kLambda, kGamma, kDelta};
49 
50  RooRealProxy _mass;
51  RooRealProxy _mu;
52  RooRealProxy _lambda;
53 
54  RooRealProxy _gamma;
55  RooRealProxy _delta;
56 
57  double _massThreshold{-1.E300};
58 
59  Double_t evaluate() const override;
60  RooSpan<double> evaluateBatch(std::size_t begin, std::size_t end) const override;
61 
62  ClassDefOverride(RooJohnson,1)
63 };
64 
65 #endif