RooAbsHiddenReal.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAbsHiddenReal.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_ABS_HIDDEN_REAL
00017 #define ROO_ABS_HIDDEN_REAL
00018 
00019 class RooArgSet ;
00020 #include "RooAbsReal.h"
00021 #include "RooCategoryProxy.h"
00022 
00023 class RooCategory ;
00024 
00025 class RooAbsHiddenReal : public RooAbsReal {
00026 public:
00027   // Constructors, assignment etc.
00028   inline RooAbsHiddenReal() { 
00029     // Default constructor
00030   }
00031   RooAbsHiddenReal(const char *name, const char *title, const char *unit= "") ;
00032   RooAbsHiddenReal(const char *name, const char *title, RooAbsCategory& blindState, const char *unit= "") ;
00033   RooAbsHiddenReal(const RooAbsHiddenReal& other, const char* name=0) ;
00034   virtual ~RooAbsHiddenReal();
00035   
00036   // I/O streaming interface (machine readable)
00037   virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
00038   virtual void writeToStream(ostream& os, Bool_t compact) const ;
00039 
00040   // Printing interface (human readable)
00041   virtual void printValue(ostream& stream) const ;
00042   
00043   inline Bool_t isHidden() const { 
00044     // If true, hiding mode is active
00045     return _state.arg().getIndex()!=0 ; 
00046   }
00047 
00048   Double_t getHiddenVal(const RooArgSet* nset=0) const { 
00049     // Bypass accessor to function value that also works in hidden mode
00050     return RooAbsReal::getVal(nset) ; 
00051   }
00052 
00053 protected:
00054 
00055   // This is dubious from a C++ point of view, but it blocks the interactive user
00056   // from accidentally calling getVal() without explicit cast, which is the whole
00057   // point of this class
00058   virtual Double_t getVal(const RooArgSet* nset=0) const { 
00059     // Forward call to RooAbsReal
00060     return RooAbsReal::getVal(nset) ; 
00061   }
00062 
00063   static RooCategory* _dummyBlindState ; 
00064   RooAbsCategory& dummyBlindState() const ;
00065 
00066   RooCategoryProxy _state ; // Proxy to hiding state category
00067 
00068   ClassDef(RooAbsHiddenReal,1) // Abstract hidden real-valued variable
00069 };
00070 
00071 #endif

Generated on Tue Jul 5 14:25:59 2011 for ROOT_528-00b_version by  doxygen 1.5.1