Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooEffGenContext.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooEffGenContext.h,v 1.2 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   GR, Gerhard Raven, NIKHEF/VU, Gerhard.Raven@nikhf.nl                    *
0007  *                                                                           *
0008  * Copyright (c) 2005, NIKHEF.  All rights reserved.                         *
0009  *                                                                           *
0010  * Redistribution and use in source and binary forms,                        *
0011  * with or without modification, are permitted according to the terms        *
0012  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0013  *****************************************************************************/
0014 #ifndef ROO_EFF_GEN_CONTEXT
0015 #define ROO_EFF_GEN_CONTEXT
0016 
0017 #include "RooAbsGenContext.h"
0018 class RooAbsPdf;
0019 class RooArgSet;
0020 class RooDataSet;
0021 class RooAbsReal;
0022 
0023 class RooEffGenContext : public RooAbsGenContext {
0024 public:
0025    RooEffGenContext(const RooAbsPdf &model, const RooAbsPdf &pdf, const RooAbsReal &eff, const RooArgSet &vars,
0026                     const RooDataSet *prototype = nullptr, const RooArgSet *auxProto = nullptr, bool verbose = false,
0027                     const RooArgSet *forceDirect = nullptr);
0028 
0029    void printMultiline(std::ostream &os, Int_t content, bool verbose = false, TString indent = "") const override;
0030 
0031 protected:
0032    void initGenerator(const RooArgSet &theEvent) override;
0033    void generateEvent(RooArgSet &theEvent, Int_t remaining) override;
0034 
0035 private:
0036    inline void initializeEff(RooAbsReal const &eff)
0037    {
0038       _eff = dynamic_cast<RooAbsReal *>(_cloneSet.find(eff.GetName()));
0039    }
0040 
0041    RooArgSet _cloneSet;          ///< Internal clone of p.d.f.
0042    RooAbsReal *_eff;             ///< Pointer to efficiency function
0043    std::unique_ptr<RooAbsGenContext> _generator; ///< Generator context for p.d.f
0044    RooArgSet _vars;              ///< Vars to generate
0045    double _maxEff;               ///< Maximum of efficiency in vars
0046 
0047    ClassDefOverride(RooEffGenContext, 0); // Context for generating a dataset from a PDF
0048 };
0049 #endif