Warning, file /include/root/RooCompositeDataStore.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_COMPOSITE_DATA_STORE
0017 #define ROO_COMPOSITE_DATA_STORE
0018
0019 #include "RooAbsDataStore.h"
0020
0021 #include <map>
0022 #include <string>
0023 #include <vector>
0024 #include <list>
0025
0026 class RooAbsArg ;
0027 class RooArgList ;
0028 class RooFormulaVar ;
0029 class RooArgSet ;
0030 class RooCategory ;
0031
0032
0033 class RooCompositeDataStore : public RooAbsDataStore {
0034 public:
0035
0036 RooCompositeDataStore() ;
0037
0038
0039 RooCompositeDataStore(RooStringView name, RooStringView title, const RooArgSet& vars, RooCategory& indexCat, std::map<std::string,RooAbsDataStore*> const& inputData) ;
0040
0041
0042 RooAbsDataStore* clone(const char* newname=nullptr) const override { return new RooCompositeDataStore(*this,newname) ; }
0043 RooAbsDataStore* clone(const RooArgSet& vars, const char* newname=nullptr) const override { return new RooCompositeDataStore(*this,vars,newname) ; }
0044
0045 std::unique_ptr<RooAbsDataStore> reduce(RooStringView name, RooStringView title,
0046 const RooArgSet& vars, const RooFormulaVar* cutVar, const char* cutRange,
0047 std::size_t nStart, std::size_t nStop) override;
0048
0049 RooCompositeDataStore(const RooCompositeDataStore& other, const char* newname=nullptr) ;
0050 RooCompositeDataStore(const RooCompositeDataStore& other, const RooArgSet& vars, const char* newname=nullptr) ;
0051
0052 ~RooCompositeDataStore() override ;
0053
0054 void dump() override ;
0055
0056
0057 Int_t fill() override ;
0058
0059 double sumEntries() const override ;
0060
0061
0062 using RooAbsDataStore::get ;
0063 const RooArgSet* get(Int_t index) const override ;
0064 using RooAbsDataStore::weight ;
0065 double weight() const override ;
0066 double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const override ;
0067 void weightError(double& lo, double& hi, RooAbsData::ErrorType etype=RooAbsData::Poisson) const override ;
0068 bool isWeighted() const override ;
0069
0070
0071 bool changeObservableName(const char* from, const char* to) override ;
0072
0073
0074 RooAbsArg* addColumn(RooAbsArg& var, bool adjustRange=true) override ;
0075
0076
0077 RooAbsDataStore* merge(const RooArgSet& allvars, std::list<RooAbsDataStore*> dstoreList) override ;
0078
0079 RooCategory* index() { return _indexCat ; }
0080
0081
0082 void append(RooAbsDataStore& other) override ;
0083
0084
0085 Int_t numEntries() const override ;
0086 void reset() override ;
0087
0088
0089 void attachBuffers(const RooArgSet& extObs) override ;
0090 void resetBuffers() override ;
0091
0092
0093 void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=nullptr, bool skipZeroWeights=false) override ;
0094 const RooAbsArg* cacheOwner() override { return nullptr ; }
0095 void setArgStatus(const RooArgSet& set, bool active) override ;
0096 void resetCache() override ;
0097
0098 void recalculateCache(const RooArgSet* , Int_t , Int_t , Int_t , bool ) override ;
0099 bool hasFilledCache() const override ;
0100
0101 void loadValues(const RooAbsDataStore *tds, const RooFormulaVar* select=nullptr, const char* rangeName=nullptr,
0102 std::size_t nStart=0, std::size_t nStop = std::numeric_limits<std::size_t>::max()) override;
0103
0104 void forceCacheUpdate() override ;
0105
0106 RooAbsData::RealSpans getBatches(std::size_t first, std::size_t len) const override {
0107
0108 std::cerr << "This functionality is not yet implemented for composite data stores." << std::endl;
0109 throw std::logic_error("getBatches() not implemented for RooCompositeDataStore.");
0110 (void)first; (void)len;
0111 return {};
0112 }
0113 std::span<const double> getWeightBatch(std::size_t first, std::size_t len) const override;
0114
0115
0116 protected:
0117
0118 void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) override ;
0119
0120 std::map<Int_t,RooAbsDataStore*> _dataMap ;
0121 RooCategory* _indexCat = nullptr;
0122 mutable RooAbsDataStore* _curStore = nullptr;
0123 mutable Int_t _curIndex = 0;
0124 mutable std::unique_ptr<std::vector<double>> _weightBuffer;
0125 bool _ownComps = false;
0126
0127 ClassDefOverride(RooCompositeDataStore,1)
0128 };
0129
0130
0131 #endif