Logo ROOT   6.08/07
Reference Guide
DetailedOutputAggregator.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Sven Kreiss, Kyle Cranmer Nov 2010
3 /*************************************************************************
4  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOSTATS_DetailedOutputAggregator
12 #define ROOSTATS_DetailedOutputAggregator
13 
14 #ifndef ROOT_TString
15 #include "TString.h"
16 #endif
17 
18 
19 /**
20 
21 This class is designed to aid in the construction of RooDataSets and RooArgSets, particularly those naturally arising in fitting operations. Typically, the usage of this class is as follows:
22 
23 1. create DetailedOutputAggregator instance
24 2. use AppendArgSet to add value sets to be stored as one row of the dataset
25 3. call CommitSet when an entire row's worth of values has been added
26 4. repeat steps 2 and 3 until all rows have been added
27 5. call GetAsDataSet to extract result RooDataSet
28 
29 \ingroup Roostats
30 
31 */
32 
33 class RooAbsCollection;
34 class RooFitResult;
35 class RooDataSet;
36 class RooArgList;
37 class RooArgSet;
38 
39 namespace RooStats {
40 
42 
43  public:
44 
45  // Translate the given fit result to a RooArgSet in a generic way.
46  // Prefix is prepended to all variable names.
47  // Note that the returned set is managed by the user and the user must
48  // explicitly delete all the set content (the returned set does not own the content)
49  static RooArgSet *GetAsArgSet(RooFitResult *result, TString prefix="", bool withErrorsAndPulls=false);
50 
52  fResult = NULL;
53  fBuiltSet = NULL;
54  }
55 
56  // For each variable in aset, prepend prefix to its name and add
57  // to the internal store. Note this will not appear in the produced
58  // dataset unless CommitSet is called.
59  void AppendArgSet(const RooAbsCollection *aset, TString prefix="");
60 
61  const RooArgList* GetAsArgList() const {
62  // Returns this set of detailed output.
63  // Note that the ownership of the returned list is not transfered
64  // It is managed by the DetailedOutputAggregator class
65  return fBuiltSet;
66  }
67 
68  // Commit to the result RooDataSet.
69  void CommitSet(double weight=1.0);
70 
72 
73  virtual ~DetailedOutputAggregator();
74 
75  private:
76 
79 
80  protected:
82  };
83 }
84 
85 #endif
Basic string class.
Definition: TString.h:137
#define ClassDef(name, id)
Definition: Rtypes.h:254
void AppendArgSet(const RooAbsCollection *aset, TString prefix="")
RooDataSet * GetAsDataSet(TString name, TString title)
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
Namespace for the RooStats classes.
Definition: Asimov.h:20
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
#define NULL
Definition: Rtypes.h:82
static RooArgSet * GetAsArgSet(RooFitResult *result, TString prefix="", bool withErrorsAndPulls=false)
double result[121]
char name[80]
Definition: TGX11.cxx:109