Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooRealVarSharedProperties.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: RooRealVarSharedProperties.h,v 1.3 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 /**
0018 \file RooRealVarSharedProperties.h
0019 \class RooRealVarSharedProperties
0020 \ingroup Roofitcore
0021 
0022 Implementation of RooSharedProperties
0023 that stores the properties of a RooRealVar that are shared among clones.
0024 For RooRealVars these are the definitions of the named ranges.
0025 **/
0026 
0027 #ifndef ROO_REAL_VAR_SHARED_PROPERTY
0028 #define ROO_REAL_VAR_SHARED_PROPERTY
0029 
0030 #include "RooAbsBinning.h"
0031 #include "RooSharedProperties.h"
0032 
0033 #include <memory>
0034 #include <unordered_map>
0035 #include <string>
0036 
0037 class RooAbsBinning;
0038 
0039 class RooRealVarSharedProperties : public RooSharedProperties {
0040 public:
0041 
0042   /// Default constructor.
0043   RooRealVarSharedProperties() {}
0044   /// Constructor with unique-id string.
0045   RooRealVarSharedProperties(const char* uuidstr) : RooSharedProperties(uuidstr) {}
0046 
0047   /// Destructor
0048   ~RooRealVarSharedProperties() override {
0049     if (_ownBinnings) {
0050       for (auto& item : _altBinning) {
0051         delete item.second;
0052       }
0053     }
0054   }
0055 
0056   void disownBinnings() {
0057     _ownBinnings = false;
0058   }
0059 
0060 protected:
0061 
0062   friend class RooRealVar ;
0063 
0064   std::unordered_map<std::string,RooAbsBinning*> _altBinning ;  ///< Optional alternative ranges and binnings
0065   bool _ownBinnings{true}; //!
0066   ClassDefOverride(RooRealVarSharedProperties,2) // Shared properties of a RooRealVar clone set
0067 };
0068 
0069 
0070 #endif