Logo ROOT  
Reference Guide
RooAbsHiddenReal.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAbsHiddenReal.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_ABS_HIDDEN_REAL
17 #define ROO_ABS_HIDDEN_REAL
18 
19 class RooArgSet ;
20 #include "RooAbsReal.h"
21 #include "RooCategoryProxy.h"
22 
23 class RooCategory ;
24 
25 class RooAbsHiddenReal : public RooAbsReal {
26 public:
27  // Constructors, assignment etc.
28  inline RooAbsHiddenReal() {
29  // Default constructor
30  }
31  RooAbsHiddenReal(const char *name, const char *title, const char *unit= "") ;
32  RooAbsHiddenReal(const char *name, const char *title, RooAbsCategory& blindState, const char *unit= "") ;
33  RooAbsHiddenReal(const RooAbsHiddenReal& other, const char* name=0) ;
34  virtual ~RooAbsHiddenReal();
35 
36  // I/O streaming interface (machine readable)
37  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
38  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
39 
40  // Printing interface (human readable)
41  virtual void printValue(std::ostream& stream) const ;
42 
43  inline Bool_t isHidden() const {
44  // If true, hiding mode is active
45  return _state.arg().getCurrentIndex()!=0 ;
46  }
47 
48  Double_t getHiddenVal(const RooArgSet* nset=0) const {
49  // Bypass accessor to function value that also works in hidden mode
50  return RooAbsReal::getVal(nset) ;
51  }
52 
53 protected:
54 
55  // This is dubious from a C++ point of view, but it blocks the interactive user
56  // from accidentally calling getVal() without explicit cast, which is the whole
57  // point of this class
58  virtual Double_t getValV(const RooArgSet* nset=0) const {
59  // Forward call to RooAbsReal
60  return RooAbsReal::getValV(nset) ;
61  }
62 
65 
66  RooCategoryProxy _state ; // Proxy to hiding state category
67 
68  ClassDef(RooAbsHiddenReal,1) // Abstract hidden real-valued variable
69 };
70 
71 #endif
RooAbsReal.h
RooAbsCategory::getCurrentIndex
virtual value_type getCurrentIndex() const
Return index number of current state.
Definition: RooAbsCategory.cxx:114
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:259
RooAbsReal::getValV
virtual Double_t getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
Definition: RooAbsReal.cxx:276
RooAbsHiddenReal::readFromStream
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Special version of readFromStream that disallows reading from stream.
Definition: RooAbsHiddenReal.cxx:101
RooAbsReal::getVal
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:91
RooAbsHiddenReal::_state
RooCategoryProxy _state
Definition: RooAbsHiddenReal.h:66
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
bool
RooAbsCategory
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
Definition: RooAbsCategory.h:37
RooAbsHiddenReal::dummyBlindState
RooAbsCategory & dummyBlindState() const
Return reference to internal dummy RooCategory implementation blinding state switch.
Definition: RooAbsHiddenReal.cxx:133
RooAbsHiddenReal::_dummyBlindState
static RooCategory * _dummyBlindState
Definition: RooAbsHiddenReal.h:63
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsHiddenReal
RooAbsHiddenReal is a base class for objects that want to hide their return value from interactive us...
Definition: RooAbsHiddenReal.h:25
RooAbsHiddenReal::RooAbsHiddenReal
RooAbsHiddenReal()
Definition: RooAbsHiddenReal.h:28
RooCategoryProxy.h
RooAbsHiddenReal::isHidden
Bool_t isHidden() const
Definition: RooAbsHiddenReal.h:43
RooTemplateProxy< RooAbsCategory >
RooAbsHiddenReal::~RooAbsHiddenReal
virtual ~RooAbsHiddenReal()
Destructor.
Definition: RooAbsHiddenReal.cxx:82
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsHiddenReal::writeToStream
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Special version of writeToStream that disallows reading from stream.
Definition: RooAbsHiddenReal.cxx:117
RooCategory
RooCategory is an object to represent discrete states.
Definition: RooCategory.h:27
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooAbsHiddenReal::getHiddenVal
Double_t getHiddenVal(const RooArgSet *nset=0) const
Definition: RooAbsHiddenReal.h:48
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooAbsHiddenReal::printValue
virtual void printValue(std::ostream &stream) const
Special version of printValue that doesn't reveal the objects value.
Definition: RooAbsHiddenReal.cxx:91
RooAbsHiddenReal::getValV
virtual Double_t getValV(const RooArgSet *nset=0) const
Return value of object.
Definition: RooAbsHiddenReal.h:58
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29