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) override
 
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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void calibrationEnd () override
 
virtual void calibrationSetup (const edm::EventSetup &) override
 
virtual bool checkCorrectCalibrationType () override
 
virtual void newDetID (uint32_t detid) override
 

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
 
- 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::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 37 of file SiPixelIsAliveCalibration.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file SiPixelIsAliveCalibration.cc.

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

Definition at line 79 of file SiPixelIsAliveCalibration.cc.

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

Member Function Documentation

void SiPixelIsAliveCalibration::calibrationEnd ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 151 of file SiPixelIsAliveCalibration.cc.

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

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

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 120 of file SiPixelIsAliveCalibration.cc.

120  {
121 
122 }
bool SiPixelIsAliveCalibration::checkCorrectCalibrationType ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 103 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::calibrationMode_.

103  {
104  if(calibrationMode_=="PixelAlive")
105  return true;
106  else if(calibrationMode_=="unknown"){
107  edm::LogInfo("SiPixelIsAliveCalibration") << "calibration mode is: " << calibrationMode_ << ", continuing anyway..." ;
108  return true;
109  }
110  else{
111  // edm::LogError("SiPixelIsAliveCalibration")<< "unknown calibration mode for Pixel ALive, should be \"PixelAlive\" and is \"" << calibrationMode_ << "\"";
112  }
113  return false;
114 
115 }
bool SiPixelIsAliveCalibration::doFits ( uint32_t  detid,
std::vector< SiPixelCalibDigi >::const_iterator  ipix 
)
overridevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 124 of file SiPixelIsAliveCalibration.cc.

References bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, cond::rpcobgas::detid, i, and summaries_.

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

116  {
117 
118 }
void SiPixelIsAliveCalibration::newDetID ( uint32_t  detid)
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 92 of file SiPixelIsAliveCalibration.cc.

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

92  {
95  bookkeeper_[detid]= bookDQMHistoPlaquetteSummary2D(detid,"pixelAlive","pixel alive for "+tempname);
96  int xpix = bookkeeper_[detid]->getNbinsX();
97  int ypix = bookkeeper_[detid]->getNbinsY();
98  int tpix = xpix*ypix;
99  summaries_[detid]= bookDQMHistogram1D(detid,"pixelAliveSummary",bookkeeper_[detid]->getTitle(),calib_->getNTriggers()+1,-.05,.95+(1./(float)calib_->getNTriggers()));
100  summaries_[detid]->setBinContent(1, tpix);
101 }
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 54 of file SiPixelIsAliveCalibration.cc.

Referenced by calibrationEnd(), doFits(), and newDetID().

double SiPixelIsAliveCalibration::mineff_
private

Definition at line 56 of file SiPixelIsAliveCalibration.cc.

Referenced by calibrationEnd().

std::map<uint32_t,MonitorElement *> SiPixelIsAliveCalibration::summaries_
private

Definition at line 55 of file SiPixelIsAliveCalibration.cc.

Referenced by doFits(), and newDetID().