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 &iSetup) final
 
void beginJob () override
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) final
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &iSetup) 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) final
 
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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private 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)
 

Private Attributes

int aveDigiOcc_
 
const SiPixelQualitybadPixelInfo_
 
const SiPixelFedCablingcablingMap_ = 0
 
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_
 
SiPixelStatusManager siPixelStatusManager_
 
std::vector< std::string > substructures
 
double thresholdL1_
 
double thresholdL2_
 
double thresholdL3_
 
double thresholdL4_
 
double thresholdRNG1_
 
double thresholdRNG2_
 
const TrackerGeometrytrackerGeometry_ = 0
 
- 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 analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

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

Definition at line 23 of file SiPixelStatusHarvester.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 59 of file SiPixelStatusHarvester.cc.

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

60  : HistogramManagerHolder(iConfig),
61  thresholdL1_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
62  .getUntrackedParameter<double>("thresholdL1")),
63  thresholdL2_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
64  .getUntrackedParameter<double>("thresholdL2")),
65  thresholdL3_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
66  .getUntrackedParameter<double>("thresholdL3")),
67  thresholdL4_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
68  .getUntrackedParameter<double>("thresholdL4")),
69  thresholdRNG1_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
70  .getUntrackedParameter<double>("thresholdRNG1")),
71  thresholdRNG2_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
72  .getUntrackedParameter<double>("thresholdRNG2")),
73  outputBase_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
74  .getUntrackedParameter<std::string>("outputBase")),
76  iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters").getUntrackedParameter<int>("aveDigiOcc")),
77  nLumi_(iConfig.getParameter<edm::ParameterSet>("SiPixelStatusManagerParameters")
78  .getUntrackedParameter<int>("resetEveryNLumi")),
79  moduleName_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
80  .getUntrackedParameter<std::string>("moduleName")),
81  label_(iConfig.getParameter<ParameterSet>("SiPixelStatusManagerParameters")
83  SiPixelStatusManager* siPixelStatusManager = new SiPixelStatusManager(iConfig, consumesCollector());
84  siPixelStatusManager_ = *siPixelStatusManager;
85  debug_ = iConfig.getUntrackedParameter<bool>("debug");
86  recordName_ = iConfig.getUntrackedParameter<std::string>("recordName", "SiPixelQualityFromDbRcd");
87 
88  sensorSize_.clear();
89  pixelO2O_.clear();
90 
92  endLumiBlock_ = 0;
93  countLumi_ = 0;
94 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, unsigned int > sensorSize_
edm::LuminosityBlockNumber_t endLumiBlock_
SiPixelStatusManager siPixelStatusManager_
std::map< int, std::map< int, std::pair< int, int > > > pixelO2O_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
HistogramManagerHolder(const edm::ParameterSet &iConfig)
SiPixelStatusHarvester::~SiPixelStatusHarvester ( )
override

Definition at line 97 of file SiPixelStatusHarvester.cc.

97 {}

Member Function Documentation

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

Definition at line 115 of file SiPixelStatusHarvester.cc.

115 {}
void SiPixelStatusHarvester::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 100 of file SiPixelStatusHarvester.cc.

100 {}
void SiPixelStatusHarvester::beginLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iEventSetup 
)
final

Definition at line 585 of file SiPixelStatusHarvester.cc.

References countLumi_.

586  {
587  countLumi_++;
588 }
void SiPixelStatusHarvester::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
finalvirtual

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

Definition at line 106 of file SiPixelStatusHarvester.cc.

References HistogramManagerHolder::histo.

108  {
109  for (auto& histoman : histo) {
110  histoman.book(iBooker, iSetup);
111  }
112 }
std::vector< HistogramManager > histo
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 660 of file SiPixelStatusHarvester.cc.

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

Referenced by dqmEndRun().

663  {
664  for (std::map<int, SiPixelQuality*>::iterator qIt = siPixelQualityTag.begin(); qIt != siPixelQualityTag.end();
665  ++qIt) {
666  edm::LuminosityBlockID lu(iRun.id().run(), qIt->first);
667  cond::Time_t thisIOV = (cond::Time_t)(lu.value());
668 
669  SiPixelQuality* thisPayload = qIt->second;
670  if (qIt == siPixelQualityTag.begin())
671  poolDbService->writeOne<SiPixelQuality>(thisPayload, thisIOV, recordName_ + "_" + tagName);
672  else {
673  SiPixelQuality* prevPayload = (std::prev(qIt))->second;
674  if (!SiPixelStatusHarvester::equal(thisPayload,
675  prevPayload)) // only append newIOV if this payload differs wrt last
676  poolDbService->writeOne<SiPixelQuality>(thisPayload, thisIOV, recordName_ + "_" + tagName);
677  }
678  }
679 }
bool equal(SiPixelQuality *a, SiPixelQuality *b)
U second(std::pair< T, U > const &p)
unsigned long long Time_t
Definition: Time.h:14
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void SiPixelStatusHarvester::dqmEndRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
final

