Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooDouble.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooDouble.h,v 1.8 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_DOUBLE
17#define ROO_DOUBLE
18
19#include "Rtypes.h"
20#include "TNamed.h"
21
22class RooDouble : public TNamed {
23public:
24
25 /// Default constructor
27 } ;
28 RooDouble(double value) ;
29 RooDouble(const RooDouble& other) : TNamed(other), _value(other._value) {}
30 /// Destructor
31 ~RooDouble() override {
32 } ;
33
34 // double cast operator
35 /// Return value of contained double
36 inline operator double() const {
37 return _value ;
38 }
39 /// Return true if contained double equals value
41 _value = value ; return *this ;
42 }
43
44 // Sorting interface ;
45 Int_t Compare(const TObject* other) const override ;
46 /// We are a sortable object
47 bool IsSortable() const override {
48 return true ;
49 }
50
51protected:
52
53 double _value ; ///< Value payload
54 ClassDefOverride(RooDouble,1) // Container class for double
55};
56
57#endif
int Int_t
Definition RtypesCore.h:45
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
RooDouble is a minimal implementation of a TObject holding a double value.
Definition RooDouble.h:22
RooDouble & operator=(double value)
Return true if contained double equals value.
Definition RooDouble.h:40
bool IsSortable() const override
We are a sortable object.
Definition RooDouble.h:47
~RooDouble() override
Destructor.
Definition RooDouble.h:31
RooDouble()
Default constructor.
Definition RooDouble.h:26
double _value
Value payload.
Definition RooDouble.h:53
Int_t Compare(const TObject *other) const override
Implement comparison to other TObjects that are also RooDouble to faciliate sorting of RooDoubles in ...
Definition RooDouble.cxx:48
RooDouble(const RooDouble &other)
Definition RooDouble.h:29
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41