Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:26

0001 /*
0002  * Project: RooFit
0003  * Authors:
0004  *   PB, Patrick Bos, Netherlands eScience Center, p.bos@esciencecenter.nl
0005  *
0006  * Copyright (c) 2021, CERN
0007  *
0008  * Redistribution and use in source and binary forms,
0009  * with or without modification, are permitted according to the terms
0010  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
0011  */
0012 
0013 #ifndef ROOT_ROOFIT_TESTSTATISTICS_RooBinnedL
0014 #define ROOT_ROOFIT_TESTSTATISTICS_RooBinnedL
0015 
0016 #include <RooFit/TestStatistics/RooAbsL.h>
0017 #include "RooAbsReal.h"
0018 
0019 #include "Math/Util.h" // KahanSum
0020 
0021 #include <vector>
0022 
0023 // forward declarations
0024 class RooAbsPdf;
0025 class RooAbsData;
0026 class RooChangeTracker;
0027 
0028 namespace RooFit {
0029 namespace TestStatistics {
0030 
0031 class RooBinnedL : public RooAbsL {
0032 public:
0033    RooBinnedL(RooAbsPdf *pdf, RooAbsData *data);
0034    ~RooBinnedL() override;
0035    ROOT::Math::KahanSum<double>
0036    evaluatePartition(Section bins, std::size_t components_begin, std::size_t components_end) override;
0037 
0038    std::string GetClassName() const override { return "RooBinnedL"; }
0039 
0040 private:
0041    mutable bool _first = true;        ///<!
0042    mutable std::vector<double> _binw; ///<!
0043    std::unique_ptr<RooChangeTracker> paramTracker_;
0044    Section lastSection_ = {0, 0}; // used for cache together with the parameter tracker
0045    mutable ROOT::Math::KahanSum<double> cachedResult_{0.};
0046 };
0047 
0048 } // namespace TestStatistics
0049 } // namespace RooFit
0050 
0051 #endif // ROOT_ROOFIT_TESTSTATISTICS_RooBinnedL