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