Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsMCStudyModule.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooAbsMCStudyModule.cxx
19\class RooAbsMCStudyModule
20\ingroup Roofitcore
21
22Base class for add-on modules to RooMCStudy that
23can perform additional calculations on each generate+fit cycle managed
24by RooMCStudy.
25
26This class can insert code to be executed before each generation step,
27between the generation and fitting step and after the fitting step.
28Any summary output variables declared in the RooDataSet exported through
29summaryData() is merged with the 'master' summary dataset in RooMCStudy.
30
31Look at RooDLLSignificanceMCSModule for an example of an implementation.
32**/
33
34#include <RooAbsMCStudyModule.h>
35
36#include <RooFitResult.h>
37
39
40
41////////////////////////////////////////////////////////////////////////////////
42/// Constructor
43
44RooAbsMCStudyModule::RooAbsMCStudyModule(const char* name, const char* title) : TNamed(name,title), _mcs(nullptr)
45{
46}
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Copy constructor
51
53{
54}
55
56
57////////////////////////////////////////////////////////////////////////////////
58/// Store reference to RooMCStudy object that this module relates to and call internal module
59/// initialization function
60
62{
63 _mcs = &study ;
64 return initializeInstance() ;
65}
66
68 if (_mcs) return _mcs->refit(inGenSample) ; else return nullptr ;
69}
#define ClassImp(name)
Definition Rtypes.h:382
char name[80]
Definition TGX11.cxx:110
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Base class for add-on modules to RooMCStudy that can perform additional calculations on each generate...
RooMCStudy * _mcs
Pointer to RooMCStudy object module is attached to.
virtual bool initializeInstance()
Initializer called immediately after attachment to RooMCStudy object and initialization of module bas...
RooFit::OwningPtr< RooFitResult > refit(RooAbsData *inGenSample=nullptr)
Refit model using original or specified data sample.
RooAbsMCStudyModule(const char *name, const char *title)
Constructor.
bool doInitializeInstance(RooMCStudy &)
Initializer method called upon attachment to given RooMCStudy object.
Helper class to facilitate Monte Carlo studies such as 'goodness-of-fit' studies, that involve fittin...
Definition RooMCStudy.h:32
RooFit::OwningPtr< RooFitResult > refit(RooAbsData *genSample=nullptr)
Redo fit on 'current' toy sample, or if genSample is not nullptr do fit on given sample instead.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35