#include <CalibTracker/SiPixelIsAliveCalibration/src/SiPixelIsAliveCalibration.cc>
Public Member Functions | |
virtual bool | doFits (uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix) |
void | doSetup (const edm::ParameterSet &) |
SiPixelIsAliveCalibration (const edm::ParameterSet &) | |
~SiPixelIsAliveCalibration () | |
Private Member Functions | |
virtual void | calibrationEnd () |
virtual void | calibrationSetup (const edm::EventSetup &) |
virtual bool | checkCorrectCalibrationType () |
virtual void | newDetID (uint32_t detid) |
Private Attributes | |
std::map< uint32_t, MonitorElement * > | bookkeeper_ |
double | mineff_ |
std::map< uint32_t, MonitorElement * > | summaries_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 38 of file SiPixelIsAliveCalibration.cc.
SiPixelIsAliveCalibration::SiPixelIsAliveCalibration | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 71 of file SiPixelIsAliveCalibration.cc.
: SiPixelOfflineCalibAnalysisBase(iConfig), mineff_(iConfig.getUntrackedParameter<double>("minEfficiencyForAliveDef",0.8)) { //now do what ever initialization is needed }
SiPixelIsAliveCalibration::~SiPixelIsAliveCalibration | ( | ) |
Definition at line 80 of file SiPixelIsAliveCalibration.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void SiPixelIsAliveCalibration::calibrationEnd | ( | ) | [private, virtual] |
Reimplemented from SiPixelOfflineCalibAnalysisBase.
Definition at line 152 of file SiPixelIsAliveCalibration.cc.
References bookkeeper_, cond::rpcobgas::detid, mineff_, SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), and SiPixelOfflineCalibAnalysisBase::translateDetIdToString().
{ // print summary of bad modules: for(std::map<uint32_t, MonitorElement *>::const_iterator idet= bookkeeper_.begin(); idet!=bookkeeper_.end();++idet){ float idead = 0; float iunderthres=0; float imultiplefill=0; float itot=0; uint32_t detid=idet->first; setDQMDirectory(detid); for(int icol=1; icol <= bookkeeper_[detid]->getNbinsX(); ++icol){ for(int irow=1; irow <= bookkeeper_[detid]->getNbinsY(); ++irow){ itot++; double val = bookkeeper_[detid]->getBinContent(icol,irow); if(val==0) idead++; if(val<mineff_) iunderthres++; if(val==-2) imultiplefill++; } } edm::LogInfo("SiPixelIsAliveCalibration") << "summary for " << translateDetIdToString(detid) << "\tfrac dead:" << idead/itot << " frac below " << mineff_ << ":" << iunderthres/itot << " bad " << imultiplefill/itot << std::endl; } }
void SiPixelIsAliveCalibration::calibrationSetup | ( | const edm::EventSetup & | iSetup | ) | [private, virtual] |
Reimplemented from SiPixelOfflineCalibAnalysisBase.
Definition at line 121 of file SiPixelIsAliveCalibration.cc.
{ }
bool SiPixelIsAliveCalibration::checkCorrectCalibrationType | ( | ) | [private, virtual] |
Reimplemented from SiPixelOfflineCalibAnalysisBase.
Definition at line 104 of file SiPixelIsAliveCalibration.cc.
References SiPixelOfflineCalibAnalysisBase::calibrationMode_.
{ if(calibrationMode_=="PixelAlive") return true; else if(calibrationMode_=="unknown"){ edm::LogInfo("SiPixelIsAliveCalibration") << "calibration mode is: " << calibrationMode_ << ", continuing anyway..." ; return true; } else{ // edm::LogError("SiPixelIsAliveCalibration")<< "unknown calibration mode for Pixel ALive, should be \"PixelAlive\" and is \"" << calibrationMode_ << "\""; } return false; }
bool SiPixelIsAliveCalibration::doFits | ( | uint32_t | detid, |
std::vector< SiPixelCalibDigi >::const_iterator | ipix | ||
) | [virtual] |
Reimplemented from SiPixelOfflineCalibAnalysisBase.
Definition at line 125 of file SiPixelIsAliveCalibration.cc.
References bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, cond::rpcobgas::detid, interpolateCardsSimple::eff, i, and summaries_.
{ edm::LogInfo("SiPixelIsAliveCalibration") << "now looking at DetID " << detid << ", pixel " << ipix->row() << "," << ipix->col() << std::endl; double denom=0; double nom=0; for(uint32_t i=0; i<ipix->getnpoints(); i++){ nom+=ipix->getnentries(i); denom+=calib_->getNTriggers(); if(i>0) edm::LogWarning("SiPixelIsAliveCalibration::doFits") << " ERROR!!" << " number of vcal points is now " << i << " for detid " << detid << std::endl; } edm::LogInfo("SiPixelIsAliveCalibration") << "DetID/col/row " << detid << "/"<< ipix->col() << "/" << ipix->row() << ", now calculating efficiency: " << nom << "/" << denom <<"=" << nom/denom << std::endl; double eff = -1; if(denom>0) eff = nom/denom; if(bookkeeper_[detid]->getBinContent(ipix->col()+1,ipix->row()+1)==0){ bookkeeper_[detid]->Fill(ipix->col(), ipix->row(), eff); summaries_[detid]->Fill(eff); float zerobin = summaries_[detid]->getBinContent(1); summaries_[detid]->setBinContent(1, zerobin-1); } else bookkeeper_[detid]->setBinContent(ipix->col()+1,ipix->row()+1,-2); return true; }
void SiPixelIsAliveCalibration::doSetup | ( | const edm::ParameterSet & | iConf | ) |
Definition at line 117 of file SiPixelIsAliveCalibration.cc.
{ }
void SiPixelIsAliveCalibration::newDetID | ( | uint32_t | detid | ) | [private, virtual] |
Reimplemented from SiPixelOfflineCalibAnalysisBase.
Definition at line 93 of file SiPixelIsAliveCalibration.cc.
References SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(), SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D(), bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, cond::rpcobgas::detid, SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), summaries_, and SiPixelOfflineCalibAnalysisBase::translateDetIdToString().
{ setDQMDirectory(detid); std::string tempname=translateDetIdToString(detid); bookkeeper_[detid]= bookDQMHistoPlaquetteSummary2D(detid,"pixelAlive","pixel alive for "+tempname); int xpix = bookkeeper_[detid]->getNbinsX(); int ypix = bookkeeper_[detid]->getNbinsY(); int tpix = xpix*ypix; summaries_[detid]= bookDQMHistogram1D(detid,"pixelAliveSummary",bookkeeper_[detid]->getTitle(),calib_->getNTriggers()+1,-.05,.95+(1./(float)calib_->getNTriggers())); summaries_[detid]->setBinContent(1, tpix); }
std::map<uint32_t,MonitorElement *> SiPixelIsAliveCalibration::bookkeeper_ [private] |
Definition at line 55 of file SiPixelIsAliveCalibration.cc.
Referenced by calibrationEnd(), doFits(), and newDetID().
double SiPixelIsAliveCalibration::mineff_ [private] |
Definition at line 57 of file SiPixelIsAliveCalibration.cc.
Referenced by calibrationEnd().
std::map<uint32_t,MonitorElement *> SiPixelIsAliveCalibration::summaries_ [private] |
Definition at line 56 of file SiPixelIsAliveCalibration.cc.
Referenced by doFits(), and newDetID().