CMS 3D CMS Logo

RPCMonitorRaw Class Reference

Analyse errors in raw data stream as RPCRawDataCounts produced by RPCRawToDigi. More...

#include <DQM/RPCMonitorClient/interface/RPCMonitorRaw.h>

Inheritance diagram for RPCMonitorRaw:

edm::EDAnalyzer edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 get data, convert to digis attach againe to Event
virtual void analyze (const edm::Event &, const edm::EventSetup &)
 get data, convert to digis attach againe to Event
virtual void beginJob (const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
virtual void endJob ()
virtual void endJob ()
 RPCMonitorRaw (const edm::ParameterSet &cfg)
 RPCMonitorRaw (const edm::ParameterSet &cfg)
virtual ~RPCMonitorRaw ()
virtual ~RPCMonitorRaw ()

Private Attributes

MonitorElementme_e
MonitorElementme_e
MonitorElementme_h [3]
MonitorElementme_h [3]
edm::ParameterSet theConfig
RPCRawDataCounts theCounts
bool theWriteHistos


Detailed Description

Analyse errors in raw data stream as RPCRawDataCounts produced by RPCRawToDigi.

Definition at line 20 of file RPCMonitorRaw.h.


Constructor & Destructor Documentation

RPCMonitorRaw::RPCMonitorRaw ( const edm::ParameterSet cfg  )  [inline, explicit]

Definition at line 23 of file RPCMonitorRaw.h.

00023 : theConfig(cfg) {}

RPCMonitorRaw::~RPCMonitorRaw (  )  [virtual]

Definition at line 30 of file RPCMonitorRaw.cc.

References LogTrace.

00030 { LogTrace("") << "RPCMonitorRaw destructor"; }

RPCMonitorRaw::RPCMonitorRaw ( const edm::ParameterSet cfg  )  [inline, explicit]

Definition at line 23 of file RPCMonitorRaw.h.

00023 : theConfig(cfg) {}

virtual RPCMonitorRaw::~RPCMonitorRaw (  )  [virtual]


Member Function Documentation

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

get data, convert to digis attach againe to Event

Implements edm::EDAnalyzer.

void RPCMonitorRaw::analyze ( const edm::Event ev,
const edm::EventSetup es 
) [virtual]

get data, convert to digis attach againe to Event

Implements edm::EDAnalyzer.

Definition at line 64 of file RPCMonitorRaw.cc.

References edm::Event::getByType(), MonitorElement::getTH1F(), i, me_e, me_h, edm::Handle< T >::product(), RPCRawDataCounts::readoutErrorVector(), RPCRawDataCounts::recordTypeVector(), MonitorElement::Reset(), theCounts, MonitorElement::update(), and v1.

00065 {
00066   edm::Handle<RPCRawDataCounts> rawCounts;
00067   ev.getByType( rawCounts);
00068 
00069   const RPCRawDataCounts * aCounts = rawCounts.product();
00070   theCounts += *aCounts;
00071 
00072   me_e->Reset();
00073   me_h[0]->Reset();
00074   me_h[1]->Reset();
00075   me_h[2]->Reset();
00076 
00077   vector<double> v1;
00078 
00079   theCounts.readoutErrorVector(v1);
00080   me_e->getTH1F()->FillN(v1.size()/2,&v1[0],&v1[1],2);
00081 
00082   for (int i=0;i<3;i++) {
00083     theCounts.recordTypeVector(790+i,v1);
00084     me_h[i]->getTH1F()->FillN(v1.size()/2,&v1[0],&v1[1],2);
00085   }
00086 
00087   me_h[0]->update();
00088   me_h[1]->update();
00089   me_h[2]->update();
00090   me_e->update();
00091 }

virtual void RPCMonitorRaw::beginJob ( const edm::EventSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

void RPCMonitorRaw::beginJob ( const edm::EventSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 32 of file RPCMonitorRaw.cc.

References DQMStore::book1D(), edm::ParameterSet::getUntrackedParameter(), me_e, me_h, RPCRawDataCounts::readoutErrorHisto(), RPCRawDataCounts::recordTypeHisto(), DQMStore::setCurrentFolder(), theConfig, and theCounts.

00033 {
00034 
00035 // Get DQM interface
00036   DQMStore* theDMBE = edm::Service<DQMStore>().operator->();
00037   
00038   theDMBE->setCurrentFolder(theConfig.getUntrackedParameter<std::string>("PrefixDir","RPC" )+"/FEDIntegrity" );
00039   
00040   me_h[0]=theDMBE->book1D("recordType_790",theCounts.recordTypeHisto(790));
00041   me_h[1]=theDMBE->book1D("recordType_791",theCounts.recordTypeHisto(791));
00042   me_h[2]=theDMBE->book1D("recordType_792",theCounts.recordTypeHisto(792));
00043   
00044   me_e =theDMBE->book1D("readoutErrors",theCounts.readoutErrorHisto());
00045 }

virtual void RPCMonitorRaw::endJob (  )  [virtual]

Reimplemented from edm::EDAnalyzer.

void RPCMonitorRaw::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 47 of file RPCMonitorRaw.cc.

References f, MonitorElement::getTH1F(), edm::ParameterSet::getUntrackedParameter(), me_e, me_h, and theConfig.

00048 {
00049 
00050   bool writeHistos = theConfig.getUntrackedParameter<bool>("writeHistograms");
00051   if (writeHistos) {
00052     std::string histoFile = theConfig.getUntrackedParameter<std::string>("histoFileName"); 
00053     TFile f(histoFile.c_str(),"RECREATE");
00054     me_h[0]->getTH1F()->Write();
00055     me_h[1]->getTH1F()->Write();
00056     me_h[2]->getTH1F()->Write();
00057     me_e->getTH1F()->Write();
00058     edm::LogInfo(" END JOB, histos saved!");
00059     f.Close();
00060   }
00061 }


Member Data Documentation

MonitorElement* RPCMonitorRaw::me_e [private]

Definition at line 40 of file RPCMonitorRaw.h.

MonitorElement* RPCMonitorRaw::me_e [private]

Definition at line 40 of file RPCMonitorRaw.h.

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

MonitorElement* RPCMonitorRaw::me_h[3] [private]

Definition at line 39 of file RPCMonitorRaw.h.

MonitorElement* RPCMonitorRaw::me_h[3] [private]

Definition at line 39 of file RPCMonitorRaw.h.

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

edm::ParameterSet RPCMonitorRaw::theConfig [private]

Definition at line 34 of file RPCMonitorRaw.h.

Referenced by beginJob(), and endJob().

RPCRawDataCounts RPCMonitorRaw::theCounts [private]

Definition at line 35 of file RPCMonitorRaw.h.

Referenced by analyze(), and beginJob().

bool RPCMonitorRaw::theWriteHistos [private]

Definition at line 37 of file RPCMonitorRaw.h.


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