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 (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_
 

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_, 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 ( const ModMEs selModME_,
uint32_t  selDetId_,
const TrackerTopology tTopo 
)
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, and SiStripBaseCondObjDQM::reader.

36  {
37  ModMEs selModME_ = _selModME_;
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_, tTopo);
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) ? gainHandle_ ->getStripGain(istrip,gainRange) : 1.;
58  else
59  gainFactor=1;
60 
61  stripnoise=noiseHandle_->getNoise(istrip,noiseRange)/gainFactor;
62  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
63  selModME_.ProfileDistr->Fill(istrip+1,stripnoise);
64  }
65  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
66  selModME_.CumulDistr->Fill(stripnoise);
67  }
68  } //istrip
69 
70 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripNoises > noiseHandle_
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
edm::ESHandle< SiStripApvGain > gainHandle_
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:44
void SiStripNoisesDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 78 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(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, SiStripBaseCondObjDQM::ModMEs::SummaryOfCumulDistr, SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr, SiStripBaseCondObjDQM::Tk_HM_, and SiStripBaseCondObjDQM::tkMapScaler.

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