#include <SiPixelErrors/SiPixelErrorsDigisToCalibDigis/src/SiPixelErrorsDigisToCalibDigis.cc>
Public Member Functions | |
MonitorElement * | bookDQMHistogram2D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY) |
MonitorElement * | bookDQMHistoPlaquetteSummary2D (uint32_t detid, std::string name, std::string title) |
bool | setDQMDirectory (std::string dirName) |
bool | setDQMDirectory (uint32_t detID) |
SiPixelErrorsDigisToCalibDigis (const edm::ParameterSet &) | |
~SiPixelErrorsDigisToCalibDigis () | |
Protected Attributes | |
edm::ESHandle< TrackerGeometry > | geom_ |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | endJob () |
Private Attributes | |
bool | createOutputFile_ |
DQMStore * | daqBE_ |
SiPixelFolderOrganizer * | folderMaker_ |
std::string | outputFilename_ |
std::map< uint32_t, MonitorElement * > | SiPixelErrorsDigisToCalibDigis_2DErrorInformation_ |
edm::InputTag | siPixelProducerLabel_ |
MonitorElement * | temp |
SiPixelHistogramId * | theHistogramIdWorker_ |
class SiPixelErrorsDigisToCalibDigis
Description: Create monitorElements for the Errors in created in the reduction of digis to calibDigis
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 51 of file SiPixelErrorsDigisToCalibDigis.h.
SiPixelErrorsDigisToCalibDigis::SiPixelErrorsDigisToCalibDigis | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 46 of file SiPixelErrorsDigisToCalibDigis.cc.
References createOutputFile_, daqBE_, folderMaker_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputFilename_, and siPixelProducerLabel_.
{ siPixelProducerLabel_ = iConfig.getParameter<edm::InputTag>("SiPixelProducerLabelTag"); createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile",false); outputFilename_ = iConfig.getParameter<std::string>("outputFilename"); daqBE_ = &*edm::Service<DQMStore>(); folderMaker_ = new SiPixelFolderOrganizer(); // std::cout<<"siPixelProducerLabel_ = "<<siPixelProducerLabel_<<std::endl; // std::cout<<"createOutputFile_= "<< createOutputFile_<<std::endl; // std::cout<<"outpuFilename_= "<< outputFilename_<< std::endl; }
SiPixelErrorsDigisToCalibDigis::~SiPixelErrorsDigisToCalibDigis | ( | ) |
Definition at line 62 of file SiPixelErrorsDigisToCalibDigis.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void SiPixelErrorsDigisToCalibDigis::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 77 of file SiPixelErrorsDigisToCalibDigis.cc.
References edm::DetSet< T >::begin(), bookDQMHistoPlaquetteSummary2D(), edm::DetSet< T >::end(), MonitorElement::Fill(), first, geom_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::InputTag::label(), setDQMDirectory(), SiPixelErrorsDigisToCalibDigis_2DErrorInformation_, siPixelProducerLabel_, and theHistogramIdWorker_.
{ using namespace edm; static int first(1); if (1 == first) { first = 0; iSetup.get<TrackerDigiGeometryRecord>().get( geom_ ); theHistogramIdWorker_ = new SiPixelHistogramId(siPixelProducerLabel_.label()); } Handle<DetSetVector<SiPixelCalibDigiError> > thePlaquettes; iEvent.getByLabel(siPixelProducerLabel_, thePlaquettes); // iEvent.getByLabel("siPixelCalibDigis", thePlaquettes); DetSetVector<SiPixelCalibDigiError>::const_iterator digiIter; for (digiIter=thePlaquettes->begin(); digiIter!=thePlaquettes->end(); digiIter++) { uint32_t detId = digiIter->id; DetSet<SiPixelCalibDigiError>::const_iterator ipix; //loop over pixel errors pulsed in the current plaquette MonitorElement* temp_; std::map<uint32_t, MonitorElement*>::iterator mapIterator = SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.find(detId); if (digiIter->begin() != digiIter->end()) { if ( mapIterator == SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.end() ) { // std::cout << "This is the beginning of an error 2d histo booking: "<<std::endl; setDQMDirectory(detId); temp_ = bookDQMHistoPlaquetteSummary2D(detId, "SiPixelErrorsCalibDigis", "SiPixelErrorsDigisToCalibDigis"); SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.insert( std::make_pair(detId,temp_)); } else { // std::cout << "This one was already booked."<<std::endl; temp_ = (*mapIterator).second; } for(ipix=digiIter->begin(); ipix!=digiIter->end(); ++ipix) { temp_->Fill(ipix->getCol(), ipix->getRow()); // std::cout << "detId: " << detId << " " << ipix->getRow() << " " << ipix->getCol() << std::endl; } } // end of the if statement asking if the plaquette in question has any errors in it }// end of the for loop that goes through all plaquettes }
void SiPixelErrorsDigisToCalibDigis::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 136 of file SiPixelErrorsDigisToCalibDigis.cc.
{ }
MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistogram2D | ( | uint32_t | detid, |
std::string | name, | ||
std::string | title, | ||
int | nchX, | ||
double | lowX, | ||
double | highX, | ||
int | nchY, | ||
double | lowY, | ||
double | highY | ||
) |
Definition at line 154 of file SiPixelErrorsDigisToCalibDigis.cc.
References DQMStore::book2D(), daqBE_, SiPixelHistogramId::setHistoId(), and theHistogramIdWorker_.
{ std::string hid = theHistogramIdWorker_->setHistoId(name,detid); return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY); }
MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D | ( | uint32_t | detid, |
std::string | name, | ||
std::string | title | ||
) |
Definition at line 160 of file SiPixelErrorsDigisToCalibDigis.cc.
References DQMStore::book2D(), daqBE_, geom_, TrackerGeometry::idToDet(), PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelHistogramId::setHistoId(), PixelGeomDetUnit::specificTopology(), and theHistogramIdWorker_.
Referenced by analyze().
{ DetId detId(detid); const TrackerGeometry &theTracker(*geom_); const PixelGeomDetUnit *theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( theTracker.idToDet(detId) ); int maxcol = theGeomDet->specificTopology().ncolumns(); int maxrow = theGeomDet->specificTopology().nrows(); std::string hid = theHistogramIdWorker_->setHistoId(name,detid); return daqBE_->book2D(hid,title,maxcol,0,maxcol,maxrow,0,maxrow); }
void SiPixelErrorsDigisToCalibDigis::endJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 143 of file SiPixelErrorsDigisToCalibDigis.cc.
References createOutputFile_, and outputFilename_.
{ if (!outputFilename_.empty() && createOutputFile_) { edm::LogInfo("SiPixelErrorCalibDigis") << "Writing ROOT file to: " << outputFilename_ << std::endl; if ( &*edm::Service<DQMStore>()) edm::Service<DQMStore>()->save (outputFilename_); } }
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory | ( | uint32_t | detID | ) |
Definition at line 178 of file SiPixelErrorsDigisToCalibDigis.cc.
References folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().
{ return folderMaker_->setModuleFolder(detID,0); }
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory | ( | std::string | dirName | ) |
Definition at line 172 of file SiPixelErrorsDigisToCalibDigis.cc.
References daqBE_, DQMStore::dirExists(), and DQMStore::setCurrentFolder().
Referenced by analyze().
bool SiPixelErrorsDigisToCalibDigis::createOutputFile_ [private] |
Definition at line 80 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().
DQMStore* SiPixelErrorsDigisToCalibDigis::daqBE_ [private] |
Definition at line 77 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by bookDQMHistogram2D(), bookDQMHistoPlaquetteSummary2D(), setDQMDirectory(), and SiPixelErrorsDigisToCalibDigis().
Definition at line 82 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by setDQMDirectory(), and SiPixelErrorsDigisToCalibDigis().
Definition at line 63 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by analyze(), and bookDQMHistoPlaquetteSummary2D().
std::string SiPixelErrorsDigisToCalibDigis::outputFilename_ [private] |
Definition at line 79 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by endJob(), and SiPixelErrorsDigisToCalibDigis().
std::map<uint32_t, MonitorElement*> SiPixelErrorsDigisToCalibDigis::SiPixelErrorsDigisToCalibDigis_2DErrorInformation_ [private] |
Definition at line 83 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by analyze().
Definition at line 75 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by analyze(), and SiPixelErrorsDigisToCalibDigis().
Definition at line 85 of file SiPixelErrorsDigisToCalibDigis.h.
Definition at line 78 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by analyze(), bookDQMHistogram2D(), and bookDQMHistoPlaquetteSummary2D().