ATLAS Offline Software
Loading...
Searching...
No Matches
runLayerRecalibration Namespace Reference

Functions

 LayerRecalibratedGenerator (input_tree, branches)
 foo_callback (option, opt, value, parser)

Variables

 level
 IgnoreCommandLineOptions
 parser = OptionParser()
 help
 type
 int
 choices
 action
 callback
 options
 args
 input_filenames = None
str prefix = 'electron' else 'ph_'
 f = ROOT.TFile.Open(filename, "update")
 tree = f.Get(options.tree)
list branches = [prefix + 'cl_eta'] + [prefix + 'rawcl_Es%d' % i for i in range(4)]
 branches_to_copy = options.branches_to_copy or []
list new_branch_names = [prefix + 'rawcl_Es%d' % i for i in range(4)]
 newtree = tree.CloneTree(0)
str isVector = 'vector' in tree.GetLeaf(prefix + 'rawcl_Es0').GetTypeName()
list new_storages = []
 new_storage = ROOT.vector(float)()
 chain = ROOT.TChain(options.tree)
 canvas = ROOT.TCanvas()

Detailed Description

To compute corrected layer energies 

Function Documentation

◆ foo_callback()

runLayerRecalibration.foo_callback ( option,
opt,
value,
parser )

Definition at line 54 of file runLayerRecalibration.py.

54 def foo_callback(option, opt, value, parser):
55 setattr(parser.values, option.dest, value.split(','))
56

◆ LayerRecalibratedGenerator()

runLayerRecalibration.LayerRecalibratedGenerator ( input_tree,
branches )

Definition at line 27 of file runLayerRecalibration.py.

27def LayerRecalibratedGenerator(input_tree, branches):
28 ""
29 tool = ROOT.egammaLayerRecalibTool("2012_alt_with_layer2")
30
31 def _rec(eta, e0, e1, e2, e3):
32 std_calibration_input = ROOT.StdCalibrationInputs(0, eta, e0, e1, e2, e3, 0)
33 tool.scale_inputs(std_calibration_input)
34 return std_calibration_input.E0raw, std_calibration_input.E1raw, std_calibration_input.E2raw, std_calibration_input.E3raw
35 fcn = _rec
36 entries = input_tree.GetEntries()
37 for i in range(entries):
38 input_tree.GetEntry(i)
39 # check if branch exists
40 try:
41 inputs = list(map(input_tree.__getattr__, branches))
42 except AttributeError:
43 raise AttributeError("cannot find branches %s" % branches)
44
45 try:
46 yield fcn(*inputs) # scalar
47 except TypeError:
48 result = [fcn(*ii) for ii in izip(*inputs)] # vectors
49 yield list(zip(*result))
50
STL class.

Variable Documentation

◆ action

runLayerRecalibration.action

Definition at line 63 of file runLayerRecalibration.py.

◆ args

runLayerRecalibration.args

Definition at line 67 of file runLayerRecalibration.py.

◆ branches

list runLayerRecalibration.branches = [prefix + 'cl_eta'] + [prefix + 'rawcl_Es%d' % i for i in range(4)]

Definition at line 98 of file runLayerRecalibration.py.

◆ branches_to_copy

runLayerRecalibration.branches_to_copy = options.branches_to_copy or []

Definition at line 103 of file runLayerRecalibration.py.

◆ callback

runLayerRecalibration.callback

Definition at line 64 of file runLayerRecalibration.py.

◆ canvas

runLayerRecalibration.canvas = ROOT.TCanvas()

Definition at line 180 of file runLayerRecalibration.py.

◆ chain

runLayerRecalibration.chain = ROOT.TChain(options.tree)

Definition at line 175 of file runLayerRecalibration.py.

◆ choices

runLayerRecalibration.choices

Definition at line 61 of file runLayerRecalibration.py.

◆ f

runLayerRecalibration.f = ROOT.TFile.Open(filename, "update")

Definition at line 92 of file runLayerRecalibration.py.

◆ help

runLayerRecalibration.help

Definition at line 58 of file runLayerRecalibration.py.

◆ IgnoreCommandLineOptions

runLayerRecalibration.IgnoreCommandLineOptions

Definition at line 16 of file runLayerRecalibration.py.

◆ input_filenames

list runLayerRecalibration.input_filenames = None

Definition at line 69 of file runLayerRecalibration.py.

◆ int

runLayerRecalibration.int

Definition at line 59 of file runLayerRecalibration.py.

◆ isVector

str runLayerRecalibration.isVector = 'vector' in tree.GetLeaf(prefix + 'rawcl_Es0').GetTypeName()

Definition at line 125 of file runLayerRecalibration.py.

◆ level

runLayerRecalibration.level

Definition at line 13 of file runLayerRecalibration.py.

◆ new_branch_names

list runLayerRecalibration.new_branch_names = [prefix + 'rawcl_Es%d' % i for i in range(4)]

Definition at line 106 of file runLayerRecalibration.py.

◆ new_storage

runLayerRecalibration.new_storage = ROOT.vector(float)()

Definition at line 129 of file runLayerRecalibration.py.

◆ new_storages

list runLayerRecalibration.new_storages = []

Definition at line 126 of file runLayerRecalibration.py.

◆ newtree

runLayerRecalibration.newtree = tree.CloneTree(0)

Definition at line 114 of file runLayerRecalibration.py.

◆ options

runLayerRecalibration.options

Definition at line 67 of file runLayerRecalibration.py.

◆ parser

runLayerRecalibration.parser = OptionParser()

Definition at line 57 of file runLayerRecalibration.py.

◆ prefix

str runLayerRecalibration.prefix = 'electron' else 'ph_'

Definition at line 87 of file runLayerRecalibration.py.

◆ tree

runLayerRecalibration.tree = f.Get(options.tree)

Definition at line 93 of file runLayerRecalibration.py.

◆ type

runLayerRecalibration.type

Definition at line 59 of file runLayerRecalibration.py.