CMS 3D CMS Logo

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

#include <EcalTBTDCRawInfoDumper.h>

Inheritance diagram for EcalTBTDCRawInfoDumper:
edm::EDAnalyzer

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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

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

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

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_.

14 {
15  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
16  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
17  rootfile_ = ps.getUntrackedParameter<std::string>("rootfile","ecalTDCRawInfoPlots.root");
18 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalTBTDCRawInfoDumper::~EcalTBTDCRawInfoDumper ( )
virtual

Definition at line 20 of file EcalTBTDCRawInfoDumper.cc.

20  {
21 }

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_.

41 {
42  // Get input
44  const EcalTBTDCRawInfo* tdcRawInfo = 0;
45  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
46  e.getByLabel( rawInfoProducer_, ecalRawTDC);
47  if (!ecalRawTDC.isValid()) {
48  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
49  } else {
50  tdcRawInfo = ecalRawTDC.product();
51  }
52 
53 
54  if (tdcRawInfo)
55  {
56  int tdcd = (*tdcRawInfo)[0].tdcValue();
57  h_TDCrawValue_->Fill(tdcd);
58  }
59  // Create empty output
60 }
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
T const * product() const
Definition: Handle.h:74
void EcalTBTDCRawInfoDumper::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file EcalTBTDCRawInfoDumper.cc.

References h_TDCrawValue_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 33 of file EcalTBTDCRawInfoDumper.cc.

References f, h_TDCrawValue_, and rootfile_.

33  {
34 //========================================================================
35  TFile f(rootfile_.c_str(),"RECREATE");
36  h_TDCrawValue_->Write();
37  f.Close();
38 }
double f[11][100]

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