CMS 3D CMS Logo

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

#include <SiStripNoisesDQM.h>

Inheritance diagram for SiStripNoisesDQM:
SiStripBaseCondObjDQMGet< SiStripNoises, SiStripNoisesRcd > SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_) override
 
void fillMEsForLayer (uint32_t selDetId_) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
 SiStripNoisesDQM (edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap, const SiStripApvGain *gainHandle)
 
 ~SiStripNoisesDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripNoises, SiStripNoisesRcd >
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

const SiStripApvGaingainHandle_ = nullptr
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripNoises, SiStripNoisesRcd >
using tokentype = typename edm::ESGetToken< SiStripNoises, SiStripNoisesRcd >
 
- Public Types inherited from SiStripBaseCondObjDQM
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from SiStripBaseCondObjDQM
virtual void fillModMEs (const std::vector< uint32_t > &selectedDetIds)
 
virtual void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds)
 
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< SiStripNoises, SiStripNoisesRcd >
const SiStripNoisescondObj_
 
- 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 10 of file SiStripNoisesDQM.h.

Constructor & Destructor Documentation

◆ SiStripNoisesDQM()

SiStripNoisesDQM::SiStripNoisesDQM ( edm::ESGetToken< SiStripNoises, SiStripNoisesRcd noiseToken,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet,
const TrackerTopology tTopo,
const TkDetMap tkDetMap,
const SiStripApvGain gainHandle 
)

Definition at line 3 of file SiStripNoisesDQM.cc.

10  : SiStripBaseCondObjDQMGet<SiStripNoises, SiStripNoisesRcd>{noiseToken, iRun, hPSet, fPSet, tTopo},
11  gainHandle_{gainHandle} {
12  // Build the Histo_TkMap:
13  if (HistoMaps_On_) {
14  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "MeanNoise_TkMap", 0.);
15  }
16 }
const SiStripApvGain * gainHandle_
std::unique_ptr< TkHistoMap > Tk_HM_

◆ ~SiStripNoisesDQM()

SiStripNoisesDQM::~SiStripNoisesDQM ( )
override

Definition at line 18 of file SiStripNoisesDQM.cc.

18 {}

Member Function Documentation

◆ fillMEsForDet()

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

Implements SiStripBaseCondObjDQM.

Definition at line 25 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQMGet< SiStripNoises, SiStripNoisesRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), gainHandle_, SiStripNoises::getDetIds(), SiStripBaseCondObjDQM::getModMEs(), SiStripNoises::getNoise(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripNoises::getRange(), SiStripApvGain::getRange(), SiStripApvGain::getStripGain(), and SiStripBaseCondObjDQM::ModMEs::ProfileDistr.

25  {
26  ModMEs selModME_ = _selModME_;
27  std::vector<uint32_t> DetIds;
28  condObj_->getDetIds(DetIds);
29 
30  const auto noiseRange = condObj_->getRange(selDetId_);
31 
32  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
33 
34  getModMEs(selModME_, selDetId_);
35 
36  float gainFactor;
37  float stripnoise;
38 
39  SiStripApvGain::Range gainRange;
40  if (gainHandle_) {
41  gainRange = gainHandle_->getRange(selDetId_);
42  }
43 
44  for (int istrip = 0; istrip < nStrip; ++istrip) {
45  if (gainHandle_)
46  gainFactor = gainHandle_->getStripGain(istrip, gainRange) ? gainHandle_->getStripGain(istrip, gainRange) : 1.;
47  else
48  gainFactor = 1;
49 
50  stripnoise = condObj_->getNoise(istrip, noiseRange) / gainFactor;
51  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
52  selModME_.ProfileDistr->Fill(istrip + 1, stripnoise);
53  }
54  if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") {
55  selModME_.CumulDistr->Fill(stripnoise);
56  }
57  } // istrip
58 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
const SiStripApvGain * gainHandle_
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
std::pair< ContainerIterator, ContainerIterator > Range
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
const Range getRange(const uint32_t detID) const
const Range getRange(const uint32_t detID) const
static float getStripGain(uint16_t strip, const Range &range)
void getDetIds(std::vector< uint32_t > &DetIds_) const

◆ fillMEsForLayer()

