ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CheckAppliedSFs.SystematicComparer Class Reference
Inheritance diagram for CheckAppliedSFs.SystematicComparer:
Collaboration diagram for CheckAppliedSFs.SystematicComparer:

Public Member Functions

def __init__ (self, var_name="", axis_title="", bins=-1, name_old_rel="", name_new_rel="", test_tree=None, branch_old="", branch_new="", weight_old=None, weight_new=None, branch_sys_old="", branch_sys_new="")
 
def fill (self)
 
def pass_cut (self)
 
def get_old_histo (self)
 
def get_new_histo (self)
 
def get_old_var (self)
 
def get_new_var (self)
 
def get_old_weight (self)
 
def get_new_weight (self)
 
def finalize (self)
 
def name (self)
 

Private Attributes

 __sys_old
 
 __sys_new
 
 __old_branch
 Direct access to the branch which are going to be compared. More...
 
 __new_branch
 
 __old_weight
 Weights as a function of the muon kinematics. More...
 
 __new_weight
 
 __quality_branch
 
 __min_quality
 
 __max_quality
 
 __var_name
 
 __old_histo
 
 __new_histo
 

Detailed Description

Definition at line 91 of file CheckAppliedSFs.py.

Constructor & Destructor Documentation

◆ __init__()

def CheckAppliedSFs.SystematicComparer.__init__ (   self,
  var_name = "",
  axis_title = "",
  bins = -1,
  name_old_rel = "",
  name_new_rel = "",
  test_tree = None,
  branch_old = "",
  branch_new = "",
  weight_old = None,
  weight_new = None,
  branch_sys_old = "",
  branch_sys_new = "" 
)

Definition at line 92 of file CheckAppliedSFs.py.

92  def __init__(self,
93  var_name = "",
94  axis_title ="",
95  bins = -1,
96 
97  name_old_rel ="",
98  name_new_rel ="",
99 
100  test_tree = None,
101  branch_old = "",
102  branch_new = "",
103  weight_old = None,
104  weight_new = None,
105 
106  branch_sys_old = "",
107  branch_sys_new = "",
108  ):
109  ReleaseComparer.__init__(self,
110  var_name = var_name,
111  axis_title = axis_title,
112  bins = bins, bmin = 5.e-4, bmax = 4.,
113  name_old_rel =name_old_rel,
114  name_new_rel =name_new_rel,
115  test_tree = test_tree,
116  branch_old = branch_old,
117  branch_new = branch_new,
118  weight_old = weight_old,
119  weight_new = weight_new,
120  log_binning = True)
121  self.__sys_old = test_tree.GetLeaf(branch_sys_old)
122  self.__sys_new = test_tree.GetLeaf(branch_sys_new)
123  if not self.__sys_old:
124  raise NameError("Failed to retrieve "+branch_sys_old)
125  if not self.__sys_new:
126  raise NameError("Failed to retrieve "+branch_sys_new)
127 
128 

Member Function Documentation

◆ fill()

def CheckAppliedSFs.SystematicComparer.fill (   self)

Reimplemented from CheckAppliedSFs.ReleaseComparer.

Definition at line 129 of file CheckAppliedSFs.py.

129  def fill(self):
130  self.get_old_histo().fill(value = math.fabs(self.get_old_var().GetValue() - self.__sys_old.GetValue()) / (self.get_old_var().GetValue() if self.get_old_var().GetValue() != 0. else 1.) ,
131  weight= self.get_old_weight())
132  self.get_new_histo().fill(value = math.fabs(self.get_new_var().GetValue() - self.__sys_new.GetValue()) / (self.get_new_var().GetValue() if self.get_new_var().GetValue() != 0. else 1.),
133  weight= self.get_new_weight())
134 
135 
136 

◆ finalize()

def CheckAppliedSFs.ReleaseComparer.finalize (   self)
inherited

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 

◆ get_new_histo()

def CheckAppliedSFs.ReleaseComparer.get_new_histo (   self)
inherited

Definition at line 69 of file CheckAppliedSFs.py.

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

◆ get_new_var()

def CheckAppliedSFs.ReleaseComparer.get_new_var (   self)
inherited

Definition at line 73 of file CheckAppliedSFs.py.

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

◆ get_new_weight()

def CheckAppliedSFs.ReleaseComparer.get_new_weight (   self)
inherited

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()

def CheckAppliedSFs.ReleaseComparer.get_old_histo (   self)
inherited

Definition at line 67 of file CheckAppliedSFs.py.

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

◆ get_old_var()

def CheckAppliedSFs.ReleaseComparer.get_old_var (   self)
inherited

Definition at line 71 of file CheckAppliedSFs.py.

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

◆ get_old_weight()

def CheckAppliedSFs.ReleaseComparer.get_old_weight (   self)
inherited

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()

def CheckAppliedSFs.ReleaseComparer.name (   self)
inherited

Definition at line 89 of file CheckAppliedSFs.py.

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

◆ pass_cut()

def CheckAppliedSFs.ReleaseComparer.pass_cut (   self)
inherited

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

CheckAppliedSFs.ReleaseComparer.__max_quality
privateinherited

Definition at line 33 of file CheckAppliedSFs.py.

◆ __min_quality

CheckAppliedSFs.ReleaseComparer.__min_quality
privateinherited

Definition at line 32 of file CheckAppliedSFs.py.

◆ __new_branch

CheckAppliedSFs.ReleaseComparer.__new_branch
privateinherited

Definition at line 14 of file CheckAppliedSFs.py.

◆ __new_histo

CheckAppliedSFs.ReleaseComparer.__new_histo
privateinherited

Definition at line 44 of file CheckAppliedSFs.py.

◆ __new_weight

CheckAppliedSFs.ReleaseComparer.__new_weight
privateinherited

Definition at line 22 of file CheckAppliedSFs.py.

◆ __old_branch

CheckAppliedSFs.ReleaseComparer.__old_branch
privateinherited

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

Definition at line 13 of file CheckAppliedSFs.py.

◆ __old_histo

CheckAppliedSFs.ReleaseComparer.__old_histo
privateinherited

Definition at line 39 of file CheckAppliedSFs.py.

◆ __old_weight

CheckAppliedSFs.ReleaseComparer.__old_weight
privateinherited

Weights as a function of the muon kinematics.

Definition at line 21 of file CheckAppliedSFs.py.

◆ __quality_branch

CheckAppliedSFs.ReleaseComparer.__quality_branch
privateinherited

Definition at line 28 of file CheckAppliedSFs.py.

◆ __sys_new

CheckAppliedSFs.SystematicComparer.__sys_new
private

Definition at line 106 of file CheckAppliedSFs.py.

◆ __sys_old

CheckAppliedSFs.SystematicComparer.__sys_old
private

Definition at line 105 of file CheckAppliedSFs.py.

◆ __var_name

CheckAppliedSFs.ReleaseComparer.__var_name
privateinherited

Definition at line 38 of file CheckAppliedSFs.py.


The documentation for this class was generated from the following file:
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
max
#define max(a, b)
Definition: cfImp.cxx:41
min
#define min(a, b)
Definition: cfImp.cxx:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
lumiFormat.fill
fill
Definition: lumiFormat.py:111