Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DQM
TrackerCommon
src
ContentReader.cc
Go to the documentation of this file.
1
#include "
DQM/TrackerCommon/interface/ContentReader.h
"
2
3
4
// fills the list with all subdirectories of dir containing something
5
void
ContentReader::give_subdirs
(std::string
dir
, std::list<std::string> &subdirs, std::string
mode
)
6
{
7
8
std::string old =
bei
->
pwd
();
9
bei
->
setCurrentFolder
(dir);
10
11
std::vector<std::string> all_subdirs =
bei
->
getSubdirs
();
12
13
// std::cout << "The directory " << bei->pwd() << " contains " << all_subdirs.size() << " subdirectories!" << std::endl;
14
15
subdirs.push_back(
".."
);
16
for
(
unsigned
int
i
= 0;
i
< all_subdirs.size();
i
++)
17
{
18
std::string subdir = dir + all_subdirs[
i
];
19
if
(mode ==
"User"
)
20
{
21
if
(
bei
->
containsAnyMonitorable
(subdir))
22
{
23
subdirs.push_back(all_subdirs[
i
]);
24
}
25
}
26
else
if
(mode ==
"SuperUser"
)
27
{
28
subdirs.push_back(all_subdirs[
i
]);
29
}
30
}
31
32
bei
->
setCurrentFolder
(old);
33
}
34
35
// fills the list with existing files in dir
36
void
ContentReader::give_files
(std::string
dir
, std::list<std::string> &
files
,
bool
only_contents)
37
{
38
// std::cout << "ContentReader was asked to find the subfiles of : "
39
// << dir << std::endl;
40
41
// for the interesting directory
42
std::string old =
bei
->
pwd
();
43
bei
->
setCurrentFolder
(dir);
44
// get the monitorable files
45
std::vector<std::string>
all_files
=
bei
->
getMEs
();
46
47
if
(only_contents)
48
{
49
// and copy those that exist in the files list
50
for
(
unsigned
int
i
= 0;
i
< all_files.size();
i
++)
51
{
52
std::string
filename
=
bei
->
pwd
() +
"/"
+ all_files[
i
];
53
// if it does exist
54
if
(
bei
->
get
(filename) !=
NULL
)
55
{
56
files.push_back(filename);
57
}
58
}
59
// go back to original folder:
60
bei
->
setCurrentFolder
(old);
61
}
62
else
63
{
64
// and copy those that exist in the files list
65
for
(
unsigned
int
i
= 0;
i
< all_files.size();
i
++)
66
{
67
std::string
filename
=
bei
->
pwd
() +
"/"
+ all_files[
i
];
68
files.push_back(filename);
69
}
70
// go back to original folder:
71
bei
->
setCurrentFolder
(old);
72
73
}
74
}
75
76
77
// returns a pointer to a requested filename, or NULL if not available
78
MonitorElement
*
ContentReader::give_ME
(std::string
filename
)
79
{
80
MonitorElement
*requested =
bei
->
get
(filename);
81
return
requested;
82
}
i
int i
Definition:
DBlmapReader.cc:9
DQMStore::containsAnyMonitorable
bool containsAnyMonitorable(const std::string &path) const
Definition:
DQMStore.cc:1458
ContentReader::give_files
void give_files(std::string dir, std::list< std::string > &files, bool only_contents)
Definition:
ContentReader.cc:36
DQMStore::getSubdirs
std::vector< std::string > getSubdirs(void) const
Definition:
DQMStore.cc:1419
NULL
#define NULL
Definition:
scimark2.h:8
alignBH_cfg.mode
list mode
Definition:
alignBH_cfg.py:7
fetchall_from_DQM_v2.all_files
tuple all_files
Definition:
fetchall_from_DQM_v2.py:123
linker.files
tuple files
Definition:
linker.py:146
ContentReader::bei
DQMStore * bei
Definition:
ContentReader.h:12
ContentReader::give_ME
MonitorElement * give_ME(std::string filename)
Definition:
ContentReader.cc:78
DQMStore::get
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition:
DQMStore.cc:1468
MonitorElement
Definition:
MonitorElement.h:34
ContentReader.h
ContentReader::give_subdirs
void give_subdirs(std::string dir, std::list< std::string > &subdirs, std::string mode)
Definition:
ContentReader.cc:5
DQMStore::getMEs
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
Definition:
DQMStore.cc:1442
lut2db_cfg.filename
tuple filename
Definition:
lut2db_cfg.py:20
dir
dbl *** dir
Definition:
mlp_gen.cc:35
DQMStore::setCurrentFolder
void setCurrentFolder(const std::string &fullpath)
Definition:
DQMStore.cc:429
DQMStore::pwd
const std::string & pwd(void) const
Definition:
DQMStore.cc:401
Generated for CMSSW Reference Manual by
1.8.5