Logo ROOT  
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
22Minimal implementation of a TObject holding a double value.
23**/
24
25#include "RooDouble.h"
26#include <string>
27
29
30
31////////////////////////////////////////////////////////////////////////////////
32
34{
35 SetName(Form("%f",value)) ;
36}
37
38
39////////////////////////////////////////////////////////////////////////////////
40/// Implement comparison to other TObjects that are also RooDouble
41/// to facilitate sorting of RooDoubles in a ROOT container.
42
43Int_t RooDouble::Compare(const TObject* other) const
44{
45 const RooDouble* otherD = dynamic_cast<const RooDouble*>(other) ;
46 if (!otherD) return 0 ;
47 return (_value>otherD->_value) ? 1 : -1 ;
48}
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
Minimal implementation of a TObject holding a double value.
Definition RooDouble.h:22
RooDouble()
Default constructor.
Definition RooDouble.h:26
double _value
Value payload.
Definition RooDouble.h:50
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:43
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
Mother of all ROOT objects.
Definition TObject.h:41