Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19class RooArgSet ;
20#include "RooAbsReal.h"
21#include "RooCategoryProxy.h"
22
23class RooCategory ;
24
26public:
27 // Constructors, assignment etc.
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=nullptr) ;
34
35 // I/O streaming interface (machine readable)
36 bool readFromStream(std::istream& is, bool compact, bool verbose=false) override ;
37 void writeToStream(std::ostream& os, bool compact) const override ;
38
39 // Printing interface (human readable)
40 void printValue(std::ostream& stream) const override ;
41
42 inline bool isHidden() const {
43 // If true, hiding mode is active
44 return _state.arg().getCurrentIndex()!=0 ;
45 }
46
47 double getHiddenVal(const RooArgSet* nset=nullptr) const {
48 // Bypass accessor to function value that also works in hidden mode
49 return RooAbsReal::getVal(nset) ;
50 }
51
52protected:
53
54 // This is dubious from a C++ point of view, but it blocks the interactive user
55 // from accidentally calling getVal() without explicit cast, which is the whole
56 // point of this class
57 double getValV(const RooArgSet* nset=nullptr) const override {
58 // Forward call to RooAbsReal
59 return RooAbsReal::getValV(nset) ;
60 }
61
64
65 RooCategoryProxy _state ; // Proxy to hiding state category
66
67 ClassDefOverride(RooAbsHiddenReal,1) // Abstract hidden real-valued variable
68};
69
70#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
char name[80]
Definition TGX11.cxx:110
A space to attach TBranches.
Base class for objects that want to hide their return value from interactive use, e....
double getValV(const RooArgSet *nset=nullptr) const override
Return value of object.
RooCategoryProxy _state
RooAbsCategory & dummyBlindState() const
Return reference to internal dummy RooCategory implementation blinding state switch.
void writeToStream(std::ostream &os, bool compact) const override
Special version of writeToStream that disallows reading from stream.
static RooCategory * _dummyBlindState
bool isHidden() const
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Special version of readFromStream that disallows reading from stream.
double getHiddenVal(const RooArgSet *nset=nullptr) const
void printValue(std::ostream &stream) const override
Special version of printValue that doesn't reveal the objects value.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:103
virtual double getValV(const RooArgSet *normalisationSet=nullptr) const
Return value of object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Object to represent discrete states.
Definition RooCategory.h:28