CMS 3D CMS Logo

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

#include <SiStripApvGainsDQM.h>

Inheritance diagram for SiStripApvGainsDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
unsigned long long getCache (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripApvGainsDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripApvGainsDQM () 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 ()
 
std::vector< uint32_t > getCabledModules ()
 
void selectModules (std::vector< uint32_t > &detIds_, const TrackerTopology *tTopo)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Attributes

edm::ESHandle< SiStripApvGaingainHandle_
 

Additional Inherited Members

- 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_, const TrackerTopology *tTopo)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
unsigned long long cacheID_current
 
unsigned long long cacheID_memory
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
const edm::EventSetupeSetup_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
SiStripDetInfoFileReaderreader
 
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
 

Detailed Description

Definition at line 11 of file SiStripApvGainsDQM.h.

Constructor & Destructor Documentation

◆ SiStripApvGainsDQM()

SiStripApvGainsDQM::SiStripApvGainsDQM ( const edm::EventSetup eSetup,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 8 of file SiStripApvGainsDQM.cc.

12  : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) {
13  // Build the Histo_TkMap:
14  if (HistoMaps_On_) {
15  edm::ESHandle<TkDetMap> tkDetMapHandle;
16  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
17  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanApvGain_TkMap", 0.);
18  }
19 }

References edm::EventSetup::get(), get, SiStripBaseCondObjDQM::HistoMaps_On_, edm::ESHandle< T >::product(), and SiStripBaseCondObjDQM::Tk_HM_.

◆ ~SiStripApvGainsDQM()

SiStripApvGainsDQM::~SiStripApvGainsDQM ( )
override

Definition at line 23 of file SiStripApvGainsDQM.cc.

23 {}

Member Function Documentation

◆ fillMEsForDet()

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

Implements SiStripBaseCondObjDQM.

Definition at line 49 of file SiStripApvGainsDQM.cc.

49  {
50  ModMEs selModME_ = _selModME_;
51  std::vector<uint32_t> DetIds;
52  gainHandle_->getDetIds(DetIds);
53 
54  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
55 
56  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
57 
58  getModMEs(selModME_, selDetId_, tTopo);
59 
60  for (int iapv = 0; iapv < nApv; ++iapv) {
61  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
62  selModME_.ProfileDistr->Fill(iapv + 1, gainHandle_->getApvGain(iapv, gainRange));
63  }
64  if (CondObj_fillId_ == "onlyCumul" || CondObj_fillId_ == "ProfileAndCumul") {
65  selModME_.CumulDistr->Fill(gainHandle_->getApvGain(iapv, gainRange));
66  }
67 
68  // Fill the TkMap
69  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
70  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv, gainRange));
71  }
72  }
73 }

