32 TList* subDirectoryNames = directory->GetListOfKeys();
33 if ( !subDirectoryNames )
return;
35 TIter
next(subDirectoryNames);
36 while ( TKey*
key = dynamic_cast<TKey*>(
next()) ) {
38 TObject*
obj = directory->Get(
key->GetName());
40 if ( TDirectory* subDirectory = dynamic_cast<TDirectory*>(obj) ) {
44 subDirectories.insert(subDirectoryName);
62 for ( vstring::const_iterator
inputFile = inputFileList.begin();
66 size_t posRangeEnd =
inputFile->find(
'#', posRangeStart);
68 size_t posRangeSeparator =
inputFile->find(
'-', posRangeStart);
70 if ( (posRangeEnd == std::string::npos) ||
71 (posRangeSeparator >= posRangeEnd) ) {
72 edm::LogError (
"TauDQMFileLoader::cfgEntryFileSet") <<
" Invalid range specification in inputFile = " << (*inputFile) <<
" !!";
81 if ( firstFile.length() != lastFile.length() ) {
82 edm::LogError (
"TauDQMFileLoader::cfgEntryFileSet") <<
" Invalid range specification in inputFile = " << (*inputFile) <<
" !!";
86 int numFirstFile = atoi(firstFile.data());
87 int numLastFile = atoi(lastFile.data());
88 for (
int iFile = numFirstFile; iFile <= numLastFile; ++iFile ) {
91 fileName << std::setfill(
'0') << std::setw(firstFile.length()) << iFile;
111 std::cout <<
"<cfgEntryFileSet::print>:" << std::endl;
124 std::cout <<
"<TauDQMFileLoader::TauDQMFileLoader>:" << std::endl;
136 for ( std::map<std::string, cfgEntryFileSet>::const_iterator
fileSet =
fileSets_.begin();
139 edm::LogError (
"TauDQMFileLoader") <<
" dqmDirectory_store undefined for fileSet = " <<
fileSet->second.name_ <<
" !!";
160 std::cout <<
"<TauDQMFileLoader::endJob>:" << std::endl;
164 edm::LogError (
"endJob") <<
" Error in Configuration ParameterSet" 165 <<
" --> histograms will NOT be loaded !!";
172 <<
" --> histograms will NOT be loaded !!";
183 for ( std::map<std::string, cfgEntryFileSet>::const_iterator
fileSet =
fileSets_.begin();
190 edm::LogError (
"endJob") <<
" Failed to open inputFile = " << (*inputFileName)
191 <<
"--> histograms will NOT be loaded !!";
197 if ( TDirectory*
directory = dynamic_cast<TDirectory*>(obj) ) {
201 <<
"--> histograms will NOT be loaded !!";
221 for ( std::map<std::string, cfgEntryFileSet>::const_iterator
fileSet =
fileSets_.begin();
225 if (
verbosity )
std::cout <<
" opening inputFile = " << (*inputFileName) << std::endl;
234 if (
fileSet->second.dqmDirectory_store_ !=
"" ) {
241 std::vector<std::string> dirNames = dqmStore.
getSubdirs();
242 for ( std::vector<std::string>::const_iterator
dirName = dirNames.begin();
248 if ( subDirectories.find(subDirName) != subDirectories.end() ) {
T getParameter(std::string const &) const
const double defaultScaleFactor
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::set< std::string > sstring
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
const std::string rangeKeyword
const std::string dqmRootDirectory_inTFile
std::string dqmSubDirectoryName_merged(const std::string &directory, const std::string &subdirectory)
std::map< std::string, sstring > subDirectoryMap_
void endRun(const edm::Run &r, const edm::EventSetup &c) override
std::vector< std::string > vstring
bool open(std::string const &filename, bool overwrite=false, std::string const &path="", std::string const &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
std::vector< std::string > getSubdirs() const
std::string format_vstring(const std::vector< std::string > &vs)
void setCurrentFolder(std::string const &fullpath)
void showDirStructure() const
cfgEntryFileSet(const std::string &, const edm::ParameterSet &)
std::map< std::string, cfgEntryFileSet > fileSets_
~TauDQMFileLoader() override
void dqmCopyRecursively(DQMStore &dqmStore, const std::string &inputDirectory, const std::string &outputDirectory, double scaleFactor, int mode, bool rmInputDirectory)
TauDQMFileLoader(const edm::ParameterSet &)
std::string dqmDirectory_store_
const std::string dqmRootDirectory
void mapSubDirectoryStructure(TDirectory *directory, std::string directoryName, std::set< std::string > &subDirectories)
void analyze(const edm::Event &, const edm::EventSetup &) override