Crombie Tools
FormulaCorrector.py
Go to the documentation of this file.
1 """@package CrombieTools.SkimmingTools.FormulaCorrector
2 
3 Submodule of CrombieTools.SkimmingTools
4 Contains the constructor and default object for FormulaCorrector.
5 
6 @author Daniel Abercrombie <dabercro@mit.edu>
7 """
8 
9 
10 from .. import Load
11 
12 newFormulaCorrector = Load('FormulaCorrector')
13 """FormulaCorrector constructor"""
14 
15 def MakeFormulaCorrector(Name, Formula, inCut='1', matchName=''):
16  """Make a FormulaCorrector object
17 
18  @param Name is the name of the branch for this Corrector if the CorrectorApplicator
19  is saving all branches.
20  @param Formula is the formula to set the branch to
21  @param inCut is the cut that a tree must pass in order for the Correction to be applied.
22  @param matchName is the regex expression that must be matched
23  for the correction to be applied to the file
24  @returns a FormulaCorrector object.
25  """
26 
27  corrector = newFormulaCorrector(Name, Formula)
28  corrector.SetInCut(inCut)
29  corrector.SetMatchFileName(matchName)
30 
31  return corrector