12 unsigned minReplacements,
unsigned maxReplacements,
int& errorFlag)
15 unsigned numReplacements = 0;
16 while ( modSrc.find(keyword) != std::string::npos ) {
17 modSrc.replace(modSrc.find(keyword), keyword.length(), parameter);
20 if ( (numReplacements < minReplacements) ||
21 (numReplacements > maxReplacements) ) {
22 edm::LogError (
"replace_string") <<
" Failed to replace parameter = " << parameter <<
" in src = " << src <<
","
23 <<
" numReplacements = " << numReplacements
24 <<
" (min = " << minReplacements <<
", max = " << maxReplacements <<
") !!";
36 std::ostringstream os;
41 for (
unsigned iEntry = 0; iEntry <
numEntries; ++iEntry ) {
43 if ( iEntry < (numEntries - 1) ) os <<
", ";
68 if ( subDirName.find(directory) <= 1 ) subDirName.replace(subDirName.find(directory), directory.length(),
"");
82 histogram->SetName(histogram->GetName());
83 if ( TH1F*
h = dynamic_cast<TH1F*>(histogram) ) {
86 }
else if ( TH1S*
h = dynamic_cast<TH1S*>(histogram) ) {
89 }
else if ( TH2F*
h = dynamic_cast<TH2F*>(histogram) ) {
92 }
else if ( TH2S*
h = dynamic_cast<TH2S*>(histogram) ) {
95 }
else if ( TH3F*
h = dynamic_cast<TH3F*>(histogram) ) {
98 }
else if ( TProfile*
h = dynamic_cast<TProfile*>(histogram) ) {
101 }
else if ( TProfile2D*
h = dynamic_cast<TProfile2D*>(histogram) ) {
108 double scaleFactor,
int mode,
bool rmInputDirectory)
115 bool meInput_copied =
false;
119 std::vector<std::string> meNames = dqmStore.
getMEs();
120 for ( std::vector<std::string>::const_iterator meName = meNames.begin();
121 meName != meNames.end(); ++meName ) {
129 edm::LogError (
"copyRecursively") <<
" Failed to access meName = " << (*meName) <<
" in DQMStore"
130 <<
" --> skipping !!";
134 TH1* histogram = meInput->
getTH1();
137 edm::LogError (
"copyRecursively") <<
" Failed to access histogram associated to meName = " << (*meName) <<
" in DQMStore"
138 <<
" --> skipping !!";
142 std::auto_ptr<TH1>
clone(dynamic_cast<TH1*>(histogram->Clone()));
143 clone->Scale(scaleFactor);
152 edm::LogError (
"copyRecursively") <<
" meName = " << (*meName) <<
" already exists in outputDirectory = " << outputDirectory
153 <<
" --> skipping !!";
159 meOutput->
getTH1()->Add(clone.get(), scaleFactor);
165 meInput_copied =
true;
170 std::vector<std::string> dirNames = dqmStore.
getSubdirs();
171 for ( std::vector<std::string>::const_iterator
dirName = dirNames.begin();
182 dqmCopyRecursively(dqmStore, inputDirName_full, outputDirName_full, scaleFactor, mode, rmInputDirectory);
188 if ( rmInputDirectory && meInput_copied ) dqmStore.
rmdir(inputDirectory);
203 if ( dqmRootDirectoryPos != std::string::npos ) {
215 }
while ( nextPos != std::string::npos );
217 histogramName = ( lastPos != std::string::npos ) ?
std::string(tempName, lastPos + 1, tempName.length()) : tempName;
218 directoryName = ( lastPos != std::string::npos ) ?
std::string(tempName, 0, lastPos) :
"";
MonitorElement * book2S(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
std::vector< std::string > getSubdirs(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
std::string replace_string(const std::string &src, const std::string &keyword, const std::string ¶meter, unsigned minReplacements, unsigned maxReplacements, int &errorFlag)
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
std::string dqmSubDirectoryName_merged(const std::string &directory, const std::string &subdirectory)
Long64_t numEntries(TFile *hdl, std::string const &trname)
void separateHistogramFromDirectoryName(const std::string &histogramAndDirectoryName, std::string &histogramName, std::string &directoryName)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void dqmRegisterHistogram(DQMStore &dqmStore, TH1 *histogram, const std::string &name)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::string format_vstring(const std::vector< std::string > &vs)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
void dqmCopyRecursively(DQMStore &dqmStore, const std::string &inputDirectory, const std::string &outputDirectory, double scaleFactor, int mode, bool rmInputDirectory)
const std::string dqmRootDirectory
const std::string dqmSeparator
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * book1S(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")