CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalTBTDCRawInfoDumper Class Reference

#include <EcalTBTDCRawInfoDumper.h>

Inheritance diagram for EcalTBTDCRawInfoDumper:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
 EcalTBTDCRawInfoDumper (const edm::ParameterSet &ps)
virtual void endJob ()
virtual ~EcalTBTDCRawInfoDumper ()

Private Attributes

TH1F * h_TDCrawValue_
std::string rawInfoCollection_
std::string rawInfoProducer_
std::string rootfile_

Detailed Description

Definition at line 18 of file EcalTBTDCRawInfoDumper.h.


Constructor & Destructor Documentation

EcalTBTDCRawInfoDumper::EcalTBTDCRawInfoDumper ( const edm::ParameterSet ps) [explicit]

Definition at line 13 of file EcalTBTDCRawInfoDumper.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), rawInfoCollection_, rawInfoProducer_, and rootfile_.

{
  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
  rawInfoProducer_   = ps.getParameter<std::string>("rawInfoProducer");
  rootfile_          = ps.getUntrackedParameter<std::string>("rootfile","ecalTDCRawInfoPlots.root");
}
EcalTBTDCRawInfoDumper::~EcalTBTDCRawInfoDumper ( ) [virtual]

Definition at line 20 of file EcalTBTDCRawInfoDumper.cc.

                                                {
}

Member Function Documentation

void EcalTBTDCRawInfoDumper::analyze ( const edm::Event e,
const edm::EventSetup es 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 40 of file EcalTBTDCRawInfoDumper.cc.

References edm::Event::getByLabel(), h_TDCrawValue_, edm::HandleBase::isValid(), edm::Handle< T >::product(), rawInfoCollection_, and rawInfoProducer_.

{
  // Get input
  edm::Handle<EcalTBTDCRawInfo> ecalRawTDC;  
  const EcalTBTDCRawInfo* tdcRawInfo = 0;
  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
  e.getByLabel( rawInfoProducer_, ecalRawTDC);
  if (!ecalRawTDC.isValid()) {
    edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
  } else {
    tdcRawInfo = ecalRawTDC.product();
  }

  
  if (tdcRawInfo)
    {
      int tdcd = (*tdcRawInfo)[0].tdcValue();
      h_TDCrawValue_->Fill(tdcd);
    }
  // Create empty output
} 
void EcalTBTDCRawInfoDumper::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file EcalTBTDCRawInfoDumper.cc.

References h_TDCrawValue_.

{
  //========================================================================
  h_TDCrawValue_ = new TH1F("h_TDCrawValue","TDC raw value",2048,-0.5,2047.5);
}
void EcalTBTDCRawInfoDumper::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 33 of file EcalTBTDCRawInfoDumper.cc.

References f, h_TDCrawValue_, and rootfile_.

                               {
//========================================================================
  TFile f(rootfile_.c_str(),"RECREATE");
  h_TDCrawValue_->Write();
  f.Close();
}

Member Data Documentation

Definition at line 33 of file EcalTBTDCRawInfoDumper.h.

Referenced by analyze(), beginJob(), and endJob().

Definition at line 31 of file EcalTBTDCRawInfoDumper.h.

Referenced by analyze(), and EcalTBTDCRawInfoDumper().

Definition at line 30 of file EcalTBTDCRawInfoDumper.h.

Referenced by analyze(), and EcalTBTDCRawInfoDumper().

std::string EcalTBTDCRawInfoDumper::rootfile_ [private]

Definition at line 32 of file EcalTBTDCRawInfoDumper.h.

Referenced by EcalTBTDCRawInfoDumper(), and endJob().