CMS 3D CMS Logo

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

#include <SiPixelStatusHarvester.h>

Inheritance diagram for SiPixelStatusHarvester:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > HistogramManagerHolder edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &) final
 
void beginJob () override
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) final
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &, const edm::EventSetup &) final
 
void dqmEndRun (const edm::Run &, const edm::EventSetup &) final
 
void endJob () override
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) final
 
 SiPixelStatusHarvester (const edm::ParameterSet &)
 
 ~SiPixelStatusHarvester () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Types

enum  {
  BADROC, PERMANENTBADROC, FEDERRORROC, STUCKTBMROC,
  OTHERBADROC, PROMPTBADROC
}
 

Private Member Functions

void constructTag (std::map< int, SiPixelQuality * > siPixelQualityTag, edm::Service< cond::service::PoolDBOutputService > &poolDbService, std::string tagName, edm::Run const &iRun)
 
bool equal (SiPixelQuality *a, SiPixelQuality *b)
 
double perLayerRingAverage (int detid, SiPixelDetectorStatus tmpSiPixelStatus)
 
edm::LuminosityBlockNumber_t stepIOV (edm::LuminosityBlockNumber_t pin, std::map< edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t > IOV)
 
std::string substructure (int detid)
 
- Private Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, edm::Transition transition=edm::Transition::BeginRun)
 

Private Attributes

int aveDigiOcc_
 
const SiPixelQualitybadPixelInfo_
 
const SiPixelFedCablingcablingMap_ = nullptr
 
SiPixelCoordinates coord_
 
int countLumi_ = 0
 
bool debug_
 
edm::LuminosityBlockNumber_t endLumiBlock_
 
std::string label_
 
std::string moduleName_
 
int nLumi_
 
std::string outputBase_
 
std::map< int, std::map< int, std::pair< int, int > > > pixelO2O_
 
std::string recordName_
 
std::map< int, unsigned int > sensorSize_
 
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcdsiPixelFedCablingMapToken_
 
edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcdsiPixelQualityToken_
 
SiPixelStatusManager siPixelStatusManager_
 
std::vector< std::string > substructures
 
double thresholdL1_
 
double thresholdL2_
 
double thresholdL3_
 
double thresholdL4_
 
double thresholdRNG1_
 
double thresholdRNG2_
 
const TrackerGeometrytrackerGeometry_ = nullptr
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeometryToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopologyToken_
 
- Private Attributes inherited from HistogramManagerHolder
GeometryInterface geometryInterface
 
std::vector< HistogramManagerhisto
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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>
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)
 
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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

harvest per-lumi prduced SiPixelDetector status and make the payload for SiPixelQualityFromDB

Definition at line 33 of file SiPixelStatusHarvester.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
BADROC 
PERMANENTBADROC 
FEDERRORROC 
STUCKTBMROC 
OTHERBADROC 
PROMPTBADROC 

Definition at line 35 of file SiPixelStatusHarvester.h.

Constructor & Destructor Documentation

◆ SiPixelStatusHarvester()

SiPixelStatusHarvester::SiPixelStatusHarvester ( const edm::ParameterSet iConfig)

Definition at line 53 of file SiPixelStatusHarvester.cc.

55  thresholdL1_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
56  .getUntrackedParameter<double>("thresholdL1")),
57  thresholdL2_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
58  .getUntrackedParameter<double>("thresholdL2")),
59  thresholdL3_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
60  .getUntrackedParameter<double>("thresholdL3")),
61  thresholdL4_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
62  .getUntrackedParameter<double>("thresholdL4")),
63  thresholdRNG1_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
64  .getUntrackedParameter<double>("thresholdRNG1")),
65  thresholdRNG2_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
66  .getUntrackedParameter<double>("thresholdRNG2")),
67  outputBase_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
68  .getUntrackedParameter<std::string>("outputBase")),
70  iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters").getUntrackedParameter<int>("aveDigiOcc")),
71  nLumi_(iConfig.getParameter<edm::ParameterSet>("SiPixelStatusManagerParameters")
72  .getUntrackedParameter<int>("resetEveryNLumi")),
73  moduleName_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
74  .getUntrackedParameter<std::string>("moduleName")),
75  label_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
77  trackerGeometryToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::EndRun>()),
78  trackerTopologyToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::EndRun>()),
79  siPixelFedCablingMapToken_(esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd, edm::Transition::EndRun>()),
80  siPixelQualityToken_(esConsumes<SiPixelQuality, SiPixelQualityFromDbRcd, edm::Transition::EndRun>()) {
81  SiPixelStatusManager* siPixelStatusManager = new SiPixelStatusManager(iConfig, consumesCollector());
82  siPixelStatusManager_ = *siPixelStatusManager;
83  debug_ = iConfig.getUntrackedParameter<bool>("debug");
84  recordName_ = iConfig.getUntrackedParameter<std::string>("recordName", "SiPixelQualityFromDbRcd");
85 
86  sensorSize_.clear();
87  pixelO2O_.clear();
88 
90  endLumiBlock_ = 0;
91  countLumi_ = 0;
92 }

References edm::EDConsumerBase::consumesCollector(), countLumi_, debug_, endLumiBlock_, edm::EndRun, edm::ParameterSet::getUntrackedParameter(), pixelO2O_, recordName_, SiPixelStatusManager::reset(), sensorSize_, siPixelStatusManager_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~SiPixelStatusHarvester()

SiPixelStatusHarvester::~SiPixelStatusHarvester ( )
override

Definition at line 95 of file SiPixelStatusHarvester.cc.

95 {}

Member Function Documentation

◆ analyze()

void SiPixelStatusHarvester::analyze ( const edm::Event iEvent,
const edm::EventSetup  
)
finalvirtual

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 113 of file SiPixelStatusHarvester.cc.

113 {}

◆ beginJob()

void SiPixelStatusHarvester::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 98 of file SiPixelStatusHarvester.cc.

98 {}

◆ beginLuminosityBlock()

void SiPixelStatusHarvester::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
final

Definition at line 578 of file SiPixelStatusHarvester.cc.

578  {
579  countLumi_++;
580 }

References countLumi_.

◆ bookHistograms()

void SiPixelStatusHarvester::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
const edm::EventSetup iSetup 
)
final

Definition at line 104 of file SiPixelStatusHarvester.cc.

106  {
107  for (auto& histoman : histo) {
108  histoman.book(iBooker, iSetup);
109  }
110 }

References HistogramManagerHolder::histo.

◆ constructTag()

