CMS 3D CMS Logo

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 (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
unsigned long long getCache (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripNoisesDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripNoisesDQM () 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< SiStripApvGaingainHandle_
 
bool gainRenormalisation_
 
edm::ESHandle< SiStripNoisesnoiseHandle_
 
bool simGainRenormalisation_
 

Additional Inherited Members

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

Constructor & Destructor Documentation

SiStripNoisesDQM::SiStripNoisesDQM ( const edm::EventSetup eSetup,
edm::RunNumber_t  iRun,
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_, edm::ESHandle< T >::product(), simGainRenormalisation_, and SiStripBaseCondObjDQM::Tk_HM_.

12  :SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet){
13  gainRenormalisation_ = hPSet_.getParameter<bool>("GainRenormalisation");
14  simGainRenormalisation_ = hPSet_.getParameter<bool>("SimGainRenormalisation");
15  if( gainRenormalisation_ && !simGainRenormalisation_){ eSetup.get<SiStripApvGainRcd>().get(gainHandle_);}
16  if( simGainRenormalisation_){ eSetup.get<SiStripApvGainSimRcd>().get(gainHandle_);}
17 
18 
19  // Build the Histo_TkMap:
20  if ( HistoMaps_On_ ) {
21  edm::ESHandle<TkDetMap> tkDetMapHandle;
22  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
23  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map","MeanNoise_TkMap",0.);
24  }
25 }
T getParameter(std::string const &) const
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
T get() const
Definition: EventSetup.h:62
edm::ESHandle< SiStripApvGain > gainHandle_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripNoisesDQM::~SiStripNoisesDQM ( )
override

Definition at line 29 of file SiStripNoisesDQM.cc.

29 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 42 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, MonitorElement::Fill(), gainHandle_, gainRenormalisation_, SiStripNoises::getDetIds(), SiStripBaseCondObjDQM::getModMEs(), SiStripNoises::getNoise(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripNoises::getRange(), SiStripApvGain::getRange(), SiStripApvGain::getStripGain(), noiseHandle_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, and simGainRenormalisation_.

42  {
43  ModMEs selModME_ = _selModME_;
44  std::vector<uint32_t> DetIds;
45  noiseHandle_->getDetIds(DetIds);
46 
47  SiStripNoises::Range noiseRange = noiseHandle_->getRange(selDetId_);
48 
49  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
50 
51  getModMEs(selModME_,selDetId_, tTopo);
52 
53  float gainFactor;
54  float stripnoise;
55 
56  SiStripApvGain::Range gainRange;
58  gainRange = gainHandle_->getRange(selDetId_);
59  }
60 
61  for( int istrip=0;istrip<nStrip;++istrip){
63  gainFactor= gainHandle_ ->getStripGain(istrip,gainRange) ? gainHandle_ ->getStripGain(istrip,gainRange) : 1.;
64  else
65  gainFactor=1;
66 
67  stripnoise=noiseHandle_->getNoise(istrip,noiseRange)/gainFactor;
68  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
69  selModME_.ProfileDistr->Fill(istrip+1,stripnoise);
70  }
71  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
72  selModME_.CumulDistr->Fill(stripnoise);
73  }
74  } //istrip
75 
76 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:74
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripNoises > noiseHandle_
void getDetIds(std::vector< uint32_t > &DetIds_) const
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
static float getStripGain(uint16_t strip, const Range &range)
const Range getRange(const uint32_t detID) const
edm::ESHandle< SiStripApvGain > gainHandle_
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50
void SiStripNoisesDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 84 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), plotBeamSpotDB::first, SiStripBaseCondObjDQM::fPSet_, gainHandle_, gainRenormalisation_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripNoises::getNoise(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripNoises::getRange(), SiStripApvGain::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getStringNameAndId(), SiStripApvGain::getStripGain(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, createfilelist::int, noiseHandle_, SiStripBaseCondObjDQM::reader, edm::second(), simGainRenormalisation_, AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_, and SiStripBaseCondObjDQM::tkMapScaler.

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

Implements SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripNoisesDQM.cc.

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

34  {
35 
36  getConditionObject(eSetup);
38 
39 }
edm::ESHandle< SiStripNoises > noiseHandle_
void getDetIds(std::vector< uint32_t > &DetIds_) const
void getConditionObject(const edm::EventSetup &eSetup) override
std::vector< uint32_t > activeDetIds
unsigned long long SiStripNoisesDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripNoisesDQM.h.

References edm::EventSetup::get().

28 { return eSetup.get<SiStripNoisesRcd>().cacheIdentifier();}
T get() const
Definition: EventSetup.h:62
void SiStripNoisesDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual

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 36 of file SiStripNoisesDQM.h.

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

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

Definition at line 37 of file SiStripNoisesDQM.h.

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