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::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase 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::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Static Public Attributes inherited from SiPixelOfflineCalibAnalysisBase
static TF1 * fitFunction_ = nullptr
 
- 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from SiPixelOfflineCalibAnalysisBase
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdcablingMapToken_
 
edm::ESHandle< SiPixelCalibConfigurationcalib_
 
std::string calibrationMode_
 
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcdcalibToken_
 
edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcdcalibTokenBeginRun_
 
edm::ESHandle< TrackerGeometrygeom_
 
short nTriggers_
 
edm::ESHandle< SiPixelFedCablingMaptheCablingMap_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 
- 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 35 of file SiPixelIsAliveCalibration.cc.

Constructor & Destructor Documentation

◆ SiPixelIsAliveCalibration()

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

Definition at line 66 of file SiPixelIsAliveCalibration.cc.

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

◆ ~SiPixelIsAliveCalibration()

SiPixelIsAliveCalibration::~SiPixelIsAliveCalibration ( )
override

Definition at line 72 of file SiPixelIsAliveCalibration.cc.

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

Member Function Documentation

◆ calibrationEnd()

void SiPixelIsAliveCalibration::calibrationEnd ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 141 of file SiPixelIsAliveCalibration.cc.

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

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

◆ calibrationSetup()

void SiPixelIsAliveCalibration::calibrationSetup ( const edm::EventSetup iSetup)
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 110 of file SiPixelIsAliveCalibration.cc.

110 {}

◆ checkCorrectCalibrationType()

bool SiPixelIsAliveCalibration::checkCorrectCalibrationType ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 95 of file SiPixelIsAliveCalibration.cc.

References SiPixelOfflineCalibAnalysisBase::calibrationMode_.

95  {
96  if (calibrationMode_ == "PixelAlive")
97  return true;
98  else if (calibrationMode_ == "unknown") {
99  edm::LogInfo("SiPixelIsAliveCalibration")
100  << "calibration mode is: " << calibrationMode_ << ", continuing anyway...";
101  return true;
102  } else {
103  // edm::LogError("SiPixelIsAliveCalibration")<< "unknown calibration mode
104  // for Pixel ALive, should be \"PixelAlive\" and is \"" <<
105  // calibrationMode_ << "\"";
106  }
107  return false;
108 }
Log< level::Info, false > LogInfo

◆ doFits()

bool SiPixelIsAliveCalibration::doFits ( uint32_t  detid,
std::vector< SiPixelCalibDigi >::const_iterator  ipix 
)
overridevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 111 of file SiPixelIsAliveCalibration.cc.

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

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

◆ doSetup()

void SiPixelIsAliveCalibration::doSetup ( const edm::ParameterSet iConf)

Definition at line 109 of file SiPixelIsAliveCalibration.cc.

109 {}

◆ newDetID()

void SiPixelIsAliveCalibration::newDetID ( uint32_t  detid)
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 80 of file SiPixelIsAliveCalibration.cc.

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

80  {
81  setDQMDirectory(detid);
82  std::string tempname = translateDetIdToString(detid);
83  bookkeeper_[detid] = bookDQMHistoPlaquetteSummary2D(detid, "pixelAlive", "pixel alive for " + tempname);
84  int xpix = bookkeeper_[detid]->getNbinsX();
85  int ypix = bookkeeper_[detid]->getNbinsY();
86  int tpix = xpix * ypix;
87  summaries_[detid] = bookDQMHistogram1D(detid,
88  "pixelAliveSummary",
89  bookkeeper_[detid]->getTitle(),
90  calib_->getNTriggers() + 1,
91  -.05,
92  .95 + (1. / (float)calib_->getNTriggers()));
93  summaries_[detid]->setBinContent(1, tpix);
94 }
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

◆ bookkeeper_

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

Definition at line 50 of file SiPixelIsAliveCalibration.cc.

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

◆ mineff_

double SiPixelIsAliveCalibration::mineff_
private

Definition at line 52 of file SiPixelIsAliveCalibration.cc.

Referenced by calibrationEnd().

◆ summaries_

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

Definition at line 51 of file SiPixelIsAliveCalibration.cc.

Referenced by doFits(), and newDetID().