BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
get_file_list.C
Go to the documentation of this file.
1
// macro for obtaining file list satisfying given criteria
2
#ifndef __CLING__
3
#include "
../FileCatalogue.cxx
"
4
#include "
../FileCatalogue.h
"
5
using namespace
std
;
6
#endif
7
8
void
get_file_list
()
9
{
10
// create one or more FileCondition objects with necessary criteria
11
unique_ptr<FileCondition> period_condition =
12
make_unique<FileCondition>(
FileCondition::kPeriodNumber
,
FileCondition::kEqual
, 9);
13
unique_ptr<FileCondition> energy_condition =
14
make_unique<FileCondition>(
FileCondition::kEnergy
,
FileCondition::kEqual
, 3.0f);
15
16
// add FileCondition objects to vector
17
vector<unique_ptr<FileCondition>> condition_vec;
18
condition_vec.push_back(std::move(period_condition));
19
condition_vec.push_back(std::move(energy_condition));
20
21
// create File Catalogue interface
22
FileCatalogue
* FC =
new
FileCatalogue
();
23
24
vector<string> file_lfns;
25
26
// call GetFileList() function and pass the vector
27
int
res = FC->
GetFileList
(std::move(condition_vec), file_lfns);
28
29
// print result vector with LFN (Logical File Name) strings
30
if
(res)
31
cout <<
"Error: "
<<
GetErrorString
(-res) << endl;
32
else
{
33
cout <<
" File List for the condtions: "
<< (file_lfns.empty() ?
"empty"
:
""
) << endl;
34
for
(
auto
file_lfn : file_lfns)
35
cout <<
" "
<< file_lfn << endl;
36
}
37
delete
FC;
38
}
GetErrorString
string const GetErrorString(int error_id)
Definition
EventCatalogue.cxx:22
FileCatalogue.cxx
FileCatalogue
Main Interface Class to work with the File Catalog of the experiment Throws runtime_exception if a cr...
Definition
FileCatalogue.h:135
FileCatalogue::GetFileList
int GetFileList(vector< unique_ptr< FileCondition > > file_conditions, vector< string > &filepaths)
Function for searching for file metadata in the File Catalog using specified conditions.
Definition
FileCatalogue.cxx:135
FileCondition::kEnergy
@ kEnergy
Definition
FileCatalogue.h:80
FileCondition::kPeriodNumber
@ kPeriodNumber
Definition
FileCatalogue.h:73
FileCondition::kEqual
@ kEqual
Definition
FileCatalogue.h:92
FileCatalogue.h
get_file_list
void get_file_list()
Definition
get_file_list.C:8
std
Definition
json.hpp:4446
database
file_db
examples
get_file_list.C
Generated on
for BmnRoot by
1.17.0