1 from ..
import Load, DirFromEnv, Nminus1Cut
3 newRatioComparer =
Load(
'RatioComparison')
8 """A function that sets up a plotter after sourcing a config file. 10 @param aPlotter is the plotter to setup. Defaults to plotter in this module. 12 from ..CommonTools.FileConfigReader
import SetupConfigFromEnv, SetFunctionFromEnv
18 (aPlotter.SetOutDirectory,
'CrombieOutPlotDir'),
22 def SetCuts(category1, region1, region2, category2=None, aPlotter=plotter, Nminus1=''):
23 """ Sets cuts based on category and region. 25 @param category1 is the category of the analysis being used. 26 @param region1 is the region of the numerator. 27 @param region2 is the region of the denominator. 28 @param category2 if set, is the category of the denominator. 29 Otherwise, the category is assumed to be the same 30 @param aPlotter is the plotter that is having its cuts set. 31 Default is the plotter defined in this module. 32 @param Nminus1 is a parameter to not cut on 35 from ..LoadConfig
import cuts
37 category2 = category2
or category1
41 numerator_cut =
Nminus1Cut(cuts.cut(category1, region1), Nminus1)
if Nminus1
else cuts.cut(category1, region1)
42 denominator_cut =
Nminus1Cut(cuts.cut(category2, region2), Nminus1)
if Nminus1
else cuts.cut(category2, region2)
44 aPlotter.AddRatioCuts(numerator_cut +
' && ' + cuts.dataMCCuts(region1,
True),
45 denominator_cut +
' && ' + cuts.dataMCCuts(region2,
True),
46 aPlotter.kData,
'Data', 1)
48 aPlotter.AddRatioCuts(numerator_cut +
' * ' + cuts.dataMCCuts(region1,
False),
49 denominator_cut +
' * ' + cuts.dataMCCuts(region2,
False),
50 aPlotter.kBackground,
'MC', 2)
52 aPlotter.SetDataIndex(0)
53 aPlotter.SetRatioIndex(1)