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 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
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
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 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 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 = 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 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 110 of file SiPixelStatusHarvester.cc.

110 {}

◆ 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 575 of file SiPixelStatusHarvester.cc.

575  {
576  countLumi_++;
577 }

References countLumi_.

◆ bookHistograms()

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

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 101 of file SiPixelStatusHarvester.cc.

103  {
104  for (auto& histoman : histo) {
105  histoman.book(iBooker, iSetup);
106  }
107 }

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 649 of file SiPixelStatusHarvester.cc.

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

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 113 of file SiPixelStatusHarvester.cc.

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

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(), if(), SiPixelCoordinates::init(), createfilelist::int, readEcalDQMStatus::interval, edm::Service< T >::isAvailable(), SiPixelQuality::IsRocBad(), SiPixelCoordinates::layer(), phase1PixelTopology::layer, 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.

◆ endLuminosityBlock()

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

Definition at line 580 of file SiPixelStatusHarvester.cc.

580  {
582  // update endLumiBlock_ by current lumi block
583  if (endLumiBlock_ < iLumi.luminosityBlock())
584  endLumiBlock_ = iLumi.luminosityBlock();
585 }

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

◆ equal()

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

Definition at line 612 of file SiPixelStatusHarvester.cc.

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

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

Referenced by constructTag(), and dqmEndRun().

◆ perLayerRingAverage()

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

Definition at line 671 of file SiPixelStatusHarvester.cc.

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

References coord_, SiPixelDetectorStatus::getDetectorStatus(), SiPixelCoordinates::layer(), phase1PixelTopology::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 588 of file SiPixelStatusHarvester.cc.

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

References first.

Referenced by dqmEndRun().

◆ substructure()

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

Definition at line 696 of file SiPixelStatusHarvester.cc.

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

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

Member Data Documentation

◆ aveDigiOcc_

int SiPixelStatusHarvester::aveDigiOcc_
private

Definition at line 57 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ badPixelInfo_

const SiPixelQuality* SiPixelStatusHarvester::badPixelInfo_
private

Definition at line 69 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ cablingMap_

const SiPixelFedCabling* SiPixelStatusHarvester::cablingMap_ = nullptr
private

Definition at line 77 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ coord_

SiPixelCoordinates SiPixelStatusHarvester::coord_
private

Definition at line 80 of file SiPixelStatusHarvester.h.

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

◆ countLumi_

int SiPixelStatusHarvester::countLumi_ = 0
private

Definition at line 72 of file SiPixelStatusHarvester.h.

Referenced by beginLuminosityBlock(), and SiPixelStatusHarvester().

◆ debug_

bool SiPixelStatusHarvester::debug_
private

Definition at line 64 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ endLumiBlock_

edm::LuminosityBlockNumber_t SiPixelStatusHarvester::endLumiBlock_
private

Definition at line 74 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 59 of file SiPixelStatusHarvester.h.

◆ nLumi_

int SiPixelStatusHarvester::nLumi_
private

Definition at line 58 of file SiPixelStatusHarvester.h.

◆ outputBase_

std::string SiPixelStatusHarvester::outputBase_
private

Definition at line 56 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ pixelO2O_

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

Definition at line 83 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ recordName_

std::string SiPixelStatusHarvester::recordName_
private

Definition at line 66 of file SiPixelStatusHarvester.h.

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

◆ sensorSize_

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

Definition at line 78 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

◆ siPixelFedCablingMapToken_

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

Definition at line 87 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ siPixelQualityToken_

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

Definition at line 88 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ siPixelStatusManager_

SiPixelStatusManager SiPixelStatusHarvester::siPixelStatusManager_
private

Definition at line 62 of file SiPixelStatusHarvester.h.

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

◆ substructures

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

Definition at line 91 of file SiPixelStatusHarvester.h.

◆ thresholdL1_

double SiPixelStatusHarvester::thresholdL1_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL2_

double SiPixelStatusHarvester::thresholdL2_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL3_

double SiPixelStatusHarvester::thresholdL3_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdL4_

double SiPixelStatusHarvester::thresholdL4_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdRNG1_

double SiPixelStatusHarvester::thresholdRNG1_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ thresholdRNG2_

double SiPixelStatusHarvester::thresholdRNG2_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerGeometry_

const TrackerGeometry* SiPixelStatusHarvester::trackerGeometry_ = nullptr
private

Definition at line 76 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerGeometryToken_

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

Definition at line 85 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

◆ trackerTopologyToken_

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

