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_RooSubsidiaryL
0014 #define ROOT_ROOFIT_TESTSTATISTICS_RooSubsidiaryL
0015 
0016 #include <RooFit/TestStatistics/RooAbsL.h>
0017 #include "RooArgList.h"
0018 #include "RooArgSet.h"
0019 
0020 #include "Math/Util.h" // KahanSum
0021 
0022 namespace RooFit {
0023 namespace TestStatistics {
0024 
0025 class RooSubsidiaryL : public RooAbsL {
0026 public:
0027    RooSubsidiaryL(const std::string &parent_pdf_name, const RooArgSet &pdfs, const RooArgSet &parameter_set);
0028 
0029    ROOT::Math::KahanSum<double>
0030    evaluatePartition(Section events, std::size_t components_begin, std::size_t components_end) override;
0031    inline std::unique_ptr<RooArgSet> getParameters() override { return std::make_unique<RooArgSet>(parameter_set_); }
0032    inline std::string GetName() const override { return std::string("subsidiary_pdf_of_") + parent_pdf_name_; }
0033 
0034    inline std::string GetTitle() const override
0035    {
0036       return std::string("Subsidiary PDF set of simultaneous PDF ") + parent_pdf_name_;
0037    }
0038 
0039    std::string GetInfo() const override { return GetClassName() + "::" + parent_pdf_name_; }
0040 
0041    std::string GetClassName() const override { return "RooSubsidiaryL"; }
0042 
0043    inline std::size_t numDataEntries() const override
0044    {
0045       // function only used in LikelihoodJob::evaluate, but this class must always be evaluated over Section(0,1), so
0046       // not useful
0047       return 0;
0048    }
0049 
0050    void constOptimizeTestStatistic(RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) override;
0051 
0052 private:
0053    std::string parent_pdf_name_;
0054    RooArgList subsidiary_pdfs_{"subsidiary_pdfs"}; ///< Set of subsidiary PDF or "constraint" terms
0055    RooArgSet parameter_set_{"parameter_set"};      ///< Set of parameters to which constraints apply
0056 };
0057 
0058 } // namespace TestStatistics
0059 } // namespace RooFit
0060 
0061 #endif // ROOT_ROOFIT_TESTSTATISTICS_RooSubsidiaryL