ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
RooDouble.cxx
Go to the documentation of this file.
1
/*****************************************************************************
2
* Project: RooFit *
3
* Package: RooFitCore *
4
* @(#)root/roofitcore:$Id$
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
17
/**
18
\file RooDouble.cxx
19
\class RooDouble
20
\ingroup Roofitcore
21
22
Minimal implementation of a TObject holding a double value.
23
**/
24
25
#include "
RooDouble.h
"
26
27
#include <sstream>
28
#include <string>
29
30
31
32
////////////////////////////////////////////////////////////////////////////////
33
34
RooDouble::RooDouble
(
double
value) :
_value
(value)
35
{
36
std::stringstream ss;
37
ss << value;
38
SetName
(ss.str().c_str());
39
}
40
41
42
////////////////////////////////////////////////////////////////////////////////
43
/// Implement comparison to other TObjects that are also RooDouble
44
/// to facilitate sorting of RooDoubles in a ROOT container.
45
46
Int_t
RooDouble::Compare
(
const
TObject
* other)
const
47
{
48
const
RooDouble
* otherD =
dynamic_cast<
const
RooDouble
*
>
(other) ;
49
if
(!otherD)
return
0 ;
50
return
(
_value
>otherD->
_value
) ? 1 : -1 ;
51
}
RooDouble.h
Int_t
int Int_t
Signed integer 4 bytes (int).
Definition
RtypesCore.h:59
RooDouble::RooDouble
RooDouble()
Default constructor.
Definition
RooDouble.h:26
RooDouble::_value
double _value
Value payload.
Definition
RooDouble.h:50
RooDouble::Compare
Int_t Compare(const TObject *other) const override
Implement comparison to other TObjects that are also RooDouble to facilitate sorting of RooDoubles in...
Definition
RooDouble.cxx:46
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition
TNamed.cxx:149
TObject::TObject
TObject()
TObject constructor.
Definition
TObject.h:259
roofit
roofitcore
src
RooDouble.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1