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 ()
 
 SiPixelOfflineCalibAnalysisBase (const edm::ParameterSet &)
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
- 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 37 of file SiPixelIsAliveCalibration.cc.

Constructor & Destructor Documentation

◆ SiPixelIsAliveCalibration()

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 }

◆ ~SiPixelIsAliveCalibration()

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

◆ calibrationEnd()

void SiPixelIsAliveCalibration::calibrationEnd ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 143 of file SiPixelIsAliveCalibration.cc.

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 }

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

◆ calibrationSetup()

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

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 112 of file SiPixelIsAliveCalibration.cc.

112 {}

◆ checkCorrectCalibrationType()

bool SiPixelIsAliveCalibration::checkCorrectCalibrationType ( )
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 97 of file SiPixelIsAliveCalibration.cc.

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 }

References SiPixelOfflineCalibAnalysisBase::calibrationMode_.

◆ doFits()

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

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 113 of file SiPixelIsAliveCalibration.cc.

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 }

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

◆ doSetup()

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

Definition at line 111 of file SiPixelIsAliveCalibration.cc.

111 {}

◆ newDetID()

void SiPixelIsAliveCalibration::newDetID ( uint32_t  detid)
overrideprivatevirtual

Reimplemented from SiPixelOfflineCalibAnalysisBase.

Definition at line 82 of file SiPixelIsAliveCalibration.cc.

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 }

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

Member Data Documentation

◆ bookkeeper_

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

Definition at line 52 of file SiPixelIsAliveCalibration.cc.

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

◆ mineff_

double SiPixelIsAliveCalibration::mineff_
private

Definition at line 54 of file SiPixelIsAliveCalibration.cc.

Referenced by calibrationEnd().

◆ summaries_

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

Definition at line 53 of file SiPixelIsAliveCalibration.cc.

Referenced by doFits(), and newDetID().

SiPixelIsAliveCalibration::summaries_
std::map< uint32_t, MonitorElement * > summaries_
Definition: SiPixelIsAliveCalibration.cc:53
SiPixelOfflineCalibAnalysisBase::translateDetIdToString
std::string translateDetIdToString(uint32_t detid)
Definition: SiPixelOfflineCalibAnalysisBase.cc:151
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelOfflineCalibAnalysisBase::calib_
edm::ESHandle< SiPixelCalibConfiguration > calib_
Definition: SiPixelOfflineCalibAnalysisBase.h:108
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
SiPixelOfflineCalibAnalysisBase::calibrationMode_
std::string calibrationMode_
Definition: SiPixelOfflineCalibAnalysisBase.h:117
makePileupJSON.denom
denom
Definition: makePileupJSON.py:146
SiPixelCalibConfiguration::getNTriggers
short getNTriggers() const
Definition: SiPixelCalibConfiguration.h:28
SiPixelOfflineCalibAnalysisBase::SiPixelOfflineCalibAnalysisBase
SiPixelOfflineCalibAnalysisBase()
Definition: SiPixelOfflineCalibAnalysisBase.cc:53
SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D
MonitorElement * bookDQMHistogram1D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
Definition: SiPixelOfflineCalibAnalysisBase.cc:177
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
Definition: SiPixelOfflineCalibAnalysisBase.cc:202
SiPixelIsAliveCalibration::mineff_
double mineff_
Definition: SiPixelIsAliveCalibration.cc:54
SiPixelOfflineCalibAnalysisBase::setDQMDirectory
bool setDQMDirectory(std::string dirName)
Definition: SiPixelOfflineCalibAnalysisBase.cc:214
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
heppy_batch.val
val
Definition: heppy_batch.py:351
SiPixelIsAliveCalibration::bookkeeper_
std::map< uint32_t, MonitorElement * > bookkeeper_
Definition: SiPixelIsAliveCalibration.cc:52