Definition at line 118 of file SiPixelStatusHarvester.cc.

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(), edm::EventSetup::get(), SiPixelQuality::getBadComponentList(), SiPixelStatusManager::getBadComponents(), SiPixelDetectorStatus::getDetectorStatus(), SiPixelStatusManager::getFEDerror25Rocs(), HistogramManagerHolder::histo, mps_fire::i, edm::RunBase::id(), sipixelobjects::PixelROC::idInDetUnit(), 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_, edm::ESHandle< T >::product(), PROMPTBADROC, DetId::rawId(), recordName_, SiPixelCoordinates::ring(), relativeConstraints::ring, PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, PixelTopology::rowsperroc(), edm::RunID::run(), edm::second(), sensorSize_, AlCaHarvesting_cff::SiPixelQuality, siPixelStatusManager_, PixelGeomDetUnit::specificTopology(), stepIOV(), STUCKTBMROC, thresholdL1_, thresholdL2_, thresholdL3_, thresholdL4_, thresholdRNG1_, thresholdRNG2_, sipixelobjects::PixelROC::toGlobal(), trackerGeometry_, cond::service::PoolDBOutputService::writeOne(), and testProducerWithPsetDescEmpty_cfi::x1.

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

Reimplemented from edm::one::EDProducerBase.

Definition at line 103 of file SiPixelStatusHarvester.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

103 {}
void SiPixelStatusHarvester::endLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup iEventSetup 
)
final

Definition at line 591 of file SiPixelStatusHarvester.cc.

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

591  {
593  // update endLumiBlock_ by current lumi block
594  if (endLumiBlock_ < iLumi.luminosityBlock())
595  endLumiBlock_ = iLumi.luminosityBlock();
596 }
edm::LuminosityBlockNumber_t endLumiBlock_
SiPixelStatusManager siPixelStatusManager_
LuminosityBlockNumber_t luminosityBlock() const
void readLumi(const edm::LuminosityBlock &)
bool SiPixelStatusHarvester::equal ( SiPixelQuality a,
SiPixelQuality b 
)
private

Definition at line 623 of file SiPixelStatusHarvester.cc.

References SiPixelQuality::getBadComponentList(), mps_fire::i, cuy::ib, and findQualityFiles::size.

Referenced by constructTag(), and dqmEndRun().

