28{
29 void SampleGrid ::
30 testInvariant () const
31 {
32 }
33
34
35
36 SampleGrid ::
37 SampleGrid ()
38 : Sample ("unnamed")
39 {
41 }
42
43
44
45 SampleGrid ::
46 SampleGrid (const std::string& name)
48 {
50 }
51
52
53
54 std::size_t SampleGrid ::
55 getNumFiles () const
56 {
58 throw std::runtime_error ("Sample::numFiles not supported for SampleGrid");
59 }
60
61
62
63 std::string SampleGrid ::
64 getFileName (const std::size_t ) const
65 {
67 throw std::runtime_error ("Sample::fileName not supported for SampleGrid");
68 }
69
70
71
72 std::unique_ptr<SampleLocal> SampleGrid ::
73 doMakeLocal () const
74 {
76
77 auto result = std::make_unique<SampleLocal> (
name());
78 for (
auto&
file : makeFileList ())
81 }
82
83
84
85 std::vector<std::string> SampleGrid ::
86 doMakeFileList () const
87 {
89 using namespace msgGridTools;
90
92
94 =
meta()->castString (MetaFields::gridName,
name());
95 const std::string fileFilter
96 =
meta()->castString (MetaFields::gridFilter, MetaFields::gridFilter_default);
97
98 if (downloadDir)
99 {
101 if (downloadDir[0] != '/')
102 throw std::runtime_error (
"rucio download path in variable " +
downloadStageEnvVar() +
" should start with /");
104 } else
105 {
106 ANA_MSG_DEBUG (
"download dir not set, trying direct access");
107 const std::string sourceOptions
108 =
meta()->castString (MetaFields::gridSourceOptions);
110 }
111 }
112}
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
std::string getenv(const std::string &variableName)
get an environment variable
const std::string & downloadStageEnvVar()
the name of the environment variable containing the directory for staging files from the grid
std::vector< std::string > rucioCacheDatasetGlob(const std::string &location, const std::string &dataset, const std::string &fileGlob)
download the dataset, and return a list matching the pattern
std::vector< std::string > rucioDirectAccessGlob(const std::string &name, const std::string &filter, const std::string &selectOptions)
list the rucio URLs for all the files in the dataset or dataset container matching the given filter (...