CMS 3D CMS Logo

List of all members | Public Member Functions
SiStripPedestalsDQM Class Reference

#include <SiStripPedestalsDQM.h>

Inheritance diagram for SiStripPedestalsDQM:
SiStripBaseCondObjDQMGet< SiStripPedestals, SiStripPedestalsRcd > 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
 
 SiStripPedestalsDQM (edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
 
 ~SiStripPedestalsDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripPedestals, SiStripPedestalsRcd >
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 ()
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripPedestals, SiStripPedestalsRcd >
using tokentype = typename edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd >
 
- 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< SiStripPedestals, SiStripPedestalsRcd >
const SiStripPedestalscondObj_
 
- 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 SiStripPedestalsDQM.h.

Constructor & Destructor Documentation

◆ SiStripPedestalsDQM()

SiStripPedestalsDQM::SiStripPedestalsDQM ( edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd token,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet,
const TrackerTopology tTopo,
const TkDetMap tkDetMap 
)

Definition at line 4 of file SiStripPedestalsDQM.cc.

References unpackBuffers-CaloStage2::token.

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

◆ ~SiStripPedestalsDQM()

SiStripPedestalsDQM::~SiStripPedestalsDQM ( )
override

Definition at line 16 of file SiStripPedestalsDQM.cc.

16 {}

Member Function Documentation

◆ fillMEsForDet()

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

Implements SiStripBaseCondObjDQM.

Definition at line 30 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQMGet< SiStripPedestals, SiStripPedestalsRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripPedestals::getPed(), SiStripPedestals::getRange(), and SiStripBaseCondObjDQM::ModMEs::ProfileDistr.

Referenced by fillModMEs().

30  {
31  ModMEs selModME_ = _selModME_;
32  getModMEs(selModME_, selDetId_);
33 
34  const auto pedRange = condObj_->getRange(selDetId_);
35  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
36 
37  for (int istrip = 0; istrip < nStrip; ++istrip) {
38  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
39  selModME_.ProfileDistr->Fill(istrip + 1, condObj_->getPed(istrip, pedRange));
40  }
41  } // istrip
42 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
const Range getRange(const uint32_t &detID) const
float getPed(const uint16_t &strip, const Range &range) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const

◆ fillMEsForLayer()

void SiStripPedestalsDQM::fillMEsForLayer ( uint32_t  selDetId_)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 74 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQMGet< SiStripPedestals, SiStripPedestalsRcd >::condObj_, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), dqmdumpme::first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripPedestals::getPed(), SiStripPedestals::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().

75  {
76  // ----
77  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
78 
79  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
80  edm::LogError("SiStripPedestalsDQM") << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such "
81  "subdetector type : "
82  << subdetectorId_ << " no folder set!" << std::endl;
83  return;
84  }
85  // ----
86 
87  // // Cumulative distribution with average Ped value on a layer (not
88  // needed):
89 
90  const auto selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
91  ModMEs selME_;
92  if (selMEsMapIter_ != SummaryMEsMap_.end())
93  selME_ = selMEsMapIter_->second;
94  getSummaryMEs(selME_, selDetId_);
95 
96  const auto pedRange = condObj_->getRange(selDetId_);
97 
98  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
99 
101 
102  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
103  // --> profile summary
104 
105  std::string hSummaryOfProfile_description;
106  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
107 
108  std::string hSummaryOfProfile_name;
109 
110  hSummaryOfProfile_name =
111  hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "");
112 
113  for (int istrip = 0; istrip < nStrip; ++istrip) {
114  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
115  selME_.SummaryOfProfileDistr->Fill(istrip + 1, condObj_->getPed(istrip, pedRange));
116  }
117 
118  // fill the TkMap
119  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
120  fillTkMap(selDetId_, condObj_->getPed(istrip, pedRange));
121  }
122 
123  } // istrip
124  } // if Fill ...
125 
126  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
127  // --> summary
128 
129  std::string hSummary_description;
130  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
131 
132  std::string hSummary_name;
133  hSummary_name = hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_).first, "");
134  float meanPedestal = 0;
135 
136  for (int istrip = 0; istrip < nStrip; ++istrip) {
137  meanPedestal = meanPedestal + condObj_->getPed(istrip, pedRange);
138 
139  } // istrip
140 
141  meanPedestal = meanPedestal / nStrip;
142 
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  selME_.SummaryDistr->Fill(iBin, meanPedestal);
160 
161  // Fill the Histo_TkMap with the mean Pedestal:
162  if (HistoMaps_On_)
163  Tk_HM_->fill(selDetId_, meanPedestal);
164 
165  } // if Fill ...
166 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const Range getRange(const uint32_t &detID) const
Log< level::Error, false > LogError
void fillTkMap(const uint32_t &detid, const float &value)
float getPed(const uint16_t &strip, const Range &range) const
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_)
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_)
std::unique_ptr< TkHistoMap > Tk_HM_

◆ fillModMEs()

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 23 of file SiStripPedestalsDQM.cc.

References fillMEsForDet().

23  {
24  ModMEs CondObj_ME;
25  for (const auto det : selectedDetIds) {
26  fillMEsForDet(CondObj_ME, det);
27  }
28 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) override

◆ fillSummaryMEs()

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 44 of file SiStripPedestalsDQM.cc.

References alignmentValidation::c1, SiStripBaseCondObjDQM::CondObj_fillId_, 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.

44  {
45  for (const auto det : selectedDetIds) {
46  fillMEsForLayer(/*SummaryMEsMap_,*/ det);
47  }
48 
49  for (const auto &itm : SummaryMEsMap_) {
50  ModMEs selME;
51  selME = itm.second;
52 
53  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") &&
54  fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")) {
55  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
56  TCanvas c1("c1");
57  selME.SummaryOfProfileDistr->getTProfile()->Draw();
58  std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
59  name += ".png";
60  c1.Print(name.c_str());
61  }
62  }
63  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
64  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
65  TCanvas c1("c1");
66  selME.SummaryDistr->getTH1()->Draw();
67  std::string name(selME.SummaryDistr->getTitle());
68  name += ".png";
69  c1.Print(name.c_str());
70  }
71  }
72 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void fillMEsForLayer(uint32_t selDetId_) override
std::map< uint32_t, ModMEs > SummaryMEsMap_

◆ getActiveDetIds()

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