void SiPixelStatusHarvester::constructTag ( std::map< int, SiPixelQuality * >  siPixelQualityTag,
edm::Service< cond::service::PoolDBOutputService > &  poolDbService,
std::string  tagName,
edm::Run const &  iRun 
)
private

Definition at line 652 of file SiPixelStatusHarvester.cc.

655  {
656  for (std::map<int, SiPixelQuality*>::iterator qIt = siPixelQualityTag.begin(); qIt != siPixelQualityTag.end();
657  ++qIt) {
658  edm::LuminosityBlockID lu(iRun.id().run(), qIt->first);
659  cond::Time_t thisIOV = (cond::Time_t)(lu.value());
660 
661  SiPixelQuality* thisPayload = qIt->second;
662  if (qIt == siPixelQualityTag.begin())
663  poolDbService->writeOne<SiPixelQuality>(thisPayload, thisIOV, recordName_ + "_" + tagName);
664  else {
665  SiPixelQuality* prevPayload = (std::prev(qIt))->second;
666  if (!SiPixelStatusHarvester::equal(thisPayload,
667  prevPayload)) // only append newIOV if this payload differs wrt last
668  poolDbService->writeOne<SiPixelQuality>(thisPayload, thisIOV, recordName_ + "_" + tagName);
669  }
670  }
671 }

References equal(), edm::RunBase::id(), recordName_, edm::RunID::run(), edm::second(), JetPartonCorrections_cff::tagName, and cond::service::PoolDBOutputService::writeOne().

Referenced by dqmEndRun().

◆ dqmEndRun()

void SiPixelStatusHarvester::dqmEndRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
finalvirtual

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 116 of file SiPixelStatusHarvester.cc.

