ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooAddition.h,v 1.3 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_ADDITION
#define ROO_ADDITION

#include "RooAbsReal.h"
#include "RooListProxy.h"

class RooRealVar;
class RooArgList ;

class RooAddition : public RooAbsReal {
public:

  RooAddition() ;
  RooAddition(const char *name, const char *title, const RooArgSet& sumSet, Bool_t takeOwnerShip=kFALSE) ;
  RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2, Bool_t takeOwnerShip=kFALSE) ;
  virtual ~RooAddition() ;

  RooAddition(const RooAddition& other, const char* name = 0);
  virtual TObject* clone(const char* newname) const { return new RooAddition(*this, newname); }

  virtual Double_t defaultErrorLevel() const ;

  void printMetaArgs(ostream& os) const ;

  const RooArgList& list1() const { return _set1 ; }
  const RooArgList& list2() const { return _set2 ; }

protected:

  RooArgList   _ownedList ;       // List of owned components
  RooListProxy _set1 ;            // First set of terms to be summed
  RooListProxy _set2 ;            // Second set of terms to be summed
  mutable TIterator* _setIter1 ;  //! Iterator over set1
  mutable TIterator* _setIter2 ;  //! Iterator over set2

  Double_t evaluate() const;

  ClassDef(RooAddition,1) // Sum of RooAbsReal objects
};

#endif
 RooAddition.h:1
 RooAddition.h:2
 RooAddition.h:3
 RooAddition.h:4
 RooAddition.h:5
 RooAddition.h:6
 RooAddition.h:7
 RooAddition.h:8
 RooAddition.h:9
 RooAddition.h:10
 RooAddition.h:11
 RooAddition.h:12
 RooAddition.h:13
 RooAddition.h:14
 RooAddition.h:15
 RooAddition.h:16
 RooAddition.h:17
 RooAddition.h:18
 RooAddition.h:19
 RooAddition.h:20
 RooAddition.h:21
 RooAddition.h:22
 RooAddition.h:23
 RooAddition.h:24
 RooAddition.h:25
 RooAddition.h:26
 RooAddition.h:27
 RooAddition.h:28
 RooAddition.h:29
 RooAddition.h:30
 RooAddition.h:31
 RooAddition.h:32
 RooAddition.h:33
 RooAddition.h:34
 RooAddition.h:35
 RooAddition.h:36
 RooAddition.h:37
 RooAddition.h:38
 RooAddition.h:39
 RooAddition.h:40
 RooAddition.h:41
 RooAddition.h:42
 RooAddition.h:43
 RooAddition.h:44
 RooAddition.h:45
 RooAddition.h:46
 RooAddition.h:47
 RooAddition.h:48
 RooAddition.h:49
 RooAddition.h:50
 RooAddition.h:51
 RooAddition.h:52
 RooAddition.h:53
 RooAddition.h:54
 RooAddition.h:55
 RooAddition.h:56