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

Public Member Functions

def __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)
 
def pass_cut (self)
 
def fill (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

 __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 10 of file CheckAppliedSFs.py.

Constructor & Destructor Documentation

◆ __init__()

def 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.

11  def __init__(self,
12  var_name = "", axis_title ="",
13  bins = -1, bmin = 0., bmax = 0., bin_width = -1,
14  bdir = None,
15 
16  name_old_rel ="", name_new_rel ="",
17 
18  test_tree = None,
19  branch_old = "", branch_new = "",
20  weight_old = None, weight_new = None,
21  log_binning = False
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()

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

◆ finalize()

def 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 

◆ get_new_histo()

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

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

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

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

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

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

def CheckAppliedSFs.ReleaseComparer.name (   self)

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)

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
private

Definition at line 33 of file CheckAppliedSFs.py.

◆ __min_quality

CheckAppliedSFs.ReleaseComparer.__min_quality
private

Definition at line 32 of file CheckAppliedSFs.py.

◆ __new_branch

CheckAppliedSFs.ReleaseComparer.__new_branch
private

Definition at line 14 of file CheckAppliedSFs.py.

◆ __new_histo

CheckAppliedSFs.ReleaseComparer.__new_histo
private

Definition at line 44 of file CheckAppliedSFs.py.

◆ __new_weight

CheckAppliedSFs.ReleaseComparer.__new_weight
private

Definition at line 22 of file CheckAppliedSFs.py.

◆ __old_branch

CheckAppliedSFs.ReleaseComparer.__old_branch
private

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
private

Definition at line 39 of file CheckAppliedSFs.py.

◆ __old_weight

CheckAppliedSFs.ReleaseComparer.__old_weight
private

Weights as a function of the muon kinematics.

Definition at line 21 of file CheckAppliedSFs.py.

◆ __quality_branch

CheckAppliedSFs.ReleaseComparer.__quality_branch
private

Definition at line 28 of file CheckAppliedSFs.py.

◆ __var_name

CheckAppliedSFs.ReleaseComparer.__var_name
private

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:50
max
#define max(a, b)
Definition: cfImp.cxx:41
min
#define min(a, b)
Definition: cfImp.cxx:40
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18