This file is indexed.

/usr/include/root/RooStats/LikelihoodInterval.h is in libroot-roofit-dev 5.34.00-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// @(#)root/roostats:$Id: LikelihoodInterval.h 39391 2011-05-26 09:51:59Z moneta $
// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef RooStats_LikelihoodInterval
#define RooStats_LikelihoodInterval

#ifndef RooStats_ConfInterval
#include "RooStats/ConfInterval.h"
#endif

#ifndef ROO_ARG_SET
#include "RooArgSet.h"
#endif

#ifndef ROO_ABS_REAL
#include "RooAbsReal.h"
#endif

#ifndef ROOT_Math_IFunctionfwd
#include "Math/IFunctionfwd.h"
#endif

#include <map>
#include <memory>

namespace ROOT { 
   namespace Math { 
      class Minimizer; 
   }
}

namespace RooStats {

   class LikelihoodInterval : public ConfInterval {

   public:

      // defult constructor 
      explicit LikelihoodInterval(const char* name = 0);

      /// construct the interval from a Profile Likelihood object, parameter of interest and optionally a snapshot of 
      /// POI with their best fit values 
      LikelihoodInterval(const char* name, RooAbsReal*, const RooArgSet*,  RooArgSet * = 0);

      // destructor
      virtual ~LikelihoodInterval();
      
      // check if given point is in the interval
      virtual Bool_t IsInInterval(const RooArgSet&) const;

      // set the confidence level for the interval (e.g 0.682 for a 1-sigma interval) 
      virtual void SetConfidenceLevel(Double_t cl) {fConfidenceLevel = cl; ResetLimits(); }

      // return confidence level
      virtual Double_t ConfidenceLevel() const {return fConfidenceLevel;}
 
      // return a cloned list of parameters of interest.  User manages the return object
      virtual  RooArgSet* GetParameters() const;

      // check if parameters are correct (i.e. they are the POI of this interval) 
      Bool_t CheckParameters(const RooArgSet&) const ;


      // return the lower bound of the interval on a given parameter 
      Double_t LowerLimit(const RooRealVar& param) { bool ok; return LowerLimit(param,ok); }
      Double_t LowerLimit(const RooRealVar& param, bool & status) ;

      // return the upper bound of the interval on a given parameter 
      Double_t UpperLimit(const RooRealVar& param) { bool ok; return UpperLimit(param,ok); }
      Double_t UpperLimit(const RooRealVar& param, bool & status) ;

      // find both lower and upper interval boundaries for a given parameter
      // retun false if the bounds have not been found
      Bool_t FindLimits(const RooRealVar & param, double & lower, double &upper);

      /**
         return the 2D-contour points for the given subset of parameters
         by default make the contour using 30 points. The User has to preallocate the x and y array which will return 
         the set of x and y points defining the contour. 
         The return value of the funciton specify the number of contour point found.
         In case of error a zero is returned
      */
      Int_t GetContourPoints(const RooRealVar & paramX, const RooRealVar & paramY, Double_t * x, Double_t *y, Int_t npoints = 30);

      // return the profile log-likelihood ratio function
      RooAbsReal* GetLikelihoodRatio() {return fLikelihoodRatio;}

      // return a pointer to a snapshot with best fit parameter of interest
      const RooArgSet * GetBestFitParameters() const { return fBestFitParams; }

   protected: 

      // reset the cached limit values
      void ResetLimits(); 

      // internal function to create the minimizer for finding the contours
      bool CreateMinimizer();

   private:

      RooArgSet   fParameters; // parameters of interest for this interval
      RooArgSet * fBestFitParams; // snapshot of the model parameters with best fit value (managed internally)
      RooAbsReal* fLikelihoodRatio; // likelihood ratio function used to make contours (managed internally)
      Double_t fConfidenceLevel; // Requested confidence level (eg. 0.95 for 95% CL)
      std::map<std::string, double> fLowerLimits; // map with cached lower bound values
      std::map<std::string, double> fUpperLimits; // map with cached upper bound values
      std::auto_ptr<ROOT::Math::Minimizer > fMinimizer; //! transient pointer to minimizer class used to find limits and contour
      std::auto_ptr<RooFunctor>           fFunctor;   //! transient pointer to functor class used by the minimizer
      std::auto_ptr<ROOT::Math::IMultiGenFunction> fMinFunc; //! transient pointer to the minimization function 

      ClassDef(LikelihoodInterval,1)  // Concrete implementation of a ConfInterval based on a likelihood ratio
      
   };
}

#endif