Belle II Software  release-06-01-15
TestSampleList Class Reference
Collaboration diagram for TestSampleList:

Public Member Functions

def __init__ (self, *SampleYAML=None, SampleDict=None, SampleList=None)
 
def __iter__ (self)
 
def __getitem__ (self, i)
 
def __len__ (self)
 
def __repr__ (self)
 
def SampleDict (self)
 
def validate_schema (self, SampleDict, InputYAML=None)
 
def query_mc_samples (self, *process=None, campaign=None, beam_energy=None, beam_background=None, exact_match=False, inplace=False)
 
def query_data_samples (self, *processing=None, experiment=None, beam_energy=None, general_skim=None, exact_match=False, inplace=False)
 

Public Attributes

 mc_samples
 
 data_samples
 
 custom_samples
 

Static Public Attributes

tuple DefaultSampleYAML
 

Private Member Functions

def _all_samples (self)
 
def _parse_all_samples (self, SampleDict)
 

Static Private Member Functions

def _parse_samples (SampleDict, BlockName, SampleClass)
 

Detailed Description

Container class for lists of MC, data, and custom samples.

Definition at line 246 of file testfiles.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
SampleYAML = None,
  SampleDict = None,
  SampleList = None 
)
Initialise a list of test samples. Three methods are of initialisation are
allowed. If no arguments are given this function will default to a standard list
of samples defined in
``/group/belle2/dataprod/MC/SkimTraining/SampleLists/TestFiles.yaml``.

Parameters:
    SampleYAML (str, pathlib.path): Path to a YAML file containing sample
        specifications.
    SampleDict (dict): Dict containing sample specifications.
    SampleList (list(Sample)): List of Sample objects.

Definition at line 253 of file testfiles.py.

Member Function Documentation

◆ _parse_all_samples()

def _parse_all_samples (   self,
  SampleDict 
)
private
Read in each block of the YAML and create lists of sample objects.

Definition at line 349 of file testfiles.py.

◆ query_data_samples()

def query_data_samples (   self,
processing = None,
  experiment = None,
  beam_energy = None,
  general_skim = None,
  exact_match = False,
  inplace = False 
)
Find all MC samples matching query.

Parameters:
    processing (str): Data processing campaign number to query.
    experiment (str, int): Experiment number to query.
    beam_energy (str): Beam energy to query.
    general_skim (skim): ``GeneralSkimName`` to query.
    exact_match (bool): If passed, an error is raised if there is not exactly
        one matching sample. If there is exactly one matching sample, then the
        single sample is returned, rather than a list.
    inplace (bool): Replace MC samples with the list obtained from query.

Definition at line 430 of file testfiles.py.

◆ query_mc_samples()

def query_mc_samples (   self,
process = None,
  campaign = None,
  beam_energy = None,
  beam_background = None,
  exact_match = False,
  inplace = False 
)
Find all MC samples matching query.

Parameters:
    process (str): Simulated MC process to query.
    campaign (str, int): MC campaign number to query.
    beam_energy (str): Beam energy to query.
    beam_background (str, int): Nominal beam background to query.
    exact_match (bool): If passed, an error is raised if there is not exactly
        one matching sample. If there is exactly one matching sample, then the
        single sample is returned, rather than a list.
    inplace (bool): Replace MC samples with the list obtained from query.

Definition at line 381 of file testfiles.py.

◆ validate_schema()

def validate_schema (   self,
  SampleDict,
  InputYAML = None 
)
Validate YAML input against JSON schema defined in
``skim/tools/resources/test_samples_schema.json``.

Definition at line 313 of file testfiles.py.

Member Data Documentation

◆ DefaultSampleYAML

tuple DefaultSampleYAML
static
Initial value:
= (
"/group/belle2/dataprod/MC/SkimTraining/SampleLists/TestFiles.yaml"
)

Definition at line 249 of file testfiles.py.


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