CMS 3D CMS Logo

List of all members | Public Member Functions
SiStripApvGainsDQM Class Reference

#include <SiStripApvGainsDQM.h>

Inheritance diagram for SiStripApvGainsDQM:
SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd > 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
 
 SiStripApvGainsDQM (edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
 
 ~SiStripApvGainsDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >
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_, const std::vector< uint32_t > &detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
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 ()
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >
using tokentype = typename edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd >
 
- 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< SiStripApvGain, SiStripApvGainRcd >
const SiStripApvGaincondObj_
 
- 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 SiStripApvGainsDQM.h.

Constructor & Destructor Documentation

◆ SiStripApvGainsDQM()

SiStripApvGainsDQM::SiStripApvGainsDQM ( edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd token,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet,
const TrackerTopology tTopo,
const TkDetMap tkDetMap 
)

Definition at line 5 of file SiStripApvGainsDQM.cc.

12  if (HistoMaps_On_) {
13  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "MeanApvGain_TkMap", 0.);
14  }
15 }

References unpackBuffers-CaloStage2::token.

◆ ~SiStripApvGainsDQM()

SiStripApvGainsDQM::~SiStripApvGainsDQM ( )
override

Definition at line 17 of file SiStripApvGainsDQM.cc.

17 {}

Member Function Documentation

◆ fillMEsForDet()

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

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripApvGainsDQM.cc.

31  {
32  ModMEs selModME_ = _selModME_;
33  std::vector<uint32_t> DetIds;
34  condObj_->getDetIds(DetIds);
35 
36  const auto gainRange = condObj_->getRange(selDetId_);
37 
38  int nApv = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first;
39 
40  getModMEs(selModME_, selDetId_);
41 
42  for (int iapv = 0; iapv < nApv; ++iapv) {
43  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
44  selModME_.ProfileDistr->Fill(iapv + 1, condObj_->getApvGain(iapv, gainRange));
45  }
46  if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") {
47  selModME_.CumulDistr->Fill(condObj_->getApvGain(iapv, gainRange));
48  }
49 
50  // Fill the TkMap
51  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
52  fillTkMap(selDetId_, condObj_->getApvGain(iapv, gainRange));
53  }
54  }
55 }

References SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), SiStripBaseCondObjDQM::fPSet_, SiStripApvGain::getApvGain(), SiStripApvGain::getDetIds(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::hPSet_, and SiStripBaseCondObjDQM::ModMEs::ProfileDistr.

Referenced by fillModMEs().

◆ fillMEsForLayer()

void SiStripApvGainsDQM::fillMEsForLayer ( uint32_t  selDetId_)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 83 of file SiStripApvGainsDQM.cc.

84  {
85  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
86 
87  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
88  edm::LogError("SiStripApvGainsDQM") << "[SiStripApvGainsDQM::fillMEsForLayer] WRONG INPUT : no such "
89  "subdetector type : "
90  << subdetectorId_ << " no folder set!" << std::endl;
91  return;
92  }
93  // ----
94 
95  const auto selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
96  ModMEs selME_;
97  if (selMEsMapIter_ != SummaryMEsMap_.end())
98  selME_ = selMEsMapIter_->second;
99  getSummaryMEs(selME_, selDetId_);
100 
101  const auto gainRange = condObj_->getRange(selDetId_);
102  int nApv = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first;
103 
104  float meanApvGain = 0;
105 
107 
108  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
109  // --> profile summary
110  std::string hSummaryOfProfile_description;
111  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
112 
113  std::string hSummaryOfProfile_name;
114  hSummaryOfProfile_name =
115  hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "");
116 
117  for (int iapv = 0; iapv < nApv; ++iapv) {
118  meanApvGain = meanApvGain + condObj_->getApvGain(iapv, gainRange);
119  selME_.SummaryOfProfileDistr->Fill(iapv + 1, condObj_->getApvGain(iapv, gainRange));
120 
121  // Fill the TkMap
122  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
123  fillTkMap(selDetId_, condObj_->getApvGain(iapv, gainRange));
124  }
125 
126  } // iapv
127 
128  meanApvGain = meanApvGain / nApv;
129 
130  // Fill the TkHistoMap with meanApvgain:
131  if (HistoMaps_On_)
132  Tk_HM_->setBinContent(selDetId_, meanApvGain);
133 
134  } // if Fill ...
135 
136  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
137  // --> summary
138  std::string hSummary_description;
139  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
140 
141  std::string hSummary_name;
142  hSummary_name = hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_).first, "");
143 
144  // get detIds belonging to same layer to fill X-axis with detId-number
145 
146  std::vector<uint32_t> sameLayerDetIds_;
147 
148  sameLayerDetIds_.clear();
149 
150  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_);
151 
152  unsigned int iBin = 0;
153  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
154  if (sameLayerDetIds_[i] == selDetId_) {
155  iBin = i + 1;
156  }
157  }
158 
159  for (int iapv = 0; iapv < nApv; ++iapv) {
160  meanApvGain = meanApvGain + condObj_->getApvGain(iapv, gainRange);
161  selME_.SummaryDistr->Fill(iBin, condObj_->getApvGain(iapv, gainRange));
162  } // iapv
163  meanApvGain = meanApvGain / nApv;
164 
165  // Fill the TkHistoMap with meanApvgain:
166  // if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
167 
168  } // if Fill ...
169 }

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >::condObj_, SiStripHistoId::createHistoLayer(), SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripApvGain::getApvGain(), SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripApvGain::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, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

