GammaCombo  Rev:Unversioneddirectory
Public Member Functions | Public Attributes | Private Member Functions | List of all members
MethodDatasetsProbScan Class Reference

#include <MethodDatasetsProbScan.h>

Inheritance diagram for MethodDatasetsProbScan:
Inheritance graph
[legend]
Collaboration diagram for MethodDatasetsProbScan:
Collaboration graph
[legend]

Public Member Functions

void addFile (TString name)
 
virtual void initScan ()
 
void loadFitResults (TString file)
 
void loadParameterLimits ()
 load Parameter limits by default the "free" limit is loaded, can be changed to "phys" by command line argument More...
 
void loadScanFromFile (TString fileNameBaseIn="default")
 
virtual bool loadScanner (TString fName)
 Save a scanner from plots/scanner. More...
 
 MethodDatasetsProbScan (PDF_Datasets *PDF, OptParser *opt)
 
void plotFitRes (TString fName)
 
virtual void print ()
 Print settings member of MethodDatasetsProbScan. More...
 
virtual int scan1d (bool fast=false, bool reverse=false)
 Perform the 1d Prob scan. More...
 
virtual int scan2d ()
 Perform a 2d Prob scan. More...
 
void setInputFile (TString name)
 
- Public Member Functions inherited from MethodProbScan
float getChi2min (float scanpoint)
 Get the chi2 value of the profile likelihood at a given scan point. More...
 
TH1F * getHChi2min ()
 
 MethodProbScan (Combiner *comb)
 
 MethodProbScan (OptParser *opt)
 
 MethodProbScan ()
 Default constructor. More...
 
void saveSolutions ()
 Find the RooFitResults corresponding to all local minima from the curveResults vector and save them into the solutions vector. More...
 
void saveSolutions2d ()
 Find the RooFitResults corresponding to all local minima from the curveResults2d vector and save them into the solutions vector. More...
 
void setScanDisableDragMode (bool f=true)
 
 ~MethodProbScan ()
 
- Public Member Functions inherited from MethodAbsScan
virtual void calcCLintervals (int CLsType=0)
 Calculate the CL intervals from the CL curve. More...
 
void calcCLintervalsSimple (int CLsType=0)
 
virtual void checkCLs ()
 
void confirmSolutions ()
 Refit all possible solutions with the scan parameter left free to confirm the solutions. More...
 
void doInitialFit (bool force=false)
 Try to find global mininum of the PDF. More...
 
const vector< RooSlimFitResult * > & getAllResults ()
 
OptParsergetArg ()
 
const std::pair< double, double > getBorders (const TGraph &graph, const double confidence_level, bool qubic=false)
 determines the borders of the confidence interval by linear or qubic interpolation. More...
 
const std::pair< double, double > getBorders_CLs (const TGraph &graph, const double confidence_level, bool qubic=false)
 
float getChi2minBkg ()
 
float getChi2minGlobal ()
 
float getCL (double val)
 
CLInterval getCLinterval (int iSol=0, int sigma=1)
 Get the CL interval that includes the best-fit value. More...
 
CLInterval getCLintervalCentral (int sigma=1)
 Get the CL interval that includes the best-fit value. More...
 
CombinergetCombiner () const
 
const vector< RooSlimFitResult * > & getCurveResults ()
 
int getDrawSolution ()
 
bool getFilled ()
 
int getFillStyle ()
 
TH1F * getHchisq ()
 
TH2F * getHchisq2d ()
 
TH1F * getHCL ()
 
TH2F * getHCL2d ()
 
TH1F * getHCLs ()
 
TH2F * getHCLs2d ()
 
TH1F * getHCLsErr1Dn ()
 
TH1F * getHCLsErr1Up ()
 
TH1F * getHCLsErr2Dn ()
 
TH1F * getHCLsErr2Up ()
 
TH1F * getHCLsExp ()
 
