RooDouble.cxx

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  * @(#)root/roofitcore:$Id: RooDouble.cxx 36210 2010-10-08 21:59:38Z wouter $
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 
00017 //////////////////////////////////////////////////////////////////////////////
00018 // 
00019 // BEGIN_HTML
00020 // RooDouble is a minimal implementation of a TObject holding a Double_t
00021 // value.
00022 // END_HTML
00023 //
00024 
00025 #include "RooFit.h"
00026 #include "RooDouble.h"
00027 #include <string>
00028 
00029 ClassImp(RooDouble)
00030 ;
00031 
00032 
00033 
00034 //_____________________________________________________________________________
00035 RooDouble::RooDouble(Double_t value) : TNamed(), _value(value) 
00036 {
00037   SetName(Form("%f",value)) ;
00038 }
00039 
00040 
00041 //_____________________________________________________________________________
00042 Int_t RooDouble::Compare(const TObject* other) const 
00043 {
00044   // Implement comparison to other TObjects that are also RooDouble
00045   // to faciliate sorting of RooDoubles in a ROOT container
00046 
00047   const RooDouble* otherD = dynamic_cast<const RooDouble*>(other) ;
00048   if (!otherD) return 0 ;
00049   return (_value>otherD->_value) ? 1 : -1 ;
00050 }

Generated on Tue Jul 5 15:06:28 2011 for ROOT_528-00b_version by  doxygen 1.5.1