|
Crombie Tools
|
Class used for making stack plots. More...
#include <PlotStack.h>
Inheritance diagram for PlotStack:Public Member Functions | |
| PlotStack () | |
| virtual | ~PlotStack () |
| PlotStack * | Copy () |
| Copy this PlotStack for parallelization. More... | |
| void | InsertTemplate (TString fileName, TString histName, TString LegendEntry) |
| Insert a histogram from file into the stack plot. More... | |
| void | MakeCanvas (TString FileBase, Int_t NumXBins, Double_t *XBins, TString XLabel, TString YLabel="", Bool_t logY=false) |
| Choose the binning of your plots and make then. More... | |
| void | MakeCanvas (TString FileBase, Int_t NumXBins, Double_t MinX, Double_t MaxX, TString XLabel, TString YLabel="", Bool_t logY=false) |
| Binning with fixed width. More... | |
| void | MakeCanvas (TString FileBase, TString XLabel, TString YLabel="", Bool_t logY=false) |
| Make plots with the PlotPreparer. More... | |
| std::vector< HistHolder * > | MergeHistograms (FileType type, std::vector< TH1D *> hists) |
| Merge a vector of histograms into a vector of HistHolders. More... | |
| void | SetAddSignal (Bool_t add) |
| Use this to set whether the signal sits on top or not. More... | |
| void | SetDebug (Bool_t debug) |
| This dumps out some raw values for you to check yields. More... | |
| void | SetDumpFileName (TString dumpName) |
| Set the name of a .root file to dump the separate histograms used in the plots. More... | |
| void | SetForceTop (TString force) |
| Sets the legend entry that will be on the top of the stack. More... | |
| void | SetHistSuff (TString suff) |
| Set the suffix of dumped histograms. More... | |
| void | SetIgnoreInLinear (Double_t ignore) |
| Set the minimum fraction of backgrounds that are not plotted or mentioned in linear scale. More... | |
| void | SetMinLegendFrac (Double_t frac) |
| Set the minimum fraction of background that shows up on the plot's legend separately. More... | |
| void | SetOthersColor (Color_t color) |
| Set the color of the "Others" legend entry. More... | |
| void | SetPostFitFile (TString file_name, TString region) |
| Use this to get a post-fit line. More... | |
| void | SetSortBackground (Bool_t doSort) |
| Use this to change the automatic sorting of backgrounds based on yields. More... | |
| void | SetSortSignal (Bool_t doSort) |
| Use this to change the automatic sorting of signals based on yields. More... | |
| void | SetStackLineWidth (Int_t width) |
| Set the line width of the stack plots. More... | |
Public Member Functions inherited from PlotPreparer | |
| virtual | ~PlotPreparer () |
| void | AddEnvelopeWeight (TString weight, Int_t index=1) |
| void | AddHist (TString FileBase, Int_t NumXBins, Double_t *XBins, TString dataExpr, TString mcExpr, TString cut, TString dataWeight, TString mcWeight) |
| Add a histogram to plot. More... | |
| void | AddHist (TString FileBase, Int_t NumXBins, Double_t MinX, Double_t MaxX, TString dataExpr, TString mcExpr, TString cut, TString dataWeight, TString mcWeight) |
| Add a histogram to plot. More... | |
| void | StartEnvelope (Bool_t is_up) |
| Start tracking branches for a given envelope. More... | |
Public Member Functions inherited from ParallelRunner | |
| void | SetNumThreads (UInt_t nthreads) |
| Set the number of cores to use in the plotting. More... | |
Public Member Functions inherited from FileConfigReader | |
| FileConfigReader () | |
| virtual | ~FileConfigReader () |
| void | AddDataFile (TString fileName) |
| Add a data file. More... | |
| void | AddFile (TString treeName, TString fileName, Double_t XSec, TString entry="", Int_t colorstyle=0) |
| This is the default MC File adder. More... | |
| void | AddFile (TString treeName, TString fileName, Double_t XSec, TString entry, Int_t colorstyle, FileType type) |
| Default File adder with FileType changing. More... | |
| void | AddFile (TString fileName, Double_t XSec, TString entry, Int_t colorstyle) |
| This is for when you don't care about limit trees and are adding by hand. More... | |
| void | AddFile (TString fileName, Double_t XSec, TString entry, Int_t colorstyle, FileType type) |
| For when you don't care about limit trees and are adding by hand with type changing. More... | |
| FileType | GetFileType () |
| Get the FileType of the current file. More... | |
| void | LoadFitResult (const char *fit_result) |
| Loads the fit result into memory for this stacks to make. More... | |
| void | NameTreesAfterLimits (FileType type=kBackground) |
| Use this function to replace the Legend Entries of the FileInfo with the Limit Tree Names. More... | |
| void | ReadMCConfig (TString config, TString fileDir="") |
| Reads an MC configuration file. More... | |
| void | ReadMCConfig (TString config, FileType type, TString fileDir="") |
| Reads an MC configuration while changing the FileType. More... | |
| void | ResetAllConfig () |
| Resets the information from the config files being held for all types. More... | |
| void | ResetConfig (FileType type=kBackground) |
| Resets the information from the for one type. More... | |
| std::vector< TString > | ReturnFileNames (FileType type=kBackground, TString matchName="", SearchBy search=kLimitName, Bool_t match=true) |
| Returns a vector of file names that have been read from the configs. More... | |
| TChain * | ReturnTChain (TString treeName="events", FileType type=kBackground, TString matchName="", SearchBy search=kLimitName, Bool_t match=true) |
| Returns a TChain of files that match the FileType and name for the LimitTreeMaker. More... | |
| std::set< TString > | ReturnTreeNames (FileType type=kBackground) |
| Returns a vector of limit tree names that have been read from the configs. More... | |
| void | ScaleBackgrounds (TString entry, Double_t scale, SearchBy search=kLimitName, FileType type=kBackground) |
| Scales the cross section of the matching MC samples by a factor of 1.0 + scale, destroying the old cross section in the process. More... | |
| void | SetAllHistName (TString name) |
| Set the all histogram and luminosity for normalization. More... | |
| void | SetDataEntry (TString entry) |
| Set the legend entry for data. More... | |
| void | SetDataExpression (TString expr) |
| Use this to set a different expression for data from MC. More... | |
| void | SetDataTreeName (TString name) |
| Set the tree name for data. More... | |
| void | SetDataWeight (TCut weight) |
| The multipliers for Data can be set separately. More... | |
| void | SetDataWeight (const char *weight) |
| The multipliers for Data can be set separately. More... | |
| void | SetFileType (FileType type) |
| Set the FileType of the next config file read. More... | |
| void | SetKeepAllFiles (Bool_t keep) |
| Allows reader to avoid skipping when reading in exception configs. More... | |
| void | SetLegendColor (TString entry, Int_t color, FileType type=kBackground) |
| Sets the FileInfo with the matching Legend Names to the new colors. More... | |
| void | SetLuminosity (Double_t lum) |
| Set the Luminosity in inverse pb. More... | |
| void | SetMCWeight (TCut weight) |
| The multipliers for MC can be set separately. More... | |
| void | SetMCWeight (const char *weight) |
| The multipliers for MC can be set separately. More... | |
| void | SetTreeName (TString name) |
| Set the tree of the files you are trying to plot. More... | |
Public Member Functions inherited from InOutDirectoryHolder | |
| InOutDirectoryHolder () | |
| virtual | ~InOutDirectoryHolder () |
| TString | GetOutDirectory () const |
| void | SetInputOutputMap (TString input, TString output) |
| Adds a mapping from input to output file name. More... | |
| void | SetOutDirectory (TString dir) |
| Sets the output directory where the files will be written, and adds a "/" if needed. More... | |
| void | SetOverwriteFiles (Bool_t overwrite) |
| Sets whether or not to overwrite files. More... | |
Public Member Functions inherited from InDirectoryHolder | |
| InDirectoryHolder () | |
| virtual | ~InDirectoryHolder () |
| TString | GetInDirectory () const |
| void | SetInDirectory (TString dir) |
| Sets the input directory where the MCFiles will be searched for, and adds a "/" if needed. More... | |
Public Member Functions inherited from Debug | |
| Debug () | |
| virtual | ~Debug () |
| DebugLevel | GetDebugLevel () |
| Gets the verbosity for a class. More... | |
| template<typename T , typename... V> | |
| void | Message (DebugLevel level, T message, V... more) |
| Sends a message if the verbosity level is appropriate. More... | |
| void | Message (DebugLevel level) |
| void | SetDebugLevel (DebugLevel level) |
| Sets the verbosity for a class. More... | |
Public Member Functions inherited from PlotHists | |
| PlotHists () | |
| virtual | ~PlotHists () |
| void | AddUncertainty (UInt_t index, TString FileName, TString HistName, Int_t startBin=1, Int_t endBin=0) |
| Add uncertainty factors to some index of histograms about to be made. More... | |
| void | MakeCanvas (TString FileBase, std::vector< TH1D *> theHists, TString XLabel, TString YLabel, Bool_t logY=false) |
| Simplest of Canvas makers with just histograms as arugments, allowing for user manipulation of histograms. More... | |
| std::vector< TH1D * > | MakeHists (Int_t NumXBins, Double_t *XBins) |
| This just return vectors of histograms for other uses. More... | |
| std::vector< TH1D * > | MakeHists (Int_t NumXBins, Double_t MinX, Double_t MaxX) |
| void | SetEventsPer (Double_t per) |
| We can set events per some value of x so that our legend entry is not wrong and variable binning doesn't look stupid. More... | |
| void | SetNormalizedHists (Bool_t b) |
| We can set normalization to match a particular other hist (or just 1) More... | |
| void | SetNormalizeTo (Int_t to) |
| Set index of which histogram to normalize to. More... | |
| void | SetUncertaintySquared (TString expr) |
| Add uncertainty factors through branch expressions instead of a histogram. More... | |
Public Member Functions inherited from PlotBase | |
| PlotBase () | |
| virtual | ~PlotBase () |
| void | AddCutLine (Double_t loc, bool is_vert=true) |
| Adds a dotted line in order to show cuts. More... | |
| void | AddExpr (TString expr) |
| Set an x expression for a single line. More... | |
| void | AddLegendEntry (TString LegendEntry, Color_t ColorEntry) |
| Set entry and color for each line. This uses the default line width and style. More... | |
| void | AddLegendEntry (TString LegendEntry, Color_t ColorEntry, Int_t LineWidth, Int_t LineStyle) |
| Set entry, color, width, and style for each line. More... | |
| void | AddLine (TTree *tree, TCut cut, TString expr) |
| This function adds a tree pointer, cut, and expression used for generating a line in the plot. More... | |
| void | AddLine (TTree *tree, const char *cut, TString expr) |
| This function adds a tree pointer, cut, and expression used for generating a line in the plot. More... | |
| void | AddRatioLine (Int_t line) |
| Add a line to show in the ratio plot. More... | |
| void | AddSystematicBranch (TString branch) |
| Add branches that contain independent systematic uncertainties to show in the plots. More... | |
| void | AddTree (TTree *tree) |
| Set a tree for a single line. More... | |
| void | AddTreeExpr (TTree *tree, TString expr) |
| Set a tree and expression concurrently for each line. Best used when a default weight is set. More... | |
| void | AddTreeWeight (TTree *tree, TCut cut) |
| Set a tree and weight concurrently for each line. Best used when a default expression is set. More... | |
| void | AddTreeWeight (TTree *tree, const char *cut) |
| Set a tree and weight concurrently for each line. Best used when a default expression is set. More... | |
| void | AddWeight (TCut cut) |
| Set a weight for a single line. More... | |
| void | AddWeight (const char *cut) |
| Set a weight for a single line. More... | |
| void | AddWeightExpr (TCut cut, TString expr) |
| Set a weight and expression concurrently for each line. Best used when a default tree is set. More... | |
| void | AddWeightExpr (const char *cut, TString expr) |
| Set a weight and expression concurrently for each line. Best used when a default tree is set. More... | |
| TCut | GetDefaultWeight () const |
| Get the default weight. More... | |
| void | OnlyPDF () |
| Call this before plotting to only write plots to .pdf files. More... | |
| void | OnlyPNG () |
| Call this before plotting to only write plots to .png files. More... | |
| void | ResetCutLines () |
| Resets the number of cut lines to plot. More... | |
| void | ResetExpr () |
| Reset the list of expressions used to makes lines. More... | |
| void | ResetLegend () |
| Resets the legend entries for each line. More... | |
| void | ResetSystematics () |
| Reset list of branches that contain systematics. More... | |
| void | ResetTree () |
| Reset the list of trees used to makes lines. More... | |
| void | ResetWeight () |
| Reset the list of weights used to makes lines. More... | |
| void | SetAxisMinMax (Float_t min, Float_t max) |
| Forces the minimum and maximum values of the Y-axis in the plot. More... | |
| void | SetAxisTitleOffset (Float_t offset) |
| Sets the offset of the Y-axis title as a ratio of the default offset. More... | |
| void | SetCanvasName (TString name) |
| Sets the name of the canvas created by PlotBase. More... | |
| void | SetCanvasSize (Int_t width, Int_t height) |
| Sets the size of the output canvas. More... | |
| void | SetCMSLabel (TString type) |
| Set the type of CMS label for the plot. More... | |
| void | SetCutLineStyle (Color_t color, Int_t width, Int_t style) |
| Sets the style for the cut lines. More... | |
| void | SetDataIndex (Int_t data) |
| Set one of the lines to be plotted as data. More... | |
| void | SetDefaultCut (const char *cut) |
| void | SetDefaultExpr (TString expr) |
| Set the default expression to be plotted on the x-axis for each line in the plot. More... | |
| void | SetDefaultLineStyle (Int_t style) |
| Set the default line style. More... | |
| void | SetDefaultLineWidth (Int_t width) |
| Set the default line width. More... | |
| void | SetDefaultTree (TTree *tree) |
| Set the default tree pointer for each line in the plot. More... | |
| void | SetDefaultWeight (TCut cut) |
| Set the default weight for each line in the plot. More... | |
| void | SetDefaultWeight (const char *cut) |
| Set the default weight for each line in the plot. More... | |
| void | SetDrawFirst (Int_t first) |
| Force a line to draw first on the plot, if desired. More... | |
| void | SetDrawOpts (TString options) |
| Set additional drawing options to force all lines to have. More... | |
| void | SetFontSize (Float_t fontSize) |
| Sets the fontsize of the axis labels. More... | |
| void | SetIncludeErrorBars (Bool_t include) |
| Set this to true to feature error bars in the plots. More... | |
| void | SetLeftMargin (float left) |
| void | SetLegendBorderSize (Int_t size) |
| Set the legend border size. More... | |
| void | SetLegendFill (Bool_t fill) |
| If true, the legend will be filled with a solid background. More... | |
| void | SetLegendLimits (Double_t lim1, Double_t lim2, Double_t lim3, Double_t lim4) |
| Set the legend location manually. More... | |
| void | SetLegendLocation (LegendY yLoc, LegendX xLoc, Double_t xWidth=0.3, Double_t yWidth=0.2) |
| Set the legend location using LegendY and LegendX enums. More... | |
| void | SetLumiLabel (TString lumi) |
| Set the luminosity label. More... | |
| void | SetLumiLabel (Float_t lumi) |
| Set the luminosity lable with a float in fb. More... | |
| void | SetLumiLabelFormat (TString format) |
| Set the luminosity format. More... | |
| void | SetMakeRatio (Bool_t ratio) |
| If true, a ratio pad will be drawn underneath. More... | |
| void | SetRatioDivisions (Int_t divisions, Bool_t optimize=true) |
| Sets the divisions of the ratio y axis. More... | |
| void | SetRatioGrid (Int_t grid) |
| Set horizontal dotted lines on the ratio pad. More... | |
| void | SetRatioIndex (Int_t ratio) |
| Set which line will be '1' in the ratio plot. More... | |
| void | SetRatioMinMax (Float_t min, Float_t max) |
| Force the minimum and maximum values of the ratio pad. More... | |
| void | SetRatioTitle (TString title) |
| Set the y axis label of the ratio pad. More... | |
| void | SetTreeList (std::vector< TTree *> treelist) |
| Can store multiple trees at once for plots. Each tree plots its own line. More... | |
Private Member Functions | |
| void | MakeCanvas (TString FileBase, std::vector< TH1D *> DataHists, std::vector< TH1D *> MCHists, std::vector< TH1D *> SignalHists, TString XLabel, TString YLabel, Bool_t logY) |
| Makes the canvas from histogram vectors. All other MakeCanvas pass through here. More... | |
Private Attributes | |
| Bool_t | fAddSignal = true |
| Bool to determine where the signal sits. More... | |
| Bool_t | fDebug = false |
| Dumps yield tests. More... | |
| TString | fDumpRootName = "" |
| File where each histogram in stack is dumped. More... | |
| TString | fForceTop = "" |
| A legend entry that is on the top of backgrounds. More... | |
| TString | fHistSuff = "" |
| Double_t | fIgnoreInLinear = 0.0 |
| If background less than this, do not draw in linear-scale plot. More... | |
| Double_t | fMinLegendFrac = 0.0 |
| If a background contributes less than this, it's grouped in others. More... | |
| Color_t | fOthersColor = 0 |
| Color of the "Others" legend entry. More... | |
| TString | fPostFitFile = "" |
| Holds the location of post-fit plots. More... | |
| TString | fRegion = "" |
| Holds the region for post-fit plots. More... | |
| Bool_t | fSortBackground = true |
| Bool to sort the backgrounds. More... | |
| Bool_t | fSortSignal = true |
| Bool to sort the signals. More... | |
| Int_t | fStackLineWidth = 1 |
| Line width of the histograms. More... | |
| std::vector< TString > | fTemplateEntries |
| Holds legend entries of the templates. More... | |
| std::vector< TString > | fTemplateFiles |
| Holds file name of the templates. More... | |
| std::vector< TString > | fTemplateHists |
| Holds histogram name of the templates. More... | |
Additional Inherited Members | |
Public Types inherited from FileConfigReader | |
| enum | FileType { kBackground = 0, kSignal, kData } |
| Differentiates between background, signal MC and data. More... | |
| enum | SearchBy { kLimitName = 0, kLegendEntry } |
| Determines how to match to return files. More... | |
Public Types inherited from Debug | |
| enum | DebugLevel { eQuiet = 0, eError, eInfo, eDebug } |
| Different possible debug levels. More... | |
Public Types inherited from PlotBase | |
| enum | LegendX { kLeft = 0, kRight } |
| Used for horizontal position of legend. More... | |
| enum | LegendY { kUpper = 0, kLower } |
| Used for vertical position of legend. More... | |
Protected Member Functions inherited from PlotPreparer | |
| std::vector< TH1D * > | GetHistList (TString FileBase, FileType type) |
| Get the HistList for a given file name, and type. More... | |
Protected Member Functions inherited from ParallelRunner | |
| void | RunThreads () |
| Run over all of the filled FileInfos. More... | |
Protected Member Functions inherited from FileConfigReader | |
| void | CloseFiles () |
| Closes the files that are open. More... | |
| std::vector< FileInfo * > * | GetFileInfo (FileType type) |
| Return a pointer to a proper vector of FileInfo. More... | |
| TH1D * | GetHist (std::vector< TH1D *> HistList) |
| Draw a single histogram using the default expression and a file list. More... | |
| TH1D * | GetHist (Int_t NumXBins, Double_t *XBins, std::vector< TString > FileList, FileType type) |
| Draw a single histogram using the default expression and a file list. More... | |
| TH1D * | GetHist (Int_t NumXBins, Double_t *XBins, FileType type, TString matchName="", SearchBy search=kLimitName, Bool_t match=true) |
| Draw a single histogram using the default expression and file configuration. More... | |
| std::vector< TH1D * > | GetHistList (Int_t NumXBins, Double_t *XBins, std::vector< TString > FileList, FileType type) |
| Draws histograms for using the default expression and a file list. More... | |
| std::vector< TH1D * > | GetHistList (Int_t NumXBins, Double_t *XBins, FileType type, TString matchName="", SearchBy search=kLimitName, Bool_t match=true) |
| Draws histograms for using the default expression and file configuration. More... | |
| void | OpenFiles (std::vector< TString > fileNames) |
| Opens the files in a vector. More... | |
| void | SetMultiplyLumi (Bool_t doMultiply) |
| Allows reader to avoid skipping when reading in exception configs. More... | |
Protected Member Functions inherited from InOutDirectoryHolder | |
| TString | AddOutDir (TString FileName) const |
| A helper function that prepends the output directory to a filename. More... | |
Protected Member Functions inherited from InDirectoryHolder | |
| TString | AddInDir (TString FileName) |
| A helper function that prepends the input directory to a filename. More... | |
Protected Member Functions inherited from Debug | |
| void | DisplayFunc (const char *func) |
| Sends the name of the function during debuggin. More... | |
Protected Member Functions inherited from PlotBase | |
| template<class T > | |
| void | BaseCanvas (TString FileBase, std::vector< T *> theLines, TString XLabel, TString YLabel, Bool_t logY=false, Bool_t logX=false) |
| This is the powerhouse of all the plotting tools. Everything happens here. More... | |
| void | ConvertToArray (Int_t NumXBins, Double_t MinX, Double_t MaxX, Double_t *XBins) |
| Takes number of bins, min and max, and dumps it into an already allocated array. More... | |
| TString | TempHistName () |
| Get a temporary name for a histogram. More... | |
Protected Attributes inherited from PlotPreparer | |
| bool | fPrepared {false} |
| A flag indicating whether or not the plots have been prepared by this class. More... | |
Protected Attributes inherited from FileConfigReader | |
| TString | fAllHistName = "htotal" |
| The all histogram name used ingenerating cross section weights. More... | |
| TString | fDataEntry = "Data" |
| The legend entry for data. More... | |
| std::vector< FileInfo * > | fDataFileInfo |
| Vector of data FileInfo objects. More... | |
| TString | fDataTreeName = "data" |
| The base name of the data in a limit tree. More... | |
| TCut | fDataWeight = "" |
| Separate Data weights if needed. More... | |
| Double_t | fLuminosity = 2000.0 |
| The Luminosity in inverse pb. More... | |
| std::vector< FileInfo * > | fMCFileInfo |
| Vector of background FileInfo objects. More... | |
| TCut | fMCWeight = "" |
| Separate MC weights if needed. More... | |
| std::vector< FileInfo * > | fSignalFileInfo |
| Vector of signal FileInfo objects. More... | |
| TString | fTreeName = "events" |
| Stores name of tree from file. More... | |
Protected Attributes inherited from PlotHists | |
| Double_t | fEventsPer = 0 |
| Histogram normalized to events per units of X axis. More... | |
Protected Attributes inherited from PlotBase | |
| Bool_t | bC = true |
| If true, BaseCanvas will create a .C macro. More... | |
| Bool_t | bPDF = true |
| If true, BaseCanvas will create a .pdf file. More... | |
| Bool_t | bPNG = true |
| If true, BaseCanvas will create a .png file. More... | |
| Float_t | fAxisMax = 0.0 |
| Maximum value of the y-axis. More... | |
| Float_t | fAxisMin = 0.0 |
| Minimum value of the y-axis. More... | |
| Int_t | fDataIndex = -1 |
| Index in the plotter of the data line. More... | |
| TCut | fDefaultCut = "" |
| Default cut if needed. More... | |
| TString | fDefaultExpr = "" |
| Default resolution expression if needed. More... | |
| TTree * | fDefaultTree = NULL |
| Default Tree if needed. More... | |
| Bool_t | fIncludeErrorBars = true |
| Option to include error bars. More... | |
| std::vector< TCut > | fInCuts |
| Holds the cuts for the trees if needed. More... | |
| std::vector< TString > | fInExpr |
| Holds multiple resolution expressions if needed. More... | |
| std::vector< TTree * > | fInTrees |
| Holds all the trees for each line if needed. More... | |
| Int_t | fLegendBorderSize = 0 |
| Border size of legend. More... | |
| std::vector< TString > | fLegendEntries |
| Number of legend entries should match number of lines. More... | |
| Bool_t | fMakeRatio = false |
| Bool to make a ratio plot on bottom of image. More... | |
| Bool_t | fOptimDivisions |
| UInt_t | fPlotCounter = 0 |
| This is used so that making scratch plots does not overlap. More... | |
| Int_t | fRatioDivisions |
| Int_t | fRatioGrid |
| Int_t | fRatioIndex = -1 |
| Pick which line to set as 1 in ratio plot. More... | |
| std::vector< Int_t > | fRatioLines |
| Vector of line indices to show up in the ratio pad. More... | |
| Float_t | fRatioMax = 0.0 |
| Maximum of the ratio pad. More... | |
| Float_t | fRatioMin = 0.0 |
| Minimum of the ratio pad. More... | |
| TString | fRatioTitle |
| Label of the ratio pad. More... | |
| std::vector< TString > | fSystematicBranches |
| Vector of branches to apply as systematic uncertainties. More... | |
| Double_t | l1 = 0.6 |
| First X value of legend location. More... | |
| Double_t | l2 = 0.7 |
| First Y value of legend location. More... | |
| Double_t | l3 = 0.9 |
| Second X value of legend location. More... | |
| Double_t | l4 = 0.9 |
| Second Y value of legend location. More... | |
Class used for making stack plots.
Most easy way to use this class is through CrombieTools.PlotTools.PlotStack convenience functions and using an MC Configuration. Many appearance flags must be set through this class's methods though.
Definition at line 24 of file PlotStack.h.
| PlotStack::PlotStack | ( | ) |
Referenced by Copy().
|
virtual |
Definition at line 36 of file PlotStack.cc.
| PlotStack * PlotStack::Copy | ( | ) |
Copy this PlotStack for parallelization.
Definition at line 446 of file PlotStack.cc.
References PlotStack().
|
inline |
Insert a histogram from file into the stack plot.
Most histograms in the stack plot are created from TTree::Draw() functions acting on trees. It is also possible to just insert a histogram generated by someone else into the stack plot.
| fileName | is the name of the file containing the histogram. |
| histName | is the name of the TH1 inside the file. |
| LegendEntry | is the entry in the legend. It does not require underscores for spaces like in the MC Configurations. |
Definition at line 79 of file PlotStack.h.
References fTemplateEntries, fTemplateFiles, and fTemplateHists.
|
virtual |
Choose the binning of your plots and make then.
Reimplemented from PlotHists.
Definition at line 111 of file PlotStack.cc.
References Debug::eDebug, FileConfigReader::fSignalFileInfo, PlotPreparer::GetHistList(), FileConfigReader::kBackground, FileConfigReader::kData, FileConfigReader::kSignal, Debug::Message(), and PlotBase::SetIncludeErrorBars().
Referenced by MakeCanvas().
|
virtual |
Binning with fixed width.
Reimplemented from PlotHists.
Definition at line 94 of file PlotStack.cc.
References PlotBase::ConvertToArray(), PlotHists::fEventsPer, MakeCanvas(), and PlotHists::SetEventsPer().
| void PlotStack::MakeCanvas | ( | TString | FileBase, |
| TString | XLabel, | ||
| TString | YLabel = "", |
||
| Bool_t | logY = false |
||
| ) |
Make plots with the PlotPreparer.
Definition at line 129 of file PlotStack.cc.
References Debug::eDebug, Debug::eError, FileConfigReader::fSignalFileInfo, PlotPreparer::GetHistList(), FileConfigReader::kBackground, FileConfigReader::kData, FileConfigReader::kSignal, MakeCanvas(), Debug::Message(), and PlotBase::SetIncludeErrorBars().
|
private |
Makes the canvas from histogram vectors. All other MakeCanvas pass through here.
Definition at line 151 of file PlotStack.cc.
References PlotBase::AddLegendEntry(), InOutDirectoryHolder::AddOutDir(), PlotBase::AddRatioLine(), PlotBase::BaseCanvas(), FileConfigReader::CloseFiles(), Debug::DisplayFunc(), Debug::eDebug, Debug::eError, Debug::eInfo, fAddSignal, PlotBase::fDataIndex, PlotBase::fDefaultCut, PlotBase::fDefaultExpr, fDumpRootName, PlotHists::fEventsPer, fHistSuff, fIgnoreInLinear, FileConfigReader::fLuminosity, PlotBase::fMakeRatio, fMinLegendFrac, fOthersColor, fPostFitFile, PlotPreparer::fPrepared, PlotBase::fRatioLines, fRegion, FileConfigReader::fSignalFileInfo, fSortBackground, fSortSignal, fStackLineWidth, fTemplateEntries, fTemplateFiles, fTemplateHists, FileConfigReader::kBackground, FileConfigReader::kSignal, MergeHistograms(), Debug::Message(), PlotBase::ResetLegend(), PlotBase::SetDataIndex(), PlotBase::SetLegendFill(), PlotBase::SetLumiLabel(), PlotBase::SetRatioIndex(), CrombieTools.PlotTools.PlotUtils::SetZeroError, SortHistHolders(), and PlotBase::TempHistName().
| std::vector< HistHolder * > PlotStack::MergeHistograms | ( | FileType | type, |
| std::vector< TH1D *> | hists | ||
| ) |
Merge a vector of histograms into a vector of HistHolders.
Definition at line 41 of file PlotStack.cc.
References Debug::DisplayFunc(), Debug::eDebug, Debug::eError, fForceTop, FileConfigReader::fTreeName, FileConfigReader::GetFileInfo(), FileConfigReader::kSignal, and Debug::Message().
Referenced by MakeCanvas().
|
inline |
Use this to set whether the signal sits on top or not.
Definition at line 91 of file PlotStack.h.
References fAddSignal.
|
inline |
This dumps out some raw values for you to check yields.
Definition at line 63 of file PlotStack.h.
References crombie::Debug::debug, and fDebug.
|
inline |
Set the name of a .root file to dump the separate histograms used in the plots.
Definition at line 65 of file PlotStack.h.
References fDumpRootName.
|
inline |
Sets the legend entry that will be on the top of the stack.
| force | should match a legend entry. It should have spaces instead of underscores if matching an entry in an [MC Configuration](formatmc). |
Definition at line 52 of file PlotStack.h.
References fForceTop.
|
inline |
Set the suffix of dumped histograms.
Definition at line 68 of file PlotStack.h.
References fHistSuff.
|
inline |
Set the minimum fraction of backgrounds that are not plotted or mentioned in linear scale.
Definition at line 56 of file PlotStack.h.
References fIgnoreInLinear.
|
inline |
Set the minimum fraction of background that shows up on the plot's legend separately.
Definition at line 54 of file PlotStack.h.
References fMinLegendFrac.
|
inline |
Set the color of the "Others" legend entry.
Definition at line 58 of file PlotStack.h.
References fOthersColor.
|
inline |
Use this to get a post-fit line.
Definition at line 94 of file PlotStack.h.
References fPostFitFile, and fRegion.
|
inline |
Use this to change the automatic sorting of backgrounds based on yields.
Definition at line 85 of file PlotStack.h.
References fSortBackground.
|
inline |
Use this to change the automatic sorting of signals based on yields.
Definition at line 88 of file PlotStack.h.
References fSortSignal.
|
inline |
Set the line width of the stack plots.
Definition at line 60 of file PlotStack.h.
References fStackLineWidth.
|
private |
Bool to determine where the signal sits.
Definition at line 113 of file PlotStack.h.
Referenced by MakeCanvas(), and SetAddSignal().
|
private |
|
private |
File where each histogram in stack is dumped.
Definition at line 109 of file PlotStack.h.
Referenced by MakeCanvas(), and SetDumpFileName().
|
private |
A legend entry that is on the top of backgrounds.
Definition at line 98 of file PlotStack.h.
Referenced by MergeHistograms(), and SetForceTop().
|
private |
Definition at line 110 of file PlotStack.h.
Referenced by MakeCanvas(), and SetHistSuff().
|
private |
If background less than this, do not draw in linear-scale plot.
Definition at line 100 of file PlotStack.h.
Referenced by MakeCanvas(), and SetIgnoreInLinear().
|
private |
If a background contributes less than this, it's grouped in others.
Definition at line 99 of file PlotStack.h.
Referenced by MakeCanvas(), and SetMinLegendFrac().
|
private |
Color of the "Others" legend entry.
Definition at line 102 of file PlotStack.h.
Referenced by MakeCanvas(), and SetOthersColor().
|
private |
Holds the location of post-fit plots.
Definition at line 114 of file PlotStack.h.
Referenced by MakeCanvas(), and SetPostFitFile().
|
private |
Holds the region for post-fit plots.
Definition at line 115 of file PlotStack.h.
Referenced by MakeCanvas(), and SetPostFitFile().
|
private |
Bool to sort the backgrounds.
Definition at line 111 of file PlotStack.h.
Referenced by MakeCanvas(), and SetSortBackground().
|
private |
Bool to sort the signals.
Definition at line 112 of file PlotStack.h.
Referenced by MakeCanvas(), and SetSortSignal().
|
private |
Line width of the histograms.
Definition at line 101 of file PlotStack.h.
Referenced by MakeCanvas(), and SetStackLineWidth().
|
private |
Holds legend entries of the templates.
Definition at line 106 of file PlotStack.h.
Referenced by InsertTemplate(), and MakeCanvas().
|
private |
Holds file name of the templates.
Definition at line 104 of file PlotStack.h.
Referenced by InsertTemplate(), and MakeCanvas().
|
private |
Holds histogram name of the templates.
Definition at line 105 of file PlotStack.h.
Referenced by InsertTemplate(), and MakeCanvas().