TH1F * getHCLsFreq ()
 
int getLineColor ()
 
int getLineStyle ()
 
TString getMethodName () const
 
TString getName () const
 
int getNObservables ()
 
int getNPoints1d ()
 
int getNPoints2dx ()
 
int getNPoints2dy ()
 
const RooArgSet * getObservables ()
 
TString getObsName ()
 
TString getParsName ()
 
RooRealVar * getScanVar1 ()
 
TString getScanVar1Name ()
 
float getScanVar1Solution (int i=0)
 Get value of scan parameter 1 a certain solution. More...
 
RooRealVar * getScanVar2 ()
 
TString getScanVar2Name ()
 
float getScanVar2Solution (int i=0)
 Get value of scan parameter 2 a certain solution (only meaningful for 2d scan). More...
 
float getScanVarSolution (int iVar, int iSol)
 Get value of scan parameter at a certain solution. More...
 
RooSlimFitResultgetSolution (int i=0)
 Return a solution corresponding to a minimum of the profile likelihoood. More...
 
vector< RooSlimFitResult * > getSolutions ()
 
int getTextColor ()
 
const RooArgSet * getTheory ()
 
TString getTitle ()
 
RooWorkspace * getWorkspace ()
 
void loadParameters (RooSlimFitResult *r)
 Load the values given by an (external) fit result. More...
 
bool loadSolution (int i=0)
 Load the values at a specific minimum into the workspace. More...
 
 MethodAbsScan ()
 
 MethodAbsScan (Combiner *c)
 
 MethodAbsScan (OptParser *opt)
 
void plot1d (TString var)
 Make a 1d plot of the NLL in var. More...
 
void plot2d (TString varx, TString vary)
 Make a 2d plot of the PDF in varx and vary. More...
 
void plotOn (OneMinusClPlotAbs *plot, int CLsType=0)
 
void plotPulls (int nSolution=0)
 Make a pull plot of observables corresponding to the given solution. More...
 
void printCLintervals (int CLsType)
 Print CL intervals. More...
 
void printLocalMinima ()
 Print local minima solutions. More...
 
void saveLocalMinima (TString fName="")
 Save local minima solutions. More...
 
void saveScanner (TString fName="")
 Save this scanner to a root file placed into plots/scanner. More...
 
virtual int scan1d ()
 
void setChi2minGlobal (double x)
 Set the global minimum manually. More...
 
void setDrawSolution (int code=0)
 
void setFilled (bool filled)
 
void setFillStyle (int c)
 
void setHchisq (TH1F *h)
 
void setHCL (TH1F *h)
 
void setLineColor (int c)
 
void setLineStyle (int c)
 
void setNPoints1d (int n)
 
void setNPoints2dx (int n)
 
void setNPoints2dy (int n)
 
void setPValueCorrector (PValueCorrection *pvalCor)
 
void setScanVar1 (TString var)
 
void setScanVar2 (TString var)
 
void setSolutions (vector< RooSlimFitResult *> s)
 Helper function to copy over solutions from another scanner. More...
 
void setTextColor (int c)
 
void setTitle (TString s)
 
void setVerbose (bool yesNo=true)
 
void setXscanRange (float min, float max)
 
void setYscanRange (float min, float max)
 
 ~MethodAbsScan ()
 

Public Attributes

RooFitResult * bkgOnlyFitResult
 
std::vector< double > bootstrapPVals
 
TChain * chain
 
RooFitResult * dataFreeFitResult
 
bool drawPlots
 
bool explicitInputFile
 
std::vector< TString > inputFiles
 
PDF_Datasetspdf
 
TH1F * probPValues
 
ToyTreeprobScanTree
 
- Public Attributes inherited from MethodAbsScan
vector< RooSlimFitResult * > allResults
 All fit results we encounter along the scan. More...
 
vector< CLIntervalclintervals1sigma
 all 1 sigma intervals that were found by calcCLintervals() More...
 