References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripApvGain::getApvGain(), SiStripApvGain::getDetIds(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::hPSet_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, and SiStripBaseCondObjDQM::reader.

Referenced by fillModMEs().

◆ fillMEsForLayer()

void SiStripApvGainsDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 111 of file SiStripApvGainsDQM.cc.

112  {
113  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
114 
115  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
116  edm::LogError("SiStripApvGainsDQM") << "[SiStripApvGainsDQM::fillMEsForLayer] WRONG INPUT : no such "
117  "subdetector type : "
118  << subdetectorId_ << " no folder set!" << std::endl;
119  return;
120  }
121  // ----
122 
123  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second);
124  ModMEs selME_;
125  if (selMEsMapIter_ != SummaryMEsMap_.end())
126  selME_ = selMEsMapIter_->second;
127  getSummaryMEs(selME_, selDetId_, tTopo);
128 
129  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
130  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
131 
132  float meanApvGain = 0;
133 
135 
136  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
137  // --> profile summary
138  std::string hSummaryOfProfile_description;
139  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
140 
141  std::string hSummaryOfProfile_name;
142  hSummaryOfProfile_name = hidmanager.createHistoLayer(
143  hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, "");
144 
145  for (int iapv = 0; iapv < nApv; ++iapv) {
146  meanApvGain = meanApvGain + gainHandle_->getApvGain(iapv, gainRange);
147  selME_.SummaryOfProfileDistr->Fill(iapv + 1, gainHandle_->getApvGain(iapv, gainRange));
148 
149  // Fill the TkMap
150  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
151  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv, gainRange));
152  }
153 
154  } // iapv
155 
156  meanApvGain = meanApvGain / nApv;
157 
158  // Fill the TkHistoMap with meanApvgain:
159  if (HistoMaps_On_)
160  Tk_HM_->setBinContent(selDetId_, meanApvGain);
161 
162  } // if Fill ...
163 
164  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
165  // --> summary
166  std::string hSummary_description;
167  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
168 
169  std::string hSummary_name;
170  hSummary_name =
171  hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, "");
172 
173  // get detIds belonging to same layer to fill X-axis with detId-number
174 
175  std::vector<uint32_t> sameLayerDetIds_;
176 
177  sameLayerDetIds_.clear();
178 
179  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo);
180 
181  unsigned int iBin = 0;
182  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
183  if (sameLayerDetIds_[i] == selDetId_) {
184  iBin = i + 1;
185  }
186  }
187 
188  for (int iapv = 0; iapv < nApv; ++iapv) {
189  meanApvGain = meanApvGain + gainHandle_->getApvGain(iapv, gainRange);
190  selME_.SummaryDistr->Fill(iBin, gainHandle_->getApvGain(iapv, gainRange));
191  } // iapv
192  meanApvGain = meanApvGain / nApv;
193 
194  // Fill the TkHistoMap with meanApvgain:
195  // if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
196 
197  } // if Fill ...
198 }

References SiStripBaseCondObjDQM::activeDetIds, SiStripHistoId::createHistoLayer(), dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), dqmdumpme::first, SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripApvGain::getApvGain(), SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripBaseCondObjDQM::reader, 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,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripApvGainsDQM.cc.

34  {
35  // Retrieve tracker topology from geometry
37  es.get<TrackerTopologyRcd>().get(tTopoHandle);
38  const TrackerTopology *const tTopo = tTopoHandle.product();
39 
40  ModMEs CondObj_ME;
41 
42  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
43  ++detIter_) {
44  fillMEsForDet(CondObj_ME, *detIter_, tTopo);
45  }
46 }

References fillMEsForDet(), edm::EventSetup::get(), get, and edm::ESHandle< T >::product().

◆ fillSummaryMEs()

void SiStripApvGainsDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 76 of file SiStripApvGainsDQM.cc.

76  {
77  // Retrieve tracker topology from geometry
79  es.get<TrackerTopologyRcd>().get(tTopoHandle);
80  const TrackerTopology *const tTopo = tTopoHandle.product();
81 
82  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
83  detIter_++) {
84  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo);
85  }
86 
87  for (std::map<uint32_t, ModMEs>::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) {
88  ModMEs selME;
89  selME = iter->second;
90 
91  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") &&
92  fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")) {
93  TCanvas c1("c1");
94  selME.SummaryOfProfileDistr->getTProfile()->Draw();
95  std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
96  name += ".png";
97  c1.Print(name.c_str());
98  }
99  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
100  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
101  TCanvas c1("c1");
102  selME.SummaryDistr->getTH1()->Draw();
103  std::string name(selME.SummaryDistr->getTH1()->GetTitle());
104  name += ".png";
105  c1.Print(name.c_str());
106  }
107  }
108 }

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), dqm::legacy::MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, Skims_PA_cff::name, edm::ESHandle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr.

◆ getActiveDetIds()

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

◆ getCache()

unsigned long long SiStripApvGainsDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 30 of file SiStripApvGainsDQM.h.

30  {
31  return eSetup.get<SiStripApvGainRcd>().cacheIdentifier();
32  }

References edm::EventSetup::get().

◆ getConditionObject()

void SiStripApvGainsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual

