CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiStripThresholdDQM Class Reference

#include <SiStripThresholdDQM.h>

Inheritance diagram for SiStripThresholdDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (ModMEs selModME_, uint32_t selDetId_)
 
void fillMEsForLayer (std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds)
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds)
 
void getActiveDetIds (const edm::EventSetup &eSetup)
 
unsigned long long getCache (const edm::EventSetup &eSetup)
 
void getConditionObject (const edm::EventSetup &eSetup)
 
 SiStripThresholdDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripThresholdDQM ()
 
- 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_, 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_)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Attributes

edm::ESHandle< SiStripThresholdthresholdHandle_
 
std::string WhichThreshold
 

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_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (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 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_
 
TkHistoMapTk_HM_
 
TkHistoMapTk_HM_H
 
TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 

Detailed Description

Definition at line 13 of file SiStripThresholdDQM.h.

Constructor & Destructor Documentation

SiStripThresholdDQM::SiStripThresholdDQM ( const edm::EventSetup eSetup,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 7 of file SiStripThresholdDQM.cc.

References edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::Tk_HM_H, SiStripBaseCondObjDQM::Tk_HM_L, and WhichThreshold.

9  :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
10  WhichThreshold=hPSet.getParameter<std::string>("WhichThreshold");
11 
12  // Build the Histo_TkMap:
13  if(HistoMaps_On_ ){
14  if(WhichThreshold=="Low") Tk_HM_L = new TkHistoMap("SiStrip/Histo_Map","LowThresh_TkMap",0.);
15  if(WhichThreshold=="High") Tk_HM_H = new TkHistoMap("SiStrip/Histo_Map","HighThresh_TkMap",0.);
16  }
17 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
SiStripThresholdDQM::~SiStripThresholdDQM ( )
virtual

Definition at line 24 of file SiStripThresholdDQM.cc.

24 {}

Member Function Documentation

void SiStripThresholdDQM::fillMEsForDet ( ModMEs  selModME_,
uint32_t  selDetId_ 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 61 of file SiStripThresholdDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, thresholdHandle_, cms::Exception::what(), and WhichThreshold.

Referenced by fillModMEs().

61  {
62 
63  std::vector<uint32_t> DetIds;
64  thresholdHandle_->getDetIds(DetIds);
65 
66 
67  SiStripThreshold::Range ThresholdRange = thresholdHandle_->getRange(selDetId_);
68  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
69 
70 
71  getModMEs(selModME_,selDetId_);
72 
73 
74 
75  for( int istrip=0;istrip<nStrip;++istrip){
76  try{
77  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
78  if(WhichThreshold=="Low")
79  selModME_.ProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getLth());
80  if(WhichThreshold=="High")
81  selModME_.ProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getHth());
82  }
83  }
84  catch(cms::Exception& e){
85  edm::LogError("SiStripThresholdDQM")
86  << "[SiStripThresholdDQM::fillMEsForDet] cms::Exception accessing thresholdHandle_->getData(istrip,ThresholdRange) for strip "
87  << istrip
88  << " and detid "
89  << selDetId_
90  << " : "
91  << e.what() ;
92  }
93  }// istrip
94 
95 
96 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
virtual char const * what() const
Definition: Exception.cc:97
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
edm::ESHandle< SiStripThreshold > thresholdHandle_
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
void SiStripThresholdDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 119 of file SiStripThresholdDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), TkHistoMap::fill(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, SiStripBaseCondObjDQM::reader, edm::second(), SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, thresholdHandle_, SiStripBaseCondObjDQM::Tk_HM_H, SiStripBaseCondObjDQM::Tk_HM_L, cms::Exception::what(), and WhichThreshold.

Referenced by fillSummaryMEs().

119  {
120 
121  // ----
122  int subdetectorId_ = ((selDetId_>>25)&0x7);
123 
124  if( subdetectorId_<3 || subdetectorId_>6 ){
125  edm::LogError("SiStripThresholdDQM")
126  << "[SiStripThresholdDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
127  << subdetectorId_ << " no folder set!"
128  << std::endl;
129  return;
130  }
131  // ----
132 
133  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second);
134  ModMEs selME_;
135  selME_ =selMEsMapIter_->second;
136  getSummaryMEs(selME_,selDetId_);
137 
138 
139  SiStripThreshold::Range ThresholdRange = thresholdHandle_->getRange(selDetId_);
140 
141  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
142 
144 
145 
146  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
147  // --> profile summary
148 
149  std::string hSummaryOfProfile_description;
150  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
151 
152  std::string hSummaryOfProfile_name;
153 
154  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description, "layer", getLayerNameAndId(selDetId_).first, "") ;
155 
156 
157 
158  for( int istrip=0;istrip<nStrip;++istrip){
159 
160  try{
161  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
162  if(WhichThreshold=="Low"){
163  selME_.SummaryOfProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getLth());
164  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) fillTkMap(selDetId_, thresholdHandle_->getData(istrip,ThresholdRange).getLth());
165  }
166  if(WhichThreshold=="High"){
167  selME_.SummaryOfProfileDistr->Fill(istrip+1,thresholdHandle_->getData(istrip,ThresholdRange).getHth());
168  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) fillTkMap(selDetId_, thresholdHandle_->getData(istrip,ThresholdRange).getHth());
169  }
170  }
171  }
172  catch(cms::Exception& e){
173  edm::LogError("SiStripThresholdDQM")
174  << "[SiStripThresholdDQM::fillMEsForLayer] cms::Exception accessing thresholdHandle_->getData(istrip,ThresholdRange) for strip "
175  << istrip
176  << " and detid "
177  << selDetId_
178  << " : "
179  << e.what() ;
180  }
181  }// istrip
182 
183 
184 
185  }//if Fill
186 
187 
188 
189  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
190 
191  // --> summary
192 
193  std::string hSummary_description;
194  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
195 
196  std::string hSummary_name;
197  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
198  "layer",
199  getLayerNameAndId(selDetId_).first,
200  "") ;
201 
202 
203  float meanLowThreshold=0;
204  float meanHighThreshold=0;
205 
206  for( int istrip=0;istrip<nStrip;++istrip){
207 
208  try{
209  meanLowThreshold = meanLowThreshold + thresholdHandle_->getData(istrip,ThresholdRange).getLth();
210  meanHighThreshold = meanHighThreshold + thresholdHandle_->getData(istrip,ThresholdRange).getHth();
211  }
212  catch(cms::Exception& e){
213  edm::LogError("SiStripNoisesDQM")
214  << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing thresholdHandle_->getThreshold(istrip,ThresholdRange) for strip "
215  << istrip
216  << "and detid "
217  << selDetId_
218  << " : "
219  << e.what() ;
220  }
221 
222  }//istrip
223 
224 
225  meanLowThreshold = meanLowThreshold/nStrip;
226  meanHighThreshold = meanHighThreshold/nStrip;
227 
228 
229  // -----
230  // get detIds belonging to same layer to fill X-axis with detId-number
231 
232  std::vector<uint32_t> sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
233 
234  unsigned int iBin=0;
235  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
236  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
237  }
238 
239  if(WhichThreshold=="Low"){
240  selME_.SummaryDistr->Fill(iBin,meanLowThreshold);
241  if(HistoMaps_On_ ) Tk_HM_L->fill(selDetId_, meanLowThreshold);
242  }
243  if(WhichThreshold=="High"){
244  selME_.SummaryDistr->Fill(iBin,meanHighThreshold);
245  if(HistoMaps_On_ )Tk_HM_H->fill(selDetId_, meanHighThreshold);
246  }
247 
248  }//if Fill ...
249 
250 
251 
252 }
virtual char const * what() const
Definition: Exception.cc:97
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::vector< uint32_t > GetSameLayerDetId(std::vector< uint32_t > activeDetIds, uint32_t selDetId)
edm::ESHandle< SiStripThreshold > thresholdHandle_
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
SiStripDetInfoFileReader * reader
void fill(uint32_t &detid, float value)
Definition: TkHistoMap.cc:130
bool first
Definition: L1TdeRCT.cc:79
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
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_)
void SiStripThresholdDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 40 of file SiStripThresholdDQM.cc.

