CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelIsAliveCalibration Class Reference

#include <CalibTracker/SiPixelIsAliveCalibration/src/SiPixelIsAliveCalibration.cc>

Inheritance diagram for SiPixelIsAliveCalibration:
SiPixelOfflineCalibAnalysisBase edm::EDAnalyzer edm::EDConsumerBase

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 ()
 
- Public Member Functions inherited from SiPixelOfflineCalibAnalysisBase
void addTF1ToDQMMonitoringElement (MonitorElement *ele, TF1 *func)
 
MonitorElementbookDQMHistogram1D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
 
MonitorElementbookDQMHistogram1D (uint32_t detid, std::string name, std::string title, int nchX, float *xbinsize)
 
MonitorElementbookDQMHistogram2D (uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
 
MonitorElementbookDQMHistoPlaquetteSummary2D (uint32_t detid, std::string name, std::string title)
 
std::vector< uint32_t > & getRunNumbers ()
 
bool setDQMDirectory (std::string dirName)
 
bool setDQMDirectory (uint32_t detID)
 
 SiPixelOfflineCalibAnalysisBase (const edm::ParameterSet &)
 
 SiPixelOfflineCalibAnalysisBase ()
 
std::string translateDetIdToString (uint32_t detid)
 
 ~SiPixelOfflineCalibAnalysisBase ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from SiPixelOfflineCalibAnalysisBase
static const std::vector< short > * getVcalValues ()
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Static Public Attributes inherited from SiPixelOfflineCalibAnalysisBase
static TF1 * fitFunction_ = NULL
 
- Protected Member Functions inherited from SiPixelOfflineCalibAnalysisBase
uint32_t & EventNumber ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from SiPixelOfflineCalibAnalysisBase
edm::ESHandle
< SiPixelCalibConfiguration
calib_
 
std::string calibrationMode_
 
edm::ESHandle< TrackerGeometrygeom_
 
short nTriggers_
 
edm::ESHandle
< SiPixelFedCablingMap
theCablingMap_
 
- Static Protected Attributes inherited from SiPixelOfflineCalibAnalysisBase
static std::vector< short > vCalValues_
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 38 of file SiPixelIsAliveCalibration.cc.

Constructor & Destructor Documentation

SiPixelIsAliveCalibration::SiPixelIsAliveCalibration ( const edm::ParameterSet iConfig)
explicit

Definition at line 71 of file SiPixelIsAliveCalibration.cc.

71  :
73  mineff_(iConfig.getUntrackedParameter<double>("minEfficiencyForAliveDef",0.8))
74 {
75  //now do what ever initialization is needed
76 
77 }
T getUntrackedParameter(std::string const &, T const &) const
SiPixelIsAliveCalibration::~SiPixelIsAliveCalibration ( )

Definition at line 80 of file SiPixelIsAliveCalibration.cc.

81 {
82 
83  // do anything here that needs to be done at desctruction time
84  // (e.g. close files, deallocate resources etc.)
85 
86 }

Member Function Documentation

void SiPixelIsAliveCalibration::calibrationEnd ( )
privatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 152 of file SiPixelIsAliveCalibration.cc.

References bookkeeper_, cond::rpcobgas::detid, mineff_, SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), and SiPixelOfflineCalibAnalysisBase::translateDetIdToString().

152  {
153  // print summary of bad modules:
154  for(std::map<uint32_t, MonitorElement *>::const_iterator idet= bookkeeper_.begin(); idet!=bookkeeper_.end();++idet){
155  float idead = 0;
156  float iunderthres=0;
157  float imultiplefill=0;
158  float itot=0;
159  uint32_t detid=idet->first;
160 
161  setDQMDirectory(detid);
162  for(int icol=1; icol <= bookkeeper_[detid]->getNbinsX(); ++icol){
163  for(int irow=1; irow <= bookkeeper_[detid]->getNbinsY(); ++irow){
164  itot++;
165  double val = bookkeeper_[detid]->getBinContent(icol,irow);
166  if(val==0)
167  idead++;
168  if(val<mineff_)
169  iunderthres++;
170  if(val==-2)
171  imultiplefill++;
172 
173  }
174  }
175  edm::LogInfo("SiPixelIsAliveCalibration") << "summary for " << translateDetIdToString(detid) << "\tfrac dead:" << idead/itot << " frac below " << mineff_ << ":" << iunderthres/itot << " bad " << imultiplefill/itot << std::endl;
176  }
177 
178 }
std::string translateDetIdToString(uint32_t detid)
std::map< uint32_t, MonitorElement * > bookkeeper_
void SiPixelIsAliveCalibration::calibrationSetup ( const edm::EventSetup iSetup)
privatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 121 of file SiPixelIsAliveCalibration.cc.

