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

#include <SiStripPedestalsDQM.h>

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

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

Constructor & Destructor Documentation

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

Definition at line 6 of file SiStripPedestalsDQM.cc.

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

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

Definition at line 18 of file SiStripPedestalsDQM.cc.

18 {}

Member Function Documentation

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

Implements SiStripBaseCondObjDQM.

Definition at line 51 of file SiStripPedestalsDQM.cc.

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

Referenced by fillModMEs().

51  {
52 
53  getModMEs(selModME_,selDetId_);
54 
55  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
56  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
57 
58  for( int istrip=0;istrip<nStrip;++istrip){
59  try{
60  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
61  selModME_.ProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
62  }
63  }
64  catch(cms::Exception& e){
65  edm::LogError("SiStripPedestalsDQM")
66  << "[SiStripPedestalsDQM::fillMEsForDet] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "
67  << istrip
68  << " and detid "
69  << selDetId_
70  << " : "
71  << e.what() ;
72  }
73  }// istrip
74 
75 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
virtual char const * what() const
Definition: Exception.cc:97
edm::ESHandle< SiStripPedestals > pedestalHandle_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
std::pair< ContainerIterator, ContainerIterator > Range
SiStripDetInfoFileReader * reader
void SiStripPedestalsDQM::fillMEsForLayer ( std::map< uint32_t, ModMEs selModMEsMap_,
uint32_t  selDetId_ 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 122 of file SiStripPedestalsDQM.cc.

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

Referenced by fillSummaryMEs().

122  {
123 
124  // ----
125  int subdetectorId_ = ((selDetId_>>25)&0x7);
126 
127  if( subdetectorId_<3 || subdetectorId_>6 ){
128  edm::LogError("SiStripPedestalsDQM")
129  << "[SiStripPedestalsDQM::fillMEsForLayer] WRONG INPUT : no such subdetector type : "
130  << subdetectorId_ << " no folder set!"
131  << std::endl;
132  return;
133  }
134  // ----
135 
136 // // Cumulative distribution with average Ped value on a layer (not needed):
137 
138  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ = selMEsMap_.find(getLayerNameAndId(selDetId_).second);
139  ModMEs selME_;
140  selME_ =selMEsMapIter_->second;
141  getSummaryMEs(selME_,selDetId_);
142 
143  SiStripPedestals::Range pedRange = pedestalHandle_->getRange(selDetId_);
144 
145  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
146 
148 
149  if(hPSet_.getParameter<bool>("FillSummaryProfileAtLayerLevel")){
150 
151  // --> profile summary
152 
153  std::string hSummaryOfProfile_description;
154  hSummaryOfProfile_description = hPSet_.getParameter<std::string>("SummaryOfProfile_description");
155 
156  std::string hSummaryOfProfile_name;
157 
158 
159  hSummaryOfProfile_name = hidmanager.createHistoLayer(hSummaryOfProfile_description,
160  "layer",
161  getLayerNameAndId(selDetId_).first,
162  "") ;
163 
164  for( int istrip=0;istrip<nStrip;++istrip){
165 
166  try{
167  if( CondObj_fillId_ =="onlyProfile" || CondObj_fillId_ =="ProfileAndCumul"){
168  selME_.SummaryOfProfileDistr->Fill(istrip+1,pedestalHandle_->getPed(istrip,pedRange));
169  }
170  }
171  catch(cms::Exception& e){
172  edm::LogError("SiStripPedestalsDQM")
173  << "[SiStripPedestalsDQM::fillMEsForLayer] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "
174  << istrip
175  << " and detid "
176  << selDetId_
177  << " : "
178  << e.what() ;
179  }
180 
181  //fill the TkMap
182  if(fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")){
183  fillTkMap(selDetId_, pedestalHandle_->getPed(istrip,pedRange));
184  }
185 
186  }// istrip
187  }//if Fill ...
188 
189  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")){
190 
191  // --> summary
192 
193  std::string hSummary_description;
194  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
195 
196  std::string hSummary_name;
197  hSummary_name = hidmanager.createHistoLayer(hSummary_description,
198  "layer",
199  getLayerNameAndId(selDetId_).first,
200  "") ;
201  float meanPedestal=0;
202 
203  for( int istrip=0;istrip<nStrip;++istrip){
204 
205  try{
206  meanPedestal = meanPedestal + pedestalHandle_->getPed(istrip,pedRange);
207  }
208  catch(cms::Exception& e){
209  edm::LogError("SiStripNoisesDQM")
210  << "[SiStripNoisesDQM::fillMEsForLayer] cms::Exception accessing pedestalHandle_->getPed(istrip,pedRange) for strip "
211  << istrip
212  << "and detid "
213  << selDetId_
214  << " : "
215  << e.what() ;
216  }
217 
218  }//istrip
219 
220  meanPedestal = meanPedestal/nStrip;
221 
222 
223  // -----
224  // get detIds belonging to same layer to fill X-axis with detId-number
225 
226  std::vector<uint32_t> sameLayerDetIds_;
227 
228  sameLayerDetIds_.clear();
229 
230  sameLayerDetIds_=GetSameLayerDetId(activeDetIds,selDetId_);
231 
232 
233  unsigned int iBin=0;
234  for(unsigned int i=0;i<sameLayerDetIds_.size();i++){
235  if(sameLayerDetIds_[i]==selDetId_){iBin=i+1;}
236  }
237 
238  selME_.SummaryDistr->Fill(iBin,meanPedestal);
239 
240  // Fill the Histo_TkMap with the mean Pedestal:
241  if(HistoMaps_On_ ) Tk_HM_->fill(selDetId_, meanPedestal);
242 
243 
244  }//if Fill ...
245 
246 
247 
248 }
virtual char const * what() const
Definition: Exception.cc:97
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< SiStripPedestals > pedestalHandle_
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::pair< ContainerIterator, ContainerIterator > Range
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
bool first
Definition: L1TdeRCT.cc:79
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 SiStripPedestalsDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 33 of file SiStripPedestalsDQM.cc.

References fillMEsForDet().

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 81 of file SiStripPedestalsDQM.cc.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 23 of file SiStripPedestalsDQM.cc.

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

23  {
24 
25  getConditionObject(eSetup);
26  pedestalHandle_->getDetIds(activeDetIds);
27 
28 }
edm::ESHandle< SiStripPedestals > pedestalHandle_
void getConditionObject(const edm::EventSetup &eSetup)
std::vector< uint32_t > activeDetIds
unsigned long long SiStripPedestalsDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripPedestalsDQM.h.

References edm::EventSetup::get().

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

Member Data Documentation

edm::ESHandle<SiStripPedestals> SiStripPedestalsDQM::pedestalHandle_
private