CMS 3D CMS Logo

Public Member Functions | Private Attributes

TauDQMSimpleFileSaver Class Reference

#include <DQMSimpleFileSaver.h>

Inheritance diagram for TauDQMSimpleFileSaver:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void endJob ()
 TauDQMSimpleFileSaver (const edm::ParameterSet &)
virtual ~TauDQMSimpleFileSaver ()

Private Attributes

int cfgError_
std::string outputFileName_

Detailed Description

Class to write all monitor elements registered in DQMStore into ROOT file (without any naming restrictions imposed by "regular" DQMFileSaver)

Date:
2012/04/20 13:26:21
Revision:
1.2
Author:
Christian Veelken, UC Davis

Definition at line 22 of file DQMSimpleFileSaver.h.


Constructor & Destructor Documentation

TauDQMSimpleFileSaver::TauDQMSimpleFileSaver ( const edm::ParameterSet cfg) [explicit]

Definition at line 15 of file DQMSimpleFileSaver.cc.

References cfgError_, edm::ParameterSet::getParameter(), and outputFileName_.

{
  //std::cout << "<TauDQMSimpleFileSaver::TauDQMSimpleFileSaver>:" << std::endl;

  cfgError_ = 0;

  outputFileName_ = cfg.getParameter<std::string>("outputFileName");
  if ( outputFileName_ == "" ) {
    edm::LogError("TauDQMSimpleFileSaver") << " No outputFileName specified --> histograms will NOT be saved !!";
    cfgError_ = 1;
  } else if ( outputFileName_.find(".root") == std::string::npos ) {
    edm::LogError("TauDQMSimpleFileSaver") << " Invalid outputFileName = " << outputFileName_ << " --> histograms will NOT be saved !!";
    cfgError_ = 1;
  }
}
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver ( ) [virtual]

Definition at line 31 of file DQMSimpleFileSaver.cc.

{
// nothing to be done yet...
}

Member Function Documentation

void TauDQMSimpleFileSaver::analyze ( const edm::Event ,
const edm::EventSetup  
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 36 of file DQMSimpleFileSaver.cc.

{
// nothing to be done yet...
}
void TauDQMSimpleFileSaver::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DQMSimpleFileSaver.cc.

References cfgError_, gather_cfg::cout, outputFileName_, and DQMStore::save().

{
  std::cout << "<TauDQMSimpleFileSaver::endJob>:" << std::endl;

//--- check that configuration parameters contain no errors
  if ( cfgError_ ) {
    edm::LogError ("endJob") << " Error in Configuration ParameterSet --> histograms will NOT be saved !!";
    return;
  }

//--- check that DQMStore service is available
  if ( !edm::Service<DQMStore>().isAvailable() ) {
    edm::LogError ("endJob") << " Failed to access dqmStore --> histograms will NOT be saved !!";
    return;
  }  

  DQMStore& dqmStore = (*edm::Service<DQMStore>());
  dqmStore.save(outputFileName_);      
}

Member Data Documentation

Definition at line 32 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().

Definition at line 31 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().