Crombie Tools
XSecAdder.py
Go to the documentation of this file.
1 """@package CrombieTools.AnalysisTools.XSecAdder
2 Holds constructor and default XSecAdder object along with convenience function.
3 @author Daniel Abercrombie <dabercro@mit.edu>
4 """
5 from .. import Load
6 
7 newXSecAdder = Load('XSecAdder')
8 xSecAdder = newXSecAdder()
9 
10 def RunXSecAdder(branchName='XSecWeight', inTree='events', outTree='events', adder=xSecAdder):
11  """Add a branch filled with floats proportional to the cross section of a process to a tree
12 
13  @param branchName is the name of the branch to be added
14  @param inTree is the name of the tree to get the number of events
15  @param outTree is the tree to write the branch to
16  @param adder is the instances of XSecAdder that is used
17  """
18 
19  from .. import LoadConfig
20  import os
21 
22  adder.SetBranchName(branchName)
23  adder.SetInTreeName(inTree)
24  adder.SetOutTreeName(outTree)
25 
26  adder.AddXSecs()