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;
112 std::cout <<
" name = " << name_ << std::endl;
114 std::cout <<
" scaleFactor = " << scaleFactor_ << std::endl;
115 std::cout <<
" dqmDirectory_store = " << dqmDirectory_store_ << std::endl;
124 std::cout <<
"<TauDQMFileLoader::TauDQMFileLoader>:" << std::endl;
130 readCfgParameter<cfgEntryFileSet>(cfg,
fileSets_);
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();
185 for ( vstring::const_iterator inputFileName =
fileSet->second.inputFileNames_.begin();
186 inputFileName !=
fileSet->second.inputFileNames_.end(); ++inputFileName ) {
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();
223 for ( vstring::const_iterator inputFileName =
fileSet->second.inputFileNames_.begin();
224 inputFileName !=
fileSet->second.inputFileNames_.end(); ++inputFileName ) {
225 if (
verbosity )
std::cout <<
" opening inputFile = " << (*inputFileName) << std::endl;
226 dqmStore.
open(*inputFileName,
true);
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() ) {
259 int mode = ( inputFileName ==
fileSet->second.inputFileNames_.begin() ) ? 1 : 3;
T getParameter(std::string const &) const
const double defaultScaleFactor
std::vector< std::string > getSubdirs(void) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
#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
virtual void endRun(const edm::Run &r, const edm::EventSetup &c)
std::string dqmSubDirectoryName_merged(const std::string &directory, const std::string &subdirectory)
std::map< std::string, sstring > subDirectoryMap_
std::vector< std::string > vstring
std::string format_vstring(const std::vector< std::string > &vs)
cfgEntryFileSet(const std::string &, const edm::ParameterSet &)
virtual ~TauDQMFileLoader()
std::map< std::string, cfgEntryFileSet > fileSets_
void dqmCopyRecursively(DQMStore &dqmStore, const std::string &inputDirectory, const std::string &outputDirectory, double scaleFactor, int mode, bool rmInputDirectory)
TauDQMFileLoader(const edm::ParameterSet &)
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
std::string dqmDirectory_store_
const std::string dqmRootDirectory
void showDirStructure(void) const
void mapSubDirectoryStructure(TDirectory *directory, std::string directoryName, std::set< std::string > &subDirectories)
void setCurrentFolder(const std::string &fullpath)