ROOT  6.06/09
Reference Guide
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 //
19 // BEGIN_HTML
20 // RooDouble is a minimal implementation of a TObject holding a Double_t
21 // value.
22 // END_HTML
23 //
24 
25 #include "RooFit.h"
26 #include "RooDouble.h"
27 #include <string>
28 
29 using namespace std;
30 
32 ;
33 
34 
35 
36 ////////////////////////////////////////////////////////////////////////////////
37 
39 {
40  SetName(Form("%f",value)) ;
41 }
42 
43 
44 ////////////////////////////////////////////////////////////////////////////////
45 /// Implement comparison to other TObjects that are also RooDouble
46 /// to faciliate sorting of RooDoubles in a ROOT container
47 
48 Int_t RooDouble::Compare(const TObject* other) const
49 {
50  const RooDouble* otherD = dynamic_cast<const RooDouble*>(other) ;
51  if (!otherD) return 0 ;
52  return (_value>otherD->_value) ? 1 : -1 ;
53 }
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:48
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
int Int_t
Definition: RtypesCore.h:41
STL namespace.
RooDouble()
Definition: RooDouble.h:25
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
char * Form(const char *fmt,...)
ClassImp(RooDouble)
double Double_t
Definition: RtypesCore.h:55
Mother of all ROOT objects.
Definition: TObject.h:58
Double_t _value
Definition: RooDouble.h:53
float value
Definition: math.cpp:443