Crombie Tools
QuickPlot.py
Go to the documentation of this file.
1 import os
2 from .. import Load, DirFromEnv, Nminus1Cut
3 
4 newQuickPlotter = Load('QuickPlot')
5 plotter = newQuickPlotter()
6 
7 
8 def SetupFromEnv(aPlotter = plotter):
9  """A function that sets up a plotter after sourcing a config file.
10 
11  @param aPlotter is the plotter to setup. Defaults to plotter in this module.
12  """
13  from ..CommonTools.FileConfigReader import SetupConfigFromEnv, SetFunctionFromEnv
14 
15  SetupConfigFromEnv(aPlotter)
16 
17  DirFromEnv('CrombieOutPlotDir')
19  (aPlotter.SetOutDirectory, 'CrombieOutPlotDir'),
20  ])
21 
22 
23 def SetCuts(category, region, aPlotter = plotter):
24  """ Sets cuts based on category and region.
25 
26  @param category is the category of the analysis being used.
27  @param region is the region of the plot being set.
28  @param aPlotter is the plotter that is having its cuts set.
29  Default is the plotter defined in this module.
30  """
31  from ..LoadConfig import cuts
32  aPlotter.SetDefaultWeight(cuts.cut(category, region))
33  aPlotter.SetMCWeight(cuts.dataMCCuts(region, False))
34  aPlotter.SetDataWeight(cuts.dataMCCuts(region, True))