ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooSuperCategory.h,v 1.17 2007/05/11 09:11:30 verkerke Exp $
 * 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)             *
 *****************************************************************************/
#ifndef ROO_SUPER_CATEGORY
#define ROO_SUPER_CATEGORY

class TObject ;
#include "RooAbsCategoryLValue.h"
#include "RooCatType.h"
#include "RooArgSet.h"
#include "RooSetProxy.h"
 

class RooSuperCategory : public RooAbsCategoryLValue {
public:
  // Constructors etc.
  inline RooSuperCategory() { _catIter = _catSet.createIterator() ; }
  RooSuperCategory(const char *name, const char *title, const RooArgSet& inputCatList);
  RooSuperCategory(const RooSuperCategory& other, const char *name=0) ;
  virtual TObject* clone(const char* newname) const { return new RooSuperCategory(*this,newname); }
  virtual ~RooSuperCategory();

  virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE) ;
  virtual Bool_t setLabel(const char* label, Bool_t printError=kTRUE) ;

  // Printing interface (human readable)
  virtual void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;

  // I/O streaming interface (machine readable)
  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
  virtual void writeToStream(ostream& os, Bool_t compact) const ;

  TIterator* MakeIterator() const ;
  const RooArgSet& inputCatList() const { return _catSet ; }

  virtual Bool_t inRange(const char* rangeName) const ;
  virtual Bool_t hasRange(const char* rangeName) const ;

protected:

  Bool_t setType(const RooCatType* type, Bool_t prinError=kTRUE) ;
  void updateIndexList() ;
  TString currentLabel() const ;

  RooSetProxy _catSet ; // Set of input category
  TIterator* _catIter ; //! Iterator over set of input categories
  
  virtual RooCatType evaluate() const ; 

  ClassDef(RooSuperCategory,1) // Lvalue product operator for catategory lvalues
};

#endif
 RooSuperCategory.h:1
 RooSuperCategory.h:2
 RooSuperCategory.h:3
 RooSuperCategory.h:4
 RooSuperCategory.h:5
 RooSuperCategory.h:6
 RooSuperCategory.h:7
 RooSuperCategory.h:8
 RooSuperCategory.h:9
 RooSuperCategory.h:10
 RooSuperCategory.h:11
 RooSuperCategory.h:12
 RooSuperCategory.h:13
 RooSuperCategory.h:14
 RooSuperCategory.h:15
 RooSuperCategory.h:16
 RooSuperCategory.h:17
 RooSuperCategory.h:18
 RooSuperCategory.h:19
 RooSuperCategory.h:20
 RooSuperCategory.h:21
 RooSuperCategory.h:22
 RooSuperCategory.h:23
 RooSuperCategory.h:24
 RooSuperCategory.h:25
 RooSuperCategory.h:26
 RooSuperCategory.h:27
 RooSuperCategory.h:28
 RooSuperCategory.h:29
 RooSuperCategory.h:30
 RooSuperCategory.h:31
 RooSuperCategory.h:32
 RooSuperCategory.h:33
 RooSuperCategory.h:34
 RooSuperCategory.h:35
 RooSuperCategory.h:36
 RooSuperCategory.h:37
 RooSuperCategory.h:38
 RooSuperCategory.h:39
 RooSuperCategory.h:40
 RooSuperCategory.h:41
 RooSuperCategory.h:42
 RooSuperCategory.h:43
 RooSuperCategory.h:44
 RooSuperCategory.h:45
 RooSuperCategory.h:46
 RooSuperCategory.h:47
 RooSuperCategory.h:48
 RooSuperCategory.h:49
 RooSuperCategory.h:50
 RooSuperCategory.h:51
 RooSuperCategory.h:52
 RooSuperCategory.h:53
 RooSuperCategory.h:54
 RooSuperCategory.h:55
 RooSuperCategory.h:56
 RooSuperCategory.h:57
 RooSuperCategory.h:58
 RooSuperCategory.h:59
 RooSuperCategory.h:60
 RooSuperCategory.h:61
 RooSuperCategory.h:62
 RooSuperCategory.h:63
 RooSuperCategory.h:64
 RooSuperCategory.h:65