CMS 3D CMS Logo

EcalTBTDCRawInfoDumper Class Reference

#include <RecoTBCalo/EcalTBTDCReconstructor/interface/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 (edm::EventSetup const &)
 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_.

00014 {
00015   rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
00016   rawInfoProducer_   = ps.getParameter<std::string>("rawInfoProducer");
00017   rootfile_          = ps.getUntrackedParameter<std::string>("rootfile","ecalTDCRawInfoPlots.root");
00018 }

EcalTBTDCRawInfoDumper::~EcalTBTDCRawInfoDumper (  )  [virtual]

Definition at line 20 of file EcalTBTDCRawInfoDumper.cc.

00020                                                 {
00021 }


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::Handle< T >::isValid(), edm::Handle< T >::product(), rawInfoCollection_, and rawInfoProducer_.

00041 {
00042   // Get input
00043   edm::Handle<EcalTBTDCRawInfo> ecalRawTDC;  
00044   const EcalTBTDCRawInfo* tdcRawInfo = 0;
00045   //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
00046   e.getByLabel( rawInfoProducer_, ecalRawTDC);
00047   if (!ecalRawTDC.isValid()) {
00048     edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
00049   } else {
00050     tdcRawInfo = ecalRawTDC.product();
00051   }
00052 
00053   
00054   if (tdcRawInfo)
00055     {
00056       int tdcd = (*tdcRawInfo)[0].tdcValue();
00057       h_TDCrawValue_->Fill(tdcd);
00058     }
00059   // Create empty output
00060 } 

void EcalTBTDCRawInfoDumper::beginJob ( edm::EventSetup const &   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file EcalTBTDCRawInfoDumper.cc.

References h_TDCrawValue_.

00026 {
00027   //========================================================================
00028   h_TDCrawValue_ = new TH1F("h_TDCrawValue","TDC raw value",2048,-0.5,2047.5);
00029 }

void EcalTBTDCRawInfoDumper::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 33 of file EcalTBTDCRawInfoDumper.cc.

References f, h_TDCrawValue_, and rootfile_.

00033                                {
00034 //========================================================================
00035   TFile f(rootfile_.c_str(),"RECREATE");
00036   h_TDCrawValue_->Write();
00037   f.Close();
00038 }


Member Data Documentation

TH1F* EcalTBTDCRawInfoDumper::h_TDCrawValue_ [private]

Definition at line 33 of file EcalTBTDCRawInfoDumper.h.

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

std::string EcalTBTDCRawInfoDumper::rawInfoCollection_ [private]

Definition at line 31 of file EcalTBTDCRawInfoDumper.h.

Referenced by analyze(), and EcalTBTDCRawInfoDumper().

std::string EcalTBTDCRawInfoDumper::rawInfoProducer_ [private]

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:57 2009 for CMSSW by  doxygen 1.5.4