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