116  {
117  // tracker geometry and cabling map to convert offline row/column (module) to online row/column
119  const TrackerTopology* trackerTopology = &iSetup.getData(trackerTopologyToken_);
120  const SiPixelFedCablingMap* siPixelFedCablingMap = &iSetup.getData(siPixelFedCablingMapToken_);
121  cablingMap_ = siPixelFedCablingMap;
122 
123  // Pixel Phase-1 helper class
124  coord_.init(trackerTopology, trackerGeometry_, siPixelFedCablingMap);
125 
126  for (TrackerGeometry::DetContainer::const_iterator it = trackerGeometry_->dets().begin();
127  it != trackerGeometry_->dets().end();
128  it++) {
129  const PixelGeomDetUnit* pgdu = dynamic_cast<const PixelGeomDetUnit*>((*it));
130  if (pgdu == nullptr)
131  continue;
132  DetId detId = (*it)->geographicalId();
133  int detid = detId.rawId();
134 
135  const PixelTopology* topo = static_cast<const PixelTopology*>(&pgdu->specificTopology());
136  // number of row/columns for a given module
137  int rowsperroc = topo->rowsperroc();
138  int colsperroc = topo->colsperroc();
139 
140  int nROCrows = pgdu->specificTopology().nrows() / rowsperroc;
141  int nROCcolumns = pgdu->specificTopology().ncolumns() / colsperroc;
142  unsigned int nrocs = nROCrows * nROCcolumns;
143  sensorSize_[detid] = nrocs;
144 
145  std::map<int, std::pair<int, int>> rocToOfflinePixel;
146 
147  std::vector<sipixelobjects::CablingPathToDetUnit> path = (cablingMap_->det2PathMap()).find(detId.rawId())->second;
148  typedef std::vector<sipixelobjects::CablingPathToDetUnit>::const_iterator IT;
149  for (IT it = path.begin(); it != path.end(); ++it) {
150  // Pixel ROC building from path in cabling map
152  int idInDetUnit = (int)roc->idInDetUnit();
153 
154  // local to global conversion
155  sipixelobjects::LocalPixel::RocRowCol local = {rowsperroc / 2, colsperroc / 2};
157 
158  rocToOfflinePixel[idInDetUnit] = std::pair<int, int>(global.row, global.col);
159  }
160 
161  pixelO2O_[detid] = rocToOfflinePixel;
162  }
163 
164  // Permananent bad components
166 
167  // read in SiPixel occupancy data in ALCARECO/ALCAPROMPT
169  std::map<edm::LuminosityBlockNumber_t, std::map<int, std::vector<int>>> FEDerror25Map =
171  std::map<edm::LuminosityBlockNumber_t, SiPixelDetectorStatus> siPixelStatusMap =
173 
174  // DB service
176 
177  if (poolDbService.isAvailable()) { // if(poolDbService.isAvailable() )
178 
179  // start producing tag for permanent component removed
180  SiPixelQuality* siPixelQualityPermBad = new SiPixelQuality();
181  const std::vector<SiPixelQuality::disabledModuleType> badComponentList = badPixelInfo_->getBadComponentList();
182  for (unsigned int i = 0; i < badComponentList.size(); i++) {
183  siPixelQualityPermBad->addDisabledModule(badComponentList[i]);
184 
185  uint32_t detId = badComponentList[i].DetID;
186  int detid = int(detId);
187  unsigned int nroc = sensorSize_[detid];
188 
189  for (int iroc = 0; iroc < int(nroc); iroc++) {
190  if (badPixelInfo_->IsRocBad(detId, short(iroc))) {
191  std::map<int, std::pair<int, int>> rocToOfflinePixel = pixelO2O_[detid];
192  int row = rocToOfflinePixel[iroc].first;
193  int column = rocToOfflinePixel[iroc].second;
194  histo[PERMANENTBADROC].fill(detId, nullptr, column, row);
195  }
196  }
197  }
198  if (debug_ == true) { // only produced for debugging reason
199  cond::Time_t thisIOV = (cond::Time_t)iRun.id().run();
200  poolDbService->writeOne<SiPixelQuality>(siPixelQualityPermBad, thisIOV, recordName_ + "_permanentBad");
201  }
202 
203  // IOV for final payloads. FEDerror25 and pcl
204  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> finalIOV;
205  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> fedError25IOV;
206  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t> pclIOV;
207 
208  // container for SiPixelQuality for the whole run
209  std::map<int, SiPixelQuality*> siPixelQualityStuckTBM_Tag;
210 
211  // stuckTBM tag from FED error 25 with permanent component removed
212  for (SiPixelStatusManager::FEDerror25Map_iterator it = FEDerror25Map.begin(); it != FEDerror25Map.end(); it++) {
213  cond::Time_t thisIOV = 1;
214  edm::LuminosityBlockID lu(iRun.id().run(), it->first);
215  thisIOV = (cond::Time_t)(lu.value());
216 
217  int interval = 0;
218  // interval is the number of lumi sections in the IOV
220  if (nextIt != FEDerror25Map.end())
221  interval = int(nextIt->first - it->first);
222  else
223  interval = int(endLumiBlock_ - it->first + 1); // +1 because need to include the last lumi section
224 
225  SiPixelQuality* siPixelQuality_stuckTBM = new SiPixelQuality();
226  SiPixelQuality* siPixelQuality_FEDerror25 = new SiPixelQuality();
227 
228  std::map<int, std::vector<int>> tmpFEDerror25 = it->second;
229  for (std::map<int, std::vector<int>>::iterator ilist = tmpFEDerror25.begin(); ilist != tmpFEDerror25.end();
230  ilist++) {
231  int detid = ilist->first;
232  uint32_t detId = uint32_t(detid);
233 
234  SiPixelQuality::disabledModuleType BadModule_stuckTBM, BadModule_FEDerror25;
235 
236  BadModule_stuckTBM.DetID = uint32_t(detid);
237  BadModule_FEDerror25.DetID = uint32_t(detid);
238  BadModule_stuckTBM.errorType = 3;
239  BadModule_FEDerror25.errorType = 3;
240 
241  BadModule_stuckTBM.BadRocs = 0;
242  BadModule_FEDerror25.BadRocs = 0;
243  std::vector<uint32_t> BadRocList_stuckTBM, BadRocList_FEDerror25;
244  std::vector<int> list = ilist->second;
245 
246  for (unsigned int i = 0; i < list.size(); i++) {
247  int iroc = list[i];
248  std::map<int, std::pair<int, int>> rocToOfflinePixel = pixelO2O_[detid];
249  int row = rocToOfflinePixel[iroc].first;
250  int column = rocToOfflinePixel[iroc].second;
251 
252  BadRocList_FEDerror25.push_back(uint32_t(iroc));
253  for (int iLumi = 0; iLumi < interval; iLumi++) {
254  histo[FEDERRORROC].fill(detId, nullptr, column, row); // 1.0/nLumiBlock_);
255  }
256 
257  // only include rocs that are not permanent known bad
258  if (!badPixelInfo_->IsRocBad(detId, short(iroc))) { // stuckTBM = FEDerror25 - permanent bad
259  BadRocList_stuckTBM.push_back(uint32_t(iroc));
260  for (int iLumi = 0; iLumi < interval; iLumi++) {
261  histo[STUCKTBMROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
262  }
263  }
264  }
265 
266  // change module error type if all ROCs are bad
267  if (BadRocList_stuckTBM.size() == sensorSize_[detid])
268  BadModule_stuckTBM.errorType = 0;
269 
270  short badrocs_stuckTBM = 0;
271  for (std::vector<uint32_t>::iterator iter = BadRocList_stuckTBM.begin(); iter != BadRocList_stuckTBM.end();
272  ++iter) {
273  badrocs_stuckTBM += 1 << *iter; // 1 << *iter = 2^{*iter} using bitwise shift
274  }
275  // fill the badmodule only if there is(are) bad ROC(s) in it
276  if (badrocs_stuckTBM != 0) {
277  BadModule_stuckTBM.BadRocs = badrocs_stuckTBM;
278  siPixelQuality_stuckTBM->addDisabledModule(BadModule_stuckTBM);
279  }
280 
281  // change module error type if all ROCs are bad
282  if (BadRocList_FEDerror25.size() == sensorSize_[detid])
283  BadModule_FEDerror25.errorType = 0;
284 
285  short badrocs_FEDerror25 = 0;
286  for (std::vector<uint32_t>::iterator iter = BadRocList_FEDerror25.begin(); iter != BadRocList_FEDerror25.end();
287  ++iter) {
288  badrocs_FEDerror25 += 1 << *iter; // 1 << *iter = 2^{*iter} using bitwise shift
289  }
290  // fill the badmodule only if there is(are) bad ROC(s) in it
291  if (badrocs_FEDerror25 != 0) {
292  BadModule_FEDerror25.BadRocs = badrocs_FEDerror25;
293  siPixelQuality_FEDerror25->addDisabledModule(BadModule_FEDerror25);
294  }
295 
296  } // loop over modules
297 
298  siPixelQualityStuckTBM_Tag[it->first] = siPixelQuality_stuckTBM;
299 
300  finalIOV[it->first] = it->first;
301  fedError25IOV[it->first] = it->first;
302 
303  if (debug_ == true) // only produced for debugging reason
304  poolDbService->writeOne<SiPixelQuality>(siPixelQuality_FEDerror25, thisIOV, recordName_ + "_FEDerror25");
305 
306  delete siPixelQuality_FEDerror25;
307  }
308 
309  // IOV for PCL output tags that "combines" permanent bad/stuckTBM/other
310  for (SiPixelStatusManager::siPixelStatusMap_iterator it = siPixelStatusMap.begin(); it != siPixelStatusMap.end();
311  it++) {
312  finalIOV[it->first] = it->first;
313  pclIOV[it->first] = it->first;
314  }
315 
316  // loop over final IOV
317  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator itIOV;
318 
319  // container for SiPixelQuality for the whole run
320  std::map<int, SiPixelQuality*> siPixelQualityPCL_Tag;
321  std::map<int, SiPixelQuality*> siPixelQualityPrompt_Tag;
322  std::map<int, SiPixelQuality*> siPixelQualityOther_Tag;
323 
324  for (itIOV = finalIOV.begin(); itIOV != finalIOV.end(); itIOV++) {
325  int interval = 0;
326  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator nextItIOV = std::next(itIOV);
327  if (nextItIOV != finalIOV.end())
328  interval = int(nextItIOV->first - itIOV->first);
329  else
330  interval = int(endLumiBlock_ - itIOV->first + 1);
331 
332  edm::LuminosityBlockNumber_t lumiFEDerror25 = SiPixelStatusHarvester::stepIOV(itIOV->first, fedError25IOV);
333  edm::LuminosityBlockNumber_t lumiPCL = SiPixelStatusHarvester::stepIOV(itIOV->first, pclIOV);
334 
335  // get badROC list due to FEDerror25 = stuckTBM + permanent bad components
336  std::map<int, std::vector<int>> tmpFEDerror25 = FEDerror25Map[lumiFEDerror25];
337  // get SiPixelDetectorStatus
338  SiPixelDetectorStatus tmpSiPixelStatus = siPixelStatusMap[lumiPCL];
339  double DetAverage = tmpSiPixelStatus.perRocDigiOcc();
340 
341  // For the IOV of which the statistics is too low, for e.g., a cosmic run
342  // When using dynamicLumibased harvester or runbased harvester
343  // this only happens when the full run is lack of statistics
344  if (DetAverage < aveDigiOcc_) {
345  edm::LogInfo("SiPixelStatusHarvester")
346  << "Tag requested for prompt in low statistics IOV in the " << outputBase_ << " harvester" << std::endl;
347  siPixelQualityPCL_Tag[itIOV->first] = siPixelQualityPermBad;
348  siPixelQualityPrompt_Tag[itIOV->first] = siPixelQualityPermBad;
349 
350  // loop over modules to fill the PROMPT DQM plots with permanent bad components
351  std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.getDetectorStatus();
352  std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
353  for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
354  int detid = itMod->first;
355  uint32_t detId = uint32_t(detid);
356  SiPixelModuleStatus modStatus = itMod->second;
357 
358  for (int iroc = 0; iroc < modStatus.nrocs(); ++iroc) {
359  if (badPixelInfo_->IsRocBad(detId, short(iroc))) {
360  std::map<int, std::pair<int, int>> rocToOfflinePixel = pixelO2O_[detid];
361  int row = rocToOfflinePixel[iroc].first;
362  int column = rocToOfflinePixel[iroc].second;
363  for (int iLumi = 0; iLumi < interval; iLumi++) {
364  histo[PROMPTBADROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
365  histo[PERMANENTBADROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
366  }
367 
368  } // if permanent BAD
369 
370  } // loop over ROCs
371 
372  } // loop over modules
373 
374  // add empty bad components to "other" tag
375  edm::LogInfo("SiPixelStatusHarvester")
376  << "Tag requested for other in low statistics IOV in the " << outputBase_ << " harvester" << std::endl;
377  siPixelQualityOther_Tag[itIOV->first] = new SiPixelQuality();
378 
379  continue;
380  }
381 
382  // create the DB object
383  // payload including all : PCL = permanent bad (low DIGI ROC) + other + stuckTBM
384  SiPixelQuality* siPixelQualityPCL = new SiPixelQuality();
385  SiPixelQuality* siPixelQualityOther = new SiPixelQuality();
386  // Prompt = permanent bad(low DIGI + low eff/damaged ROCs + other)
387  SiPixelQuality* siPixelQualityPrompt = new SiPixelQuality();
388 
389  // loop over modules
390  std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.getDetectorStatus();
391  std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
392  for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
393  // create the bad module list for PCL and other
394  SiPixelQuality::disabledModuleType BadModulePCL, BadModuleOther;
395 
396  int detid = itMod->first;
397  uint32_t detId = uint32_t(detid);
398 
399  double DetAverage_local = SiPixelStatusHarvester::perLayerRingAverage(detid, tmpSiPixelStatus);
400  double local_threshold = 0.0;
401 
402  int layer = coord_.layer(DetId(detid));
403  int ring = coord_.ring(DetId(detid));
404 
405  if (layer == 1)
406  local_threshold = thresholdL1_;
407  if (layer == 2)
408  local_threshold = thresholdL2_;
409  if (layer == 3)
410  local_threshold = thresholdL3_;
411  if (layer == 4)
412  local_threshold = thresholdL4_;
413 
414  if (ring == 1)
415  local_threshold = thresholdRNG1_;
416  if (ring == 2)
417  local_threshold = thresholdRNG2_;
418 
419  BadModulePCL.DetID = uint32_t(detid);
420  BadModuleOther.DetID = uint32_t(detid);
421  BadModulePCL.errorType = 3;
422  BadModuleOther.errorType = 3;
423  BadModulePCL.BadRocs = 0;
424  BadModuleOther.BadRocs = 0;
425 
426  std::vector<uint32_t> BadRocListPCL, BadRocListOther;
427 
428  // module status and FEDerror25 status for module with DetId detId
429  SiPixelModuleStatus modStatus = itMod->second;
430  std::vector<int> listFEDerror25 = tmpFEDerror25[detid];
431 
432  std::map<int, std::pair<int, int>> rocToOfflinePixel = pixelO2O_[detid];
433  for (int iroc = 0; iroc < modStatus.nrocs(); ++iroc) {
434  unsigned int rocOccupancy = modStatus.digiOccROC(iroc);
435 
436  int row = rocToOfflinePixel[iroc].first;
437  int column = rocToOfflinePixel[iroc].second;
438 
439  // Bad ROC are from low DIGI Occ ROCs
440  if (rocOccupancy < local_threshold * DetAverage_local) { // if BAD
441 
442  //PCL bad roc list
443  BadRocListPCL.push_back(uint32_t(iroc));
444  for (int iLumi = 0; iLumi < interval; iLumi++) {
445  histo[BADROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
446  }
447 
448  //FEDerror25 list
449  std::vector<int>::iterator it = std::find(listFEDerror25.begin(), listFEDerror25.end(), iroc);
450 
451  // other source of bad components = PCL bad - FEDerror25 - permanent bad
452  if (it == listFEDerror25.end() && !(badPixelInfo_->IsRocBad(detId, short(iroc)))) {
453  // if neither permanent nor FEDerror25
454  BadRocListOther.push_back(uint32_t(iroc));
455  for (int iLumi = 0; iLumi < interval; iLumi++) {
456  histo[OTHERBADROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
457  }
458  }
459 
460  } // if BAD
461 
462  } // loop over ROCs
463 
464  // errorType 0 means the full module is bad
465  if (BadRocListPCL.size() == sensorSize_[detid])
466  BadModulePCL.errorType = 0;
467  if (BadRocListOther.size() == sensorSize_[detid])
468  BadModuleOther.errorType = 0;
469 
470  // PCL
471  short badrocsPCL = 0;
472  for (std::vector<uint32_t>::iterator iterPCL = BadRocListPCL.begin(); iterPCL != BadRocListPCL.end();
473  ++iterPCL) {
474  badrocsPCL += 1 << *iterPCL; // 1 << *iter = 2^{*iter} using bitwise shift
475  }
476  if (badrocsPCL != 0) {
477  BadModulePCL.BadRocs = badrocsPCL;
478  siPixelQualityPCL->addDisabledModule(BadModulePCL);
479  }
480 
481  // Other
482  short badrocsOther = 0;
483  for (std::vector<uint32_t>::iterator iterOther = BadRocListOther.begin(); iterOther != BadRocListOther.end();
484  ++iterOther) {
485  badrocsOther += 1 << *iterOther; // 1 << *iter = 2^{*iter} using bitwise shift
486  }
487  if (badrocsOther != 0) {
488  BadModuleOther.BadRocs = badrocsOther;
489  siPixelQualityOther->addDisabledModule(BadModuleOther);
490  }
491 
492  // start constructing bad components for prompt = "other" + permanent
493  SiPixelQuality::disabledModuleType BadModulePrompt;
494  BadModulePrompt.DetID = uint32_t(detid);
495  BadModulePrompt.errorType = 3;
496  BadModulePrompt.BadRocs = 0;
497 
498  std::vector<uint32_t> BadRocListPrompt;
499  for (int iroc = 0; iroc < modStatus.nrocs(); ++iroc) {
500  // if in permannet bad tag or is in other tag
501  if (badPixelInfo_->IsRocBad(detId, short(iroc)) || ((badrocsOther >> short(iroc)) & 0x1)) {
502  BadRocListPrompt.push_back(uint32_t(iroc));
503 
504  std::map<int, std::pair<int, int>> rocToOfflinePixel = pixelO2O_[detid];
505  int row = rocToOfflinePixel[iroc].first;
506  int column = rocToOfflinePixel[iroc].second;
507  for (int iLumi = 0; iLumi < interval; iLumi++) {
508  histo[PROMPTBADROC].fill(detId, nullptr, column, row); //, 1.0/nLumiBlock_);
509  }
510  } // if bad
511  } // loop over all ROCs
512 
513  // errorType 0 means the full module is bad
514  if (BadRocListPrompt.size() == sensorSize_[detid])
515  BadModulePrompt.errorType = 0;
516 
517  short badrocsPrompt = 0;
518  for (std::vector<uint32_t>::iterator iterPrompt = BadRocListPrompt.begin();
519  iterPrompt != BadRocListPrompt.end();
520  ++iterPrompt) {
521  badrocsPrompt += 1 << *iterPrompt; // 1 << *iter = 2^{*iter} using bitwise shift
522  }
523  if (badrocsPrompt != 0) {
524  BadModulePrompt.BadRocs = badrocsPrompt;
525  siPixelQualityPrompt->addDisabledModule(BadModulePrompt);
526  }
527 
528  } // end module loop
529 
530  // PCL
531  siPixelQualityPCL_Tag[itIOV->first] = siPixelQualityPCL;
532  // Prompt
533  siPixelQualityPrompt_Tag[itIOV->first] = siPixelQualityPrompt;
534  // Other
535  siPixelQualityOther_Tag[itIOV->first] = siPixelQualityOther;
536 
537  } // loop over IOV
538 
539  // Now construct the tags made of payloads
540  // and only append newIOV if this payload differs wrt last
541 
542  //PCL
543  if (debug_ == true) // only produced for debugging reason
544  SiPixelStatusHarvester::constructTag(siPixelQualityPCL_Tag, poolDbService, "PCL", iRun);
545  // other
546  SiPixelStatusHarvester::constructTag(siPixelQualityOther_Tag, poolDbService, "other", iRun);
547  // prompt
548  SiPixelStatusHarvester::constructTag(siPixelQualityPrompt_Tag, poolDbService, "prompt", iRun);
549  // stuckTBM
550  SiPixelStatusHarvester::constructTag(siPixelQualityStuckTBM_Tag, poolDbService, "stuckTBM", iRun);
551 
552  // Add a dummy IOV starting from last lumisection+1 to close the tag for the run
553  if ((outputBase_ == "nLumibased" || outputBase_ == "dynamicLumibased") && !finalIOV.empty()) {
554  itIOV = std::prev(finalIOV.end()); // go to last element in the pixel quality tag
555  SiPixelQuality* lastPrompt = siPixelQualityPrompt_Tag[itIOV->first];
556  SiPixelQuality* lastOther = siPixelQualityOther_Tag[itIOV->first];
557 
558  // add permanent bad components to last lumi+1 IF AND ONLY IF the last payload of prompt is not equal to permanent bad components
559  edm::LuminosityBlockID lu(iRun.id().run(), endLumiBlock_ + 1);
560  cond::Time_t thisIOV = (cond::Time_t)(lu.value());
561  if (!SiPixelStatusHarvester::equal(lastPrompt, siPixelQualityPermBad))
562  poolDbService->writeOne<SiPixelQuality>(siPixelQualityPermBad, thisIOV, recordName_ + "_prompt");
563 
564  // add empty bad components to last lumi+1 IF AND ONLY IF the last payload of other is not equal to empty
565  SiPixelQuality* siPixelQualityDummy = new SiPixelQuality();
566  if (!SiPixelStatusHarvester::equal(lastOther, siPixelQualityDummy))
567  poolDbService->writeOne<SiPixelQuality>(siPixelQualityDummy, thisIOV, recordName_ + "_other");
568 
569  delete siPixelQualityDummy;
570  }
571 
572  delete siPixelQualityPermBad;
573 
574  } // end of if(poolDbService.isAvailable() )
575 }

References SiPixelQuality::addDisabledModule(), aveDigiOcc_, badPixelInfo_, BADROC, SiPixelQuality::disabledModuleType::BadRocs, cablingMap_, sipixelobjects::GlobalPixel::col, PixelTopology::colsperroc(), constructTag(), coord_, SiPixelStatusManager::createPayloads(), debug_, SiPixelFedCabling::det2PathMap(), SiPixelQuality::disabledModuleType::DetID, TrackerGeometry::dets(), SiPixelModuleStatus::digiOccROC(), endLumiBlock_, equal(), SiPixelQuality::disabledModuleType::errorType, FEDERRORROC, spr::find(), SiPixelFedCabling::findItem(), cms::cuda::for(), SiPixelQuality::getBadComponentList(), SiPixelStatusManager::getBadComponents(), edm::EventSetup::getData(), SiPixelDetectorStatus::getDetectorStatus(), SiPixelStatusManager::getFEDerror25Rocs(), HistogramManagerHolder::histo, mps_fire::i, edm::RunBase::id(), SiPixelCoordinates::init(), createfilelist::int, readEcalDQMStatus::interval, edm::Service< T >::isAvailable(), SiPixelQuality::IsRocBad(), SiPixelCoordinates::layer(), list(), DTRecHitClients_cfi::local, genParticles_cff::map, PixelTopology::ncolumns(), GetRecoTauVFromDQM_MC_cff::next, SiPixelModuleStatus::nrocs(), DeadROCCounter::nrocs, PixelTopology::nrows(), OTHERBADROC, outputBase_, castor_dqm_sourceclient_file_cfg::path, perLayerRingAverage(), PERMANENTBADROC, SiPixelDetectorStatus::perRocDigiOcc(), pixelO2O_, PROMPTBADROC, DetId::rawId(), recordName_, SiPixelCoordinates::ring(), relativeConstraints::ring, PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, PixelTopology::rowsperroc(), edm::RunID::run(), edm::second(), sensorSize_, siPixelFedCablingMapToken_, AlCaHarvesting_cff::SiPixelQuality, siPixelQualityToken_, siPixelStatusManager_, PixelGeomDetUnit::specificTopology(), stepIOV(), STUCKTBMROC, thresholdL1_, thresholdL2_, thresholdL3_, thresholdL4_, thresholdRNG1_, thresholdRNG2_, trackerGeometry_, trackerGeometryToken_, trackerTopologyToken_, cond::service::PoolDBOutputService::writeOne(), and testProducerWithPsetDescEmpty_cfi::x1.

◆ endJob()

void SiPixelStatusHarvester::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 101 of file SiPixelStatusHarvester.cc.

101 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ endLuminosityBlock()

void SiPixelStatusHarvester::endLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
final

Definition at line 583 of file SiPixelStatusHarvester.cc.

583  {
585  // update endLumiBlock_ by current lumi block
586  if (endLumiBlock_ < iLumi.luminosityBlock())
587  endLumiBlock_ = iLumi.luminosityBlock();
588 }

References endLumiBlock_, edm::LuminosityBlockBase::luminosityBlock(), SiPixelStatusManager::readLumi(), and siPixelStatusManager_.

◆ equal()

bool SiPixelStatusHarvester::equal ( SiPixelQuality a,
SiPixelQuality b 
)
private

Definition at line 615 of file SiPixelStatusHarvester.cc.

615  {
616  std::vector<SiPixelQuality::disabledModuleType> badRocListA;
617  std::vector<SiPixelQuality::disabledModuleType> badRocListB;
618 
619  for (unsigned int ia = 0; ia < (a->getBadComponentList()).size(); ia++) {
620  badRocListA.push_back((a->getBadComponentList())[ia]);
621  }
622  for (unsigned int ib = 0; ib < (b->getBadComponentList()).size(); ib++) {
623  badRocListB.push_back((b->getBadComponentList())[ib]);
624  }
625 
626  if (badRocListA.size() != badRocListB.size())
627  return false;
628 
629  // ordering ROCs by DetId
630  std::sort(badRocListA.begin(), badRocListA.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
631  std::sort(badRocListB.begin(), badRocListB.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
632 
633  for (unsigned int i = 0; i < badRocListA.size(); i++) {
634  uint32_t detIdA = badRocListA[i].DetID;
635  uint32_t detIdB = badRocListB[i].DetID;
636  if (detIdA != detIdB)
637  return false;
638  else {
639  unsigned short BadRocsA = badRocListA[i].BadRocs;
640  unsigned short BadRocsB = badRocListB[i].BadRocs;
641  if (BadRocsA != BadRocsB)
642  return false;
643  }
644  }
645 
646  //if the module list is the same, and for each module, roc list is the same
647  //the two SiPixelQualitys are equal
648  return true;
649 }

References a, b, mps_fire::i, cuy::ib, and findQualityFiles::size.

Referenced by constructTag(), and dqmEndRun().

◆ perLayerRingAverage()

double SiPixelStatusHarvester::perLayerRingAverage ( int  detid,
SiPixelDetectorStatus  tmpSiPixelStatus 
)
private

Definition at line 674 of file SiPixelStatusHarvester.cc.

674  {
675  unsigned long int ave(0);
676  int nrocs(0);
677 
678  int layer = coord_.layer(DetId(detid));
679  int ring = coord_.ring(DetId(detid));
680 
681  std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.getDetectorStatus();
682  std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
683  for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
684  if (layer != coord_.layer(DetId(itMod->first)))
685  continue;
686  if (ring != coord_.ring(DetId(itMod->first)))
687  continue;
688  unsigned long int inc = itMod->second.digiOccMOD();
689  ave += inc;
690  nrocs += itMod->second.nrocs();
691  }
692 
693  if (nrocs > 0)
694  return ave * 1.0 / nrocs;
695  else
696  return 0.0;
697 }

References coord_, SiPixelDetectorStatus::getDetectorStatus(), SiPixelCoordinates::layer(), DeadROCCounter::nrocs, SiPixelCoordinates::ring(), and relativeConstraints::ring.

Referenced by dqmEndRun().

◆ stepIOV()

edm::LuminosityBlockNumber_t SiPixelStatusHarvester::stepIOV ( edm::LuminosityBlockNumber_t  pin,
std::map< edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t IOV 
)
private

Definition at line 591 of file SiPixelStatusHarvester.cc.

592  {
593  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator itIOV;
594  for (itIOV = IOV.begin(); itIOV != IOV.end(); itIOV++) {
595  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator nextItIOV;
596  nextItIOV = itIOV;
597  nextItIOV++;
598 
599  if (nextItIOV != IOV.end()) {
600  if (pin >= itIOV->first && pin < nextItIOV->first) {
601  return itIOV->first;
602  }
603  } else {
604  if (pin >= itIOV->first) {
605  return itIOV->first;
606  }
607  }
608  }
609 
610  // return the firstIOV in case all above fail
611  return (IOV.begin())->first;
612 }

References dqmdumpme::first.

Referenced by dqmEndRun().

◆ substructure()

std::string SiPixelStatusHarvester::substructure ( int  detid)
private

Definition at line 699 of file SiPixelStatusHarvester.cc.

699  {
701  int layer = coord_.layer(DetId(detid));
702 
703  if (layer > 0) {
704  std::string L = std::to_string(layer);
705  substructure = "BpixLYR";
706  substructure += L;
707  } else {
708  substructure = "FpixRNG";
709  int ring = coord_.ring(DetId(detid));
710  std::string R = std::to_string(ring);
711  substructure += R;
712  }
713 
714  return substructure;
715 }

References coord_, dttmaxenums::L, SiPixelCoordinates::layer(), dttmaxenums::R, SiPixelCoordinates::ring(), relativeConstraints::ring, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ aveDigiOcc_

int SiPixelStatusHarvester::aveDigiOcc_
private

Definition at line 58 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ badPixelInfo_

const SiPixelQuality* SiPixelStatusHarvester::badPixelInfo_
private

Definition at line 70 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ cablingMap_

const SiPixelFedCabling* SiPixelStatusHarvester::cablingMap_ = nullptr
private

Definition at line 78 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ coord_

SiPixelCoordinates SiPixelStatusHarvester::coord_
private

Definition at line 81 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), perLayerRingAverage(), and substructure().

◆ countLumi_

int SiPixelStatusHarvester::countLumi_ = 0
private

Definition at line 73 of file SiPixelStatusHarvester.h.

Referenced by beginLuminosityBlock(), and SiPixelStatusHarvester().

◆ debug_

bool SiPixelStatusHarvester::debug_
private

Definition at line 65 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ endLumiBlock_

edm::LuminosityBlockNumber_t SiPixelStatusHarvester::endLumiBlock_
private

Definition at line 75 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), endLuminosityBlock(), and SiPixelStatusHarvester().

◆ label_

std::string SiPixelStatusHarvester::label_
private

◆ moduleName_

std::string SiPixelStatusHarvester::moduleName_
private

Definition at line 60 of file SiPixelStatusHarvester.h.

◆ nLumi_

int SiPixelStatusHarvester::nLumi_
private

Definition at line 59 of file SiPixelStatusHarvester.h.

◆ outputBase_

std::string SiPixelStatusHarvester::outputBase_
private

Definition at line 57 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ pixelO2O_

std::map<int, std::map<int, std::pair<int, int> > > SiPixelStatusHarvester::pixelO2O_
private

Definition at line 84 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ recordName_

std::string SiPixelStatusHarvester::recordName_
private

Definition at line 67 of file SiPixelStatusHarvester.h.

Referenced by constructTag(), dqmEndRun(), and SiPixelStatusHarvester().

◆ sensorSize_

std::map<int, unsigned int> SiPixelStatusHarvester::sensorSize_
private

Definition at line 79 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ siPixelFedCablingMapToken_

edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> SiPixelStatusHarvester::siPixelFedCablingMapToken_
private

Definition at line 88 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ siPixelQualityToken_

edm::ESGetToken<SiPixelQuality, SiPixelQualityFromDbRcd> SiPixelStatusHarvester::siPixelQualityToken_
private

Definition at line 89 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ siPixelStatusManager_

SiPixelStatusManager SiPixelStatusHarvester::siPixelStatusManager_
private

Definition at line 63 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), endLuminosityBlock(), and SiPixelStatusHarvester().

◆ substructures

std::vector<std::string> SiPixelStatusHarvester::substructures
private

Definition at line 92 of file SiPixelStatusHarvester.h.

◆ thresholdL1_

double SiPixelStatusHarvester::thresholdL1_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL2_

double SiPixelStatusHarvester::thresholdL2_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL3_

double SiPixelStatusHarvester::thresholdL3_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL4_

double SiPixelStatusHarvester::thresholdL4_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdRNG1_

double SiPixelStatusHarvester::thresholdRNG1_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdRNG2_

double SiPixelStatusHarvester::thresholdRNG2_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerGeometry_

const TrackerGeometry* SiPixelStatusHarvester::trackerGeometry_ = nullptr
private

Definition at line 77 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerGeometryToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelStatusHarvester::trackerGeometryToken_
private

Definition at line 86 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerTopologyToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelStatusHarvester::trackerTopologyToken_
private

Definition at line 87 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

dttmaxenums::L
Definition: DTTMax.h:29
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelStatusManager::reset
void reset()
Definition: SiPixelStatusManager.cc:46
SiPixelStatusHarvester::trackerGeometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: SiPixelStatusHarvester.h:86
SiPixelStatusHarvester::FEDERRORROC
Definition: SiPixelStatusHarvester.h:35
SiPixelCoordinates::layer
int layer(const DetId &)
Definition: SiPixelCoordinates.cc:94
SiPixelQuality::BadComponentStrictWeakOrdering
Definition: SiPixelQuality.h:54
SiPixelStatusHarvester::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: SiPixelStatusHarvester.h:77
edm::RunID::run
RunNumber_t run() const
Definition: RunID.h:36
SiPixelFedCabling::findItem
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
PixelTopology::colsperroc
virtual int colsperroc() const =0
TrackerTopology
Definition: TrackerTopology.h:16
SiPixelStatusHarvester::STUCKTBMROC
Definition: SiPixelStatusHarvester.h:35
SiPixelQuality::disabledModuleType
Definition: SiPixelQuality.h:29
edm::LogInfo
Definition: MessageLogger.h:254
SiPixelStatusHarvester::cablingMap_
const SiPixelFedCabling * cablingMap_
Definition: SiPixelStatusHarvester.h:78
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
HistogramManagerHolder::histo
std::vector< HistogramManager > histo
Definition: SiPixelPhase1Base.h:37
SiPixelQuality::disabledModuleType::errorType
int errorType
Definition: SiPixelQuality.h:31
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
SiPixelStatusHarvester::recordName_
std::string recordName_
Definition: SiPixelStatusHarvester.h:67
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
SiPixelStatusHarvester::perLayerRingAverage
double perLayerRingAverage(int detid, SiPixelDetectorStatus tmpSiPixelStatus)
Definition: SiPixelStatusHarvester.cc:674
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
dqmdumpme.first
first
Definition: dqmdumpme.py:55
SiPixelStatusManager::siPixelStatusMap_iterator
std::map< edm::LuminosityBlockNumber_t, SiPixelDetectorStatus >::iterator siPixelStatusMap_iterator
Definition: SiPixelStatusManager.h:40
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
SiPixelStatusManager::readLumi
void readLumi(const edm::LuminosityBlock &)
Definition: SiPixelStatusManager.cc:72
SiPixelDetectorStatus
Definition: SiPixelDetectorStatus.h:11
SiPixelDetectorStatus::getDetectorStatus
std::map< int, SiPixelModuleStatus > getDetectorStatus()
Definition: SiPixelDetectorStatus.h:80
DetId
Definition: DetId.h:17
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
SiPixelStatusHarvester::debug_
bool debug_
Definition: SiPixelStatusHarvester.h:65
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
SiPixelCoordinates::init
void init(const TrackerTopology *, const TrackerGeometry *, const SiPixelFedCablingMap *)
Definition: SiPixelCoordinates.cc:30
SiPixelStatusHarvester::thresholdL4_
double thresholdL4_
Definition: SiPixelStatusHarvester.h:56
SiPixelStatusHarvester::OTHERBADROC
Definition: SiPixelStatusHarvester.h:35
SiPixelStatusHarvester::thresholdRNG1_
double thresholdRNG1_
Definition: SiPixelStatusHarvester.h:56
edm::LuminosityBlockBase::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockBase.h:40
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
SiPixelStatusManager::getBadComponents
const std::map< edm::LuminosityBlockNumber_t, SiPixelDetectorStatus > & getBadComponents()
Definition: SiPixelStatusManager.h:35
PixelTopology::ncolumns
virtual int ncolumns() const =0
SiPixelStatusManager::getFEDerror25Rocs
const std::map< edm::LuminosityBlockNumber_t, std::map< int, std::vector< int > > > & getFEDerror25Rocs()
Definition: SiPixelStatusManager.h:36
SiPixelModuleStatus
Definition: SiPixelModuleStatus.h:10
SiPixelStatusHarvester::thresholdL2_
double thresholdL2_
Definition: SiPixelStatusHarvester.h:56
SiPixelStatusHarvester::sensorSize_
std::map< int, unsigned int > sensorSize_
Definition: SiPixelStatusHarvester.h:79
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
PixelTopology
Definition: PixelTopology.h:10
b
double b
Definition: hdecay.h:118
SiPixelStatusHarvester::coord_
SiPixelCoordinates coord_
Definition: SiPixelStatusHarvester.h:81
SiPixelStatusHarvester::thresholdL3_
double thresholdL3_
Definition: SiPixelStatusHarvester.h:56
SiPixelFedCabling::det2PathMap
virtual std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const =0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelCoordinates::ring
int ring(const DetId &)
Definition: SiPixelCoordinates.cc:232
SiPixelStatusHarvester::outputBase_
std::string outputBase_
Definition: SiPixelStatusHarvester.h:57
SiPixelStatusHarvester::BADROC
Definition: SiPixelStatusHarvester.h:35
SiPixelStatusManager::FEDerror25Map_iterator
std::map< edm::LuminosityBlockNumber_t, std::map< int, std::vector< int > > >::iterator FEDerror25Map_iterator
Definition: SiPixelStatusManager.h:41
edm::ParameterSet
Definition: ParameterSet.h:36
SiPixelStatusManager
Definition: SiPixelStatusManager.h:24
SiPixelQuality
Definition: SiPixelQuality.h:27
a
double a
Definition: hdecay.h:119
SiPixelStatusHarvester::constructTag
void constructTag(std::map< int, SiPixelQuality * > siPixelQualityTag, edm::Service< cond::service::PoolDBOutputService > &poolDbService, std::string tagName, edm::Run const &iRun)
Definition: SiPixelStatusHarvester.cc:652
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
SiPixelStatusHarvester::PERMANENTBADROC
Definition: SiPixelStatusHarvester.h:35
HistogramManagerHolder::HistogramManagerHolder
HistogramManagerHolder(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, edm::Transition transition=edm::Transition::BeginRun)
Definition: SiPixelPhase1Base.h:29
SiPixelQuality::disabledModuleType::DetID
uint32_t DetID
Definition: SiPixelQuality.h:30
edm::Service< cond::service::PoolDBOutputService >
createfilelist.int
int
Definition: createfilelist.py:10
SiPixelQuality::addDisabledModule
void addDisabledModule(disabledModuleType module)
Definition: SiPixelQuality.h:71
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
SiPixelStatusHarvester::thresholdL1_
double thresholdL1_
Definition: SiPixelStatusHarvester.h:56
SiPixelStatusHarvester::thresholdRNG2_
double thresholdRNG2_
Definition: SiPixelStatusHarvester.h:56
cuy.ib
ib
Definition: cuy.py:662
SiPixelStatusHarvester::moduleName_
std::string moduleName_
Definition: SiPixelStatusHarvester.h:60
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
SiPixelModuleStatus::digiOccROC
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
Definition: SiPixelModuleStatus.cc:46
PixelTopology::rowsperroc
virtual int rowsperroc() const =0
SiPixelStatusHarvester::trackerTopologyToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: SiPixelStatusHarvester.h:87
SiPixelStatusHarvester::aveDigiOcc_
int aveDigiOcc_
Definition: SiPixelStatusHarvester.h:58
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:113
SiPixelQuality::getBadComponentList
const std::vector< disabledModuleType > getBadComponentList() const
Definition: SiPixelQuality.h:100
SiPixelStatusHarvester::endLumiBlock_
edm::LuminosityBlockNumber_t endLumiBlock_
Definition: SiPixelStatusHarvester.h:75
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiPixelStatusHarvester::equal
bool equal(SiPixelQuality *a, SiPixelQuality *b)
Definition: SiPixelStatusHarvester.cc:615
sipixelobjects::PixelROC
Definition: PixelROC.h:23
SiPixelStatusHarvester::siPixelQualityToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > siPixelQualityToken_
Definition: SiPixelStatusHarvester.h:89
SiPixelStatusManager::createPayloads
void createPayloads()
Definition: SiPixelStatusManager.cc:56
SiPixelStatusHarvester::PROMPTBADROC
Definition: SiPixelStatusHarvester.h:35
SiPixelQuality::disabledModuleType::BadRocs
unsigned short BadRocs
Definition: SiPixelQuality.h:32
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
SiPixelStatusHarvester::pixelO2O_
std::map< int, std::map< int, std::pair< int, int > > > pixelO2O_
Definition: SiPixelStatusHarvester.h:84
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
SiPixelStatusHarvester::siPixelFedCablingMapToken_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapToken_
Definition: SiPixelStatusHarvester.h:88
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:56
DeadROCCounter.nrocs
nrocs
Definition: DeadROCCounter.py:57
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelStatusHarvester::stepIOV
edm::LuminosityBlockNumber_t stepIOV(edm::LuminosityBlockNumber_t pin, std::map< edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t > IOV)
Definition: SiPixelStatusHarvester.cc:591
SiPixelStatusHarvester::nLumi_
int nLumi_
Definition: SiPixelStatusHarvester.h:59
SiPixelStatusHarvester::siPixelStatusManager_
SiPixelStatusManager siPixelStatusManager_
Definition: SiPixelStatusHarvester.h:63
SiPixelDetectorStatus::perRocDigiOcc
double perRocDigiOcc()
Definition: SiPixelDetectorStatus.cc:179
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiPixelModuleStatus::nrocs
int nrocs()
Definition: SiPixelModuleStatus.cc:61
SiPixelStatusHarvester::badPixelInfo_
const SiPixelQuality * badPixelInfo_
Definition: SiPixelStatusHarvester.h:70
SiPixelQuality::IsRocBad
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
Definition: SiPixelQuality.cc:111
AlCaHarvesting_cff.SiPixelQuality
SiPixelQuality
Definition: AlCaHarvesting_cff.py:229
PixelTopology::nrows
virtual int nrows() const =0
edm::RunBase::id
RunID const & id() const
Definition: RunBase.h:39
dttmaxenums::R
Definition: DTTMax.h:29
JetPartonCorrections_cff.tagName
tagName
Definition: JetPartonCorrections_cff.py:12
SiPixelStatusHarvester::substructure
std::string substructure(int detid)
Definition: SiPixelStatusHarvester.cc:699
SiPixelStatusHarvester::countLumi_
int countLumi_
Definition: SiPixelStatusHarvester.h:73
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31
SiPixelStatusHarvester::label_
std::string label_
Definition: SiPixelStatusHarvester.h:61
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443