Logo ROOT   6.14/05
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 \file RooCategorySharedProperties.cxx
19 \class RooCategorySharedProperties
20 \ingroup Roofitcore
21 
22 RooCategorySharedProperties is the container for all properties
23 that are shared between instance of RooCategory objects that
24 are clones of each other. At present the only property that is
25 shared in this way is the list of alternate named range definitions
26 **/
27 
28 #include "RooFit.h"
30 #include "TList.h"
31 #include "RooCatType.h"
32 #include <iostream>
33 using namespace std ;
34 
36 ;
37 
38 
39 ////////////////////////////////////////////////////////////////////////////////
40 /// Constructor
41 
43 {
44 }
45 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// Constructor with unique-id string
49 
51 {
52 }
53 
54 
55 
56 
57 
58 ////////////////////////////////////////////////////////////////////////////////
59 
61  RooSharedProperties(other)
62 {
63  cout << "RooCategorySharedProperties::cctor()" << endl ;
64  // Copy constructor
65  TIterator* iter = other._altRanges.MakeIterator() ;
66  TList* olist ;
67  while((olist=(TList*)iter->Next())) {
68  TList* mylist = new TList ;
69  mylist->SetName(olist->GetName()) ;
70  RooCatType* ctype ;
71  TIterator* citer = olist->MakeIterator() ;
72  while ((ctype=(RooCatType*)citer->Next())) {
73  mylist->Add(new RooCatType(*ctype)) ;
74  }
75  delete citer ;
76  mylist->SetOwner(kTRUE) ;
77  _altRanges.Add(mylist) ;
78  }
79  delete iter ;
80 }
81 
82 
83 
84 
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 /// Destructor
88 
90 {
91  _altRanges.Delete() ;
92 }
93 
94 
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
RooCategorySharedProperties is the container for all properties that are shared between instance of R...
STL namespace.
Iterator abstract base class.
Definition: TIterator.h:30
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition: RooCatType.h:22
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:718
A doubly linked list.
Definition: TList.h:44
Class RooSharedProperties is the base class for shared properties that can be stored in RooSharedProp...
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:62
void SetName(const char *name)
Definition: TCollection.h:204
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements...
#define ClassImp(name)
Definition: Rtypes.h:359
virtual void Add(TObject *obj)
Definition: TList.h:87
TIterator * MakeIterator(Bool_t dir=kTRUE) const
Return an iterator over this list.
virtual TObject * Next()=0
virtual ~RooCategorySharedProperties()
Destructor.
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual const char * GetName() const
Return name of this collection.