vector< CLIntervalclintervals2sigma
 all 2 sigma intervals that were found by calcCLintervals() More...
 
vector< CLIntervalclintervals3sigma
 all 3 sigma intervals that were found by calcCLintervals() More...
 
vector< RooSlimFitResult * > curveResults
 All fit results of the the points that make it into the 1-CL curve. More...
 
vector< vector< RooSlimFitResult * > > curveResults2d
 All fit results of the the points that make it into the 1-CL curve. More...
 
vector< RooSlimFitResult * > solutions
 Local minima filled by saveSolutions() and saveSolutions2d(). More...
 

Private Member Functions

double getPValueTTestStatistic (double test_statistic_value, bool isCLs=false)
 
RooFitResult * loadAndFit (PDF_Datasets *pdf)
 Prepare environment depending on data or toy fit. More...
 
TChain * readFiles (TString fileNameBaseIn="default")
 
void readScan1dTrees (TString fileNameBaseIn="default")
 
void sanityChecks ()
 
void setAndPrintFitStatusConstrainedToys (const ToyTree &toyTree)
 
void setAndPrintFitStatusFreeToys (const ToyTree &toyTree)
 
void sethCLFromProbScanTree ()
 

Additional Inherited Members

- Protected Member Functions inherited from MethodProbScan
bool computeInnerTurnCoords (const int iStart, const int jStart, const int i, const int j, int &iResult, int &jResult, int nTurn)
 Compute coordinates that can be used as coordinates of that fit result, that we want to use as start parameters in the drag mode. More...
 
bool deleteIfNotInCurveResults2d (RooSlimFitResult *r)
 Delete a pointer if it is not included in the curveResults2d vector. More...
 
void sanityChecks ()
 
- Protected Member Functions inherited from MethodAbsScan
void sortSolutions ()
 Sort solutions in order of increasing chi2. More...
 
- Protected Attributes inherited from MethodProbScan
int nScansDone
 
bool scanDisableDragMode
 
- Protected Attributes inherited from MethodAbsScan
OptParserarg
 command line options More...
 
double chi2minBkg
 chi2 value at global minimum More...
 
double chi2minGlobal
 chi2 value at global minimum More...
 
bool chi2minGlobalFound
 flag to avoid finding minimum twice More...
 
Combinercombiner
 the combination More...
 
bool drawFilled
 choose if Histogram is drawn filled or not More...
 
int drawSolution
 Configure how to draw solutions on the plots. More...
 
int fillStyle
 
RooFitResult * globalMin
 parameter values at a global minimum More...
 
TH1F * hChi2min
 histogram for the chi2min values before Prob() More...
 
TH2F * hChi2min2d
 histogram for the chi2min values before Prob() More...
 
TH1F * hCL
 1-CL curve More...
 
TH2F * hCL2d
 1-CL curve More...
 
TH1F * hCLs
 1-CL curve More...
 
TH2F * hCLs2d
 1-CL curve More...
 
TH1F * hCLsErr1Dn
 1-CL curve More...
 
TH1F * hCLsErr1Up
 1-CL curve More...
 
TH1F * hCLsErr2Dn
 1-CL curve More...
 
TH1F * hCLsErr2Up
 1-CL curve More...
 
TH1F * hCLsExp
 1-CL curve More...
 
TH1F * hCLsFreq
 1-CL curve More...
 
int lineColor
 
int lineStyle
 
bool m_initialized
 true if initScan() was called More...
 
bool m_xrangeset
 true if the x range was set manually (setXscanRange()) More...
 
bool m_yrangeset
 true if the y range was set manually (setYscanRange()) More...
 
TString methodName
 Prob, ... More...
 
TString name
 basename, e.g. ggsz More...
 
int nPoints1d
 number of scan points used by 1d scan More...
 
int nPoints2dx
 number of scan points used by 2d scan, x axis More...
 
