CMS 3D CMS Logo

SiStripThresholdDQM.cc
Go to the documentation of this file.
2 
4  edm::RunNumber_t iRun,
5  edm::ParameterSet const &hPSet,
6  edm::ParameterSet const &fPSet,
7  const TrackerTopology *tTopo,
8  const TkDetMap *tkDetMap)
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 }
19 
21 
23  getConditionObject(eSetup);
25 }
26 
27 void SiStripThresholdDQM::fillModMEs(const std::vector<uint32_t> &selectedDetIds) {
28  ModMEs CondObj_ME;
29  for (const auto det : selectedDetIds) {
30  fillMEsForDet(CondObj_ME, det);
31  }
32 }
33 
34 void SiStripThresholdDQM::fillMEsForDet(const ModMEs &_selModME_, uint32_t selDetId_) {
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 }
53 
54 void SiStripThresholdDQM::fillSummaryMEs(const std::vector<uint32_t> &selectedDetIds) {
55  for (const auto det : selectedDetIds) {
56  fillMEsForLayer(/*SummaryMEsMap_,*/ det);
57  }
58 }
59 
61  /*std::map<uint32_t, ModMEs> selMEsMap_,*/ uint32_t selDetId_) {
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 }
SiStripBaseCondObjDQM::Tk_HM_L
std::unique_ptr< TkHistoMap > Tk_HM_L
Definition: SiStripBaseCondObjDQM.h:119
SiStripHistoId::createHistoLayer
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
Definition: SiStripHistoId.cc:51
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
SiStripBaseCondObjDQM::hidmanager
SiStripHistoId hidmanager
Definition: SiStripBaseCondObjDQM.h:141
mps_fire.i
i
Definition: mps_fire.py:428
SiStripBaseCondObjDQM::ModMEs::ProfileDistr
MonitorElement * ProfileDistr
Definition: SiStripBaseCondObjDQM.h:73
SiStripThreshold::Data::getLth
float getLth() const
Definition: SiStripThreshold.h:61
TrackerTopology
Definition: TrackerTopology.h:16
SiStripBaseCondObjDQM::activeDetIds
std::vector< uint32_t > activeDetIds
Definition: SiStripBaseCondObjDQM.h:114
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SiStripThreshold::Data::getHth
float getHth() const
Definition: SiStripThreshold.h:60
SiStripThreshold::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripThreshold.cc:48
SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr
MonitorElement * SummaryOfProfileDistr
Definition: SiStripBaseCondObjDQM.h:75
SiStripBaseCondObjDQM::HistoMaps_On_
bool HistoMaps_On_
Definition: SiStripBaseCondObjDQM.h:100
SiStripBaseCondObjDQM::SummaryMEsMap_
std::map< uint32_t, ModMEs > SummaryMEsMap_
Definition: SiStripBaseCondObjDQM.h:113
SiStripBaseCondObjDQM::Tk_HM_H
std::unique_ptr< TkHistoMap > Tk_HM_H
Definition: SiStripBaseCondObjDQM.h:118
SiStripBaseCondObjDQM::ModMEs::SummaryDistr
MonitorElement * SummaryDistr
Definition: SiStripBaseCondObjDQM.h:77
SiStripBaseCondObjDQM::fillTkMap
void fillTkMap(const uint32_t &detid, const float &value)
Definition: SiStripBaseCondObjDQM.cc:1050
SiStripThresholdDQM::fillSummaryMEs
void fillSummaryMEs(const std::vector< uint32_t > &selectedDetIds) override
Definition: SiStripThresholdDQM.cc:54
SiStripThreshold::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripThreshold.cc:38
SiStripThresholdDQM::fillModMEs
void fillModMEs(const std::vector< uint32_t > &selectedDetIds) override
Definition: SiStripThresholdDQM.cc:27
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
SiStripBaseCondObjDQM::getLayerNameAndId
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
Definition: SiStripBaseCondObjDQM.cc:828
SiStripDetInfo::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfo.cc:19
SiStripBaseCondObjDQM::getModMEs
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
Definition: SiStripBaseCondObjDQM.cc:301
SiStripThreshold::getData
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
Definition: SiStripThreshold.cc:70
TkDetMap
Definition: TkDetMap.h:175
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
SiStripThresholdRcd
Definition: SiStripCondDataRecords.h:50
SiStripBaseCondObjDQMGet
Definition: SiStripBaseCondObjDQM.h:148
SiStripThresholdDQM.h
SiStripBaseCondObjDQM::CondObj_fillId_
std::string CondObj_fillId_
Definition: SiStripBaseCondObjDQM.h:109
edm::ParameterSet
Definition: ParameterSet.h:47
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: SiStripThresholdDQM.cc:3
SiStripThresholdDQM::fillMEsForLayer
void fillMEsForLayer(uint32_t selDetId_) override
Definition: SiStripThresholdDQM.cc:60
SiStripThresholdDQM::WhichThreshold
std::string WhichThreshold
Definition: SiStripThresholdDQM.h:30
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd >
SiStripBaseCondObjDQM::GetSameLayerDetId
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
Definition: SiStripBaseCondObjDQM.cc:1023
SiStripBaseCondObjDQM::detInfo_
SiStripDetInfo detInfo_
Definition: SiStripBaseCondObjDQM.h:94
SiStripBaseCondObjDQM::ModMEs
Definition: SiStripBaseCondObjDQM.h:64
SiStripHistoId
Definition: SiStripHistoId.h:25
SiStripThreshold
Definition: __init__.py:1
SiStripBaseCondObjDQM::getSummaryMEs
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
Definition: SiStripBaseCondObjDQM.cc:334
SiStripThresholdDQM::fillMEsForDet
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) override
Definition: SiStripThresholdDQM.cc:34
SiStripBaseCondObjDQM::fPSet_
edm::ParameterSet fPSet_
Definition: SiStripBaseCondObjDQM.h:97
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripBaseCondObjDQM::hPSet_
edm::ParameterSet hPSet_
Definition: SiStripBaseCondObjDQM.h:96
SiStripThresholdDQM::getActiveDetIds
void getActiveDetIds(const edm::EventSetup &eSetup) override
Definition: SiStripThresholdDQM.cc:22
SiStripThresholdDQM::~SiStripThresholdDQM
~SiStripThresholdDQM() override
Definition: SiStripThresholdDQM.cc:20
SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >::getConditionObject
void getConditionObject(const edm::EventSetup &eSetup) override
Definition: SiStripBaseCondObjDQM.h:159
SiStripBaseCondObjDQMGet< SiStripThreshold, SiStripThresholdRcd >::condObj_
const SiStripThreshold * condObj_
Definition: SiStripBaseCondObjDQM.h:163
OnDemandMonitoring_cfi.WhichThreshold
WhichThreshold
Definition: OnDemandMonitoring_cfi.py:84
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316