This file is indexed.

/usr/include/root/RooAbsCachedPdf.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*****************************************************************************
 * Project: RooFit                                                           *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

#ifndef ROOABSCACHEDPDF
#define ROOABSCACHEDPDF

#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooAbsReal.h"
#include "RooHistPdf.h"
#include "RooObjCacheManager.h"
#include "RooAICRegistry.h"
#include <map>
class RooArgSet ;
class RooChangeTracker ;
 
class RooAbsCachedPdf : public RooAbsPdf {
public:

  RooAbsCachedPdf() {
    // Default constructor
  } ;
  RooAbsCachedPdf(const char *name, const char *title, Int_t ipOrder=0);
  RooAbsCachedPdf(const RooAbsCachedPdf& other, const char* name=0) ;
  virtual ~RooAbsCachedPdf() ;

  virtual Double_t getValV(const RooArgSet* set=0) const ;
  virtual Bool_t selfNormalized() const { 
    // Declare p.d.f self normalized
    return kTRUE ; 
  }

  RooAbsPdf* getCachePdf(const RooArgSet& nset) const {
    // Return RooHistPdf that represents cache histogram
    return getCachePdf(&nset) ;
  }
  RooDataHist* getCacheHist(const RooArgSet& nset) const {
    // Return RooDataHist with cached values
    return getCacheHist(&nset) ;
  }
  RooAbsPdf* getCachePdf(const RooArgSet* nset=0) const ;
  RooDataHist* getCacheHist(const RooArgSet* nset=0) const ;

  void setInterpolationOrder(Int_t order) ;
  Int_t getInterpolationOrder() const { 
    // Set interpolation order in RooHistPdf that represent cached histogram
    return _ipOrder ; 
  }

  virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
  virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const ; 
  virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;

protected:

  class PdfCacheElem : public RooAbsCacheElement {
  public:
    PdfCacheElem(const RooAbsCachedPdf& self, const RooArgSet* nset) ;
    virtual ~PdfCacheElem()  ;

    // Cache management functions
    virtual RooArgList containedArgs(Action) ;
    virtual void printCompactTreeHook(std::ostream&, const char *, Int_t, Int_t) ;

    RooHistPdf* pdf() { return _pdf ; }
    RooDataHist* hist() { return _hist ; }
    const RooArgSet& nset() { return _nset ; }
    RooChangeTracker* paramTracker() { return _paramTracker ; }

  private:
    // Payload
    RooHistPdf*  _pdf ;
    RooChangeTracker* _paramTracker ;
    RooDataHist* _hist ;
    RooArgSet    _nset ;
    RooAbsReal*  _norm ;

  } ;

  PdfCacheElem* getCache(const RooArgSet* nset, Bool_t recalculate=kTRUE) const ;
  void clearCacheObject(PdfCacheElem& cache) const ;

  virtual const char* payloadUniqueSuffix() const { return 0 ; }
  
  friend class PdfCacheElem ;
  virtual const char* binningName() const { 
    // Return name of binning to be used for creation of cache histogram
    return "cache" ; 
  }
  virtual PdfCacheElem* createCache(const RooArgSet* nset) const { 
    // Create cache storage element
    return new PdfCacheElem(*this,nset) ; 
  }
  virtual const char* inputBaseName() const = 0 ;
  virtual RooArgSet* actualObservables(const RooArgSet& nset) const = 0 ;
  virtual RooArgSet* actualParameters(const RooArgSet& nset) const = 0 ;
  virtual RooAbsArg& pdfObservable(RooAbsArg& histObservable) const { return histObservable ; }
  virtual void fillCacheObject(PdfCacheElem& cache) const = 0 ;

  mutable RooObjCacheManager _cacheMgr ; // The cache manager  
  Int_t _ipOrder ; // Interpolation order for cache histograms 
 
  TString cacheNameSuffix(const RooArgSet& nset) const ;
  virtual TString histNameSuffix() const { return TString("") ; }
  void disableCache(Bool_t flag) { 
    // Flag to disable caching mechanism
    _disableCache = flag ; 
  }

  mutable RooAICRegistry _anaReg ; //! Registry for analytical integration codes
  class AnaIntConfig {
  public:
    RooArgSet _allVars ;
    RooArgSet _anaVars ;
    const RooArgSet* _nset ;
    Bool_t    _unitNorm ;
  } ;
  mutable std::map<Int_t,AnaIntConfig> _anaIntMap ; //! Map for analytical integration codes



private:

  Bool_t _disableCache ; // Flag to run object in passthrough (= non-caching mode)

  ClassDef(RooAbsCachedPdf,1) // Abstract base class for cached p.d.f.s
};
 
#endif