Member Data Documentation

◆ gainHandle_

edm::ESHandle<SiStripApvGain> SiStripApvGainsDQM::gainHandle_
private
SiStripHistoId::createHistoLayer
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
Definition: SiStripHistoId.cc:51
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiStripBaseCondObjDQM::hidmanager
SiStripHistoId hidmanager
Definition: SiStripBaseCondObjDQM.h:157
mps_fire.i
i
Definition: mps_fire.py:355
TrackerTopology
Definition: TrackerTopology.h:16
SiStripBaseCondObjDQM::activeDetIds
std::vector< uint32_t > activeDetIds
Definition: SiStripBaseCondObjDQM.h:123
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
SiStripBaseCondObjDQM::HistoMaps_On_
bool HistoMaps_On_
Definition: SiStripBaseCondObjDQM.h:109
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
dqmdumpme.first
first
Definition: dqmdumpme.py:55
SiStripBaseCondObjDQM::SummaryMEsMap_
std::map< uint32_t, ModMEs > SummaryMEsMap_
Definition: SiStripBaseCondObjDQM.h:122
SiStripBaseCondObjDQM::reader
SiStripDetInfoFileReader * reader
Definition: SiStripBaseCondObjDQM.h:102
SiStripBaseCondObjDQM::fillTkMap
void fillTkMap(const uint32_t &detid, const float &value)
Definition: SiStripBaseCondObjDQM.cc:1144
SiStripBaseCondObjDQM::getLayerNameAndId
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:913
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripBaseCondObjDQM::Tk_HM_
std::unique_ptr< TkHistoMap > Tk_HM_
Definition: SiStripBaseCondObjDQM.h:129
edm::ESHandle
Definition: DTSurvey.h:22
SiStripBaseCondObjDQM::cacheID_memory
unsigned long long cacheID_memory
Definition: SiStripBaseCondObjDQM.h:126
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripApvGainsDQM::fillMEsForDet
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
Definition: SiStripApvGainsDQM.cc:49
SiStripBaseCondObjDQM::CondObj_fillId_
std::string CondObj_fillId_
Definition: SiStripBaseCondObjDQM.h:118
edm::LogError
Definition: MessageLogger.h:183
SiStripApvGainsDQM::fillMEsForLayer
void fillMEsForLayer(uint32_t selDetId_, const TrackerTopology *tTopo) override
Definition: SiStripApvGainsDQM.cc:111
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
get
#define get
SiStripBaseCondObjDQM::getModMEs
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:363
SiStripApvGainRcd
Definition: SiStripCondDataRecords.h:8
SiStripApvGainsDQM::gainHandle_
edm::ESHandle< SiStripApvGain > gainHandle_
Definition: SiStripApvGainsDQM.h:40
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiStripHistoId
Definition: SiStripHistoId.h:25
SiStripDetInfoFileReader::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfoFileReader.cc:101
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
SiStripBaseCondObjDQM::SiStripBaseCondObjDQM
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
Definition: SiStripBaseCondObjDQM.cc:10
SiStripBaseCondObjDQM::fPSet_
edm::ParameterSet fPSet_
Definition: SiStripBaseCondObjDQM.h:106
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripBaseCondObjDQM::getSummaryMEs
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:399
SiStripBaseCondObjDQM::hPSet_
edm::ParameterSet hPSet_
Definition: SiStripBaseCondObjDQM.h:105
SiStripApvGainsDQM::getConditionObject
void getConditionObject(const edm::EventSetup &eSetup) override
Definition: SiStripApvGainsDQM.h:34
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SiStripApvGain::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripApvGain.cc:53
SiStripApvGain::getApvGain
static float getApvGain(uint16_t apv, const Range &range)
Definition: SiStripApvGain.h:82
SiStripBaseCondObjDQM::GetSameLayerDetId
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:1114
SiStripBaseCondObjDQM::cacheID_current
unsigned long long cacheID_current
Definition: SiStripBaseCondObjDQM.h:127