◆ fillModMEs()

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripApvGainsDQM.cc.

24  {
25  ModMEs CondObj_ME;
26  for (const auto detIter : selectedDetIds) {
27  fillMEsForDet(CondObj_ME, detIter);
28  }
29 }

References fillMEsForDet().

◆ fillSummaryMEs()

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 57 of file SiStripApvGainsDQM.cc.

57  {
58  for (const auto det : selectedDetIds) {
59  fillMEsForLayer(/*SummaryMEsMap_,*/ det);
60  }
61 
62  for (const auto &itm : SummaryMEsMap_) {
63  ModMEs selME = itm.second;
64  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") &&
65  fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")) {
66  TCanvas c1("c1");
67  selME.SummaryOfProfileDistr->getTProfile()->Draw();
68  std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
69  name += ".png";
70  c1.Print(name.c_str());
71  }
72  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
73  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
74  TCanvas c1("c1");
75  selME.SummaryDistr->getTH1()->Draw();
76  std::string name(selME.SummaryDistr->getTitle());
77  name += ".png";
78  c1.Print(name.c_str());
79  }
80  }
81 }

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), dqm::impl::MonitorElement::getTitle(), dqm::legacy::MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr.

◆ getActiveDetIds()

void SiStripApvGainsDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual
SiStripHistoId::createHistoLayer
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
Definition: SiStripHistoId.cc:51
SiStripApvGainsDQM::fillMEsForLayer
void fillMEsForLayer(uint32_t selDetId_) override
Definition: SiStripApvGainsDQM.cc:83
SiStripBaseCondObjDQM::hidmanager
SiStripHistoId hidmanager
Definition: SiStripBaseCondObjDQM.h:141
mps_fire.i
i
Definition: mps_fire.py:428
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
SiStripBaseCondObjDQM::HistoMaps_On_
bool HistoMaps_On_
Definition: SiStripBaseCondObjDQM.h:100
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
SiStripBaseCondObjDQM::SummaryMEsMap_
std::map< uint32_t, ModMEs > SummaryMEsMap_
Definition: SiStripBaseCondObjDQM.h:113
SiStripBaseCondObjDQM::fillTkMap
void fillTkMap(const uint32_t &detid, const float &value)
Definition: SiStripBaseCondObjDQM.cc:1050
SiStripBaseCondObjDQM::getLayerNameAndId
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
Definition: SiStripBaseCondObjDQM.cc:828
SiStripBaseCondObjDQM::Tk_HM_
std::unique_ptr< TkHistoMap > Tk_HM_
Definition: SiStripBaseCondObjDQM.h:117
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
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >
SiStripBaseCondObjDQM::CondObj_fillId_
std::string CondObj_fillId_
Definition: SiStripBaseCondObjDQM.h:109
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
SiStripApvGainsDQM::fillMEsForDet
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) override
Definition: SiStripApvGainsDQM.cc:31
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
SiStripHistoId
Definition: SiStripHistoId.h:25
SiStripBaseCondObjDQM::getSummaryMEs
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
Definition: SiStripBaseCondObjDQM.cc:334
SiStripBaseCondObjDQM::fPSet_
edm::ParameterSet fPSet_
Definition: SiStripBaseCondObjDQM.h:97
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripBaseCondObjDQM::hPSet_
edm::ParameterSet hPSet_
Definition: SiStripBaseCondObjDQM.h:96
SiStripApvGain::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripApvGain.cc:53
SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >::getConditionObject
void getConditionObject(const edm::EventSetup &eSetup) override
Definition: SiStripBaseCondObjDQM.h:159
SiStripBaseCondObjDQMGet< SiStripApvGain, SiStripApvGainRcd >::condObj_
const SiStripApvGain * condObj_
Definition: SiStripBaseCondObjDQM.h:163
SiStripApvGain::getApvGain
static float getApvGain(uint16_t apv, const Range &range)
Definition: SiStripApvGain.h:82
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316