int nPoints2dy
 number of scan points used by 2d scan, y axis More...
 
int nWarnings
 number of warnings printed in getScanVarSolution() More...
 
RooDataSet * obsDataset
 save the nominal observables so we can restore them after we have fitted toys More...
 
TString obsName
 dataset name of observables, derived from name More...
 
TString parsName
 set name of physics parameters, derived from name More...
 
TString pdfName
 PDF name in workspace, derived from name. More...
 
PValueCorrectionpvalueCorrector
 
bool pvalueCorrectorSet
 
TRandom3 rndm
 
TString scanVar1
 scan parameter More...
 
TString scanVar2
 second scan parameter if we're scanning 2d More...
 
RooDataSet * startPars
 save the start parameter values before any scan More...
 
int textColor
 color used for plotted central values More...
 
TString thName
 set name of theory parameters, derived from name More...
 
TString title
 nice string for the legends More...
 
TString toysName
 set name of parameters to vary in toys More...
 
bool verbose
 
RooWorkspace * w
 

Detailed Description

Definition at line 19 of file MethodDatasetsProbScan.h.

Constructor & Destructor Documentation

§ MethodDatasetsProbScan()

MethodDatasetsProbScan::MethodDatasetsProbScan ( PDF_Datasets PDF,
OptParser opt 
)

Definition at line 15 of file MethodDatasetsProbScan.cpp.

Member Function Documentation

§ addFile()

void MethodDatasetsProbScan::addFile ( TString  name)
inline

Definition at line 33 of file MethodDatasetsProbScan.h.

§ getPValueTTestStatistic()

double MethodDatasetsProbScan::getPValueTTestStatistic ( double  test_statistic_value,
bool  isCLs = false 
)
private

Definition at line 767 of file MethodDatasetsProbScan.cpp.

§ initScan()

void MethodDatasetsProbScan::initScan ( )
virtual

Reimplemented from MethodAbsScan.

Definition at line 61 of file MethodDatasetsProbScan.cpp.

§ loadAndFit()

RooFitResult * MethodDatasetsProbScan::loadAndFit ( PDF_Datasets pdf)
private

Prepare environment depending on data or toy fit.

Parameters
pdfthe pdf that is to be fitted.

Definition at line 306 of file MethodDatasetsProbScan.cpp.

§ loadFitResults()

void MethodDatasetsProbScan::loadFitResults ( TString  file)

Definition at line 214 of file MethodDatasetsProbScan.cpp.

§ loadParameterLimits()

void MethodDatasetsProbScan::loadParameterLimits ( )

load Parameter limits by default the "free" limit is loaded, can be changed to "phys" by command line argument

Definition at line 322 of file MethodDatasetsProbScan.cpp.

§ loadScanFromFile()

void MethodDatasetsProbScan::loadScanFromFile ( TString  fileNameBaseIn = "default")

Definition at line 198 of file MethodDatasetsProbScan.cpp.

§ loadScanner()

bool MethodDatasetsProbScan::loadScanner ( TString  fName)
virtual

Save a scanner from plots/scanner.

It contains the 1-CL histograms and the solutions.

Reimplemented from MethodAbsScan.

Definition at line 793 of file MethodDatasetsProbScan.cpp.

§ plotFitRes()

void MethodDatasetsProbScan::plotFitRes ( TString  fName)

Definition at line 803 of file MethodDatasetsProbScan.cpp.

§ print()

void MethodDatasetsProbScan::print ( )
virtual

Print settings member of MethodDatasetsProbScan.

Reimplemented from MethodAbsScan.

Definition at line 334 of file MethodDatasetsProbScan.cpp.

§ readFiles()

TChain* MethodDatasetsProbScan::readFiles ( TString  fileNameBaseIn = "default")
private

§ readScan1dTrees()

void MethodDatasetsProbScan::readScan1dTrees ( TString  fileNameBaseIn = "default")
private

