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_RooUnbinnedL
0014 #define ROOT_ROOFIT_TESTSTATISTICS_RooUnbinnedL
0015 
0016 #include <RooFit/TestStatistics/RooAbsL.h>
0017 #include <RooGlobalFunc.h>
0018 
0019 #include "Math/Util.h" // KahanSum
0020 
0021 // forward declarations
0022 class RooAbsPdf;
0023 class RooAbsData;
0024 class RooArgSet;
0025 class RooChangeTracker;
0026 
0027 namespace RooFit {
0028 
0029 class Evaluator;
0030 
0031 namespace TestStatistics {
0032 
0033 class RooUnbinnedL : public RooAbsL {
0034 public:
0035    RooUnbinnedL(RooAbsPdf *pdf, RooAbsData *data, RooAbsL::Extended extended = RooAbsL::Extended::Auto,
0036                 RooFit::EvalBackend evalBackend = RooFit::EvalBackend::Legacy());
0037    RooUnbinnedL(const RooUnbinnedL &other);
0038    ~RooUnbinnedL() override;
0039    bool setApplyWeightSquared(bool flag);
0040 
0041    ROOT::Math::KahanSum<double>
0042    evaluatePartition(Section events, std::size_t components_begin, std::size_t components_end) override;
0043 
0044    std::string GetClassName() const override { return "RooUnbinnedL"; }
0045 
0046 private:
0047    bool apply_weight_squared = false; ///< Apply weights squared?
0048    mutable bool _first = true;        ///<!
0049    std::unique_ptr<RooChangeTracker> paramTracker_;
0050    Section lastSection_ = {0, 0}; // used for cache together with the parameter tracker
0051    mutable ROOT::Math::KahanSum<double> cachedResult_{0.};
0052    std::shared_ptr<RooFit::Evaluator> evaluator_;  ///<! For batched evaluation
0053    std::stack<std::vector<double>> _vectorBuffers; // used for preserving resources in batched evaluation
0054 };
0055 
0056 } // namespace TestStatistics
0057 } // namespace RooFit
0058 
0059 #endif // ROOT_ROOFIT_TESTSTATISTICS_RooUnbinnedL