ATLAS Offline Software
Loading...
Searching...
No Matches
CheckAppliedSFs.ReleaseComparer Class Reference
Inheritance diagram for CheckAppliedSFs.ReleaseComparer:
Collaboration diagram for CheckAppliedSFs.ReleaseComparer:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, var_name="", axis_title="", bins=-1, bmin=0., bmax=0., bin_width=-1, bdir=None, name_old_rel="", name_new_rel="", test_tree=None, branch_old="", branch_new="", weight_old=None, weight_new=None, log_binning=False)
 pass_cut (self)
 fill (self)
 get_old_histo (self)
 get_new_histo (self)
 get_old_var (self)
 get_new_var (self)
 get_old_weight (self)
 get_new_weight (self)
 finalize (self)
 name (self)

Private Attributes

 __old_branch = test_tree.GetLeaf(branch_old)
 Direct access to the branch which are going to be compared.
 __new_branch = test_tree.GetLeaf(branch_new)
int __old_weight = 1. if not weight_old else test_tree.GetLeaf(weight_old)
 Weights as a function of the muon kinematics.
int __new_weight = 1. if not weight_new else test_tree.GetLeaf(weight_new)
 __quality_branch = test_tree.GetLeaf("Muon_quality")
int __min_quality = -1 else 1
int __max_quality = 2
 __var_name = var_name
 __old_histo
 __new_histo

Detailed Description

Definition at line 10 of file CheckAppliedSFs.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

CheckAppliedSFs.ReleaseComparer.__init__ ( self,
var_name = "",
axis_title = "",
bins = -1,
bmin = 0.,
bmax = 0.,
bin_width = -1,
bdir = None,
name_old_rel = "",
name_new_rel = "",
test_tree = None,
branch_old = "",
branch_new = "",
weight_old = None,
weight_new = None,
log_binning = False )

Definition at line 11 of file CheckAppliedSFs.py.

22 ):
23
24 self.__old_branch = test_tree.GetLeaf(branch_old)
25 self.__new_branch = test_tree.GetLeaf(branch_new)
26 if not self.__old_branch:
27 raise NameError("Could not find "+branch_old+" in the Tree")
28
29 if not self.__new_branch:
30 raise NameError("Could not find "+branch_new+" in the Tree")
31
32 self.__old_weight = 1. if not weight_old else test_tree.GetLeaf(weight_old)
33 self.__new_weight = 1. if not weight_new else test_tree.GetLeaf(weight_new)
34 if weight_old and not self.__old_weight:
35 raise NameError("Could not find "+weight_old+" in the Tree")
36 if weight_new and not self.__new_weight:
37 raise NameError("Could not find "+weight_new+" in the Tree")
38
39 self.__quality_branch = test_tree.GetLeaf("Muon_quality")
40 if branch_old.find("HighPt") != -1 : self.__quality_branch = test_tree.GetLeaf("Muon_isHighPt")
41 if branch_old.find("LowPt") != -1 : self.__quality_branch = test_tree.GetLeaf("Muon_isLowPt")
42
43 self.__min_quality = 0 if branch_old.find("HighPt") != -1 and branch_old.find("LowPt") != -1 else 1
44 self.__max_quality = 2
45 if branch_old.find("Medium") != -1: self.__max_quality = 1
46 if branch_old.find("Tight") != -1: self.__max_quality = 0
47
48
49 self.__var_name = var_name
50 self.__old_histo = DiagnosticHisto(
51 name = "%s_%s"%(name_old_rel, var_name),
52 axis_title = axis_title,
53 bins = bins, bmin = bmin, bmax = bmax,
54 bin_width = bin_width, bdir = bdir, log_binning = log_binning)
55 self.__new_histo = DiagnosticHisto(
56 name = "%s_%s"%(name_new_rel, var_name),
57 axis_title = axis_title,
58 bins = bins, bmin = bmin, bmax = bmax,
59 bin_width = bin_width, bdir = bdir, log_binning = log_binning)
60

Member Function Documentation

◆ fill()

CheckAppliedSFs.ReleaseComparer.fill ( self)

Reimplemented in CheckAppliedSFs.SystematicComparer.

Definition at line 63 of file CheckAppliedSFs.py.

63 def fill(self):
64 if not self.pass_cut(): return
65 self.__old_histo.fill(value = self.__old_branch.GetValue(), weight= self.get_old_weight())
66 self.__new_histo.fill(value = self.__new_branch.GetValue(), weight= self.get_new_weight())
void fill(H5::Group &out_file, size_t iterations)

◆ finalize()

CheckAppliedSFs.ReleaseComparer.finalize ( self)

Definition at line 81 of file CheckAppliedSFs.py.

