Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:20

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id$
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_CONSTRAINT_SUM
0017 #define ROO_CONSTRAINT_SUM
0018 
0019 #include "RooAbsReal.h"
0020 #include "RooListProxy.h"
0021 #include "RooSetProxy.h"
0022 
0023 class RooRealVar;
0024 class RooArgList ;
0025 class RooWorkspace ;
0026 
0027 class RooConstraintSum : public RooAbsReal {
0028 public:
0029 
0030   RooConstraintSum() {}
0031   RooConstraintSum(const char *name, const char *title, const RooArgSet& constraintSet, const RooArgSet& paramSet, bool takeGlobalObservablesFromData=false) ;
0032 
0033   RooConstraintSum(const RooConstraintSum& other, const char* name = nullptr);
0034   TObject* clone(const char* newname) const override { return new RooConstraintSum(*this, newname); }
0035 
0036   const RooArgList& list() { return _set1 ; }
0037 
0038   bool setData(RooAbsData const& data, bool cloneData=true);
0039   /// \copydoc setData(RooAbsData const&, bool)
0040   bool setData(RooAbsData& data, bool cloneData=true) override {
0041     return setData(static_cast<RooAbsData const&>(data), cloneData);
0042   }
0043 
0044   void doEval(RooFit::EvalContext &) const override;
0045 
0046   std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
0047 
0048   void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
0049 protected:
0050 
0051   RooListProxy _set1 ;    ///< Set of constraint terms
0052   RooArgSet _paramSet ; ///< Set of parameters to which constraints apply
0053   const bool _takeGlobalObservablesFromData = false; ///< If the global observable values are taken from data
0054 
0055   double evaluate() const override;
0056 
0057   ClassDefOverride(RooConstraintSum,4) // sum of -log of set of RooAbsPdf representing parameter constraints
0058 };
0059 
0060 #endif