/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
// 
// BEGIN_HTML
// RooCategorySharedProperties is the container for all properties
// that are shared between instance of RooCategory objects that
// are clones of each other. At present the only property that is
// shared in this way is the list of alternate named range definitions
// END_HTML
//

#include "RooFit.h"
#include "RooCategorySharedProperties.h"
#include "TList.h"
#include "RooCatType.h"
#include <iostream>
using namespace std ;

ClassImp(RooCategorySharedProperties)
;


//_____________________________________________________________________________
RooCategorySharedProperties::RooCategorySharedProperties()
{
  // Constructor
} 


//_____________________________________________________________________________
RooCategorySharedProperties::RooCategorySharedProperties(const char* uuidstr) : RooSharedProperties(uuidstr)
{
  // Constructor with unique-id string
} 





//_____________________________________________________________________________
RooCategorySharedProperties::RooCategorySharedProperties(const RooCategorySharedProperties& other) :
  RooSharedProperties(other)
{
  cout << "RooCategorySharedProperties::cctor()" << endl ;
  // Copy constructor
  TIterator* iter = other._altRanges.MakeIterator() ;
  TList* olist ;
  while((olist=(TList*)iter->Next())) {
    TList* mylist = new TList ; 
    mylist->SetName(olist->GetName()) ;
    RooCatType* ctype ;
    TIterator* citer = olist->MakeIterator() ;    
    while ((ctype=(RooCatType*)citer->Next())) {
      mylist->Add(new RooCatType(*ctype)) ;
    }
    delete citer ;
    mylist->SetOwner(kTRUE) ;
    _altRanges.Add(mylist) ;
  }
  delete iter ;
}





//_____________________________________________________________________________
RooCategorySharedProperties::~RooCategorySharedProperties() 
{
  // Destructor
  _altRanges.Delete() ;
} 


 RooCategorySharedProperties.cxx:1
 RooCategorySharedProperties.cxx:2
 RooCategorySharedProperties.cxx:3
 RooCategorySharedProperties.cxx:4
 RooCategorySharedProperties.cxx:5
 RooCategorySharedProperties.cxx:6
 RooCategorySharedProperties.cxx:7
 RooCategorySharedProperties.cxx:8
 RooCategorySharedProperties.cxx:9
 RooCategorySharedProperties.cxx:10
 RooCategorySharedProperties.cxx:11
 RooCategorySharedProperties.cxx:12
 RooCategorySharedProperties.cxx:13
 RooCategorySharedProperties.cxx:14
 RooCategorySharedProperties.cxx:15
 RooCategorySharedProperties.cxx:16
 RooCategorySharedProperties.cxx:17
 RooCategorySharedProperties.cxx:18
 RooCategorySharedProperties.cxx:19
 RooCategorySharedProperties.cxx:20
 RooCategorySharedProperties.cxx:21
 RooCategorySharedProperties.cxx:22
 RooCategorySharedProperties.cxx:23
 RooCategorySharedProperties.cxx:24
 RooCategorySharedProperties.cxx:25
 RooCategorySharedProperties.cxx:26
 RooCategorySharedProperties.cxx:27
 RooCategorySharedProperties.cxx:28
 RooCategorySharedProperties.cxx:29
 RooCategorySharedProperties.cxx:30
 RooCategorySharedProperties.cxx:31
 RooCategorySharedProperties.cxx:32
 RooCategorySharedProperties.cxx:33
 RooCategorySharedProperties.cxx:34
 RooCategorySharedProperties.cxx:35
 RooCategorySharedProperties.cxx:36
 RooCategorySharedProperties.cxx:37
 RooCategorySharedProperties.cxx:38
 RooCategorySharedProperties.cxx:39
 RooCategorySharedProperties.cxx:40
 RooCategorySharedProperties.cxx:41
 RooCategorySharedProperties.cxx:42
 RooCategorySharedProperties.cxx:43
 RooCategorySharedProperties.cxx:44
 RooCategorySharedProperties.cxx:45
 RooCategorySharedProperties.cxx:46
 RooCategorySharedProperties.cxx:47
 RooCategorySharedProperties.cxx:48
 RooCategorySharedProperties.cxx:49
 RooCategorySharedProperties.cxx:50
 RooCategorySharedProperties.cxx:51
 RooCategorySharedProperties.cxx:52
 RooCategorySharedProperties.cxx:53
 RooCategorySharedProperties.cxx:54
 RooCategorySharedProperties.cxx:55
 RooCategorySharedProperties.cxx:56
 RooCategorySharedProperties.cxx:57
 RooCategorySharedProperties.cxx:58
 RooCategorySharedProperties.cxx:59
 RooCategorySharedProperties.cxx:60
 RooCategorySharedProperties.cxx:61
 RooCategorySharedProperties.cxx:62
 RooCategorySharedProperties.cxx:63
 RooCategorySharedProperties.cxx:64
 RooCategorySharedProperties.cxx:65
 RooCategorySharedProperties.cxx:66
 RooCategorySharedProperties.cxx:67
 RooCategorySharedProperties.cxx:68
 RooCategorySharedProperties.cxx:69
 RooCategorySharedProperties.cxx:70
 RooCategorySharedProperties.cxx:71
 RooCategorySharedProperties.cxx:72
 RooCategorySharedProperties.cxx:73
 RooCategorySharedProperties.cxx:74
 RooCategorySharedProperties.cxx:75
 RooCategorySharedProperties.cxx:76
 RooCategorySharedProperties.cxx:77
 RooCategorySharedProperties.cxx:78
 RooCategorySharedProperties.cxx:79
 RooCategorySharedProperties.cxx:80
 RooCategorySharedProperties.cxx:81
 RooCategorySharedProperties.cxx:82
 RooCategorySharedProperties.cxx:83
 RooCategorySharedProperties.cxx:84
 RooCategorySharedProperties.cxx:85
 RooCategorySharedProperties.cxx:86
 RooCategorySharedProperties.cxx:87
 RooCategorySharedProperties.cxx:88
 RooCategorySharedProperties.cxx:89