RooCompositeDataStore.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooCompositeDataStore.h 31258 2009-11-17 22:41:06Z 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 #ifndef ROO_COMPOSITE_DATA_STORE
00017 #define ROO_COMPOSITE_DATA_STORE
00018 
00019 #include "RooAbsDataStore.h" 
00020 #include "TString.h"
00021 #include <map>
00022 #include <string>
00023 
00024 class RooAbsArg ;
00025 class RooArgList ;
00026 class RooFormulaVar ;
00027 class RooArgSet ;
00028 class RooCategory ;
00029 
00030 
00031 class RooCompositeDataStore : public RooAbsDataStore {
00032 public:
00033 
00034   RooCompositeDataStore() ; 
00035 
00036   // Ctors from DataStore
00037   RooCompositeDataStore(const char* name, const char* title, const RooArgSet& vars, RooCategory& indexCat, std::map<std::string,RooAbsDataStore*> inputData) ;
00038 
00039   // Empty ctor
00040   virtual RooAbsDataStore* clone(const RooArgSet& vars, const char* newname=0) const { return new RooCompositeDataStore(*this,vars,newname) ; }
00041 
00042   RooCompositeDataStore(const RooCompositeDataStore& other, const char* newname=0) ;
00043   RooCompositeDataStore(const RooCompositeDataStore& other, const RooArgSet& vars, const char* newname=0) ;
00044   virtual ~RooCompositeDataStore() ;
00045 
00046 
00047   // Write current row
00048   virtual Int_t fill() ;
00049 
00050   // Retrieve a row
00051   using RooAbsDataStore::get ;
00052   virtual const RooArgSet* get(Int_t index) const ;
00053   virtual Double_t weight() const ;
00054   virtual Double_t weight(Int_t index) const ;
00055   virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const ;
00056   virtual void weightError(Double_t& lo, Double_t& hi, RooAbsData::ErrorType etype=RooAbsData::Poisson) const ; 
00057   virtual Bool_t isWeighted() const ;
00058 
00059   // Change observable name
00060   virtual Bool_t changeObservableName(const char* from, const char* to) ;
00061   
00062   // Add one or more columns
00063   virtual RooAbsArg* addColumn(RooAbsArg& var, Bool_t adjustRange=kTRUE) ;
00064   virtual RooArgSet* addColumns(const RooArgList& varList) ;
00065 
00066   // Merge column-wise
00067   RooAbsDataStore* merge(const RooArgSet& allvars, std::list<RooAbsDataStore*> dstoreList) ;
00068 
00069   // Add rows 
00070   virtual void append(RooAbsDataStore& other) ;
00071 
00072   // General & bookkeeping methods
00073   virtual Bool_t valid() const ;
00074   virtual Int_t numEntries() const ;
00075   virtual void reset() ;
00076   
00077   // Constant term  optimizer interface
00078   virtual void cacheArgs(const RooAbsArg* owner, RooArgSet& varSet, const RooArgSet* nset=0) ;
00079   virtual const RooAbsArg* cacheOwner() { return 0 ; }
00080   virtual void setArgStatus(const RooArgSet& set, Bool_t active) ;
00081   virtual void resetCache() ;
00082   
00083  protected:
00084 
00085   void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) ;
00086 
00087   std::map<std::string,RooAbsDataStore*> _dataMap ;
00088   RooCategory* _indexCat ;
00089   mutable RooAbsDataStore* _curStore ; //! Datastore associated with current event
00090   mutable Int_t _curIndex ; //! Index associated with current event
00091 
00092   ClassDef(RooCompositeDataStore,1) // Composite Data Storage class
00093 };
00094 
00095 
00096 #endif

Generated on Tue Jul 5 14:26:07 2011 for ROOT_528-00b_version by  doxygen 1.5.1