Go to the documentation of this file.00001 #include "DQM/TrackerCommon/interface/ContentReader.h"
00002
00003
00004
00005 void ContentReader::give_subdirs(std::string dir, std::list<std::string> &subdirs, std::string mode)
00006 {
00007
00008 std::string old = bei->pwd();
00009 bei->setCurrentFolder(dir);
00010
00011 std::vector<std::string> all_subdirs = bei->getSubdirs();
00012
00013
00014
00015 subdirs.push_back("..");
00016 for (unsigned int i = 0; i < all_subdirs.size(); i++)
00017 {
00018 std::string subdir = dir + all_subdirs[i];
00019 if (mode == "User")
00020 {
00021 if (bei->containsAnyMonitorable(subdir))
00022 {
00023 subdirs.push_back(all_subdirs[i]);
00024 }
00025 }
00026 else if (mode == "SuperUser")
00027 {
00028 subdirs.push_back(all_subdirs[i]);
00029 }
00030 }
00031
00032 bei->setCurrentFolder(old);
00033 }
00034
00035
00036 void ContentReader::give_files(std::string dir, std::list<std::string> &files, bool only_contents)
00037 {
00038
00039
00040
00041
00042 std::string old = bei->pwd();
00043 bei->setCurrentFolder(dir);
00044
00045 std::vector<std::string> all_files = bei->getMEs();
00046
00047 if (only_contents)
00048 {
00049
00050 for (unsigned int i = 0; i < all_files.size(); i++)
00051 {
00052 std::string filename = bei->pwd() + "/" + all_files[i];
00053
00054 if (bei->get(filename) != NULL)
00055 {
00056 files.push_back(filename);
00057 }
00058 }
00059
00060 bei->setCurrentFolder(old);
00061 }
00062 else
00063 {
00064
00065 for (unsigned int i = 0; i < all_files.size(); i++)
00066 {
00067 std::string filename = bei->pwd() + "/" + all_files[i];
00068 files.push_back(filename);
00069 }
00070
00071 bei->setCurrentFolder(old);
00072
00073 }
00074 }
00075
00076
00077
00078 MonitorElement * ContentReader::give_ME(std::string filename)
00079 {
00080 MonitorElement *requested = bei->get(filename);
00081 return requested;
00082 }