Belle II Software development
MonitoringNTuple Class Reference

Public Member Functions

 __init__ (self, filename, treenameprefix)
 

Public Attributes

 valid = os.path.isfile(filename)
 Indicates if the ntuple were successfully read.
 
 f = ROOT.TFile.Open(filename, 'read')
 Reference to the ROOT file, so it isn't closed.
 
 tree = self.f.Get(ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(f'{treenameprefix} variables'))
 Reference to the tree named variables inside the ROOT file.
 
 filename = filename
 Filename so we can use it later.
 

Detailed Description

Reads the ntuple named variables from a ROOT file

Definition at line 298 of file monitoring.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
filename,
treenameprefix )
Reads ntuple from the given file
@param filename the name of the ROOT file

Definition at line 303 of file monitoring.py.

303 def __init__(self, filename, treenameprefix):
304 """
305 Reads ntuple from the given file
306 @param filename the name of the ROOT file
307 """
308 # Always avoid the top-level 'import ROOT'.
309 import ROOT # noqa
310
311 self.valid = os.path.isfile(filename)
312 print(f'FEI-monitoring: Looking for {filename}')
313 if not self.valid:
314 raise RuntimeError(f"Could not find {filename}: current dir is {os.getcwd()}")
315 return
316
317 self.f = ROOT.TFile.Open(filename, 'read')
318 print(f'FEI-monitoring: Found {filename}')
319
320 self.tree = self.f.Get(ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(f'{treenameprefix} variables'))
321 print(f'FEI-monitoring: Found {treenameprefix} variables')
322
323 self.filename = filename
324
325

Member Data Documentation

◆ f

f = ROOT.TFile.Open(filename, 'read')

Reference to the ROOT file, so it isn't closed.

Definition at line 317 of file monitoring.py.

◆ filename

filename = filename

Filename so we can use it later.

Definition at line 323 of file monitoring.py.

◆ tree

tree = self.f.Get(ROOT.Belle2.MakeROOTCompatible.makeROOTCompatible(f'{treenameprefix} variables'))

Reference to the tree named variables inside the ROOT file.

Definition at line 320 of file monitoring.py.

◆ valid

valid = os.path.isfile(filename)

Indicates if the ntuple were successfully read.

Definition at line 311 of file monitoring.py.


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