#include <DQMHistAdder.h>
Classes | |
struct | cfgEntryAddJob |
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
DQMHistAdder (const edm::ParameterSet &) | |
virtual void | endJob () |
virtual | ~DQMHistAdder () |
Private Types | |
typedef std::vector< std::string > | vstring |
Private Attributes | |
std::map< std::string, cfgEntryAddJob > | addJobs_ |
int | cfgError_ |
Class to add DQM monitoring elements stored in separate directories in DQMStore (in order to e.g. compute the total Standard Model expectation)
Definition at line 27 of file DQMHistAdder.h.
typedef std::vector<std::string> DQMHistAdder::vstring [private] |
Definition at line 29 of file DQMHistAdder.h.
DQMHistAdder::DQMHistAdder | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 50 of file DQMHistAdder.cc.
References addJobs_, cfgError_, and gather_cfg::cout.
DQMHistAdder::~DQMHistAdder | ( | ) | [virtual] |
Definition at line 63 of file DQMHistAdder.cc.
{
// nothing to be done yet...
}
void DQMHistAdder::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 68 of file DQMHistAdder.cc.
{
// nothing to be done yet...
}
void DQMHistAdder::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 73 of file DQMHistAdder.cc.
References addJobs_, cfgError_, gather_cfg::cout, dqmCopyRecursively(), dqmDirectoryName(), dqmRootDirectory, mode, DQMStore::showDirStructure(), and verbosity.
{ std::cout << "<DQMHistAdder::endJob>:" << std::endl; //--- check that configuration parameters contain no errors if ( cfgError_ ) { edm::LogError ("endJob") << " Error in Configuration ParameterSet --> histograms will NOT be added !!"; return; } //--- check that DQMStore service is available if ( !edm::Service<DQMStore>().isAvailable() ) { edm::LogError ("endJob") << " Failed to access dqmStore --> histograms will NOT be added !!"; return; } //--- stop ROOT from keeping references to all histograms //TH1::AddDirectory(false); //--- add histograms //std::cout << "--> adding histograms..." << std::endl; DQMStore& dqmStore = (*edm::Service<DQMStore>()); for ( std::map<std::string, cfgEntryAddJob>::const_iterator addJob = addJobs_.begin(); addJob != addJobs_.end(); ++addJob ) { const std::string& dqmDirectory_output = addJob->second.dqmDirectory_output_; for ( vstring::const_iterator dqmDirectory_input = addJob->second.dqmDirectories_input_.begin(); dqmDirectory_input != addJob->second.dqmDirectories_input_.end(); ++dqmDirectory_input ) { std::string inputDirectory = dqmDirectoryName(std::string(dqmRootDirectory)).append(*dqmDirectory_input); //std::cout << " inputDirectory = " << inputDirectory << std::endl; std::string outputDirectory = dqmDirectoryName(std::string(dqmRootDirectory)).append(dqmDirectory_output); //std::cout << " outputDirectory = " << outputDirectory << std::endl; //--- when processing first inputDirectory, check that histograms in outputDirectory do not yet exist; // afterwards, add histograms in inputDirectory to those in outputDirectory int mode = ( dqmDirectory_input == addJob->second.dqmDirectories_input_.begin() ) ? 1 : 3; //std::cout << " mode = " << mode << std::endl; dqmCopyRecursively(dqmStore, inputDirectory, outputDirectory, 1., mode, false); } } std::cout << "done." << std::endl; if ( verbosity ) dqmStore.showDirStructure(); }
std::map<std::string, cfgEntryAddJob> DQMHistAdder::addJobs_ [private] |
Definition at line 47 of file DQMHistAdder.h.
Referenced by DQMHistAdder(), and endJob().
int DQMHistAdder::cfgError_ [private] |
Definition at line 48 of file DQMHistAdder.h.
Referenced by DQMHistAdder(), and endJob().