#include <EcalTBHodoscopeRawInfoDumper.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
EcalTBHodoscopeRawInfoDumper (const edm::ParameterSet &ps) | |
virtual void | endJob () |
virtual | ~EcalTBHodoscopeRawInfoDumper () |
Private Attributes | |
TH1F * | h_firedHits_ [4] |
TH1F * | h_numberOfFiredHits_ [4] |
std::string | rawInfoCollection_ |
std::string | rawInfoProducer_ |
std::string | rootfile_ |
Definition at line 18 of file EcalTBHodoscopeRawInfoDumper.h.
EcalTBHodoscopeRawInfoDumper::EcalTBHodoscopeRawInfoDumper | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 13 of file EcalTBHodoscopeRawInfoDumper.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","ecalHodoscopeRawInfoPlots.root"); }
EcalTBHodoscopeRawInfoDumper::~EcalTBHodoscopeRawInfoDumper | ( | ) | [virtual] |
Definition at line 20 of file EcalTBHodoscopeRawInfoDumper.cc.
{ }
void EcalTBHodoscopeRawInfoDumper::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 62 of file EcalTBHodoscopeRawInfoDumper.cc.
References edm::Event::getByLabel(), h_firedHits_, h_numberOfFiredHits_, i, edm::HandleBase::isValid(), j, LogDebug, edm::Handle< T >::product(), rawInfoCollection_, and rawInfoProducer_.
{ // Get input edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope; const EcalTBHodoscopeRawInfo* hodoscopeRawInfo = 0; //evt.getByLabel( digiProducer_, digiCollection_, pDigis); e.getByLabel( rawInfoProducer_, ecalRawHodoscope); if (!ecalRawHodoscope.isValid()) { edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ; } else { hodoscopeRawInfo = ecalRawHodoscope.product(); } if (hodoscopeRawInfo) for (int i=0; i<4; i++) { std::ostringstream str; str << " Hits " ; std::vector<int> firedHits; h_numberOfFiredHits_[i]->Fill((*hodoscopeRawInfo)[i].numberOfFiredHits()); for (int j=0;j<64;j++) if ((*hodoscopeRawInfo)[i][j]) { h_firedHits_[i]->Fill(j); firedHits.push_back(j); str << j << " " ; } LogDebug("EcalTBHodoscope") << "Looking plane " << i << " number of hits " << (*hodoscopeRawInfo)[i].numberOfFiredHits() << str.str(); } // Create empty output }
void EcalTBHodoscopeRawInfoDumper::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 25 of file EcalTBHodoscopeRawInfoDumper.cc.
References h_firedHits_, h_numberOfFiredHits_, and i.
{ //======================================================================== char histoName[100]; char histoTitle[100]; for (int i=0; i<4; i++) { sprintf(histoName,"h_numberOfFiredHits_%d",i); sprintf(histoTitle,"NumberOfFiredHits Plane %d",i); h_numberOfFiredHits_[i]=new TH1F(histoName,histoTitle,10,0.,10.); } for (int i=0; i<4; i++) { sprintf(histoName,"h_firedHits_%d",i); sprintf(histoTitle,"firedHits Plane %d",i); h_firedHits_[i]=new TH1F(histoName,histoTitle,64,-0.5,63.5); } }
void EcalTBHodoscopeRawInfoDumper::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 48 of file EcalTBHodoscopeRawInfoDumper.cc.
References f, h_firedHits_, h_numberOfFiredHits_, i, and rootfile_.
TH1F* EcalTBHodoscopeRawInfoDumper::h_firedHits_[4] [private] |
Definition at line 34 of file EcalTBHodoscopeRawInfoDumper.h.
Referenced by analyze(), beginJob(), and endJob().
TH1F* EcalTBHodoscopeRawInfoDumper::h_numberOfFiredHits_[4] [private] |
Definition at line 33 of file EcalTBHodoscopeRawInfoDumper.h.
Referenced by analyze(), beginJob(), and endJob().
std::string EcalTBHodoscopeRawInfoDumper::rawInfoCollection_ [private] |
Definition at line 31 of file EcalTBHodoscopeRawInfoDumper.h.
Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().
std::string EcalTBHodoscopeRawInfoDumper::rawInfoProducer_ [private] |
Definition at line 30 of file EcalTBHodoscopeRawInfoDumper.h.
Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().
std::string EcalTBHodoscopeRawInfoDumper::rootfile_ [private] |
Definition at line 32 of file EcalTBHodoscopeRawInfoDumper.h.
Referenced by EcalTBHodoscopeRawInfoDumper(), and endJob().