void SiStripNoisesDQM::fillMEsForLayer ( uint32_t  selDetId_)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 68 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQMGet< SiStripNoises, SiStripNoisesRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripNoises::getNoise(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripNoises::getRange(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getStringNameAndId(), SiStripApvGain::getStripGain(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, createfilelist::int, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_, and SiStripBaseCondObjDQM::tkMapScaler.

69  {
70  // ----
71  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
72 
73  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
74  edm::LogError("SiStripNoisesDQM") << "[SiStripNoisesDQM::fillMEsForLayer] WRONG INPUT : no such "
75  "subdetector type : "
76  << subdetectorId_ << " no folder set!" << std::endl;
77  return;
78  }
79  // ----
80 
81  const auto selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
82  ModMEs selME_;
83  if (selMEsMapIter_ != SummaryMEsMap_.end())
84  selME_ = selMEsMapIter_->second;
85  getSummaryMEs(selME_, selDetId_);
86 
87  const auto noiseRange = condObj_->getRange(selDetId_);
88  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
89 
90  float stripnoise = -1.;
91  float meanNoise = 0;
92  int Nbadstrips = 0;
93 
94  SiStripApvGain::Range gainRange;
95  if (gainHandle_) {
96  gainRange = gainHandle_->getRange(selDetId_);
97  }
98  float gainFactor = 1;
99 
101 
102  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
103  // --> profile summary
104  std::string hSummaryOfProfile_description;
105  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
106 
107  std::string hSummaryOfProfile_name;
108  hSummaryOfProfile_name =
109  hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "");
110  }
111  if (hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")) {
112  std::string hSummaryOfCumul_description;
113  hSummaryOfCumul_description = hPSet_.getParameter<std::string>("Cumul_description");
114 
115  std::string hSummaryOfCumul_name;
116  hSummaryOfCumul_name =
117  hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_).first, "");
118  }
119  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
120  // --> cumul summary
121  std::string hSummary_description;
122  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
123 
124  std::string hSummary_name;
125  hSummary_name = hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_).first, "");
126  }
127 
128  for (int istrip = 0; istrip < nStrip; ++istrip) {
129  if (gainHandle_) {
130  gainFactor = gainHandle_->getStripGain(istrip, gainRange) ? gainHandle_->getStripGain(istrip, gainRange) : 1.;
131  } else {
132  gainFactor = 1.;
133  }
134 
135  stripnoise = condObj_->getNoise(istrip, noiseRange) / gainFactor;
136  meanNoise += stripnoise;
137  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
138  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
139  selME_.SummaryOfProfileDistr->Fill(istrip + 1, stripnoise);
140  }
141  }
142 
143  if (hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")) {
144  if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") {
145  selME_.SummaryOfCumulDistr->Fill(stripnoise);
146  }
147  }
148 
149  // Fill the TkMap
150  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
151  fillTkMap(selDetId_, stripnoise);
152  }
153 
154  } // istrip
155 
156  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
157  meanNoise = meanNoise / (nStrip - Nbadstrips);
158  // get detIds belonging to same layer to fill X-axis with detId-number
159 
160  std::vector<uint32_t> sameLayerDetIds_;
161  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_);
162 
163  std::vector<uint32_t>::const_iterator ibound =
164  lower_bound(sameLayerDetIds_.begin(), sameLayerDetIds_.end(), selDetId_);
165  if (ibound != sameLayerDetIds_.end() && *ibound == selDetId_)
166  selME_.SummaryDistr->Fill(ibound - sameLayerDetIds_.begin() + 1, meanNoise);
167 
168  // Fill the Histo_TkMap with the mean Noise:
169  if (HistoMaps_On_) {
170  Tk_HM_->fill(selDetId_, meanNoise);
171  }
172 
173  // Check the axis range for tkmap, and in case redefine;
174  int intNoise = int(meanNoise);
175  if (intNoise + 1 > (int)tkMapScaler.size()) {
176  tkMapScaler.resize(intNoise + 1, 0);
177  }
178  tkMapScaler[intNoise]++;
179  }
180 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const SiStripApvGain * gainHandle_
std::vector< int > tkMapScaler
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_
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
const Range getRange(const 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)
static float getStripGain(uint16_t strip, const Range &range)
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_)
std::unique_ptr< TkHistoMap > Tk_HM_

◆ getActiveDetIds()

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

Member Data Documentation

◆ gainHandle_

const SiStripApvGain* SiStripNoisesDQM::gainHandle_ = nullptr
private

Definition at line 29 of file SiStripNoisesDQM.h.

Referenced by fillMEsForDet(), and fillMEsForLayer().