ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooThresholdCategory.h,v 1.8 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_THRESHOLD_CATEGORY
#define ROO_THRESHOLD_CATEGORY

#include "TSortedList.h"
#include "RooAbsCategory.h"
#include "RooRealProxy.h"
#include "RooCatType.h"

class RooThresholdCategory : public RooAbsCategory {

public:
  // Constructors etc.
  inline RooThresholdCategory() { }
  RooThresholdCategory(const char *name, const char *title, RooAbsReal& inputVar, const char* defCatName="Default", Int_t defCatIdx=0);
  RooThresholdCategory(const RooThresholdCategory& other, const char *name=0) ;
  virtual TObject* clone(const char* newname) const { return new RooThresholdCategory(*this, newname); }
  virtual ~RooThresholdCategory();

  // Mapping function
  Bool_t addThreshold(Double_t upperLimit, const char* catName, Int_t catIdx=-99999) ;

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

  void writeToStream(std::ostream& os, Bool_t compact) const ;

protected:
  
  RooRealProxy _inputVar ;
  RooCatType* _defCat ;
  TSortedList _threshList ;
  TIterator* _threshIter ; //! do not persist 

  virtual RooCatType evaluate() const ; 

  ClassDef(RooThresholdCategory,1) // Real-to-Category function defined by series of threshold
};

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