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 11 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_.

10  :SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet){
11 
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:62
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripPedestalsDQM::~SiStripPedestalsDQM ( )
override

Definition at line 24 of file SiStripPedestalsDQM.cc.

24 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 61 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().

61  {
62  ModMEs selModME_ = _selModME_;
63  getModMEs(selModME_,selDetId_,tTopo);
64 
65  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
66  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
67 
68  for( int istrip=0;istrip<nStrip;++istrip){
69  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
70  selModME_.ProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
71  }
72  }// istrip
73 
74 }
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 126 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().

126  {
127 
128  // ----
129  int subdetectorId_ = ((selDetId_>>25)&0x7);
130 
131  if( subdetectorId_<3 || subdetectorId_>6 ){
132  edm::LogError("SiStripPedestalsDQM")
133  << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
134  << subdetectorId_ << " no folder set!"
135  << std::endl;
136  return;
137  }
138  // ----
139 
140 // // Cumulative distribution with average Ped value on a layer (not needed):
141 
142  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_,tTopo).second);
143  ModMEs selME_;
144  if ( selMEsMapIter_ != SummaryMEsMap_.end())
145  selME_ =selMEsMapIter_->second;
146  getSummaryMEs(selME_,selDetId_,tTopo);
147 
148  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
149 
150  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
151 
153 
154  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
155 
156  // --> profile summary
157 
158  std::string hSummaryOfProfile_description;
159  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
160 
161  std::string hSummaryOfProfile_name;
162 
163 
164  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
165  "layer",
166  getLayerNameAndId(selDetId_,tTopo).first,
167  "") ;
168 
169  for( int istrip=0;istrip<nStrip;++istrip){
170 
171  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
172  selME_.SummaryOfProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
173  }
174 
175  //fill the TkMap
176  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
177  fillTkMap(selDetId_, pedestalHandle_->getPed(istrip,pedRange));
178  }
179 
180  }// istrip
181  }//if Fill ...
182 
183  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
184 
185  // --> summary
186 
187  std::string hSummary_description;
188  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
189 
190  std::string hSummary_name;
191  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
192  "layer",
193  getLayerNameAndId(selDetId_,tTopo).first,
194  "") ;
195  float meanPedestal=0;
196 
197  for( int istrip=0;istrip<nStrip;++istrip){
198 
199  meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip,pedRange);
200 
201  }//istrip
202 
203  meanPedestal = meanPedestal/nStrip;
204 
205 
206  // -----
207  // get detIds belonging to same layer to fill X-axis with detId-number
208 
209  std::vector<uint32_t> sameLayerDetIds_;
210 
211  sameLayerDetIds_.clear();
212 
213  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_,tTopo);
214 
215 
216  unsigned int iBin=0;
217  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
218  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
219  }
220 
221  selME_.SummaryDistr->Fill(iBin,meanPedestal);
222 
223  // Fill the Histo_TkMap with the mean Pedestal:
224  if(HistoMaps_On_ ) Tk_HM_->fill(selDetId_, meanPedestal);
225 
226 
227  }//if Fill ...
228 
229 
230 
231 }
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 39 of file SiStripPedestalsDQM.cc.

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

39  {
40 
41  //Retrieve tracker topology from geometry
43  es.get<TrackerTopologyRcd>().get(tTopoHandle);
44  const TrackerTopology* const tTopo = tTopoHandle.product();
45 
46  ModMEs CondObj_ME;
47 
48  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
49  detIter_!= selectedDetIds.end();detIter_++){
50 
51  fillMEsForDet(CondObj_ME,*detIter_,tTopo);
52 
53  }
54 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
T get() const
Definition: EventSetup.h:62
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 80 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.

80  {
81 
82  //Retrieve tracker topology from geometry
84  es.get<TrackerTopologyRcd>().get(tTopoHandle);
85  const TrackerTopology* const tTopo = tTopoHandle.product();
86 
87  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
88  detIter_!= selectedDetIds.end();detIter_++){
89  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_,tTopo);
90  }
91 
92  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){
93 
94  ModMEs selME;
95  selME = iter->second;
96 
97  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){
98 
99  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
100 
101  TCanvas c1("c1");
102  selME.SummaryOfProfileDistr->getTProfile()->Draw();
103  std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
104  name+=".png";
105  c1.Print(name.c_str());
106  }
107  }
108  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
109 
110  TCanvas c1("c1");
111  selME.SummaryDistr->getTH1()->Draw();
112  std::string name (selME.SummaryDistr->getTH1()->GetTitle());
113  name+=".png";
114  c1.Print(name.c_str());
115  }
116 
117  }
118 
119 }
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:62
T const * product() const
Definition: ESHandle.h:86
void SiStripPedestalsDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripPedestalsDQM.cc.

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

29  {
30 
31  getConditionObject(eSetup);
33 
34 }
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 30 of file SiStripPedestalsDQM.h.

References edm::EventSetup::get().

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

Member Data Documentation

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