§ sanityChecks()

void MethodDatasetsProbScan::sanityChecks ( )
private

Definition at line 491 of file MethodDatasetsProbScan.cpp.

§ scan1d()

int MethodDatasetsProbScan::scan1d ( bool  fast = false,
bool  reverse = false 
)
virtual

Perform the 1d Prob scan.

Saves chi2 values and the prob-Scan p-values in a root tree For the datasets stuff, we do not yet have a MethodDatasetsProbScan class, so we do it all in MethodDatasetsProbScan

Parameters
nRunPart of the root tree file name to facilitate parallel production.

Default is "free", if not changed by cmd-line parameter

Reimplemented from MethodProbScan.

Definition at line 361 of file MethodDatasetsProbScan.cpp.

§ scan2d()

int MethodDatasetsProbScan::scan2d ( )
virtual

Perform a 2d Prob scan.

Scan range defined through limit "scan". Fills the hCL2d histogram with the 1-CL curve. Saves all encountered fit results to allResults. Saves the fit results that make it into the 1-CL curve into curveResults2d. Scan strategy: Spiral out!

< number of messages

< number of messages

Reimplemented from MethodProbScan.

Definition at line 509 of file MethodDatasetsProbScan.cpp.

§ setAndPrintFitStatusConstrainedToys()

void MethodDatasetsProbScan::setAndPrintFitStatusConstrainedToys ( const ToyTree toyTree)
private

§ setAndPrintFitStatusFreeToys()

void MethodDatasetsProbScan::setAndPrintFitStatusFreeToys ( const ToyTree toyTree)
private

§ sethCLFromProbScanTree()

void MethodDatasetsProbScan::sethCLFromProbScanTree ( )
private
Todo:
replace this such that there's always one bin per scan point, but still the range is the scan range.
Todo:
Also, if we use the min/max from the tree, we have the problem that they are not exactly the scan range, so that the axis won't show the lowest and highest number.
Todo:
If the scan range was changed after the toys were generate, we absolutely have to derive the range from the root files - else we'll have bining effects.

Definition at line 240 of file MethodDatasetsProbScan.cpp.

§ setInputFile()

void MethodDatasetsProbScan::setInputFile ( TString  name)
inline

Definition at line 32 of file MethodDatasetsProbScan.h.

Member Data Documentation

§ bkgOnlyFitResult

RooFitResult* MethodDatasetsProbScan::bkgOnlyFitResult

Definition at line 44 of file MethodDatasetsProbScan.h.

§ bootstrapPVals

std::vector<double> MethodDatasetsProbScan::bootstrapPVals

Definition at line 41 of file MethodDatasetsProbScan.h.

§ chain

TChain* MethodDatasetsProbScan::chain

Definition at line 42 of file MethodDatasetsProbScan.h.

§ dataFreeFitResult

RooFitResult* MethodDatasetsProbScan::dataFreeFitResult

Definition at line 43 of file MethodDatasetsProbScan.h.

§ drawPlots

bool MethodDatasetsProbScan::drawPlots

Definition at line 38 of file MethodDatasetsProbScan.h.

§ explicitInputFile

bool MethodDatasetsProbScan::explicitInputFile

Definition at line 39 of file MethodDatasetsProbScan.h.

§ inputFiles

std::vector<TString> MethodDatasetsProbScan::inputFiles

Definition at line 40 of file MethodDatasetsProbScan.h.

§ pdf

PDF_Datasets* MethodDatasetsProbScan::pdf

Definition at line 36 of file MethodDatasetsProbScan.h.

§ probPValues

TH1F* MethodDatasetsProbScan::probPValues

Definition at line 37 of file MethodDatasetsProbScan.h.

§ probScanTree

ToyTree* MethodDatasetsProbScan::probScanTree

Definition at line 45 of file MethodDatasetsProbScan.h.


The documentation for this class was generated from the following files: