Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
35 ClassImp(RooCategorySharedProperties);
36 ;
37 
38 
39 ////////////////////////////////////////////////////////////////////////////////
40 /// Constructor
41 
42 RooCategorySharedProperties::RooCategorySharedProperties()
43 {
44 }
45 
46 
47 ////////////////////////////////////////////////////////////////////////////////
48 /// Constructor with unique-id string
49 
50 RooCategorySharedProperties::RooCategorySharedProperties(const char* uuidstr) : RooSharedProperties(uuidstr)
51 {
52 }
53 
54 
55 
56 
57 
58 ////////////////////////////////////////////////////////////////////////////////
59 
60 RooCategorySharedProperties::RooCategorySharedProperties(const RooCategorySharedProperties& other) :
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 
89 RooCategorySharedProperties::~RooCategorySharedProperties()
90 {
91  _altRanges.Delete() ;
92 }
93 
94