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
SiStripNoisesDQM Class Reference

#include <SiStripNoisesDQM.h>

Inheritance diagram for SiStripNoisesDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (ModMEs selModME_, uint32_t selDetId_)
 
void fillMEsForLayer (std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
 
void getActiveDetIds (const edm::EventSetup &eSetup)
 
unsigned long long getCache (const edm::EventSetup &eSetup)
 
void getConditionObject (const edm::EventSetup &eSetup)
 
 SiStripNoisesDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripNoisesDQM ()
 
- 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< SiStripApvGaingainHandle_
 
bool gainRenormalisation_
 
edm::ESHandle< SiStripNoisesnoiseHandle_
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripBaseCondObjDQM
virtual void fillModMEs (const std::vector< uint32_t > &selectedDetIds)
 
virtual void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds)
 
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 14 of file SiStripNoisesDQM.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file SiStripNoisesDQM.cc.

References gainHandle_, gainRenormalisation_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, and SiStripBaseCondObjDQM::Tk_HM_.

11  :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
12  gainRenormalisation_ = hPSet_.getParameter<bool>("GainRenormalisation");
14 
15 
16  // Build the Histo_TkMap:
17  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","MeanNoise_TkMap",0.);
18 
19 }
T getParameter(std::string const &) const
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< SiStripApvGain > gainHandle_
SiStripNoisesDQM::~SiStripNoisesDQM ( )
virtual

Definition at line 23 of file SiStripNoisesDQM.cc.

23 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 36 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, MonitorElement::Fill(), gainHandle_, gainRenormalisation_, SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), noiseHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, and cms::Exception::what().

