CMS 3D CMS Logo

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

#include <SiStripThresholdDQM.h>

Inheritance diagram for SiStripThresholdDQM:
SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd > SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_) override
 
void fillMEsForLayer (uint32_t selDetId_) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
 SiStripThresholdDQM (edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
 
 ~SiStripThresholdDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >
bool checkChanged (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripBaseCondObjDQMGet (tokentype token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
 ~SiStripBaseCondObjDQMGet () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQM
void analysis (const edm::EventSetup &eSetup_)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, const std::vector< uint32_t > &detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
virtual void end ()
 
void selectModules (std::vector< uint32_t > &detIds_)
 
 SiStripBaseCondObjDQM (edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Attributes

std::string WhichThreshold
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >
using tokentype = typename edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd >
 
- Public Types inherited from SiStripBaseCondObjDQM
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from SiStripBaseCondObjDQM
void fillTkMap (const uint32_t &detid, const float &value)
 
std::pair< std::string, uint32_t > getLayerNameAndId (const uint32_t &detId_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
- Protected Attributes inherited from SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >
const SiStripThresholdcondObj_
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
SiStripDetInfo detInfo_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
std::map< uint32_t, ModMEsSummaryMEsMap_
 
bool SummaryOnLayerLevel_On_
 
bool SummaryOnStringLevel_On_
 
std::unique_ptr< TkHistoMapTk_HM_
 
std::unique_ptr< TkHistoMapTk_HM_H
 
std::unique_ptr< TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 9 of file SiStripThresholdDQM.h.

Constructor & Destructor Documentation

◆ SiStripThresholdDQM()

SiStripThresholdDQM::SiStripThresholdDQM ( edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd token,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet,
const TrackerTopology tTopo,
const TkDetMap tkDetMap 
)

Definition at line 3 of file SiStripThresholdDQM.cc.

References unpackBuffers-CaloStage2::token.

10  WhichThreshold = hPSet.getParameter<std::string>("WhichThreshold");
11 
12  if (HistoMaps_On_) {
13  if (WhichThreshold == "Low")
14  Tk_HM_L = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "LowThresh_TkMap", 0.);
15  if (WhichThreshold == "High")
16  Tk_HM_H = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "HighThresh_TkMap", 0.);
17  }
18 }
std::unique_ptr< TkHistoMap > Tk_HM_L
std::unique_ptr< TkHistoMap > Tk_HM_H

◆ ~SiStripThresholdDQM()

SiStripThresholdDQM::~SiStripThresholdDQM ( )
override

Definition at line 20 of file SiStripThresholdDQM.cc.

20 {}

Member Function Documentation

◆ fillMEsForDet()

void SiStripThresholdDQM::fillMEsForDet ( const ModMEs selModME_,
uint32_t  selDetId_ 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripThresholdDQM.cc.

References SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripThreshold::getData(), SiStripThreshold::getDetIds(), SiStripThreshold::Data::getHth(), SiStripThreshold::Data::getLth(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripThreshold::getRange(), SiStripBaseCondObjDQM::ModMEs::ProfileDistr, and WhichThreshold.

Referenced by fillModMEs().

34  {
35  ModMEs selModME_ = _selModME_;
36  std::vector<uint32_t> DetIds;
37  condObj_->getDetIds(DetIds);
38 
39  const auto ThresholdRange = condObj_->getRange(selDetId_);
40  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
41 
42  getModMEs(selModME_, selDetId_);
43 
44  for (int istrip = 0; istrip < nStrip; ++istrip) {
45  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
46  if (WhichThreshold == "Low")
47  selModME_.ProfileDistr->Fill(istrip + 1, condObj_->getData(istrip, ThresholdRange).getLth());
48  if (WhichThreshold == "High")
49  selModME_.ProfileDistr->Fill(istrip + 1, condObj_->getData(istrip, ThresholdRange).getHth());
50  }
51  } // istrip
52 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
const Range getRange(const uint32_t &detID) const
void getDetIds(std::vector< uint32_t > &DetIds_) const

◆ fillMEsForLayer()

void SiStripThresholdDQM::fillMEsForLayer ( uint32_t  selDetId_)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 60 of file SiStripThresholdDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripThreshold::getData(), SiStripThreshold::Data::getHth(), SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripThreshold::Data::getLth(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripThreshold::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_H, SiStripBaseCondObjDQM::Tk_HM_L, and WhichThreshold.

Referenced by fillSummaryMEs().

61  {
62  // ----
63  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
64 
65  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
66  edm::LogError("SiStripThresholdDQM") << "[SiStripThresholdDQM::fillMEsForLayer] WRONG INPUT : no such "
67  "subdetector type : "
68  << subdetectorId_ << " no folder set!" << std::endl;
69  return;
70  }
71  // ----
72 
73  const auto selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
74  ModMEs selME_;
75  if (selMEsMapIter_ != SummaryMEsMap_.end())
76  selME_ = selMEsMapIter_->second;
77 
78  getSummaryMEs(selME_, selDetId_);
79 
80  const auto ThresholdRange = condObj_->getRange(selDetId_);
81 
82  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
83 
85 
86  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
87  // --> profile summary
88 
89  std::string hSummaryOfProfile_description;
90  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
91 
92  std::string hSummaryOfProfile_name;
93 
94  hSummaryOfProfile_name =
95  hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "");
96 
97  for (int istrip = 0; istrip < nStrip; ++istrip) {
98  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
99  if (WhichThreshold == "Low") {
100  selME_.SummaryOfProfileDistr->Fill(istrip + 1, condObj_->getData(istrip, ThresholdRange).getLth());
101  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On"))
102  fillTkMap(selDetId_, condObj_->getData(istrip, ThresholdRange).getLth());
103  }
104  if (WhichThreshold == "High") {
105  selME_.SummaryOfProfileDistr->Fill(istrip + 1, condObj_->getData(istrip, ThresholdRange).getHth());
106  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On"))
107  fillTkMap(selDetId_, condObj_->getData(istrip, ThresholdRange).getHth());
108  }
109  }
110  } // istrip
111 
112  } // if Fill
113 
114  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
115  // --> summary
116 
117  std::string hSummary_description;
118  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
119 
120  std::string hSummary_name;
121  hSummary_name = hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_).first, "");
122 
123  float meanLowThreshold = 0;
124  float meanHighThreshold = 0;
125 
126  for (int istrip = 0; istrip < nStrip; ++istrip) {
127  meanLowThreshold = meanLowThreshold + condObj_->getData(istrip, ThresholdRange).getLth();
128  meanHighThreshold = meanHighThreshold + condObj_->getData(istrip, ThresholdRange).getHth();
129  } // istrip
130 
131  meanLowThreshold = meanLowThreshold / nStrip;
132  meanHighThreshold = meanHighThreshold / nStrip;
133 
134  // -----
135  // get detIds belonging to same layer to fill X-axis with detId-number
136 
137  std::vector<uint32_t> sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_);
138 
139  unsigned int iBin = 0;
140  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
141  if (sameLayerDetIds_[i] == selDetId_) {
142  iBin = i + 1;
143  }
144  }
145 
146  if (WhichThreshold == "Low") {
147  selME_.SummaryDistr->Fill(iBin, meanLowThreshold);
148  if (HistoMaps_On_)
149  Tk_HM_L->fill(selDetId_, meanLowThreshold);
150  }
151  if (WhichThreshold == "High") {
152  selME_.SummaryDistr->Fill(iBin, meanHighThreshold);
153  if (HistoMaps_On_)
154  Tk_HM_H->fill(selDetId_, meanHighThreshold);
155  }
156 
157  } // if Fill ...
158 }
std::unique_ptr< TkHistoMap > Tk_HM_L
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
std::unique_ptr< TkHistoMap > Tk_HM_H
Log< level::Error, false > LogError
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
std::map< uint32_t, ModMEs > SummaryMEsMap_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
const Range getRange(const uint32_t &detID) const
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
std::vector< uint32_t > activeDetIds
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)

◆ fillModMEs()

void SiStripThresholdDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 27 of file SiStripThresholdDQM.cc.

References fillMEsForDet().

27  {
28  ModMEs CondObj_ME;
29  for (const auto det : selectedDetIds) {
30  fillMEsForDet(CondObj_ME, det);
31  }
32 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) override

◆ fillSummaryMEs()

void SiStripThresholdDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 54 of file SiStripThresholdDQM.cc.

References fillMEsForLayer().

54  {
55  for (const auto det : selectedDetIds) {
56  fillMEsForLayer(/*SummaryMEsMap_,*/ det);
57  }
58 }
void fillMEsForLayer(uint32_t selDetId_) override

◆ getActiveDetIds()

void SiStripThresholdDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Member Data Documentation

◆ WhichThreshold

std::string SiStripThresholdDQM::WhichThreshold
private

Definition at line 30 of file SiStripThresholdDQM.h.

Referenced by fillMEsForDet(), and fillMEsForLayer().