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

#include <SiStripApvGainsDQM.h>

Inheritance diagram for SiStripApvGainsDQM:
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)
 
 SiStripApvGainsDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripApvGainsDQM ()
 
- 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_
 

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 SiStripApvGainsDQM.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripApvGainsDQM.cc.

References SiStripBaseCondObjDQM::HistoMaps_On_, and SiStripBaseCondObjDQM::Tk_HM_.

10  :SiStripBaseCondObjDQM(eSetup,hPSet, fPSet){
11 
12  // Build the Histo_TkMap:
13  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","MeanApvGain_TkMap",0.);
14 
15 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
SiStripApvGainsDQM::~SiStripApvGainsDQM ( )
virtual

Definition at line 19 of file SiStripApvGainsDQM.cc.

19 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 48 of file SiStripApvGainsDQM.cc.

References SiStripBaseCondObjDQM::CondObj_fillId_, SiStripBaseCondObjDQM::ModMEs::CumulDistr, MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), SiStripBaseCondObjDQM::fPSet_, gainHandle_, SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::hPSet_, SiStripBaseCondObjDQM::ModMEs::ProfileDistr, SiStripBaseCondObjDQM::reader, and cms::Exception::what().

Referenced by fillModMEs().

48  {
49 
50  std::vector<uint32_t> DetIds;
51  gainHandle_->getDetIds(DetIds);
52 
53  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
54 
55  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
56 
57  getModMEs(selModME_,selDetId_);
58 
59  for( int iapv=0;iapv<nApv;++iapv){
60  try{
61  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
62  selModME_.ProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
63  }
64  if( CondObj_fillId_ =="onlyCumul" || CondObj_fillId_ =="ProfileAndCumul"){
65  selModME_.CumulDistr ->Fill(gainHandle_->getApvGain(iapv,gainRange));
66  }
67 
68  // Fill the TkMap
69  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
70  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
71  }
72 
73  }
74  catch(cms::Exception& e){
75  edm::LogError("SiStripApvGainsDQM")
76  << "[SiStripApvGainsDQM::fillMEsForDet] cms::Exception accessing gainHandle_->getApvGain(iapv,gainRange) for apv "
77  << iapv
78  << " and detid "
79  << selDetId_
80  << " : "
81  << e.what() ;
82  }
83  }
84 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
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
void fillTkMap(const uint32_t &detid, const float &value)
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripApvGain > gainHandle_
void SiStripApvGainsDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 120 of file SiStripApvGainsDQM.cc.

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

Referenced by fillSummaryMEs().

120  {
121 
122  int subdetectorId_ = ((selDetId_>>25)&0x7);
123 
124  if( subdetectorId_<3 ||subdetectorId_>6 ){
125  edm::LogError("SiStripApvGainsDQM")
126  << "[SiStripApvGainsDQM::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  SiStripApvGain::Range gainRange = gainHandle_->getRange(selDetId_);
139  int nApv = reader->getNumberOfApvsAndStripLength(selDetId_).first;
140 
141  float meanApvGain=0;
142 
144 
145  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
146 
147  // --> profile summary
148  std::string hSummaryOfProfile_description;
149  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
150 
151  std::string hSummaryOfProfile_name;
152  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
153  "layer",
154  getLayerNameAndId(selDetId_).first, "") ;
155 
156  for( int iapv=0;iapv<nApv;++iapv){
157 
158  try{
159  meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
160  selME_.SummaryOfProfileDistr->Fill(iapv+1,gainHandle_->getApvGain(iapv,gainRange));
161  }
162  catch(cms::Exception& e){
163  edm::LogError("SiStripApvGainsDQM")
164  << "[SiStripApvGainsDQM::fillMEsForLayer] cms::Exception accessing gainHandle_->getApvGain(istrip,gainRange) for strip "
165  << iapv
166  << " and detid "
167  << selDetId_
168  << " : "
169  << e.what() ;
170  }
171 
172  // Fill the TkMap
173  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
174  fillTkMap(selDetId_, gainHandle_->getApvGain(iapv,gainRange));
175  }
176 
177  }// iapv
178 
179  meanApvGain = meanApvGain/nApv;
180 
181  // Fill the TkHistoMap with meanApvgain:
182  if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
183 
184  }//if Fill ...
185 
186 
187  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
188 
189  // --> summary
190  std::string hSummary_description;
191  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
192 
193  std::string hSummary_name;
194  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
195  "layer",
196  getLayerNameAndId(selDetId_).first,
197  "") ;
198 
199 
200  // get detIds belonging to same layer to fill X-axis with detId-number
201 
202  std::vector<uint32_t> sameLayerDetIds_;
203 
204  sameLayerDetIds_.clear();
205 
206  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
207 
208  unsigned int iBin=0;
209  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
210  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
211  }
212 
213  for( int iapv=0;iapv<nApv;++iapv){
214  try{
215  meanApvGain = meanApvGain +gainHandle_ ->getApvGain(iapv,gainRange);
216  selME_.SummaryDistr->Fill(iBin,gainHandle_->getApvGain(iapv,gainRange));
217  }
218  catch(cms::Exception& e){
219  edm::LogError("SiApvGainsDQM")
220  << "[SiStripApvGainsDQM::fillMEsForLayer] cms::Exception accessing noiseHandle_->gainHandle_->getApvGain(iapv,gainRange) for apv "
221  << iapv
222  << "and detid "
223  << selDetId_
224  << " : "
225  << e.what() ;
226  }
227  }//iapv
228  meanApvGain = meanApvGain/nApv;
229 
230  // Fill the TkHistoMap with meanApvgain:
231  // if(HistoMaps_On_ ) Tk_HM_->setBinContent(selDetId_, meanApvGain);
232 
233  }//if Fill ...
234 }
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)
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
SiStripDetInfoFileReader * reader
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripApvGain > gainHandle_
bool first
Definition: L1TdeRCT.cc:79
void setBinContent(uint32_t &detid, float value)
Definition: TkHistoMap.cc:146
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 SiStripApvGainsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 36 of file SiStripApvGainsDQM.cc.