81 def finalize(self):
82 minimum = min(self.get_old_histo().min(), self.get_new_histo().min()) - 0.01
83 maximum = max(self.get_old_histo().max(), self.get_new_histo().max()) + 0.01
84 for H in [ self.get_old_histo(), self.get_new_histo()]:
85 H.setMinimum(minimum)
86 H.setMaximum(maximum)
87 H.write()
88
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

◆ get_new_histo()

CheckAppliedSFs.ReleaseComparer.get_new_histo ( self)

Definition at line 69 of file CheckAppliedSFs.py.

69 def get_new_histo(self):
70 return self.__new_histo

◆ get_new_var()

CheckAppliedSFs.ReleaseComparer.get_new_var ( self)

Definition at line 73 of file CheckAppliedSFs.py.

73 def get_new_var(self):
74 return self.__new_branch

◆ get_new_weight()

CheckAppliedSFs.ReleaseComparer.get_new_weight ( self)

Definition at line 78 of file CheckAppliedSFs.py.

78 def get_new_weight(self):
79 if isinstance(self.__new_weight, float): return self.__new_weight
80 return self.__new_weight.GetValue()

◆ get_old_histo()

CheckAppliedSFs.ReleaseComparer.get_old_histo ( self)

Definition at line 67 of file CheckAppliedSFs.py.

67 def get_old_histo(self):
68 return self.__old_histo

◆ get_old_var()

CheckAppliedSFs.ReleaseComparer.get_old_var ( self)

Definition at line 71 of file CheckAppliedSFs.py.

71 def get_old_var(self):
72 return self.__old_branch

◆ get_old_weight()

CheckAppliedSFs.ReleaseComparer.get_old_weight ( self)

Definition at line 75 of file CheckAppliedSFs.py.

75 def get_old_weight(self):
76 if isinstance(self.__old_weight, float): return self.__old_weight
77 return self.__old_weight.GetValue()

◆ name()

CheckAppliedSFs.ReleaseComparer.name ( self)

Definition at line 89 of file CheckAppliedSFs.py.

89 def name(self):
90 return self.__var_name

◆ pass_cut()

CheckAppliedSFs.ReleaseComparer.pass_cut ( self)

Definition at line 61 of file CheckAppliedSFs.py.

61 def pass_cut(self):
62 return self.__min_quality >= self.__quality_branch .GetValue() and self.__quality_branch.GetValue() <= self.__max_quality

Member Data Documentation

◆ __max_quality

int CheckAppliedSFs.ReleaseComparer.__max_quality = 2
private

Definition at line 44 of file CheckAppliedSFs.py.

◆ __min_quality

int CheckAppliedSFs.ReleaseComparer.__min_quality = -1 else 1
private

Definition at line 43 of file CheckAppliedSFs.py.

◆ __new_branch

CheckAppliedSFs.ReleaseComparer.__new_branch = test_tree.GetLeaf(branch_new)
private

Definition at line 25 of file CheckAppliedSFs.py.

◆ __new_histo

CheckAppliedSFs.ReleaseComparer.__new_histo
private
Initial value:
= DiagnosticHisto(
name = "%s_%s"%(name_new_rel, var_name),
axis_title = axis_title,
bins = bins, bmin = bmin, bmax = bmax,
bin_width = bin_width, bdir = bdir, log_binning = log_binning)

Definition at line 55 of file CheckAppliedSFs.py.

◆ __new_weight

CheckAppliedSFs.ReleaseComparer.__new_weight = 1. if not weight_new else test_tree.GetLeaf(weight_new)
private

Definition at line 33 of file CheckAppliedSFs.py.

◆ __old_branch

CheckAppliedSFs.ReleaseComparer.__old_branch = test_tree.GetLeaf(branch_old)
private

Direct access to the branch which are going to be compared.

Definition at line 24 of file CheckAppliedSFs.py.

◆ __old_histo

CheckAppliedSFs.ReleaseComparer.__old_histo
private
Initial value:
= DiagnosticHisto(
name = "%s_%s"%(name_old_rel, var_name),
axis_title = axis_title,
bins = bins, bmin = bmin, bmax = bmax,
bin_width = bin_width, bdir = bdir, log_binning = log_binning)

Definition at line 50 of file CheckAppliedSFs.py.

◆ __old_weight

CheckAppliedSFs.ReleaseComparer.__old_weight = 1. if not weight_old else test_tree.GetLeaf(weight_old)
private

Weights as a function of the muon kinematics.

Definition at line 32 of file CheckAppliedSFs.py.

◆ __quality_branch

CheckAppliedSFs.ReleaseComparer.__quality_branch = test_tree.GetLeaf("Muon_quality")
private

Definition at line 39 of file CheckAppliedSFs.py.

◆ __var_name

CheckAppliedSFs.ReleaseComparer.__var_name = var_name
private

Definition at line 49 of file CheckAppliedSFs.py.


The documentation for this class was generated from the following file: