/usr/include/root/RooNormSetCache.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 | /*****************************************************************************
* Project: RooFit *
* Package: RooFitCore *
* File: $Id: RooNormSetCache.h,v 1.12 2007/08/09 19:55:47 wouter Exp $
* Authors: *
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
* *
* 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 ROO_NORMSET_CACHE
#define ROO_NORMSET_CACHE
#include "Riosfwd.h"
#include <assert.h>
#include "Rtypes.h"
#include "RooNameSet.h"
#include "RooSetPair.h"
#include "RooHashTable.h"
class RooArgSet ;
class RooSetPair ;
typedef RooArgSet* pRooArgSet ;
class RooNormSetCache {
public:
RooNormSetCache(Int_t regSize=64) ;
RooNormSetCache(const RooNormSetCache& other) ;
virtual ~RooNormSetCache() ;
void add(const RooArgSet* set1, const RooArgSet* set2=0) ;
inline Int_t index(const RooArgSet* set1, const RooArgSet* set2=0, const TNamed* set2RangeName=0) {
// Match range name first
if (set2RangeName != _set2RangeName) return -1 ;
// Match pointer of sets
Int_t i ;
for (i=0 ; i<_nreg ; i++) {
if (_asArr[i]._set1 == set1 &&
_asArr[i]._set2 == set2
) return i ;
}
return -1 ;
}
inline Bool_t contains(const RooArgSet* set1, const RooArgSet* set2=0, const TNamed* set2RangeName=0) {
if (set2RangeName!=_set2RangeName) return kFALSE ;
if (_htable) return (_htable->findSetPair(set1,set2)) ;
return (index(set1,set2,set2RangeName)>=0) ;
}
inline Bool_t containsSet1(const RooArgSet* set1) {
Int_t i ;
for (i=0 ; i<_nreg ; i++) {
if (_asArr[i]._set1 == set1) return kTRUE ;
}
return kFALSE ;
}
const RooArgSet* lastSet1() const { return _nreg>0?_asArr[_nreg-1]._set1:0 ; }
const RooArgSet* lastSet2() const { return _nreg>0?_asArr[_nreg-1]._set2:0 ; }
const RooNameSet& nameSet1() const { return _name1 ; }
const RooNameSet& nameSet2() const { return _name2 ; }
Bool_t autoCache(const RooAbsArg* self, const RooArgSet* set1, const RooArgSet* set2=0, const TNamed* set2RangeName=0, Bool_t autoRefill=kTRUE) ;
void clear() ;
Int_t entries() const { return _nreg ; }
void initialize(const RooNormSetCache& other) ;
protected:
void expand() ;
RooHashTable* _htable ; //! do not persist
Int_t _regSize ;
Int_t _nreg ;
RooSetPair* _asArr ; //! do not persist
RooNameSet _name1 ; //!
RooNameSet _name2 ; //!
TNamed* _set2RangeName ; //!
ClassDef(RooNormSetCache,1) // Management tool for tracking sets of similar integration/normalization sets
} ;
#endif
|