Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /// \cond ROOFIT_INTERNAL
0002 
0003 /*****************************************************************************
0004  * Project: RooFit                                                           *
0005  * Package: RooFitCore                                                       *
0006  *    File: $Id: RooTObjWrap.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
0007  * Authors:                                                                  *
0008  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0009  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0010  *                                                                           *
0011  * Copyright (c) 2000-2005, Regents of the University of California          *
0012  *                          and Stanford University. All rights reserved.    *
0013  *                                                                           *
0014  * Redistribution and use in source and binary forms,                        *
0015  * with or without modification, are permitted according to the terms        *
0016  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0017  *****************************************************************************/
0018 
0019 #ifndef ROO_TOBJ_WRAP
0020 #define ROO_TOBJ_WRAP
0021 
0022 #include "Rtypes.h"
0023 #include "TNamed.h"
0024 #include "RooLinkedList.h"
0025 
0026 class RooTObjWrap : public TNamed {
0027 public:
0028 
0029   RooTObjWrap(bool isArray=false) : _isArray(isArray), _owning(false) {} ;
0030   RooTObjWrap(TObject *inObj, bool isArray = false) : _isArray(isArray), _owning(false)
0031   {
0032      if (inObj)
0033         _list.Add(inObj);
0034   }
0035   RooTObjWrap(const RooTObjWrap& other) : TNamed(other),  _isArray(other._isArray), _owning(false), _list(other._list) {}
0036   ~RooTObjWrap() override { if (_owning) _list.Delete() ; } ;
0037 
0038   void setOwning(bool flag) { _owning = flag ; }
0039   TObject* obj() const { return _list.At(0) ; }
0040   const RooLinkedList& objList() const { return _list ; }
0041 
0042   void setObj(TObject* inObj) {
0043      if (!_isArray) {
0044          _list.Clear() ;
0045      }
0046     if (inObj) _list.Add(inObj) ;
0047    }
0048 
0049 protected:
0050 
0051   bool _isArray ;
0052   bool _owning ;
0053   RooLinkedList _list ;
0054   ClassDefOverride(RooTObjWrap,2) // Container class for Int_t
0055 };
0056 
0057 #endif
0058 
0059 /// \endcond