ATLAS Offline Software
GridTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SAMPLE_HANDLER__GRID_TOOLS_H
6 #define SAMPLE_HANDLER__GRID_TOOLS_H
7 
8 #include <SampleHandler/Global.h>
9 
11 #include <map>
12 #include <memory>
13 #include <set>
14 #include <vector>
15 
16 namespace SH
17 {
18  ANA_MSG_HEADER (msgGridTools)
19 
20 
21 
22  const std::string& downloadStageEnvVar ();
24 
25 
31  bool checkVomsProxy ();
32 
33 
44  void ensureVomsProxy ();
45 
46 
56  [[deprecated("please use rucioDirectAccessGlob instead")]]
57  std::vector<std::string>
58  faxListFilesGlob (const std::string& name, const std::string& filter);
59 
60 
71  [[deprecated("please use rucioDirectAccessRegex instead")]]
72  std::vector<std::string>
73  faxListFilesRegex (const std::string& name, const std::string& filter);
74 
75 
85  std::vector<std::string>
86  rucioDirectAccessGlob (const std::string& name, const std::string& filter,
87  const std::string& selectOptions);
88 
89 
100  std::vector<std::string>
101  rucioDirectAccessRegex (const std::string& name, const std::string& filter,
102  const std::string& selectOptions);
103 
104 
107  {
109  std::string scope;
110 
112  std::string name;
113 
115  std::string type;
116  };
117 
124  std::vector<RucioListDidsEntry>
125  rucioListDids (const std::string& dataset);
126 
127 
128 
131  {
133  std::string scope;
134 
136  std::string name;
137 
139  std::string filesize;
140 
142  std::string adler32;
143 
145  std::string disk;
146 
148  std::string replica;
149  };
150 
157  std::vector<RucioListFileReplicasEntry>
158  rucioListFileReplicas (const std::string& dataset);
159 
160 
161 
169  std::map<std::string,std::unique_ptr<MetaObject> >
170  rucioGetMetadata (const std::set<std::string>& datasets);
171 
172 
175  {
176  std::string did;
177  unsigned totalFiles = 0;
178  unsigned downloadedFiles = 0;
179  unsigned alreadyLocal = 0;
180  unsigned notDownloaded = 0;
181  };
182 
189  rucioDownload (const std::string& location,
190  const std::string& dataset);
191 
197  std::vector<RucioDownloadResult>
198  rucioDownloadList (const std::string& location,
199  const std::vector<std::string>& datasets);
200 
201 
209  std::vector<std::string>
210  rucioCacheDatasetGlob (const std::string& location,
211  const std::string& dataset,
212  const std::string& fileGlob);
213 }
214 
215 #endif
SH::RucioDownloadResult::totalFiles
unsigned totalFiles
Definition: GridTools.h:177
SH::faxListFilesRegex
std::vector< std::string > faxListFilesRegex(const std::string &name, const std::string &filter)
list the FAX URLs for all the files in the dataset or dataset container matching the given filter (as...
Definition: GridTools.cxx:234
SH::rucioListDids
std::vector< RucioListDidsEntry > rucioListDids(const std::string &dataset)
run rucio-list-dids for the given dataset
Definition: GridTools.cxx:348
SH::checkVomsProxy
bool checkVomsProxy()
return whether we have a valid VOMS proxy available
Definition: GridTools.cxx:206
SH::RucioListFileReplicasEntry::adler32
std::string adler32
the checksum
Definition: GridTools.h:142
SH::rucioDirectAccessRegex
std::vector< std::string > rucioDirectAccessRegex(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 (...
Definition: GridTools.cxx:291
SH::rucioListFileReplicas
std::vector< RucioListFileReplicasEntry > rucioListFileReplicas(const std::string &dataset)
run rucio-list-file-replicas for the given dataset
Definition: GridTools.cxx:384
SH::RucioListFileReplicasEntry::replica
std::string replica
the replica
Definition: GridTools.h:148
SH::RucioListFileReplicasEntry
one entry from the rucio-list-file-replicas command
Definition: GridTools.h:131
SH::rucioDirectAccessGlob
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 (...
Definition: GridTools.cxx:281
SH::RucioDownloadResult::alreadyLocal
unsigned alreadyLocal
Definition: GridTools.h:179
SH::RucioListFileReplicasEntry::filesize
std::string filesize
the file size
Definition: GridTools.h:139
covarianceTool.filter
filter
Definition: covarianceTool.py:514
SH::RucioListDidsEntry::scope
std::string scope
the scope
Definition: GridTools.h:109
ANA_MSG_HEADER
#define ANA_MSG_HEADER(NAME)
for standalone code this creates a new message category
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:113
SH::RucioListDidsEntry
one entry from the rucio-list-dids command
Definition: GridTools.h:107
SH::RucioListFileReplicasEntry::scope
std::string scope
the scope
Definition: GridTools.h:133
SH::RucioListDidsEntry::type
std::string type
the type
Definition: GridTools.h:115
MessageCheck.h
macros for messaging and checking status codes
SH::rucioGetMetadata
std::map< std::string, std::unique_ptr< MetaObject > > rucioGetMetadata(const std::set< std::string > &datasets)
run rucio-get-metadata for the given list of datasets
Definition: GridTools.cxx:426
dataset
Definition: dataset.h:27
SH::rucioDownload
RucioDownloadResult rucioDownload(const std::string &location, const std::string &dataset)
run rucio-download
Definition: GridTools.cxx:496
SH::ensureVomsProxy
void ensureVomsProxy()
ensure that we have a valid VOMS proxy available
Definition: GridTools.cxx:213
SH::RucioDownloadResult::downloadedFiles
unsigned downloadedFiles
Definition: GridTools.h:178
SH::RucioDownloadResult::did
std::string did
Definition: GridTools.h:176
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SH::rucioCacheDatasetGlob
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
Definition: GridTools.cxx:535
runJobs.deprecated
deprecated
Definition: runJobs.py:191
SH::RucioDownloadResult
the result from rucio_download
Definition: GridTools.h:175
SH::RucioDownloadResult::notDownloaded
unsigned notDownloaded
Definition: GridTools.h:180
SH::RucioListFileReplicasEntry::name
std::string name
the name
Definition: GridTools.h:136
SH::RucioListDidsEntry::name
std::string name
the name
Definition: GridTools.h:112
SH::downloadStageEnvVar
const std::string & downloadStageEnvVar()
the name of the environment variable containing the directory for staging files from the grid
Definition: GridTools.cxx:198
SH
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition: PrunDriver.h:15
SH::rucioDownloadList
std::vector< RucioDownloadResult > rucioDownloadList(const std::string &location, const std::vector< std::string > &datasets)
run rucio-download with multiple datasets
Definition: GridTools.cxx:523
SH::faxListFilesGlob
std::vector< std::string > faxListFilesGlob(const std::string &name, const std::string &filter)
list the FAX URLs for all the files in the dataset or dataset container matching the given filter (as...
Definition: GridTools.cxx:221
Global.h
SH::RucioListFileReplicasEntry::disk
std::string disk
the disk the replica is on
Definition: GridTools.h:145