CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
SiStripHitEffData Struct Reference

#include <SiStripHitEffData.h>

Public Member Functions

const bool checkFedError (const DetId det)
 
void fillMapFromTkMap (const int nevents, const float threshold, const std::vector< DetId > &stripDetIds)
 
void fillTkMapFromMap ()
 
 SiStripHitEffData ()
 

Public Attributes

dqm::reco::MonitorElementEventStats
 
std::unordered_map< uint32_t, int > fedErrorCounts
 
std::unique_ptr< TkHistoMapFEDErrorOccupancy
 

Private Attributes

bool m_isLoaded
 

Detailed Description

Definition at line 9 of file SiStripHitEffData.h.

Constructor & Destructor Documentation

◆ SiStripHitEffData()

SiStripHitEffData::SiStripHitEffData ( )
inline

Definition at line 11 of file SiStripHitEffData.h.

11 : EventStats(), FEDErrorOccupancy(nullptr), m_isLoaded(false) {}
std::unique_ptr< TkHistoMap > FEDErrorOccupancy
dqm::reco::MonitorElement * EventStats

Member Function Documentation

◆ checkFedError()

const bool SiStripHitEffData::checkFedError ( const DetId  det)
inline

Definition at line 54 of file SiStripHitEffData.h.

References Exception, fedErrorCounts, and m_isLoaded.

Referenced by SiStripHitEfficiencyHarvester::dqmEndJob().

54  {
55  if (m_isLoaded) {
56  return (fedErrorCounts.find(det) == fedErrorCounts.end());
57  } else {
58  throw cms::Exception("LogicError") << __PRETTY_FUNCTION__ << "cannot check DetId when map not filled";
59  }
60  }
std::unordered_map< uint32_t, int > fedErrorCounts

◆ fillMapFromTkMap()

void SiStripHitEffData::fillMapFromTkMap ( const int  nevents,
const float  threshold,
const std::vector< DetId > &  stripDetIds 
)
inline

Definition at line 19 of file SiStripHitEffData.h.

References submitPVResolutionJobs::count, dqmiodumpmetadata::counts, fedErrorCounts, FEDErrorOccupancy, HLT_2024v13_cff::fraction, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogTrace, m_isLoaded, cosmicMuonLinks_cfi::Maps, createIOVlist::nevents, DiMuonV_cfg::threshold, HcalDetIdTransform::transform(), and x.

Referenced by SiStripHitEfficiencyHarvester::dqmEndJob().

19  {
20  const auto& Maps = FEDErrorOccupancy->getAllMaps();
21  std::vector<bool> isThere;
22  isThere.reserve(Maps.size());
23  std::transform(Maps.begin() + 1, Maps.end(), std::back_inserter(isThere), [](auto& x) { return !(x == nullptr); });
24 
25  int count{0};
26  for (const auto& it : isThere) {
27  count++;
28  LogTrace("SiStripHitEffData") << " layer: " << count << " " << it << std::endl;
29  if (it)
30  LogTrace("SiStripHitEffData") << "resolving to " << Maps[count]->getName()
31  << " with entries: " << Maps[count]->getEntries() << std::endl;
32  // color the map
33  Maps[count]->setOption("colz");
34  }
35 
36  for (const auto& det : stripDetIds) {
37  const auto& counts = FEDErrorOccupancy->getValue(det);
38 
39  if (counts > 0) {
40  float fraction = counts / nevents;
41 
42  LogTrace("SiStripHitEffData") << det.rawId() << " has " << counts << " counts, " << fraction * 100
43  << "% fraction of the " << nevents << " events processed" << std::endl;
44 
45  if (fraction > threshold) {
46  fedErrorCounts.insert(std::make_pair(det, 1));
47  }
48  } // do not check functioning modules
49  }
50  // the map has been loaded
51  m_isLoaded = true;
52  }
std::unordered_map< uint32_t, int > fedErrorCounts
std::unique_ptr< TkHistoMap > FEDErrorOccupancy
#define LogTrace(id)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ fillTkMapFromMap()

void SiStripHitEffData::fillTkMapFromMap ( )
inline

Definition at line 13 of file SiStripHitEffData.h.

References submitPVResolutionJobs::count, fedErrorCounts, and FEDErrorOccupancy.

13  {
14  for (const auto& [id, count] : fedErrorCounts) {
15  FEDErrorOccupancy->fill(id, count);
16  }
17  }
std::unordered_map< uint32_t, int > fedErrorCounts
std::unique_ptr< TkHistoMap > FEDErrorOccupancy

Member Data Documentation

◆ EventStats

dqm::reco::MonitorElement* SiStripHitEffData::EventStats

◆ fedErrorCounts

std::unordered_map<uint32_t, int> SiStripHitEffData::fedErrorCounts

◆ FEDErrorOccupancy

std::unique_ptr<TkHistoMap> SiStripHitEffData::FEDErrorOccupancy

◆ m_isLoaded

bool SiStripHitEffData::m_isLoaded
private

Definition at line 67 of file SiStripHitEffData.h.

Referenced by checkFedError(), and fillMapFromTkMap().