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)
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo)
 
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_, 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_)
 
 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_
 
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_
 
TkHistoMapTk_HM_
 
TkHistoMapTk_HM_H
 
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::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_, simGainRenormalisation_, and SiStripBaseCondObjDQM::Tk_HM_.

11  :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
12  gainRenormalisation_ = hPSet_.getParameter<bool>("GainRenormalisation");
13  simGainRenormalisation_ = hPSet_.getParameter<bool>("SimGainRenormalisation");
14  if( gainRenormalisation_ && !simGainRenormalisation_){ eSetup.get<SiStripApvGainRcd>().get(gainHandle_);}
15  if( simGainRenormalisation_){ eSetup.get<SiStripApvGainSimRcd>().get(gainHandle_);}
16 
17 
18  // Build the Histo_TkMap:
19  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","MeanNoise_TkMap",0.);
20 
21 }
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 25 of file SiStripNoisesDQM.cc.

25 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 38 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_.

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

Implements SiStripBaseCondObjDQM.

Definition at line 80 of file SiStripNoisesDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripBaseCondObjDQM::CondObj_fillId_, SiStripHistoId::createHistoLayer(), TkHistoMap::fill(), 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.

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

Implements SiStripBaseCondObjDQM.

Definition at line 30 of file SiStripNoisesDQM.cc.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 27 of file SiStripNoisesDQM.h.

References edm::EventSetup::get().

27 { 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 29 of file SiStripNoisesDQM.h.

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

Referenced by getActiveDetIds().

29  {
30  eSetup.get<SiStripNoisesRcd>().get(noiseHandle_);
32  }
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 38 of file SiStripNoisesDQM.h.

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

bool SiStripNoisesDQM::gainRenormalisation_
private

Definition at line 35 of file SiStripNoisesDQM.h.

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

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

Definition at line 36 of file SiStripNoisesDQM.h.

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