Crombie Tools
|
A single object that holds all of the information about the files to run on. More...
#include <FileConfig.h>
Public Member Functions | |
FileConfig (const std::string &inputdir, const bool onedir=true) | |
const DirectoryInfo & | get_dir (const std::string &dirname) const |
Read a single directory info. More... | |
const std::vector< DirectoryInfo > & | get_dirs () const |
Read the directory infos. More... | |
const bool | has_data () const |
Say if this object has data directories stored in it. More... | |
const bool | has_mc () const |
Say if this object has MC directories stored in it. More... | |
template<typename M , typename R > | |
auto | runfiles (MapFunc< M > map, R reduce) |
This will perform a map-reduce operation on all of the files in this configuration. More... | |
Private Attributes | |
bool | _has_data {false} |
Tracks when data files are stored. More... | |
bool | _has_mc {false} |
Tracks when MC files are stored. More... | |
std::vector< DirectoryInfo > | dirinfos |
Internal store of DirectoryInfo objects. More... | |
const std::string | inputdir |
The directory containing the files. More... | |
Friends | |
std::istream & | operator>> (std::istream &is, FileConfig &config) |
A single object that holds all of the information about the files to run on.
This is the result of reading a single file configuration file.
Definition at line 157 of file FileConfig.h.
crombie::FileConfig::FileConfig::FileConfig | ( | const std::string & | inputdir, |
const bool | onedir = true |
||
) |
Definition at line 206 of file FileConfig.h.
References hadd::input, and inputdir.
const DirectoryInfo & crombie::FileConfig::FileConfig::get_dir | ( | const std::string & | dirname | ) | const |
Read a single directory info.
Definition at line 215 of file FileConfig.h.
References crombie_completion::dir, and dirinfos.
|
inline |
Read the directory infos.
Definition at line 173 of file FileConfig.h.
References crombie::FileSystem::dirname().
Referenced by crombie::Plotter::Merge().
|
inline |
Say if this object has data directories stored in it.
Definition at line 181 of file FileConfig.h.
|
inline |
Say if this object has MC directories stored in it.
Definition at line 179 of file FileConfig.h.
Referenced by crombie::Plotter::Merge().
auto crombie::FileConfig::FileConfig::runfiles | ( | MapFunc< M > | map, |
R | reduce | ||
) |
This will perform a map-reduce operation on all of the files in this configuration.
Takes two functions. One to map files to outputs and one to reduce these outputs.
M | The type of output of the map function |
R | The type of reduce |
map | Is a function that takes a FileInfo as input, and outputs some object of type M |
reduce | is fed ToMerge<M> as input. Whatever reduce returns is returned by runfiles. |
Definition at line 315 of file FileConfig.h.
References dumpfilelist::count, Debug::Debug(), dirinfos, crombie::FileConfig::FileInfo::dirname, crombie::Misc::draw_progress(), crombie::Misc::env(), crombie::FileConfig::FileInfo::name, and localslim::running.
|
friend |
Definition at line 254 of file FileConfig.h.
|
private |
Tracks when data files are stored.
Definition at line 188 of file FileConfig.h.
Referenced by crombie::FileConfig::operator>>().
|
private |
Tracks when MC files are stored.
Definition at line 187 of file FileConfig.h.
Referenced by crombie::FileConfig::operator>>().
|
private |
Internal store of DirectoryInfo objects.
Definition at line 184 of file FileConfig.h.
Referenced by get_dir(), crombie::FileConfig::operator>>(), and runfiles().
|
private |
The directory containing the files.
Definition at line 185 of file FileConfig.h.
Referenced by FileConfig(), and crombie::FileConfig::operator>>().