Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
22 class RooDouble : public TNamed {
23 public:
24 
25  RooDouble() : _value(0) {
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  }
39  RooDouble& operator=(Double_t value) {
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 
51 protected:
52 
53  Double_t _value ; // Value payload
54  ClassDef(RooDouble,1) // Container class for Double_t
55 };
56 
57 #endif