623  {
624  std::vector<SiPixelQuality::disabledModuleType> badRocListA;
625  std::vector<SiPixelQuality::disabledModuleType> badRocListB;
626 
627  for (unsigned int ia = 0; ia < (a->getBadComponentList()).size(); ia++) {
628  badRocListA.push_back((a->getBadComponentList())[ia]);
629  }
630  for (unsigned int ib = 0; ib < (b->getBadComponentList()).size(); ib++) {
631  badRocListB.push_back((b->getBadComponentList())[ib]);
632  }
633 
634  if (badRocListA.size() != badRocListB.size())
635  return false;
636 
637  // ordering ROCs by DetId
638  std::sort(badRocListA.begin(), badRocListA.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
639  std::sort(badRocListB.begin(), badRocListB.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
640 
641  for (unsigned int i = 0; i < badRocListA.size(); i++) {
642  uint32_t detIdA = badRocListA[i].DetID;
643  uint32_t detIdB = badRocListB[i].DetID;
644  if (detIdA != detIdB)
645  return false;
646  else {
647  unsigned short BadRocsA = badRocListA[i].BadRocs;
648  unsigned short BadRocsB = badRocListB[i].BadRocs;
649  if (BadRocsA != BadRocsB)
650  return false;
651  }
652  }
653 
654  //if the module list is the same, and for each module, roc list is the same
655  //the two SiPixelQualitys are equal
656  return true;
657 }
size
Write out results.
const std::vector< disabledModuleType > getBadComponentList() const
ib
Definition: cuy.py:662
double SiPixelStatusHarvester::perLayerRingAverage ( int  detid,
SiPixelDetectorStatus  tmpSiPixelStatus 
)
private

Definition at line 682 of file SiPixelStatusHarvester.cc.

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

Referenced by dqmEndRun().

682  {
683  unsigned long int ave(0);
684  int nrocs(0);
685 
686  int layer = coord_.layer(DetId(detid));
687  int ring = coord_.ring(DetId(detid));
688 
689  std::map<int, SiPixelModuleStatus> detectorStatus = tmpSiPixelStatus.getDetectorStatus();
690  std::map<int, SiPixelModuleStatus>::iterator itModEnd = detectorStatus.end();
691  for (std::map<int, SiPixelModuleStatus>::iterator itMod = detectorStatus.begin(); itMod != itModEnd; ++itMod) {
692  if (layer != coord_.layer(DetId(itMod->first)))
693  continue;
694  if (ring != coord_.ring(DetId(itMod->first)))
695  continue;
696  unsigned long int inc = itMod->second.digiOccMOD();
697  ave += inc;
698  nrocs += itMod->second.nrocs();
699  }
700 
701  if (nrocs > 0)
702  return ave * 1.0 / nrocs;
703  else
704  return 0.0;
705 }
int ring(const DetId &)
int layer(const DetId &)
std::map< int, SiPixelModuleStatus > getDetectorStatus()
Definition: DetId.h:17
edm::LuminosityBlockNumber_t SiPixelStatusHarvester::stepIOV ( edm::LuminosityBlockNumber_t  pin,
std::map< edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t IOV 
)
private

Definition at line 599 of file SiPixelStatusHarvester.cc.

References dqmdumpme::first.

Referenced by dqmEndRun().

600  {
601  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator itIOV;
602  for (itIOV = IOV.begin(); itIOV != IOV.end(); itIOV++) {
603  std::map<edm::LuminosityBlockNumber_t, edm::LuminosityBlockNumber_t>::iterator nextItIOV;
604  nextItIOV = itIOV;
605  nextItIOV++;
606 
607  if (nextItIOV != IOV.end()) {
608  if (pin >= itIOV->first && pin < nextItIOV->first) {
609  return itIOV->first;
610  }
611  } else {
612  if (pin >= itIOV->first) {
613  return itIOV->first;
614  }
615  }
616  }
617 
618  // return the firstIOV in case all above fail
619  return (IOV.begin())->first;
620 }
std::string SiPixelStatusHarvester::substructure ( int  detid)
private

Definition at line 707 of file SiPixelStatusHarvester.cc.

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

707  {
709  int layer = coord_.layer(DetId(detid));
710 
711  if (layer > 0) {
712  std::string L = std::to_string(layer);
713  substructure = "BpixLYR";
714  substructure += L;
715  } else {
716  substructure = "FpixRNG";
717  int ring = coord_.ring(DetId(detid));
718  std::string R = std::to_string(ring);
719  substructure += R;
720  }
721 
722  return substructure;
723 }
int ring(const DetId &)
int layer(const DetId &)
std::string substructure(int detid)
Definition: DetId.h:17

Member Data Documentation

int SiPixelStatusHarvester::aveDigiOcc_
private

Definition at line 48 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

const SiPixelQuality* SiPixelStatusHarvester::badPixelInfo_
private

Definition at line 60 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

const SiPixelFedCabling* SiPixelStatusHarvester::cablingMap_ = 0
private

Definition at line 68 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

SiPixelCoordinates SiPixelStatusHarvester::coord_
private

Definition at line 71 of file SiPixelStatusHarvester.h.

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

int SiPixelStatusHarvester::countLumi_ = 0
private

Definition at line 63 of file SiPixelStatusHarvester.h.

Referenced by beginLuminosityBlock(), and SiPixelStatusHarvester().

bool SiPixelStatusHarvester::debug_
private

Definition at line 55 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

edm::LuminosityBlockNumber_t SiPixelStatusHarvester::endLumiBlock_
private

Definition at line 65 of file SiPixelStatusHarvester.h.

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

std::string SiPixelStatusHarvester::label_
private
std::string SiPixelStatusHarvester::moduleName_
private

Definition at line 50 of file SiPixelStatusHarvester.h.

int SiPixelStatusHarvester::nLumi_
private

Definition at line 49 of file SiPixelStatusHarvester.h.

std::string SiPixelStatusHarvester::outputBase_
private

Definition at line 47 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

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

Definition at line 74 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

std::string SiPixelStatusHarvester::recordName_
private

Definition at line 57 of file SiPixelStatusHarvester.h.

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

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

Definition at line 69 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun(), and SiPixelStatusHarvester().

SiPixelStatusManager SiPixelStatusHarvester::siPixelStatusManager_
private

Definition at line 53 of file SiPixelStatusHarvester.h.

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

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

Definition at line 77 of file SiPixelStatusHarvester.h.

double SiPixelStatusHarvester::thresholdL1_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

double SiPixelStatusHarvester::thresholdL2_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

double SiPixelStatusHarvester::thresholdL3_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

double SiPixelStatusHarvester::thresholdL4_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

double SiPixelStatusHarvester::thresholdRNG1_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

double SiPixelStatusHarvester::thresholdRNG2_
private

Definition at line 46 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().

const TrackerGeometry* SiPixelStatusHarvester::trackerGeometry_ = 0
private

Definition at line 67 of file SiPixelStatusHarvester.h.

Referenced by dqmEndRun().