Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/roostats:$Id$
0002 // Author: George Lewis, Kyle Cranmer
0003 /*************************************************************************
0004  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOBARLOWBEESTONLL
0012 #define ROOBARLOWBEESTONLL
0013 
0014 #include "RooAbsReal.h"
0015 #include "RooRealProxy.h"
0016 #include "RooSetProxy.h"
0017 #include <map>
0018 #include <set>
0019 #include <string>
0020 #include <vector>
0021 
0022 namespace RooStats{
0023   namespace HistFactory{
0024 
0025 class RooBarlowBeestonLL : public RooAbsReal {
0026 public:
0027 
0028   RooBarlowBeestonLL(const char *name, const char *title, RooAbsReal& nll /*, const RooArgSet& observables*/);
0029   RooBarlowBeestonLL(const RooBarlowBeestonLL& other, const char* name=nullptr) ;
0030   TObject* clone(const char* newname=nullptr) const override { return new RooBarlowBeestonLL(*this,newname); }
0031 
0032   // A simple class to store the
0033   // necessary objects for a
0034   // single gamma in a single channel
0035   class BarlowCache {
0036   public:
0037     bool hasStatUncert = false;
0038     RooRealVar* gamma = nullptr;
0039     RooArgSet* observables = nullptr;
0040     RooArgSet* bin_center = nullptr; // Snapshot
0041     RooRealVar* tau = nullptr;
0042     RooAbsReal* nom_pois_mean = nullptr;
0043     RooAbsReal* sumPdf = nullptr;
0044     double nData = -1;
0045     double binVolume = 0;
0046     void SetBinCenter() const;
0047   };
0048 
0049   void initializeBarlowCache();
0050   bool getParameters(const RooArgSet* depList, RooArgSet& outputSet, bool stripDisconnected=true) const override;
0051   RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
0052   void setPdf(RooAbsPdf* pdf) { _pdf = pdf; }
0053   void setDataset(RooAbsData* data) { _data = data; }
0054 
0055 protected:
0056 
0057   RooRealProxy _nll ;    ///< Input -log(L) function
0058   RooAbsPdf* _pdf = nullptr;
0059   RooAbsData* _data = nullptr;
0060   mutable std::map< std::string, std::vector< BarlowCache > > _barlowCache;
0061   mutable std::set< std::string > _statUncertParams;
0062   mutable std::map<std::string,bool> _paramFixed ; ///< Parameter constant status at last time of use
0063   double evaluate() const override ;
0064 
0065 private:
0066 
0067   // Real-valued function representing a Barlow-Beeston minimized profile likelihood of external (likelihood) function
0068   ClassDefOverride(RooStats::HistFactory::RooBarlowBeestonLL,0)
0069 };
0070 
0071   }
0072 }
0073 
0074 #endif