Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooCustomizer.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: RooCustomizer.h,v 1.11 2007/05/11 09:11:30 verkerke 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 
0017 #ifndef ROO_PDF_CUSTOMIZER
0018 #define ROO_PDF_CUSTOMIZER
0019 
0020 #include <RooArgList.h>
0021 #include <RooArgSet.h>
0022 #include <RooPrintable.h>
0023 
0024 #include <TNamed.h>
0025 #include <TString.h>
0026 
0027 #include <vector>
0028 #include <string>
0029 
0030 class RooAbsCategoryLValue ;
0031 class RooAbsCategory ;
0032 class RooAbsArg ;
0033 class RooAbsPdf ;
0034 
0035 // Editing tool for RooAbsArg composite object expressions
0036 class RooCustomizer {
0037 
0038 public:
0039 
0040   // Constructors, assignment etc
0041   RooCustomizer(const RooAbsArg& pdf, const RooAbsCategoryLValue& masterCat, RooArgSet& splitLeafListOwned, RooArgSet* splitLeafListAll=nullptr) ;
0042   RooCustomizer(const RooAbsArg& pdf, const char* name) ;
0043 
0044   /// If flag is true, make customizer own all created components
0045   void setOwning(bool flag) {
0046     _owning = flag ;
0047   }
0048 
0049   void splitArgs(const RooArgSet& argSet, const RooAbsCategory& splitCat) ;
0050   void splitArg(const RooAbsArg& arg, const RooAbsCategory& splitCat) ;
0051   void replaceArg(const RooAbsArg& orig, const RooAbsArg& subst) ;
0052   RooAbsArg* build(const char* masterCatState, bool verbose=false) ;
0053   RooAbsArg* build(bool verbose=false) ;
0054 
0055   /// Return list of cloned branch nodes
0056   const RooArgSet& cloneBranchList() const {
0057     return *_cloneBranchList ;
0058   }
0059   /// Return list of cloned leaf nodes
0060   const RooArgSet& cloneLeafList() const {
0061     return *_cloneNodeListOwned ;
0062   }
0063 
0064   // Printing interface
0065   void printArgs(std::ostream& os) const ;
0066   void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent= "") const;
0067 
0068   /// Releases ownership of list of cloned branch nodes
0069   void setCloneBranchSet(RooArgSet& cloneBranchSet) ;
0070 
0071   RooAbsPdf const& pdf() const;
0072 
0073   RooCustomizer(const RooCustomizer &) = delete;
0074   RooCustomizer &operator=(const RooCustomizer &) = delete;
0075   RooCustomizer(RooCustomizer &&) = delete;
0076   RooCustomizer &operator=(RooCustomizer &&) = delete;
0077 
0078 protected:
0079 
0080   void initialize() ;
0081 
0082   RooAbsArg* doBuild(const char* masterCatState, bool verbose) ;
0083 
0084   bool _sterile ; ///< If true we do not have as associated master category
0085   bool _owning ;  ///< If true we own all created components
0086   TString _name ;   ///< Name of this object
0087 
0088   RooArgList _splitArgList ; ///< List of RooAbsArgs to be split
0089   RooArgList _splitCatList ; ///< List of categories to be used for above splits
0090 
0091   RooArgList _replaceArgList ; ///< List of RooAbsArgs to be replaced
0092   RooArgList _replaceSubList ; ///< List of replacement RooAbsArgs
0093 
0094   // Master nodes are not owned
0095   RooAbsArg* _masterPdf ;             ///< Pointer to input p.d.f
0096   RooAbsCategoryLValue* _masterCat = nullptr;  ///< Pointer to input master category
0097 
0098   RooArgSet  _masterBranchList ;      ///< List of branch nodes
0099   RooArgSet  _masterLeafList ;        ///< List of leaf nodes
0100 
0101   RooArgSet  _internalCloneBranchList;   ///< List of branches of internal clone
0102   RooArgSet* _cloneBranchList = nullptr; ///< Pointer to list of cloned branches used
0103 
0104   // Cloned leaves are owned by the user supplied list in the constructor
0105   RooArgSet* _cloneNodeListAll = nullptr;  ///< List of all cloned nodes
0106   RooArgSet* _cloneNodeListOwned = nullptr;///< List of owned cloned nodes
0107 } ;
0108 
0109 #endif