CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelIsAliveCalibration Class Reference

#include <SiPixelIsAliveCalibration.cc>

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

Public Member Functions

bool doFits (uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix) override
 
void doSetup (const edm::ParameterSet &)
 
 SiPixelIsAliveCalibration (const edm::ParameterSet &)
 
 ~SiPixelIsAliveCalibration () override
 
- 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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void calibrationEnd () override
 
void calibrationSetup (const edm::EventSetup &) override
 
bool checkCorrectCalibrationType () override
 
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 SiPixelOfflineCalibAnalysisBase
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Static Public Attributes inherited from SiPixelOfflineCalibAnalysisBase
static TF1 * fitFunction_ = 0
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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< SiPixelCalibConfigurationcalib_
 
std::string calibrationMode_
 
edm::ESHandle< TrackerGeometrygeom_
 
short nTriggers_
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap_
 
- Static Protected Attributes inherited from SiPixelOfflineCalibAnalysisBase
static std::vector< short > vCalValues_
 

Detailed Description

CalibTracker/SiPixelIsAliveCalibration/src/SiPixelIsAliveCalibration.cc

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

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

Definition at line 74 of file SiPixelIsAliveCalibration.cc.

74  {
75  // do anything here that needs to be done at desctruction time
76  // (e.g. close files, deallocate resources etc.)
77 }

Member Function Documentation

void SiPixelIsAliveCalibration::calibrationEnd ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 143 of file SiPixelIsAliveCalibration.cc.

References bookkeeper_, DEFINE_FWK_MODULE, mineff_, SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), SiPixelOfflineCalibAnalysisBase::translateDetIdToString(), and heppy_batch::val.

143  {
144  // print summary of bad modules:
145  for (std::map<uint32_t, MonitorElement *>::const_iterator idet = bookkeeper_.begin(); idet != bookkeeper_.end();
146  ++idet) {
147  float idead = 0;
148  float iunderthres = 0;
149  float imultiplefill = 0;
150  float itot = 0;
151  uint32_t detid = idet->first;
152 
153  setDQMDirectory(detid);
154  for (int icol = 1; icol <= bookkeeper_[detid]->getNbinsX(); ++icol) {
155  for (int irow = 1; irow <= bookkeeper_[detid]->getNbinsY(); ++irow) {
156  itot++;
157  double val = bookkeeper_[detid]->getBinContent(icol, irow);
158  if (val == 0)
159  idead++;
160  if (val < mineff_)
161  iunderthres++;
162  if (val == -2)
163  imultiplefill++;
164  }
165  }
166  edm::LogInfo("SiPixelIsAliveCalibration")
167  << "summary for " << translateDetIdToString(detid) << "\tfrac dead:" << idead / itot << " frac below "
168  << mineff_ << ":" << iunderthres / itot << " bad " << imultiplefill / itot << std::endl;
169  }
170 }
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 112 of file SiPixelIsAliveCalibration.cc.

112 {}
bool SiPixelIsAliveCalibration::checkCorrectCalibrationType ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 97 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::calibrationMode_.

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

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 113 of file SiPixelIsAliveCalibration.cc.

References bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, makePileupJSON::denom, SiPixelCalibConfiguration::getNTriggers(), mps_fire::i, and summaries_.

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

111 {}
void SiPixelIsAliveCalibration::newDetID ( uint32_t  detid)
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 82 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D(), SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D(), bookkeeper_, SiPixelOfflineCalibAnalysisBase::calib_, dqmMemoryStats::float, SiPixelCalibConfiguration::getNTriggers(), SiPixelOfflineCalibAnalysisBase::setDQMDirectory(), AlCaHLTBitMon_QueryRunRegistry::string, summaries_, and SiPixelOfflineCalibAnalysisBase::translateDetIdToString().

82  {
83  setDQMDirectory(detid);
84  std::string tempname = translateDetIdToString(detid);
85  bookkeeper_[detid] = bookDQMHistoPlaquetteSummary2D(detid, "pixelAlive", "pixel alive for " + tempname);
86  int xpix = bookkeeper_[detid]->getNbinsX();
87  int ypix = bookkeeper_[detid]->getNbinsY();
88  int tpix = xpix * ypix;
89  summaries_[detid] = bookDQMHistogram1D(detid,
90  "pixelAliveSummary",
91  bookkeeper_[detid]->getTitle(),
92  calib_->getNTriggers() + 1,
93  -.05,
94  .95 + (1. / (float)calib_->getNTriggers()));
95  summaries_[detid]->setBinContent(1, tpix);
96 }
edm::ESHandle< SiPixelCalibConfiguration > calib_
std::string translateDetIdToString(uint32_t detid)
std::map< uint32_t, MonitorElement * > bookkeeper_
MonitorElement * bookDQMHistogram1D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
std::map< uint32_t, MonitorElement * > summaries_

Member Data Documentation

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

Definition at line 52 of file SiPixelIsAliveCalibration.cc.

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

double SiPixelIsAliveCalibration::mineff_
private

Definition at line 54 of file SiPixelIsAliveCalibration.cc.

Referenced by calibrationEnd().

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

Definition at line 53 of file SiPixelIsAliveCalibration.cc.

Referenced by doFits(), and newDetID().