ROOT  6.06/09
Reference Guide
RooCategorySharedProperties.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 
17 //////////////////////////////////////////////////////////////////////////////
18 //
19 // BEGIN_HTML
20 // RooCategorySharedProperties is the container for all properties
21 // that are shared between instance of RooCategory objects that
22 // are clones of each other. At present the only property that is
23 // shared in this way is the list of alternate named range definitions
24 // END_HTML
25 //
26 
27 #include "RooFit.h"
29 #include "TList.h"
30 #include "RooCatType.h"
31 #include <iostream>
32 using namespace std ;
33 
35 ;
36 
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Constructor
40 
42 {
43 }
44 
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Constructor with unique-id string
48 
50 {
51 }
52 
53 
54 
55 
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 
60  RooSharedProperties(other)
61 {
62  cout << "RooCategorySharedProperties::cctor()" << endl ;
63  // Copy constructor
65  TList* olist ;
66  while((olist=(TList*)iter->Next())) {
67  TList* mylist = new TList ;
68  mylist->SetName(olist->GetName()) ;
69  RooCatType* ctype ;
70  TIterator* citer = olist->MakeIterator() ;
71  while ((ctype=(RooCatType*)citer->Next())) {
72  mylist->Add(new RooCatType(*ctype)) ;
73  }
74  delete citer ;
75  mylist->SetOwner(kTRUE) ;
76  _altRanges.Add(mylist) ;
77  }
78  delete iter ;
79 }
80 
81 
82 
83 
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Destructor
87 
89 {
90  _altRanges.Delete() ;
91 }
92 
93 
virtual const char * GetName() const
Return name of this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
ClassImp(RooCategorySharedProperties)
STL namespace.
Iterator abstract base class.
Definition: TIterator.h:32
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
A doubly linked list.
Definition: TList.h:47
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:62
void SetName(const char *name)
Definition: TCollection.h:116
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements...
virtual void Add(TObject *obj)
Definition: TList.h:81
virtual TObject * Next()=0
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:603
virtual ~RooCategorySharedProperties()
Destructor.
const Bool_t kTRUE
Definition: Rtypes.h:91