PyLamarr
Pythonizations for the ultra-fast simulation option for the LHCb experiment
 
Loading...
Searching...
No Matches
PyLamarr.loaders.UprootLoader.UprootLoader Class Reference

Ease loading nTuples generated with Gaussino into the SQLite event model of Lamarr. More...

Public Member Functions

 __init__ (self, str input_file, Collection[str] tables, str collector='LamarrCollector', str batch_id_var='batch_id', Union[int, None] max_rows=None)
 
 batches (self)
 
 __call__ (self, db)
 
 load (self, batch)
 

Public Attributes

 input_file
 
 tables
 
 bid_var
 
 logger
 

Protected Attributes

 _db
 
 _batch_codes
 
 _dataframe
 

Detailed Description

Ease loading nTuples generated with Gaussino into the SQLite event model of Lamarr.

As the other python data loaders, UprootLoader should be configured in the constructor. The configured object is then called during the event loop to pass the updated connection to the SQLamarr.SQLite3DB instance.

The ROOT file with path input_file is expected contain a TDirectory (named as configured with the collector keyword) with a TTree per SQLite table (the names of the TTrees are listed in tables) and each TTree should include a column (titled as indicated by batch_id_var) providing a unique identifier for the event number.

Definition at line 24 of file UprootLoader.py.

Constructor & Destructor Documentation

◆ __init__()

PyLamarr.loaders.UprootLoader.UprootLoader.__init__ (   self,
str  input_file,
Collection[str]  tables,
str   collector = 'LamarrCollector',
str   batch_id_var = 'batch_id',
Union[int, None]   max_rows = None 
)

Definition at line 41 of file UprootLoader.py.

Member Function Documentation

◆ __call__()

PyLamarr.loaders.UprootLoader.UprootLoader.__call__ (   self,
  db 
)

Definition at line 73 of file UprootLoader.py.

◆ batches()

PyLamarr.loaders.UprootLoader.UprootLoader.batches (   self)

Definition at line 69 of file UprootLoader.py.

◆ load()

PyLamarr.loaders.UprootLoader.UprootLoader.load (   self,
  batch 
)

Definition at line 78 of file UprootLoader.py.

Member Data Documentation

◆ _batch_codes

PyLamarr.loaders.UprootLoader.UprootLoader._batch_codes
protected

Definition at line 58 of file UprootLoader.py.

◆ _dataframe

PyLamarr.loaders.UprootLoader.UprootLoader._dataframe
protected

Definition at line 62 of file UprootLoader.py.

◆ _db

PyLamarr.loaders.UprootLoader.UprootLoader._db
protected

Definition at line 55 of file UprootLoader.py.

◆ bid_var

PyLamarr.loaders.UprootLoader.UprootLoader.bid_var

Definition at line 54 of file UprootLoader.py.

◆ input_file

PyLamarr.loaders.UprootLoader.UprootLoader.input_file

Definition at line 52 of file UprootLoader.py.

◆ logger

PyLamarr.loaders.UprootLoader.UprootLoader.logger

Definition at line 66 of file UprootLoader.py.

◆ tables

PyLamarr.loaders.UprootLoader.UprootLoader.tables

Definition at line 53 of file UprootLoader.py.


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