CMS 3D CMS Logo

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

#include <SiStripPedestalsDQM.h>

Inheritance diagram for SiStripPedestalsDQM:
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
 
 SiStripPedestalsDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripPedestalsDQM () 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 ()
 
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< SiStripPedestalspedestalHandle_
 

Additional Inherited Members

- 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 9 of file SiStripPedestalsDQM.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripPedestalsDQM.cc.

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

11  : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) {
12  // Build the Histo_TkMap:
13  if (HistoMaps_On_) {
14  edm::ESHandle<TkDetMap> tkDetMapHandle;
15  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
16  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map", "MeanPed_TkMap", 0.);
17  }
18 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripPedestalsDQM::~SiStripPedestalsDQM ( )
override

Definition at line 22 of file SiStripPedestalsDQM.cc.

22 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 49 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripPedestals::getPed(), SiStripPedestals::getRange(), pedestalHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, and SiStripBaseCondObjDQM::reader.

Referenced by fillModMEs().

49  {
50  ModMEs selModME_ = _selModME_;
51  getModMEs(selModME_, selDetId_, tTopo);
52 
53  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
54  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128;
55 
56  for (int istrip = 0; istrip < nStrip; ++istrip) {
57  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
58  selModME_.ProfileDistr->Fill(istrip + 1, pedestalHandle_->getPed(istrip, pedRange));
59  }
60  } // istrip
61 }
edm::ESHandle< SiStripPedestals > pedestalHandle_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
float getPed(const uint16_t &strip, const Range &range) const
SiStripDetInfoFileReader * reader
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
const Range getRange(const uint32_t &detID) const
void SiStripPedestalsDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 104 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), plotBeamSpotDB::first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripPedestals::getPed(), SiStripPedestals::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, pedestalHandle_, SiStripBaseCondObjDQM::reader, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

105  {
106  // ----
107  int subdetectorId_ = ((selDetId_ >> 25) & 0x7);
108 
109  if (subdetectorId_ < 3 || subdetectorId_ > 6) {
110  edm::LogError("SiStripPedestalsDQM") << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such "
111  "subdetector type : "
112  << subdetectorId_ << " no folder set!" << std::endl;
113  return;
114  }
115  // ----
116 
117  // // Cumulative distribution with average Ped value on a layer (not
118  // needed):
119 
120  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second);
121  ModMEs selME_;
122  if (selMEsMapIter_ != SummaryMEsMap_.end())
123  selME_ = selMEsMapIter_->second;
124  getSummaryMEs(selME_, selDetId_, tTopo);
125 
126  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
127 
128  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128;
129 
131 
132  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")) {
133  // --> profile summary
134 
135  std::string hSummaryOfProfile_description;
136  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
137 
138  std::string hSummaryOfProfile_name;
139 
140  hSummaryOfProfile_name = hidmanager.createHistoLayer(
141  hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, "");
142 
143  for (int istrip = 0; istrip < nStrip; ++istrip) {
144  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
145  selME_.SummaryOfProfileDistr->Fill(istrip + 1, pedestalHandle_->getPed(istrip, pedRange));
146  }
147 
148  // fill the TkMap
149  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
150  fillTkMap(selDetId_, pedestalHandle_->getPed(istrip, pedRange));
151  }
152 
153  } // istrip
154  } // if Fill ...
155 
156  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
157  // --> summary
158 
159  std::string hSummary_description;
160  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
161 
162  std::string hSummary_name;
163  hSummary_name =
164  hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, "");
165  float meanPedestal = 0;
166 
167  for (int istrip = 0; istrip < nStrip; ++istrip) {
168  meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip, pedRange);
169 
170  } // istrip
171 
172  meanPedestal = meanPedestal / nStrip;
173 
174  // -----
175  // get detIds belonging to same layer to fill X-axis with detId-number
176 
177  std::vector<uint32_t> sameLayerDetIds_;
178 
179  sameLayerDetIds_.clear();
180 
181  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo);
182 
183  unsigned int iBin = 0;
184  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
185  if (sameLayerDetIds_[i] == selDetId_) {
186  iBin = i + 1;
187  }
188  }
189 
190  selME_.SummaryDistr->Fill(iBin, meanPedestal);
191 
192  // Fill the Histo_TkMap with the mean Pedestal:
193  if (HistoMaps_On_)
194  Tk_HM_->fill(selDetId_, meanPedestal);
195 
196  } // if Fill ...
197 }
T getParameter(std::string const &) const
edm::ESHandle< SiStripPedestals > pedestalHandle_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
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_
SiStripDetInfoFileReader * reader
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
std::vector< uint32_t > activeDetIds
const Range getRange(const uint32_t &detID) const
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::unique_ptr< TkHistoMap > Tk_HM_
void SiStripPedestalsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 33 of file SiStripPedestalsDQM.cc.

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

33  {
34  // Retrieve tracker topology from geometry
36  es.get<TrackerTopologyRcd>().get(tTopoHandle);
37  const TrackerTopology *const tTopo = tTopoHandle.product();
38 
39  ModMEs CondObj_ME;
40 
41  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
42  detIter_++) {
43  fillMEsForDet(CondObj_ME, *detIter_, tTopo);
44  }
45 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void SiStripPedestalsDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 65 of file SiStripPedestalsDQM.cc.

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

65  {
66  // Retrieve tracker topology from geometry
68  es.get<TrackerTopologyRcd>().get(tTopoHandle);
69  const TrackerTopology *const tTopo = tTopoHandle.product();
70 
71  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
72  detIter_++) {
73  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo);
74  }
75 
76  for (std::map<uint32_t, ModMEs>::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) {
77  ModMEs selME;
78  selME = iter->second;
79 
80  if (hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") &&
81  fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")) {
82  if (CondObj_fillId_ == "onlyProfile" || CondObj_fillId_ == "ProfileAndCumul") {
83  TCanvas c1("c1");
84  selME.SummaryOfProfileDistr->getTProfile()->Draw();
85  std::string name(selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
86  name += ".png";
87  c1.Print(name.c_str());
88  }
89  }
90  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
91  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
92  TCanvas c1("c1");
93  selME.SummaryDistr->getTH1()->Draw();
94  std::string name(selME.SummaryDistr->getTH1()->GetTitle());
95  name += ".png";
96  c1.Print(name.c_str());
97  }
98  }
99 }
T getParameter(std::string const &) const
void fillMEsForLayer(uint32_t selDetId_, const TrackerTopology *tTopo) override
std::map< uint32_t, ModMEs > SummaryMEsMap_
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void SiStripPedestalsDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 26 of file SiStripPedestalsDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, getConditionObject(), SiStripPedestals::getDetIds(), and pedestalHandle_.

26  {
27  getConditionObject(eSetup);
29 }
edm::ESHandle< SiStripPedestals > pedestalHandle_
void getConditionObject(const edm::EventSetup &eSetup) override
void getDetIds(std::vector< uint32_t > &DetIds_) const
std::vector< uint32_t > activeDetIds
unsigned long long SiStripPedestalsDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 27 of file SiStripPedestalsDQM.h.

References edm::EventSetup::get().

27  {
28  return eSetup.get<SiStripPedestalsRcd>().cacheIdentifier();
29  }
T get() const
Definition: EventSetup.h:71
void SiStripPedestalsDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual

Member Data Documentation

edm::ESHandle<SiStripPedestals> SiStripPedestalsDQM::pedestalHandle_
private