17namespace Experimental {
19RSample::RSample(
const std::string &sampleName,
const std::string &treeName,
const std::string &fileNameGlob,
21 :
RSample(sampleName, std::vector<std::string>{treeName}, std::vector<std::string>{fileNameGlob}, metaData)
26 const std::vector<std::string> &fileNameGlobs,
const RMetaData &metaData)
27 :
RSample(sampleName, std::vector<std::string>(fileNameGlobs.
size(), treeName), fileNameGlobs, metaData)
32 const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
34 : fSampleName(sampleName), fMetaData(metaData)
37 if (treeAndFileNameGlobs.empty())
41 for (
const auto &
p : treeAndFileNameGlobs) {
42 const auto fullpath =
p.second +
"?#" +
p.first;
43 chain.
Add(fullpath.c_str());
46 fTreeNames.reserve(expandedNames->GetEntries());
48 for (
auto i = 0; i < expandedNames->GetEntries(); ++i) {
49 fTreeNames.emplace_back(expandedNames->At(i)->GetName());
54RSample::RSample(
const std::string &sampleName,
const std::vector<std::string> &treeNames,
55 const std::vector<std::string> &fileNameGlobs,
const RMetaData &metaData)
56 : fSampleName(sampleName), fMetaData(metaData)
58 if (treeNames.size() != 1 && treeNames.size() != fileNameGlobs.size())
59 throw std::logic_error(
"Mismatch between number of trees and file globs.");
61 for (
auto i = 0u; i < fileNameGlobs.size(); ++i) {
62 const auto fullpath = fileNameGlobs[i] +
"?#" + (treeNames.size() == 1u ? treeNames[0] : treeNames[i]);
63 chain.
Add(fullpath.c_str());
66 fTreeNames.reserve(expandedNames->GetEntries());
68 for (
auto i = 0; i < expandedNames->GetEntries(); ++i) {
69 fTreeNames.emplace_back(expandedNames->At(i)->GetName());
94unsigned int RSample::GetSampleId()
const
99void RSample::SetSampleId(
unsigned int id)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Class representing a sample (grouping of trees (and their fileglobs) and (optional) metadata)
const std::string & GetSampleName() const
const std::vector< std::string > & GetFileNameGlobs() const
std::vector< std::string > fFileNameGlobs
A list of file names.
const std::vector< std::string > & GetTreeNames() const
const RMetaData & GetMetaData() const
std::vector< std::string > fTreeNames
A list of names of trees.
A chain is a collection of files containing TTree objects.
TObjArray * GetListOfFiles() const
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.