Definition at line 86 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

dttmaxenums::L
Definition: DTTMax.h:29
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelStatusManager::reset
void reset()
Definition: SiPixelStatusManager.cc:46
SiPixelStatusHarvester::trackerGeometryToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: SiPixelStatusHarvester.h:85
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:76
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
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:58
SiPixelStatusHarvester::cablingMap_
const SiPixelFedCabling * cablingMap_
Definition: SiPixelStatusHarvester.h:77
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
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
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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:66
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
SiPixelStatusHarvester::perLayerRingAverage
double perLayerRingAverage(int detid, SiPixelDetectorStatus tmpSiPixelStatus)
Definition: SiPixelStatusHarvester.cc:671
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
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:41
DetId
Definition: DetId.h:17
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
SiPixelStatusHarvester::debug_
bool debug_
Definition: SiPixelStatusHarvester.h:64
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:55
SiPixelStatusHarvester::OTHERBADROC
Definition: SiPixelStatusHarvester.h:35
SiPixelStatusHarvester::thresholdRNG1_
double thresholdRNG1_
Definition: SiPixelStatusHarvester.h:55
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:55
SiPixelStatusHarvester::sensorSize_
std::map< int, unsigned int > sensorSize_
Definition: SiPixelStatusHarvester.h:78
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:80
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
SiPixelStatusHarvester::thresholdL3_
double thresholdL3_
Definition: SiPixelStatusHarvester.h:55
SiPixelFedCabling::det2PathMap
virtual std::map< uint32_t, std::vector< sipixelobjects::CablingPathToDetUnit > > det2PathMap() const =0
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
SiPixelCoordinates::ring
int ring(const DetId &)
Definition: SiPixelCoordinates.cc:232
SiPixelStatusHarvester::outputBase_
std::string outputBase_
Definition: SiPixelStatusHarvester.h:56
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:47
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:649
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
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:55
SiPixelStatusHarvester::thresholdRNG2_
double thresholdRNG2_
Definition: SiPixelStatusHarvester.h:55
cuy.ib
ib
Definition: cuy.py:661
SiPixelStatusHarvester::moduleName_
std::string moduleName_
Definition: SiPixelStatusHarvester.h:59
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:58
PixelTopology::rowsperroc
virtual int rowsperroc() const =0
SiPixelStatusHarvester::trackerTopologyToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: SiPixelStatusHarvester.h:86
SiPixelStatusHarvester::aveDigiOcc_
int aveDigiOcc_
Definition: SiPixelStatusHarvester.h:57
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:15
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
SiPixelQuality::getBadComponentList
const std::vector< disabledModuleType > getBadComponentList() const
Definition: SiPixelQuality.h:100
SiPixelStatusHarvester::endLumiBlock_
edm::LuminosityBlockNumber_t endLumiBlock_
Definition: SiPixelStatusHarvester.h:74
SiPixelStatusHarvester::equal
bool equal(SiPixelQuality *a, SiPixelQuality *b)
Definition: SiPixelStatusHarvester.cc:612
sipixelobjects::PixelROC
Definition: PixelROC.h:23
SiPixelStatusHarvester::siPixelQualityToken_
edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > siPixelQualityToken_
Definition: SiPixelStatusHarvester.h:88
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:83
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
SiPixelStatusHarvester::siPixelFedCablingMapToken_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapToken_
Definition: SiPixelStatusHarvester.h:87
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
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:588
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelStatusHarvester::nLumi_
int nLumi_
Definition: SiPixelStatusHarvester.h:58
SiPixelStatusHarvester::siPixelStatusManager_
SiPixelStatusManager siPixelStatusManager_
Definition: SiPixelStatusHarvester.h:62
SiPixelDetectorStatus::perRocDigiOcc
double perRocDigiOcc()
Definition: SiPixelDetectorStatus.cc:174
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:40
SiPixelStatusHarvester::badPixelInfo_
const SiPixelQuality * badPixelInfo_
Definition: SiPixelStatusHarvester.h:69
SiPixelQuality::IsRocBad
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
Definition: SiPixelQuality.cc:107
AlCaHarvesting_cff.SiPixelQuality
SiPixelQuality
Definition: AlCaHarvesting_cff.py:239
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:696
SiPixelStatusHarvester::countLumi_
int countLumi_
Definition: SiPixelStatusHarvester.h:72
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31
SiPixelStatusHarvester::label_
std::string label_
Definition: SiPixelStatusHarvester.h:60
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443