Belle II Software  light-2403-persian
GraFEIModule Class Reference
Inheritance diagram for GraFEIModule:
Collaboration diagram for GraFEIModule:

Public Member Functions

def __init__ (self, particle_list, cfg_path=None, param_file=None, sig_side_lcas=None, sig_side_masses=None, gpu=False, payload_config_name="graFEIConfigFile", payload_model_name="graFEIModelFile")
 
def initialize (self)
 
def event (self)
 

Public Attributes

 particle_list
 Input particle list.
 
 cfg_path
 Config yaml file path.
 
 param_file
 PyTorch parameter file path.
 
 sig_side_lcas
 Chosen sig-side LCAS.
 
 sig_side_masses
 Chosen sig-side mass hypotheses.
 
 gpu
 If running on GPU.
 
 payload_config_name
 Config file name in the payload.
 
 payload_model_name
 Model file name in the payload.
 
 storeTrueInfo
 Figure out if we re running on data or MC.
 
 device
 Figure out which device all this is running on - CPU or GPU.
 
 configs
 Config file.
 
 mc_particle
 Top MC particle.
 
 max_level
 Max LCAS level.
 
 normalize
 Normalize features.
 
 use_amp
 Mixed precision.
 
 node_features
 Node features.
 
 edge_features
 Edge features.
 
 glob_features
 Global features.
 
 discarded_features
 Discarded node features.
 
 model
 The model The correct edge_classes is taken from the config file.
 

Detailed Description

Applies graFEI model to a particle list in basf2.
GraFEI information is stored as extraInfos.

Args:
    particle_list (str): Name of particle list.
    cfg_path (str): Path to config file. If `None` the config file in the global tag is used.
    param_file (str): Path to parameter file containing the model. If `None` the parameter file in the global tag is used.
    sig_side_lcas (list): List containing LCAS matrix of signal-side.
    sig_side_masses (list): List containing mass hypotheses of signal-side.
    gpu (bool): Whether to run on a GPU.
    payload_config_name (str): Name of config file payload. The default should be kept, except in basf2 examples.
    payload_model_name (str): Name of model file payload. The default should be kept, except in basf2 examples.

Definition at line 31 of file GraFEIModule.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  particle_list,
  cfg_path = None,
  param_file = None,
  sig_side_lcas = None,
  sig_side_masses = None,
  gpu = False,
  payload_config_name = "graFEIConfigFile",
  payload_model_name = "graFEIModelFile" 
)
Initialization.

Definition at line 47 of file GraFEIModule.py.

57  ):
58  """
59  Initialization.
60  """
61  super().__init__()
62 
63  self.particle_list = particle_list
64 
65  self.cfg_path = cfg_path
66 
67  self.param_file = param_file
68 
69  self.sig_side_lcas = torch.tensor(sig_side_lcas) if sig_side_lcas else None
70 
71  self.sig_side_masses = sig_side_masses
72 
73  self.gpu = gpu
74 
75  self.payload_config_name = payload_config_name
76 
77  self.payload_model_name = payload_model_name
78 

Member Function Documentation

◆ event()

def event (   self)
Called at the beginning of each event.

Definition at line 173 of file GraFEIModule.py.

◆ initialize()

def initialize (   self)
Called at the beginning.

Definition at line 79 of file GraFEIModule.py.


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