36  {
37 
38  std::vector<uint32_t> DetIds;
39  noiseHandle_->getDetIds(DetIds);
40 
41  SiStripNoises::Range noiseRange = noiseHandle_->getRange(selDetId_);
42 
43  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
44 
45  getModMEs(selModME_,selDetId_);
46 
47  float gainFactor;
48  float stripnoise;
49 
50  SiStripApvGain::Range gainRange;
52  gainRange = gainHandle_->getRange(selDetId_);
53  }
54 
55  for( int istrip=0;istrip<nStrip;++istrip){
57  gainFactor= gainHandle_ ->getStripGain(istrip,gainRange);
58  else
59  gainFactor=1;
60 
61  try{
62  stripnoise=noiseHandle_->getNoise(istrip,noiseRange)/gainFactor;
63  }catch(cms::Exception& e){
64  edm::LogError("SiStripNoisesDQM")
65  << "[SiStripNoisesDQM::fillMEsForDet] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip "
66  << istrip
67  << " and detid "
68  << selDetId_
69  << " : "
70  << e.what() ;
71  stripnoise=-1.;
72  }
73  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
74  selModME_.ProfileDistr->Fill(istrip+1,stripnoise);
75  }
76  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
77  selModME_.CumulDistr->Fill(stripnoise);
78  }
79  } //istrip
80 }
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
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripNoises > noiseHandle_
edm::ESHandle< SiStripApvGain > gainHandle_
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
void SiStripNoisesDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 88 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), TkHistoMap::fill(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, gainHandle_, gainRenormalisation_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getStringNameAndId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, noiseHandle_, SiStripBaseCondObjDQM::reader, edm::second(), SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_, SiStripBaseCondObjDQM::tkMapScaler, and cms::Exception::what().

88  {
89 
90  // ----
91  int subdetectorId_ = ((selDetId_>>25)&0x7);
92 
93  if( subdetectorId_<3 ||subdetectorId_>6 ){
94  edm::LogError("SiStripNoisesDQM")
95  << "[SiStripNoisesDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
96  << subdetectorId_ << " no folder set!"
97  << std::endl;
98  return;
99  }
100  // ----
101 
102  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second);
103  ModMEs selME_;
104  selME_ =selMEsMapIter_->second;
105  getSummaryMEs(selME_,selDetId_);
106 
107  SiStripNoises::Range noiseRange = noiseHandle_->getRange(selDetId_);
108  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
109  float stripnoise;
110  float meanNoise=0;
111  int Nbadstrips=0;
112 
113  SiStripApvGain::Range gainRange;
115  gainRange = gainHandle_->getRange(selDetId_);
116  }
117  float gainFactor=1;
118 
120 
121  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
122  // --> profile summary
123  std::string hSummaryOfProfile_description;
124  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
125 
126  std::string hSummaryOfProfile_name;
127  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
128  "layer",
129  getLayerNameAndId(selDetId_).first,
130  "") ;
131  }
132  if(hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")){
133  std::string hSummaryOfCumul_description;
134  hSummaryOfCumul_description = hPSet_.getParameter<std::string>("Cumul_description");
135 
136  std::string hSummaryOfCumul_name;
137  hSummaryOfCumul_name = hidmanager.createHistoLayer(hSummaryOfCumul_description, "layer", getStringNameAndId(selDetId_).first, "") ;
138  }
139  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
140  // --> cumul summary
141  std::string hSummary_description;
142  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
143 
144  std::string hSummary_name;
145  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
146  "layer",
147  getLayerNameAndId(selDetId_).first,
148  "") ;
149  }
150 
151  for( int istrip=0;istrip<nStrip;++istrip){
153  gainFactor= gainHandle_ ->getStripGain(istrip,gainRange);
154  } else{
155  gainFactor=1.;
156  }
157 
158  try{
159  stripnoise=noiseHandle_->getNoise(istrip,noiseRange)/gainFactor;
160  meanNoise+=stripnoise;
161  }
162  catch(cms::Exception& e){
163  edm::LogError("SiStripNoisesDQM")
164  << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->getNoise(istrip,noiseRange) for strip "
165  << istrip
166  << " and detid "
167  << selDetId_
168  << " : "
169  << e.what() ;
170  stripnoise=-1;
171  Nbadstrips++;
172  }
173  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
174  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
175  selME_.SummaryOfProfileDistr->Fill(istrip+1,stripnoise);
176  }
177  }
178 
179  if(hPSet_.getParameter<bool>("FillCumulativeSummaryAtLayerLevel")){
180  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
181  selME_.SummaryOfCumulDistr->Fill(stripnoise);
182  }
183  }
184 
185  // Fill the TkMap
186  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
187  fillTkMap(selDetId_, stripnoise);
188  }
189 
190  } //istrip
191 
192  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
193 
194  meanNoise = meanNoise/(nStrip-Nbadstrips);
195  // get detIds belonging to same layer to fill X-axis with detId-number
196 
197  std::vector<uint32_t> sameLayerDetIds_;
198  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
199 
200  std::vector<uint32_t>::const_iterator ibound=lower_bound(sameLayerDetIds_.begin(),sameLayerDetIds_.end(),selDetId_);
201  if(ibound!=sameLayerDetIds_.end() && *ibound==selDetId_)
202  selME_.SummaryDistr->Fill(ibound-sameLayerDetIds_.begin()+1,meanNoise);
203 
204 
205  // Fill the Histo_TkMap with the mean Noise:
206  if(HistoMaps_On_ ){Tk_HM_->fill(selDetId_, meanNoise); }
207 
208 
209  //Check the axis range for tkmap, and in case redefine;
210  int intNoise = int(meanNoise);
211  if(intNoise+1 > (int)tkMapScaler.size()){
212  tkMapScaler.resize(intNoise+1,0);
213  }
214  tkMapScaler[intNoise]++;
215 
216  }
217 
218 
219 }
virtual char const * what() const
Definition: Exception.cc:97
T getParameter(std::string const &) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::vector< uint32_t > GetSameLayerDetId(std::vector< uint32_t > activeDetIds, uint32_t selDetId)
std::vector< int > tkMapScaler
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
std::pair< ContainerIterator, ContainerIterator > Range
bool first
Definition: L1TdeRCT.cc:79
edm::ESHandle< SiStripNoises > noiseHandle_
std::pair< std::string, uint32_t > getStringNameAndId(const uint32_t &detId_)
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
std::vector< uint32_t > activeDetIds
edm::ESHandle< SiStripApvGain > gainHandle_
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
void SiStripNoisesDQM::getActiveDetIds ( const edm::EventSetup eSetup)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripNoisesDQM.cc.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 29 of file SiStripNoisesDQM.h.

References edm::EventSetup::get().

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

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripNoisesDQM.h.

References SiStripBaseCondObjDQM::cacheID_current, SiStripBaseCondObjDQM::cacheID_memory, edm::EventSetup::get(), and noiseHandle_.

Referenced by getActiveDetIds().

31  {
32  eSetup.get<SiStripNoisesRcd>().get(noiseHandle_);
34  }
unsigned long long cacheID_memory
edm::ESHandle< SiStripNoises > noiseHandle_
const T & get() const
Definition: EventSetup.h:55
unsigned long long cacheID_current

Member Data Documentation

edm::ESHandle<SiStripApvGain> SiStripNoisesDQM::gainHandle_
private

Definition at line 39 of file SiStripNoisesDQM.h.

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

bool SiStripNoisesDQM::gainRenormalisation_
private

Definition at line 37 of file SiStripNoisesDQM.h.

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

edm::ESHandle<SiStripNoises> SiStripNoisesDQM::noiseHandle_
private