Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooResolutionModel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooResolutionModel.h,v 1.26 2007/05/14 18:37:46 wouter Exp $
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_RESOLUTION_MODEL
0017 #define ROO_RESOLUTION_MODEL
0018 
0019 #include "RooAbsPdf.h"
0020 #include "RooTemplateProxy.h"
0021 #include "RooRealVar.h"
0022 #include "RooFormulaVar.h"
0023 
0024 class RooAbsAnaConvPdf;
0025 
0026 class RooResolutionModel : public RooAbsPdf {
0027 public:
0028 
0029   // Constructors, assignment etc
0030   inline RooResolutionModel() = default;
0031   RooResolutionModel(const char *name, const char *title, RooAbsRealLValue& x) ;
0032   RooResolutionModel(const RooResolutionModel& other, const char* name=nullptr);
0033   TObject* clone(const char* newname) const override = 0;
0034   ~RooResolutionModel() override;
0035 
0036   virtual RooAbsGenContext* modelGenContext(const RooAbsAnaConvPdf&, const RooArgSet&,
0037                                             const RooDataSet*, const RooArgSet*,
0038                                             bool) const { return nullptr; }
0039 
0040   double getValV(const RooArgSet* nset=nullptr) const override ;
0041 
0042   // If used as regular PDF, it also has to be normalized. If this resolution
0043   // model is used in a convolution, return unnormalized value regardless of
0044   // specified normalization set.
0045   bool selfNormalized() const override { return isConvolved() ; }
0046 
0047   virtual RooResolutionModel* convolution(RooFormulaVar* basis, RooAbsArg* owner) const ;
0048   /// Return the convolution variable of the resolution model.
0049   RooAbsRealLValue& convVar() const {return *x;}
0050   const RooRealVar& basisConvVar() const ;
0051 
0052   inline bool isBasisSupported(const char* name) const { return basisCode(name)?true:false ; }
0053   virtual Int_t basisCode(const char* name) const = 0 ;
0054 
0055   virtual void normLeafServerList(RooArgSet& list) const ;
0056   double getNorm(const RooArgSet* nset=nullptr) const override ;
0057 
0058   inline const RooFormulaVar& basis() const { return _basis?*_basis:*identity() ; }
0059   bool isConvolved() const { return _basis ? true : false ; }
0060 
0061   void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
0062 
0063   static RooFormulaVar* identity() ;
0064 
0065   virtual void changeBasis(RooFormulaVar* basis) ;
0066 
0067 protected:
0068 
0069   friend class RooConvGenContext ;
0070   friend class RooAddModel ;
0071   RooTemplateProxy<RooAbsRealLValue> x;                   ///< Dependent/convolution variable
0072 
0073   bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0074 
0075   friend class RooAbsAnaConvPdf ;
0076 
0077   Int_t _basisCode ;         ///< Identifier code for selected basis function
0078   RooFormulaVar* _basis = nullptr;    ///< Basis function convolved with this resolution model
0079   bool _ownBasis ;         ///< Flag indicating ownership of _basis
0080 
0081   ClassDefOverride(RooResolutionModel, 2) // Abstract Resolution Model
0082 };
0083 
0084 #endif