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 RCU_THROW_MSG (
"Sample::numFiles not supported for SampleGrid");
59 return 0;
60 }
61
62
63
64 std::string SampleGrid ::
65 getFileName (const std::size_t ) const
66 {
68 RCU_THROW_MSG (
"Sample::fileName not supported for SampleGrid");
69 return "";
70 }
71
72
73
74 std::unique_ptr<SampleLocal> SampleGrid ::
75 doMakeLocal () const
76 {
78
79 std::unique_ptr<SampleLocal>
result (
new SampleLocal (
name()));
80 for (
auto&
file : makeFileList ())
83 }
84
85
86
87 std::vector<std::string> SampleGrid ::
88 doMakeFileList () const
89 {
91 using namespace msgGridTools;
92
94
96 =
meta()->castString (MetaFields::gridName,
name());
97 const std::string fileFilter
98 =
meta()->castString (MetaFields::gridFilter, MetaFields::gridFilter_default);
99
100 if (downloadDir)
101 {
103 if (downloadDir[0] != '/')
104 throw std::runtime_error (
"rucio download path in variable " +
downloadStageEnvVar() +
" should start with /");
106 } else
107 {
108 ANA_MSG_DEBUG (
"download dir not set, trying direct access");
109 const std::string sourceOptions
110 =
meta()->castString (MetaFields::gridSourceOptions);
112 }
113 }
114}
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
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 (...