Logo ROOT  
Reference Guide
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
26 // Default constructor
27 } ;
28 RooDouble(Double_t value) ;
29 RooDouble(const RooDouble& other) : TNamed(other), _value(other._value) {}
30 virtual ~RooDouble() {
31 // Destructor
32 } ;
33
34 // Double_t cast operator
35 inline operator Double_t() const {
36 // Return value of contained double
37 return _value ;
38 }
40 // 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 ;
46 virtual Bool_t IsSortable() const {
47 // We are a sortable object
48 return kTRUE ;
49 }
50
51protected:
52
53 Double_t _value ; // Value payload
54 ClassDef(RooDouble,1) // Container class for Double_t
55};
56
57#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
RooDouble is a minimal implementation of a TObject holding a Double_t value.
Definition: RooDouble.h:22
virtual Bool_t IsSortable() const
Definition: RooDouble.h:46
virtual ~RooDouble()
Definition: RooDouble.h:30
RooDouble()
Definition: RooDouble.h:25
Double_t _value
Definition: RooDouble.h:53
RooDouble & operator=(Double_t value)
Definition: RooDouble.h:39
Int_t Compare(const TObject *other) const
Implement comparison to other TObjects that are also RooDouble to faciliate sorting of RooDoubles in ...
Definition: RooDouble.cxx:49
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:37