References fillMEsForDet().

40  {
41 
42  ModMEs CondObj_ME;
43 
44 
45  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
46  detIter_!= selectedDetIds.end();detIter_++){
47 
48  fillMEsForDet(CondObj_ME,*detIter_);
49 
50  }
51 }
void fillMEsForDet(ModMEs selModME_, uint32_t selDetId_)
void SiStripThresholdDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 105 of file SiStripThresholdDQM.cc.

References fillMEsForLayer(), and SiStripBaseCondObjDQM::SummaryMEsMap_.

105  {
106 
107  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
108  detIter_!= selectedDetIds.end();detIter_++){
109  fillMEsForLayer(SummaryMEsMap_, *detIter_);
110 
111  }
112 
113 }
void fillMEsForLayer(std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
std::map< uint32_t, ModMEs > SummaryMEsMap_
void SiStripThresholdDQM::getActiveDetIds ( const edm::EventSetup eSetup)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripThresholdDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, getConditionObject(), and thresholdHandle_.

29  {
30 
31  getConditionObject(eSetup);
32  thresholdHandle_->getDetIds(activeDetIds);
33 }
edm::ESHandle< SiStripThreshold > thresholdHandle_
std::vector< uint32_t > activeDetIds
void getConditionObject(const edm::EventSetup &eSetup)
unsigned long long SiStripThresholdDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripThresholdDQM.h.

References edm::EventSetup::get().

31 { return eSetup.get<SiStripThresholdRcd>().cacheIdentifier();}
const T & get() const
Definition: EventSetup.h:55
void SiStripThresholdDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual

Member Data Documentation

edm::ESHandle<SiStripThreshold> SiStripThresholdDQM::thresholdHandle_
private
std::string SiStripThresholdDQM::WhichThreshold
private

Definition at line 40 of file SiStripThresholdDQM.h.

Referenced by fillMEsForDet(), fillMEsForLayer(), and SiStripThresholdDQM().