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_RooSumL
0014 #define ROOT_ROOFIT_TESTSTATISTICS_RooSumL
0015 
0016 #include <RooFit/TestStatistics/RooAbsL.h>
0017 
0018 #include "Math/Util.h" // KahanSum
0019 
0020 #include <tuple>
0021 
0022 namespace RooFit {
0023 namespace TestStatistics {
0024 
0025 class RooSumL : public RooAbsL {
0026 public:
0027    RooSumL(RooAbsPdf *pdf, RooAbsData *data, std::vector<std::unique_ptr<RooAbsL>> components,
0028            RooAbsL::Extended extended = RooAbsL::Extended::Auto);
0029    // Note: when above ctor is called without std::moving components, you get a really obscure error. Pass as
0030    // std::move(components)!
0031 
0032    ROOT::Math::KahanSum<double>
0033    evaluatePartition(Section events, std::size_t components_begin, std::size_t components_end) override;
0034 
0035    // necessary only for legacy offsetting mode in LikelihoodWrapper; TODO: remove this if legacy mode is ever removed
0036    ROOT::Math::KahanSum<double> getSubsidiaryValue();
0037 
0038    void constOptimizeTestStatistic(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) override;
0039 
0040    std::string GetClassName() const override { return "RooSumL"; }
0041 
0042    const std::vector<std::unique_ptr<RooAbsL>> &GetComponents() const { return components_; };
0043 
0044 private:
0045    std::vector<std::unique_ptr<RooAbsL>> components_;
0046 };
0047 
0048 } // namespace TestStatistics
0049 } // namespace RooFit
0050 
0051 #endif // ROOT_ROOFIT_TESTSTATISTICS_RooSumL