00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooDouble.h,v 1.8 2007/05/11 09:11:30 verkerke Exp $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 #ifndef ROO_DOUBLE 00017 #define ROO_DOUBLE 00018 00019 #include "Rtypes.h" 00020 #include "TNamed.h" 00021 00022 class RooDouble : public TNamed { 00023 public: 00024 00025 RooDouble() : _value(0) { 00026 // Default constructor 00027 } ; 00028 RooDouble(Double_t value) ; 00029 RooDouble(const RooDouble& other) : TNamed(other), _value(other._value) {} 00030 virtual ~RooDouble() { 00031 // Destructor 00032 } ; 00033 00034 // Double_t cast operator 00035 inline operator Double_t() const { 00036 // Return value of contained double 00037 return _value ; 00038 } 00039 RooDouble& operator=(Double_t value) { 00040 // Return true if contained double equals value 00041 _value = value ; return *this ; 00042 } 00043 00044 // Sorting interface ; 00045 Int_t Compare(const TObject* other) const ; 00046 virtual Bool_t IsSortable() const { 00047 // We are a sortable object 00048 return kTRUE ; 00049 } 00050 00051 protected: 00052 00053 Double_t _value ; // Value payload 00054 ClassDef(RooDouble,1) // Container class for Double_t 00055 }; 00056 00057 #endif