References fillMEsForDet().

36  {
37 
38  ModMEs CondObj_ME;
39 
40  for(std::vector<uint32_t>::const_iterator detIter_ =selectedDetIds.begin();
41  detIter_!=selectedDetIds.end();++detIter_){
42  fillMEsForDet(CondObj_ME,*detIter_);
43  }
44 }
void fillMEsForDet(ModMEs selModME_, uint32_t selDetId_)
void SiStripApvGainsDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 87 of file SiStripApvGainsDQM.cc.

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTProfile(), SiStripBaseCondObjDQM::hPSet_, mergeVDriftHistosByStation::name, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::ModMEs::SummaryOfProfileDistr.

87  {
88 
89  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
90  detIter_!= selectedDetIds.end();detIter_++){
91  fillMEsForLayer(SummaryMEsMap_, *detIter_);
92  }
93 
94  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){
95 
96  ModMEs selME;
97  selME = iter->second;
98 
99  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryProfileAtLayerLevelAsImage")){
100 
101  TCanvas c1("c1");
102  selME.SummaryOfProfileDistr->getTProfile()->Draw();
103  std::string name (selME.SummaryOfProfileDistr->getTProfile()->GetTitle());
104  name+=".png";
105  c1.Print(name.c_str());
106  }
107  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
108 
109  TCanvas c1("c1");
110  selME.SummaryDistr->getTH1()->Draw();
111  std::string name (selME.SummaryDistr->getTH1()->GetTitle());
112  name+=".png";
113  c1.Print(name.c_str());
114  }
115  }
116 
117 }
T getParameter(std::string const &) const
void fillMEsForLayer(std::map< uint32_t, ModMEs > selModMEsMap_, uint32_t selDetId_)
std::map< uint32_t, ModMEs > SummaryMEsMap_
void SiStripApvGainsDQM::getActiveDetIds ( const edm::EventSetup eSetup)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripApvGainsDQM.cc.

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

24  {
25 
26  getConditionObject(eSetup);
27  gainHandle_->getDetIds(activeDetIds);
28 
29 }
void getConditionObject(const edm::EventSetup &eSetup)
edm::ESHandle< SiStripApvGain > gainHandle_
std::vector< uint32_t > activeDetIds
unsigned long long SiStripApvGainsDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 32 of file SiStripApvGainsDQM.h.

References edm::EventSetup::get().

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

Implements SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripApvGainsDQM.h.

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

Referenced by getActiveDetIds().

34  {
35  eSetup.get<SiStripApvGainRcd>().get(gainHandle_);
37  }
unsigned long long cacheID_memory
edm::ESHandle< SiStripApvGain > gainHandle_
const T & get() const
Definition: EventSetup.h:55
unsigned long long cacheID_current

Member Data Documentation

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