Logo ROOT  
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 \file RooDouble.cxx
19 \class RooDouble
20 \ingroup Roofitcore
21 
22 RooDouble is a minimal implementation of a TObject holding a Double_t
23 value.
24 **/
25 
26 #include "RooFit.h"
27 #include "RooDouble.h"
28 #include <string>
29 
30 using namespace std;
31 
33 ;
34 
35 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 
39 RooDouble::RooDouble(Double_t value) : TNamed(), _value(value)
40 {
41  SetName(Form("%f",value)) ;
42 }
43 
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Implement comparison to other TObjects that are also RooDouble
47 /// to faciliate sorting of RooDoubles in a ROOT container
48 
49 Int_t RooDouble::Compare(const TObject* other) const
50 {
51  const RooDouble* otherD = dynamic_cast<const RooDouble*>(other) ;
52  if (!otherD) return 0 ;
53  return (_value>otherD->_value) ? 1 : -1 ;
54 }
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
RooFit.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
RooDouble::_value
Double_t _value
Definition: RooDouble.h:67
RooDouble
Definition: RooDouble.h:22
TNamed
Definition: TNamed.h:29
Double_t
double Double_t
Definition: RtypesCore.h:59
RooDouble::RooDouble
RooDouble()
Definition: RooDouble.h:39
TObject
Definition: TObject.h:37
RooDouble.h
RooDouble::Compare
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
int