/usr/include/root/RooMCStudy.h is in libroot-roofit-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | /*****************************************************************************
* Project: RooFit *
* Package: RooFitCore *
* File: $Id: RooMCStudy.h,v 1.18 2007/05/11 10:14:56 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_MC_STUDY
#define ROO_MC_STUDY
#include "TList.h"
#include "TNamed.h"
#include "RooArgSet.h"
#include <list>
class RooAbsPdf;
class RooDataSet ;
class RooAbsData ;
class RooAbsGenContext ;
class RooFitResult ;
class RooPlot ;
class RooRealVar ;
class RooAbsMCStudyModule ;
class RooMCStudy : public TNamed {
public:
RooMCStudy(const RooAbsPdf& model, const RooArgSet& observables,
const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),
const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooMCStudy(const RooAbsPdf& genModel, const RooAbsPdf& fitModel,
const RooArgSet& dependents, const char* genOptions="",
const char* fitOptions="", const RooDataSet* genProtoData=0,
const RooArgSet& projDeps=RooArgSet()) ;
virtual ~RooMCStudy() ;
// Method to add study modules
void addModule(RooAbsMCStudyModule& module) ;
// Run methods
Bool_t generateAndFit(Int_t nSamples, Int_t nEvtPerSample=0, Bool_t keepGenData=kFALSE, const char* asciiFilePat=0) ;
Bool_t generate(Int_t nSamples, Int_t nEvtPerSample=0, Bool_t keepGenData=kFALSE, const char* asciiFilePat=0) ;
Bool_t fit(Int_t nSamples, const char* asciiFilePat) ;
Bool_t fit(Int_t nSamples, TList& dataSetList) ;
Bool_t addFitResult(const RooFitResult& fr) ;
// Result accessors
const RooArgSet* fitParams(Int_t sampleNum) const ;
const RooFitResult* fitResult(Int_t sampleNum) const ;
const RooAbsData* genData(Int_t sampleNum) const ;
const RooDataSet& fitParDataSet() ;
const RooDataSet* genParDataSet() const {
// Return dataset with generator parameters for each toy. When constraints are used these
// may generally not be the same
return _genParData ;
}
// Plot methods
RooPlot* plotParamOn(RooPlot* frame, const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotParam(const RooRealVar& param, const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotParam(const char* paramName, const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotNLL(const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotError(const RooRealVar& param, const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotPull(const RooRealVar& param, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg::none(),
const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(),
const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(),
const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) ;
RooPlot* plotNLL(Double_t lo, Double_t hi, Int_t nBins=100) ;
RooPlot* plotError(const RooRealVar& param, Double_t lo, Double_t hi, Int_t nbins=100) ;
RooPlot* plotPull(const RooRealVar& param, Double_t lo=-3.0, Double_t hi=3.0, Int_t nbins=25, Bool_t fitGauss=kFALSE) ;
protected:
friend class RooAbsMCStudyModule ;
RooPlot* makeFrameAndPlotCmd(const RooRealVar& param, RooLinkedList& cmdList, Bool_t symRange=kFALSE) const ;
Bool_t run(Bool_t generate, Bool_t fit, Int_t nSamples, Int_t nEvtPerSample, Bool_t keepGenData, const char* asciiFilePat) ;
Bool_t fitSample(RooAbsData* genSample) ;
RooFitResult* doFit(RooAbsData* genSample) ;
void calcPulls() ;
RooAbsData* _genSample ; // Currently generated sample
RooAbsPdf* _genModel ; // Generator model
RooAbsGenContext* _genContext ; // Generator context
RooArgSet* _genInitParams ; // List of originalgenerator parameters
RooArgSet* _genParams ; // List of actual generator parameters
const RooDataSet* _genProtoData ; // Generator prototype data set
RooArgSet _projDeps ; // List of projected dependents in fit
RooAbsPdf* _constrPdf ; // Constraints p.d.f
RooAbsGenContext* _constrGenContext ; // Generator context for constraints p.d.f
RooArgSet _dependents ; // List of dependents
RooArgSet _allDependents ; // List of generate + prototype dependents
RooAbsPdf* _fitModel ; // Fit model
RooArgSet* _fitInitParams ; // List of initial values of fit parameters
RooArgSet* _fitParams ; // List of actual fit parameters
RooRealVar* _nllVar ;
RooRealVar* _ngenVar ;
TList _genDataList ; // List of generated data sample
TList _fitResList ; // List of RooFitResult fit output objects
RooDataSet* _genParData ; // List of of generated parameters of each sample
RooDataSet* _fitParData ; // Data set of fit parameters of each sample
TString _fitOptions ; // Fit options string
RooLinkedList _fitOptList ; // Fit option command list
Bool_t _extendedGen ; // Add poisson term to number of events to generate?
Bool_t _binGenData ; // Bin data between generating and fitting
Double_t _nExpGen ; // Number of expected events to generate in extended mode
Bool_t _randProto ; // Randomize order of prototype data access
Bool_t _canAddFitResults ; // Allow adding of external fit results?
Bool_t _verboseGen ; // Verbose generation?
Bool_t _perExptGenParams ; // Do generation parameter change per event?
Bool_t _silence ; // Silent running mode?
std::list<RooAbsMCStudyModule*> _modList ; // List of additional study modules ;
// Utilities for modules ;
RooFitResult* refit(RooAbsData* genSample=0) ;
void resetFitParams() ;
private:
RooMCStudy(const RooMCStudy&) ;
ClassDef(RooMCStudy,0) // A general purpose toy Monte Carlo study manager
} ;
#endif
|