|
ATLAS Offline Software
|
Go to the documentation of this file.
34 : m_relSampleDepth (-2), m_absSampleDepth (0),
35 m_minDepth (0), m_maxDepth (-1),
40 m_samplePostfixEmpty (true),
41 m_extraNameComponent (0)
103 fileRegex (
const std::string& val_fileRegex)
190 std::vector<std::string> hierarchy;
191 hierarchy.push_back (
list.dirname());
193 std::map<std::string,SamplePtr> samples;
196 for (samplesIter
sample = samples.begin(),
end = samples.end();
199 if (
sample->second.get() != 0)
211 const std::vector<std::string>& hierarchy)
const
213 using namespace msgScanDir;
218 std::unique_ptr<DiskList> sublist (
list.openDir());
220 if (sublist.get() != 0)
224 ANA_MSG_DEBUG (
"directory does not match pattern, skipping directory " <<
list.path());
231 std::vector<std::string> subhierarchy = hierarchy;
232 subhierarchy.push_back (
list.fileName());
233 recurse (samples, *sublist, subhierarchy);
241 std::vector<std::string> subhierarchy = hierarchy;
242 subhierarchy.push_back (
list.fileName());
256 const std::vector<std::string>& hierarchy,
257 const std::string&
path)
const
275 iter !=
end && !done; ++ iter)
291 if (component.empty())
315 if (iter == samples.end())
331 int relSampleDepth)
const
336 if (relSampleDepth < 0)
337 myindex = relSampleDepth + hierarchy.size();
338 if (std::size_t (myindex) >= hierarchy.size())
357 if (
split == std::string::npos)
369 if (
split != std::string::npos)
JetConstituentVector::iterator iterator
the class used for scanning local directories and file servers for samples
boost::regex m_samplePattern
the value set by samplePattern, converted to a regular expression
ScanDir & sampleRename(const std::string &pattern, const std::string &name)
rename any sample matching pattern to name
ScanDir & directoryRegex(const std::string &val_directoryRegex)
the regular expression for directories to be visited
std::vector< std::pair< boost::regex, std::string > >::const_iterator SampleRenameIter
the list of entries from sampleRename
ScanDir & maxDepth(std::size_t val_maxDepth)
the maximum depth for files to make it into the sample
path
python interpreter configuration --------------------------------------—
boost::regex m_filePattern
the value set by filePattern, converted to a regular expression
boost::regex m_samplePostfix
the value set by samplePostfix, converted to a regular expression
std::size_t m_minDepth
the value set by minDepth
bool m_samplePostfixEmpty
whether samplePostfix has been set to the empty string
boost::regex m_directoryPattern
the value set by directoryPattern, converted to a regular expression
std::string findPathComponent(const std::vector< std::string > &hierarchy, int absSampleDepth, int relSampleDepth) const
find the path component at the given depth
This module defines a variety of assert style macros.
std::string m_sampleName
the value set by sampleName
ScanDir & samplePattern(const std::string &val_samplePattern)
the pattern for samples to be accepted
ScanDir & directoryPattern(const std::string &val_directoryPattern)
the pattern for directories to be visited
ScanDir & samplePostfix(const std::string &val_samplePostfix)
the pattern for the postfix to be stripped from the sampleName
int m_relSampleDepth
if this is negative it is the depth at which we take the sample name, counting from the end
ScanDir & sampleDepth(int val_sampleDepth)
the index of the file hierarchy at which we gather the sample name.
bool match_expr(const boost::regex &expr, const std::string &str)
returns: whether we can match the entire string with the regular expression guarantee: strong failure...
an interface for listing directory contents, locally or on a file server
ScanDir & absSampleDepth(int val_absSampleDepth)
the index of the file hierarchy at which we gather the sample name.
ScanDir & extraNameComponent(int val_relSampleDepth)
attach an extra name component to the sample based on a second component of the path
a DiskList implementation for EOS
std::vector< std::pair< boost::regex, std::string > > m_sampleRename
ScanDir & fileRegex(const std::string &val_fileRegex)
the regular expression for files to be accepted
int m_absSampleDepth
if m_relSampleDepth is not negative, it is the depth at which we take the sample name,...
A smart pointer class that holds a single Sample object.
a DiskList implementation for local directories
const ScanDir & scan(SampleHandler &sh, const std::string &dir) const
scan the given directory and put the created samples into the sample handler
std::size_t m_maxDepth
the value set by maxDepth
A Sample based on a simple file list.
const ScanDir & scanEOS(SampleHandler &sh, const std::string &eosDir) const
scan the given directory in EOS and put the created samples into the sample handler
ScanDir & sampleName(const std::string &val_sampleName)
a single sample name into which all found files should be placed.
ScanDir & filePattern(const std::string &val_filePattern)
the pattern for files to be accepted
A class that manages a list of Sample objects.
This module provides a lot of global definitions, forward declarations and includes that are used by ...
#define RCU_THROW_MSG(message)
std::string glob_to_regexp(const std::string &glob)
returns: a string that is the regular expression equivalent of the given glob expression guarantee: s...
int m_extraNameComponent
the depth set with extraNameComponent, or 0 otherwise
void addSampleFile(std::map< std::string, SamplePtr > &samples, const std::vector< std::string > &hierarchy, const std::string &path) const
add the given file to the sample based on the hierarchy, creating the sample if necessary
ScanDir()
standard constructor
void recurse(std::map< std::string, SamplePtr > &samples, DiskList &list, const std::vector< std::string > &hierarchy) const
perform the recursive scanning of the directory tree
ScanDir & minDepth(std::size_t val_minDepth)
the minimum depth for files to make it into the sample