CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Attributes
DQMHistAdder Class Reference

#include <DQMHistAdder.h>

Inheritance diagram for DQMHistAdder:
edm::EDAnalyzer

Classes

struct  cfgEntryAddJob
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 DQMHistAdder (const edm::ParameterSet &)
 
virtual void endJob ()
 
virtual ~DQMHistAdder ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Types

typedef std::vector< std::string > vstring
 

Private Attributes

std::map< std::string,
cfgEntryAddJob
addJobs_
 
int cfgError_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Class to add DQM monitoring elements stored in separate directories in DQMStore (in order to e.g. compute the total Standard Model expectation)

Date:
2008/11/18 16:41:39
Revision:
1.1
Author
Christian Veelken, UC Davis

Definition at line 27 of file DQMHistAdder.h.

Member Typedef Documentation

typedef std::vector<std::string> DQMHistAdder::vstring
private

Definition at line 29 of file DQMHistAdder.h.

Constructor & Destructor Documentation

DQMHistAdder::DQMHistAdder ( const edm::ParameterSet cfg)
explicit

Definition at line 50 of file DQMHistAdder.cc.

References addJobs_, cfgError_, and gather_cfg::cout.

51 {
52  std::cout << "<DQMHistAdder::DQMHistAdder>:" << std::endl;
53 
54  cfgError_ = 0;
55 
56 //--- configure processes
57  //std::cout << "--> configuring addJobs..." << std::endl;
58  readCfgParameter<cfgEntryAddJob>(cfg, addJobs_);
59 
60  std::cout << "done." << std::endl;
61 }
std::map< std::string, cfgEntryAddJob > addJobs_
Definition: DQMHistAdder.h:47
tuple cout
Definition: gather_cfg.py:41
DQMHistAdder::~DQMHistAdder ( )
virtual

Definition at line 63 of file DQMHistAdder.cc.

64 {
65 // nothing to be done yet...
66 }

Member Function Documentation

void DQMHistAdder::analyze ( const edm::Event ,
const edm::EventSetup  
)
virtual

Implements edm::EDAnalyzer.

Definition at line 68 of file DQMHistAdder.cc.

69 {
70 // nothing to be done yet...
71 }
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.

74 {
75  std::cout << "<DQMHistAdder::endJob>:" << std::endl;
76 
77 //--- check that configuration parameters contain no errors
78  if ( cfgError_ ) {
79  edm::LogError ("endJob") << " Error in Configuration ParameterSet --> histograms will NOT be added !!";
80  return;
81  }
82 
83 //--- check that DQMStore service is available
84  if ( !edm::Service<DQMStore>().isAvailable() ) {
85  edm::LogError ("endJob") << " Failed to access dqmStore --> histograms will NOT be added !!";
86  return;
87  }
88 
89 //--- stop ROOT from keeping references to all histograms
90  //TH1::AddDirectory(false);
91 
92 //--- add histograms
93  //std::cout << "--> adding histograms..." << std::endl;
94  DQMStore& dqmStore = (*edm::Service<DQMStore>());
95  for ( std::map<std::string, cfgEntryAddJob>::const_iterator addJob = addJobs_.begin();
96  addJob != addJobs_.end(); ++addJob ) {
97  const std::string& dqmDirectory_output = addJob->second.dqmDirectory_output_;
98  for ( vstring::const_iterator dqmDirectory_input = addJob->second.dqmDirectories_input_.begin();
99  dqmDirectory_input != addJob->second.dqmDirectories_input_.end(); ++dqmDirectory_input ) {
100 
101  std::string inputDirectory = dqmDirectoryName(std::string(dqmRootDirectory)).append(*dqmDirectory_input);
102  //std::cout << " inputDirectory = " << inputDirectory << std::endl;
103  std::string outputDirectory = dqmDirectoryName(std::string(dqmRootDirectory)).append(dqmDirectory_output);
104  //std::cout << " outputDirectory = " << outputDirectory << std::endl;
105 
106 //--- when processing first inputDirectory, check that histograms in outputDirectory do not yet exist;
107 // afterwards, add histograms in inputDirectory to those in outputDirectory
108  int mode = ( dqmDirectory_input == addJob->second.dqmDirectories_input_.begin() ) ? 1 : 3;
109  //std::cout << " mode = " << mode << std::endl;
110  dqmCopyRecursively(dqmStore, inputDirectory, outputDirectory, 1., mode, false);
111  }
112  }
113 
114  std::cout << "done." << std::endl;
115  if ( verbosity ) dqmStore.showDirStructure();
116 }
std::map< std::string, cfgEntryAddJob > addJobs_
Definition: DQMHistAdder.h:47
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
Definition: EwkTauDQM.cc:10
const int verbosity
int mode
Definition: AMPTWrapper.h:139
void dqmCopyRecursively(DQMStore &dqmStore, const std::string &inputDirectory, const std::string &outputDirectory, double scaleFactor, int mode, bool rmInputDirectory)
tuple cout
Definition: gather_cfg.py:41
const std::string dqmRootDirectory
void showDirStructure(void) const
Definition: DQMStore.cc:2554

Member Data Documentation

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().