14 unsigned minReplacements,
15 unsigned maxReplacements,
18 unsigned numReplacements = 0;
19 while (modSrc.find(keyword) != std::string::npos) {
20 modSrc.replace(modSrc.find(keyword), keyword.length(), parameter);
23 if ((numReplacements < minReplacements) || (numReplacements > maxReplacements)) {
24 edm::LogError(
"replace_string") <<
" Failed to replace parameter = " << parameter <<
" in src = " << src <<
","
25 <<
" numReplacements = " << numReplacements <<
" (min = " << minReplacements
26 <<
", max = " << maxReplacements <<
") !!";
37 std::ostringstream os;
42 for (
unsigned iEntry = 0; iEntry <
numEntries; ++iEntry) {
44 if (iEntry < (numEntries - 1))
61 if (!dirName.empty() && dirName.find_last_of(
dqmSeparator) != (dirName.length() - 1))
69 if (subDirName.find(directory) <= 1)
70 subDirName.replace(subDirName.find(directory), directory.length(),
"");
84 histogram->SetName(histogram->GetName());
85 if (TH1F*
h = dynamic_cast<TH1F*>(histogram)) {
88 }
else if (TH1S*
h = dynamic_cast<TH1S*>(histogram)) {
91 }
else if (TH2F*
h = dynamic_cast<TH2F*>(histogram)) {
94 }
else if (TH2S*
h = dynamic_cast<TH2S*>(histogram)) {
97 }
else if (TH3F*
h = dynamic_cast<TH3F*>(histogram)) {
100 }
else if (TProfile*
h = dynamic_cast<TProfile*>(histogram)) {
103 }
else if (TProfile2D*
h = dynamic_cast<TProfile2D*>(histogram)) {
114 bool rmInputDirectory) {
122 std::vector<std::string> meNames = dqmStore.
getMEs();
123 for (std::vector<std::string>::const_iterator meName = meNames.begin(); meName != meNames.end(); ++meName) {
131 edm::LogError(
"copyRecursively") <<
" Failed to access meName = " << (*meName) <<
" in DQMStore"
132 <<
" --> skipping !!";
136 TH1* histogram = meInput->
getTH1();
139 edm::LogError(
"copyRecursively") <<
" Failed to access histogram associated to meName = " << (*meName)
141 <<
" --> skipping !!";
145 std::unique_ptr<TH1>
clone(dynamic_cast<TH1*>(histogram->Clone()));
146 clone->Scale(scaleFactor);
156 <<
" meName = " << (*meName) <<
" already exists in outputDirectory = " << outputDirectory
157 <<
" --> skipping !!";
172 std::vector<std::string> dirNames = dqmStore.
getSubdirs();
173 for (std::vector<std::string>::const_iterator
dirName = dirNames.begin();
dirName != dirNames.end(); ++
dirName) {
183 dqmCopyRecursively(dqmStore, inputDirName_full, outputDirName_full, scaleFactor, mode, rmInputDirectory);
200 if (dqmRootDirectoryPos != std::string::npos) {
212 }
while (nextPos != std::string::npos);
214 histogramName = (lastPos != std::string::npos) ?
std::string(tempName, lastPos + 1, tempName.length()) : tempName;
215 directoryName = (lastPos != std::string::npos) ?
std::string(tempName, 0, lastPos) :
"";
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * book2S(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void dqmRegisterHistogram(dqm::legacy::DQMStore &dqmStore, TH1 *histogram, const std::string &name)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
void setCurrentFolder(std::string const &fullpath) override
std::string replace_string(const std::string &src, const std::string &keyword, const std::string ¶meter, unsigned minReplacements, unsigned maxReplacements, int &errorFlag)
Log< level::Error, false > LogError
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
std::string dqmSubDirectoryName_merged(const std::string &directory, const std::string &subdirectory)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Long64_t numEntries(TFile *hdl, std::string const &trname)
virtual MonitorElement * get(std::string const &fullpath) const
MonitorElement * book1S(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
void dqmCopyRecursively(dqm::legacy::DQMStore &dqmStore, const std::string &inputDirectory, const std::string &outputDirectory, double scaleFactor, int mode, bool rmInputDirectory)
std::string format_vstring(const std::vector< std::string > &vs)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
virtual std::vector< std::string > getMEs() const
const std::string dqmRootDirectory
const std::string dqmSeparator
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
virtual TH1 * getTH1() const