DatasetInfo Class Reference

Input files included in a dataset and metadata about it. More...

#include <Dataset.h>

Collaboration diagram for DatasetInfo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DatasetInfo (std::filesystem::path const &path, Options const &options)
 Constructor from a dataset definition file.
std::filesystem::path const & DefinitionFile () const
 Returns path to dataset definition file used.
double CrossSection () const
 Returns the cross section, in pb.
std::vector< std::string > const & Files () const
 Returns paths to all input files in the dataset.
bool IsSimulation () const
 Indicates whether this is simulation or real data.
double MeanWeight () const
 Returns mean nominal weight in the dataset.
std::string const & Name () const
 Returns unique name of the dataset.
int64_t NumEventsTotal () const
 Returns total number of events before any selection.
YAML::Node const & Parameters () const
 Parameters extracted from dataset definition file.

Private Member Functions

YAML::Node const FindStem (std::string_view name) const
 Finds stem dataset definition with given name.
YAML::Node const GetNode (YAML::Node const root, std::string const &key) const
 Get a scalar node from dataset definition file with error reporting.
void ReadYaml (std::filesystem::path const &path)
 Reads YAML dataset definition file.
void SpliceYaml (YAML::Node info) const
 Incorporate stem definition into the given dataset definition fragment.

Private Attributes

std::vector
< std::filesystem::path > 
stemsFiles_
 Locations of files with dataset stems.
std::filesystem::path definitionFile_
 Path to dataset definition file.
std::vector< std::string > files_
 Paths to input files in the dataset.
YAML::Node parameters_
 Parameters extracted from dataset definition file.
std::string name_
 Name that uniquely identifies the dataset.
bool isSimulation_
 Indicates whether this is simulation or real data.
double crossSection_
 Cross section, in pb.
int64_t numEventsTotal_
 Total number of events before any selection.
double meanWeight_
 Mean nominal event weight.

Detailed Description

Input files included in a dataset and metadata about it.

An object of this class is created from a text file definining a dataset. Several file formats are supported, as described here:

  1. Full YAML dataset definition file.
  2. YAML dataset definition fragment that provides several parameters and points to a stem definition fragment. The stem fragment is included into it. This class searches the stem fragment within YAML files whose locations are specified in the master configuration.

The access to the list of input files and some generic parameters is provided with dedicated methods. All other parameters are accessible via YAML::Node returned by Parameters.


Member Function Documentation

double DatasetInfo::CrossSection (  )  const [inline]

Returns the cross section, in pb.

Undefined for real data.

std::vector<std::string> const& DatasetInfo::Files (  )  const [inline]

Returns paths to all input files in the dataset.

The paths can include protocol prefix for ROOT::TFile::Open.

double DatasetInfo::MeanWeight (  )  const [inline]

Returns mean nominal weight in the dataset.

Undefined for real data.

int64_t DatasetInfo::NumEventsTotal (  )  const [inline]

Returns total number of events before any selection.

Undefined for real data.

YAML::Node const& DatasetInfo::Parameters (  )  const [inline]

Parameters extracted from dataset definition file.

This includes all parameters except the paths to input files.

void DatasetInfo::ReadYaml ( std::filesystem::path const &  path  )  [private]

Reads YAML dataset definition file.

The stem definition is incorporated if needed.

void DatasetInfo::SpliceYaml ( YAML::Node  info  )  const [private]

Incorporate stem definition into the given dataset definition fragment.

The given node is modified in place. Key "stem" is removed.


Member Data Documentation

double DatasetInfo::crossSection_ [private]

Cross section, in pb.

Undefined for real data.

std::filesystem::path DatasetInfo::definitionFile_ [private]

Path to dataset definition file.

Mostly needed for error reports.

std::vector<std::string> DatasetInfo::files_ [private]

Paths to input files in the dataset.

These can include protocol prefix for ROOT::TFile::Open and therefore cannot be represented with std::filesystem::path.

double DatasetInfo::meanWeight_ [private]

Mean nominal event weight.

Undefined for real data.

int64_t DatasetInfo::numEventsTotal_ [private]

Total number of events before any selection.

Undefined for real data.

YAML::Node DatasetInfo::parameters_ [private]

Parameters extracted from dataset definition file.

See Parameters.

std::vector<std::filesystem::path> DatasetInfo::stemsFiles_ [private]

Locations of files with dataset stems.

Only needed to construct the full dataset definition from a YAML fragment.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Enumerator

Generated on 30 Oct 2020 for H→ZZ→2ℓ2ν analysis by  doxygen 1.6.1