121  {
122 
123 }
bool SiPixelIsAliveCalibration::checkCorrectCalibrationType ( )
privatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 104 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::calibrationMode_.

104  {
105  if(calibrationMode_=="PixelAlive")
106  return true;
107  else if(calibrationMode_=="unknown"){
108  edm::LogInfo("SiPixelIsAliveCalibration") << "calibration mode is: " << calibrationMode_ << ", continuing anyway..." ;
109  return true;
110  }
111  else{
112  // edm::LogError("SiPixelIsAliveCalibration")<< "unknown calibration mode for Pixel ALive, should be \"PixelAlive\" and is \"" << calibrationMode_ << "\"";
113  }
114  return false;
115 
116 }
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, i, and summaries_.

125  {
126  edm::LogInfo("SiPixelIsAliveCalibration") << "now looking at DetID " << detid << ", pixel " << ipix->row() << "," << ipix->col() << std::endl;
127 
128  double denom=0;
129  double nom=0;
130  for(uint32_t i=0; i<ipix->getnpoints(); i++){
131  nom+=ipix->getnentries(i);
132  denom+=calib_->getNTriggers();
133  if(i>0)
134  edm::LogWarning("SiPixelIsAliveCalibration::doFits") << " ERROR!!" << " number of vcal points is now " << i << " for detid " << detid << std::endl;
135  }
136  edm::LogInfo("SiPixelIsAliveCalibration") << "DetID/col/row " << detid << "/"<< ipix->col() << "/" << ipix->row() << ", now calculating efficiency: " << nom << "/" << denom <<"=" << nom/denom << std::endl;
137  double eff = -1;
138  if(denom>0)
139  eff = nom/denom;
140  if(bookkeeper_[detid]->getBinContent(ipix->col()+1,ipix->row()+1)==0){
141  bookkeeper_[detid]->Fill(ipix->col(), ipix->row(), eff);
142  summaries_[detid]->Fill(eff);
143  float zerobin = summaries_[detid]->getBinContent(1);
144  summaries_[detid]->setBinContent(1, zerobin-1);
145  }
146  else
147  bookkeeper_[detid]->setBinContent(ipix->col()+1,ipix->row()+1,-2);
148  return true;
149 }
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::map< uint32_t, MonitorElement * > bookkeeper_
std::map< uint32_t, MonitorElement * > summaries_
void SiPixelIsAliveCalibration::doSetup ( const edm::ParameterSet iConf)

Definition at line 117 of file SiPixelIsAliveCalibration.cc.

117  {
118 
119 }
void SiPixelIsAliveCalibration::newDetID ( uint32_t  detid)
privatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 93 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(), SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D(), bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, cond::rpcobgas::detid, SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), AlCaHLTBitMon_QueryRunRegistry::string, summaries_, and SiPixelOfflineCalibAnalysisBase::translateDetIdToString().

93  {
96  bookkeeper_[detid]= bookDQMHistoPlaquetteSummary2D(detid,"pixelAlive","pixel alive for "+tempname);
97  int xpix = bookkeeper_[detid]->getNbinsX();
98  int ypix = bookkeeper_[detid]->getNbinsY();
99  int tpix = xpix*ypix;
100  summaries_[detid]= bookDQMHistogram1D(detid,"pixelAliveSummary",bookkeeper_[detid]->getTitle(),calib_->getNTriggers()+1,-.05,.95+(1./(float)calib_->getNTriggers()));
101  summaries_[detid]->setBinContent(1, tpix);
102 }
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::string translateDetIdToString(uint32_t detid)
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
std::map< uint32_t, MonitorElement * > bookkeeper_
MonitorElement * bookDQMHistogram1D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
std::map< uint32_t, MonitorElement * > summaries_

Member Data Documentation

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().