#include <SiPixelErrors/SiPixelErrorsDigisToCalibDigis/src/SiPixelErrorsDigisToCalibDigis.cc>
Description: <one line="" class="" summary>="">.
Description: Create monitorElements for the Errors in created in the reduction of digis to calibDigis
Implementation: <Notes on="" implementation>="">
Definition at line 51 of file SiPixelErrorsDigisToCalibDigis.h.
SiPixelErrorsDigisToCalibDigis::SiPixelErrorsDigisToCalibDigis | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 45 of file SiPixelErrorsDigisToCalibDigis.cc.
References createOutputFile_, daqBE_, folderMaker_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputFilename_, and siPixelProducerLabel_.
00047 { 00048 00049 siPixelProducerLabel_ = iConfig.getParameter<edm::InputTag>("SiPixelProducerLabelTag"); 00050 createOutputFile_ = iConfig.getUntrackedParameter<bool>("saveFile",false); 00051 outputFilename_ = iConfig.getParameter<std::string>("outputFilename"); 00052 daqBE_ = &*edm::Service<DQMStore>(); 00053 folderMaker_ = new SiPixelFolderOrganizer(); 00054 00055 // std::cout<<"siPixelProducerLabel_ = "<<siPixelProducerLabel_<<std::endl; 00056 // std::cout<<"createOutputFile_= "<< createOutputFile_<<std::endl; 00057 // std::cout<<"outpuFilename_= "<< outputFilename_<< std::endl; 00058 }
SiPixelErrorsDigisToCalibDigis::~SiPixelErrorsDigisToCalibDigis | ( | ) |
Definition at line 61 of file SiPixelErrorsDigisToCalibDigis.cc.
00062 { 00063 00064 // do anything here that needs to be done at desctruction time 00065 // (e.g. close files, deallocate resources etc.) 00066 00067 }
void SiPixelErrorsDigisToCalibDigis::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 76 of file SiPixelErrorsDigisToCalibDigis.cc.
References bookDQMHistoPlaquetteSummary2D(), detId, MonitorElement::Fill(), edm::Event::getByLabel(), setDQMDirectory(), SiPixelErrorsDigisToCalibDigis_2DErrorInformation_, and siPixelProducerLabel_.
00077 { 00078 using namespace edm; 00079 00080 Handle<DetSetVector<SiPixelCalibDigiError> > thePlaquettes; 00081 iEvent.getByLabel(siPixelProducerLabel_, thePlaquettes); 00082 // iEvent.getByLabel("siPixelCalibDigis", thePlaquettes); 00083 00084 00085 DetSetVector<SiPixelCalibDigiError>::const_iterator digiIter; 00086 00087 00088 for (digiIter=thePlaquettes->begin(); digiIter!=thePlaquettes->end(); digiIter++) 00089 { 00090 uint32_t detId = digiIter->id; 00091 00092 DetSet<SiPixelCalibDigiError>::const_iterator ipix; 00093 //loop over pixel errors pulsed in the current plaquette 00094 00095 MonitorElement* temp_; 00096 00097 std::map<uint32_t, MonitorElement*>::iterator mapIterator = SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.find(detId); 00098 00099 if (digiIter->begin() != digiIter->end()) { 00100 if ( mapIterator == SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.end() ) 00101 { 00102 // std::cout << "This is the beginning of an error 2d histo booking: "<<std::endl; 00103 setDQMDirectory(detId); 00104 temp_ = bookDQMHistoPlaquetteSummary2D(detId, "SiPixelErrorsCalibDigis", "SiPixelErrorsDigisToCalibDigis"); 00105 SiPixelErrorsDigisToCalibDigis_2DErrorInformation_.insert( std::make_pair(detId,temp_)); 00106 } 00107 else 00108 { 00109 // std::cout << "This one was already booked."<<std::endl; 00110 temp_ = (*mapIterator).second; 00111 } 00112 00113 for(ipix=digiIter->begin(); ipix!=digiIter->end(); ++ipix) 00114 { 00115 temp_->Fill(ipix->getCol(), ipix->getRow()); 00116 // std::cout << "detId: " << detId << " " << ipix->getRow() << " " << ipix->getCol() << std::endl; 00117 } 00118 00119 } // end of the if statement asking if the plaquette in question has any errors in it 00120 00121 }// end of the for loop that goes through all plaquettes 00122 00123 }
void SiPixelErrorsDigisToCalibDigis::beginJob | ( | const edm::EventSetup & | iSetup | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 128 of file SiPixelErrorsDigisToCalibDigis.cc.
References geom_, edm::EventSetup::get(), edm::InputTag::label(), siPixelProducerLabel_, and theHistogramIdWorker_.
00129 { 00130 iSetup.get<TrackerDigiGeometryRecord>().get( geom_ ); 00131 theHistogramIdWorker_ = new SiPixelHistogramId(siPixelProducerLabel_.label()); 00132 00133 }
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 148 of file SiPixelErrorsDigisToCalibDigis.cc.
References DQMStore::book2D(), daqBE_, SiPixelHistogramId::setHistoId(), and theHistogramIdWorker_.
00149 { 00150 std::string hid = theHistogramIdWorker_->setHistoId(name,detid); 00151 return daqBE_->book2D(hid, title, nchX, lowX, highX, nchY, lowY, highY); 00152 }
MonitorElement * SiPixelErrorsDigisToCalibDigis::bookDQMHistoPlaquetteSummary2D | ( | uint32_t | detid, | |
std::string | name, | |||
std::string | title | |||
) |
Definition at line 154 of file SiPixelErrorsDigisToCalibDigis.cc.
References DQMStore::book2D(), daqBE_, detId, geom_, TrackerGeometry::idToDet(), PixelTopology::ncolumns(), PixelTopology::nrows(), SiPixelHistogramId::setHistoId(), PixelGeomDetUnit::specificTopology(), and theHistogramIdWorker_.
Referenced by analyze().
00154 { 00155 00156 DetId detId(detid); 00157 const TrackerGeometry &theTracker(*geom_); 00158 const PixelGeomDetUnit *theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( theTracker.idToDet(detId) ); 00159 int maxcol = theGeomDet->specificTopology().ncolumns(); 00160 int maxrow = theGeomDet->specificTopology().nrows(); 00161 00162 std::string hid = theHistogramIdWorker_->setHistoId(name,detid); 00163 return daqBE_->book2D(hid,title,maxcol,0,maxcol,maxrow,0,maxrow); 00164 }
Reimplemented from edm::EDAnalyzer.
Definition at line 137 of file SiPixelErrorsDigisToCalibDigis.cc.
References createOutputFile_, lat::endl(), and outputFilename_.
00137 { 00138 00139 if (!outputFilename_.empty() && createOutputFile_) 00140 { 00141 edm::LogInfo("SiPixelErrorCalibDigis") << "Writing ROOT file to: " << outputFilename_ << std::endl; 00142 if ( &*edm::Service<DQMStore>()) edm::Service<DQMStore>()->save (outputFilename_); 00143 } 00144 }
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory | ( | uint32_t | detID | ) |
Definition at line 172 of file SiPixelErrorsDigisToCalibDigis.cc.
References folderMaker_, and SiPixelFolderOrganizer::setModuleFolder().
00173 { 00174 return folderMaker_->setModuleFolder(detID,0); 00175 }
bool SiPixelErrorsDigisToCalibDigis::setDQMDirectory | ( | std::string | dirName | ) |
Definition at line 166 of file SiPixelErrorsDigisToCalibDigis.cc.
References daqBE_, DQMStore::dirExists(), and DQMStore::setCurrentFolder().
Referenced by analyze().
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 beginJob(), 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 75 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by analyze(), beginJob(), and SiPixelErrorsDigisToCalibDigis().
Definition at line 85 of file SiPixelErrorsDigisToCalibDigis.h.
Definition at line 78 of file SiPixelErrorsDigisToCalibDigis.h.
Referenced by beginJob(), bookDQMHistogram2D(), and bookDQMHistoPlaquetteSummary2D().