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 
21 RooCategorySharedProperties is the container for all properties
22 that are shared between instance of RooCategory objects that
23 are clones of each other. At present the only property that is
24 shared 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 
35 using 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 
63  RooSharedProperties(other)
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 {
93  _altRanges.Delete() ;
94 }
95 
96 
RooLinkedList::MakeIterator
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
Definition: RooLinkedList.cxx:747
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooFit.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
RooCategorySharedProperties
Definition: RooCategorySharedProperties.h:22
RooCategorySharedProperties::RooCategorySharedProperties
RooCategorySharedProperties()
Constructor.
Definition: RooCategorySharedProperties.cxx:44
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TList.h
RooSharedProperties
Definition: RooSharedProperties.h:23
RooCategorySharedProperties::_altRanges
RooLinkedList _altRanges
Definition: RooCategorySharedProperties.h:50
TIterator
Definition: TIterator.h:30
RooCategorySharedProperties.h
TList::MakeIterator
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:721
RooLinkedList::Add
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:62
TIterator::Next
virtual TObject * Next()=0
RooCategorySharedProperties::~RooCategorySharedProperties
virtual ~RooCategorySharedProperties()
Destructor.
Definition: RooCategorySharedProperties.cxx:91
TCollection::SetName
void SetName(const char *name)
Definition: TCollection.h:204
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
RooCatType
Definition: RooCatTypeLegacy.h:23
RooCatTypeLegacy.h
TCollection::GetName
virtual const char * GetName() const
Return name of this collection.
Definition: TCollection.cxx:351
RooLinkedList::Delete
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
Definition: RooLinkedList.cxx:587
TList
Definition: TList.h:44