Belle II Software  release-05-02-19
PXDValidationTTree Class Reference
Inheritance diagram for PXDValidationTTree:
Collaboration diagram for PXDValidationTTree:

Public Member Functions

def __init__ (self)
 
def beginRun (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 file
 Output ROOT file.
 
 tree
 TTree for output data.
 
 h_consts
 Histogram for constances.
 
 data
 Instance of EventData class.
 

Detailed Description

A simple module to check the reconstruction of PXDTrueHits.
This module writes its output to a ROOT tree.
Primary goal is supporting of validation plots

Definition at line 54 of file PXDValidationTTree.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialize the module

Definition at line 62 of file PXDValidationTTree.py.

62  def __init__(self):
63  """Initialize the module"""
64 
65  super(PXDValidationTTree, self).__init__()
66 
67  self.file = ROOT.TFile('PXDValidationTTreeOutput.root', 'recreate')
68 
69  self.tree = ROOT.TTree('tree', 'Event data of PXD simulation')
70 
71  self.h_consts = ROOT.TH1F('h_consts', 'Constances', 12, 0, 12)
72  self.h_consts.GetXaxis().SetBinLabel(1, 'Sensor thicknes [cm] (0.0075)')
73  self.h_consts.GetXaxis().SetBinLabel(2, 'Pitch in u - all sensors [cm] (0.005)')
74  self.h_consts.GetXaxis().SetBinLabel(3, 'Pitch in v, layer 1 small pitch [cm] (0.0055)')
75  self.h_consts.GetXaxis().SetBinLabel(4, 'Pitch in v, layer 1 large pitch [cm] (0.006)')
76  self.h_consts.GetXaxis().SetBinLabel(5, 'Pitch in v, layer 2 small pitch [cm] (0.007)')
77  self.h_consts.GetXaxis().SetBinLabel(6, 'Pitch in v, layer 2 large pitch [cm] (0.0085)')
78  self.h_consts.GetXaxis().SetBinLabel(7, 'Number of cells in u, all layers (250)')
79  self.h_consts.GetXaxis().SetBinLabel(8, 'Number of cells in v, layer 1 small pitch (256)')
80  self.h_consts.GetXaxis().SetBinLabel(9, 'Number of cells in v, layer 1 large pitch (512)')
81  self.h_consts.GetXaxis().SetBinLabel(10, 'Number of cells in v, layer 2 small pitch (256)')
82  self.h_consts.GetXaxis().SetBinLabel(11, 'Number of cells in v, layer 2 large pitch (512)')
83  self.h_consts.GetXaxis().SetBinLabel(12, 'Noise of digits of sensors [electrons] (200)')
84 
85  self.data = EventData()
86  # Declare tree branches
87  for key in EventData.__dict__:
88  if '__' not in key:
89  formstring = '/F'
90  if isinstance(self.data.__getattribute__(key), int):
91  formstring = '/I'
92  self.tree.Branch(key, AddressOf(self.data, key), key + formstring)
93 

Member Function Documentation

◆ beginRun()

def beginRun (   self)
Does nothing 

Definition at line 94 of file PXDValidationTTree.py.

◆ event()

def event (   self)
Find clusters with a truehit and save needed information.

Definition at line 97 of file PXDValidationTTree.py.

◆ terminate()

def terminate (   self)
Close the output file.

Definition at line 196 of file PXDValidationTTree.py.


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