ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooAbsHiddenReal.h,v 1.10 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_ABS_HIDDEN_REAL
#define ROO_ABS_HIDDEN_REAL

class RooArgSet ;
#include "RooAbsReal.h"
#include "RooCategoryProxy.h"

class RooCategory ;

class RooAbsHiddenReal : public RooAbsReal {
public:
  // Constructors, assignment etc.
  inline RooAbsHiddenReal() { 
    // Default constructor
  }
  RooAbsHiddenReal(const char *name, const char *title, const char *unit= "") ;
  RooAbsHiddenReal(const char *name, const char *title, RooAbsCategory& blindState, const char *unit= "") ;
  RooAbsHiddenReal(const RooAbsHiddenReal& other, const char* name=0) ;
  virtual ~RooAbsHiddenReal();
  
  // 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 ;

  // Printing interface (human readable)
  virtual void printValue(ostream& stream) const ;
  
  inline Bool_t isHidden() const { 
    // If true, hiding mode is active
    return _state.arg().getIndex()!=0 ; 
  }

  Double_t getHiddenVal(const RooArgSet* nset=0) const { 
    // Bypass accessor to function value that also works in hidden mode
    return RooAbsReal::getVal(nset) ; 
  }

protected:

  // This is dubious from a C++ point of view, but it blocks the interactive user
  // from accidentally calling getVal() without explicit cast, which is the whole
  // point of this class
  virtual Double_t getVal(const RooArgSet* nset=0) const { 
    // Forward call to RooAbsReal
    return RooAbsReal::getVal(nset) ; 
  }

  static RooCategory* _dummyBlindState ; 
  RooAbsCategory& dummyBlindState() const ;

  RooCategoryProxy _state ; // Proxy to hiding state category

  ClassDef(RooAbsHiddenReal,1) // Abstract hidden real-valued variable
};

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