CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripMonitorPedestals.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripMonitorPedestals
4 // Class: SiStripMonitorPedestals
5 //
13 //
14 // Original Author: Simone Gennai and Suchandra Dutta
15 // Created: Sat Feb 4 20:49:10 CET 2006
16 // $Id: SiStripMonitorPedestals.cc,v 1.37 2011/09/19 10:56:39 demattia Exp $
17 //
18 //
19 
22 
25 
28 
30 
33 
41 
42 #include "TProfile.h"
43 // std
44 #include <cstdlib>
45 #include <cmath>
46 #include <numeric>
47 #include <algorithm>
48 
49 const std::string SiStripMonitorPedestals::RunMode1 = "ConDBPlotsOnly";
50 const std::string SiStripMonitorPedestals::RunMode2 = "CalculatedPlotsOnly";
51 const std::string SiStripMonitorPedestals::RunMode3 = "AllPlots";
52 
54  dqmStore_(edm::Service<DQMStore>().operator->()),
55  conf_(iConfig),
56  pedsPSet_(iConfig.getParameter<edm::ParameterSet>("PedestalsPSet")),
57  analyzed(false),
59  signalCutPeds_(4),
60  nEvTot_(0),
61  nIteration_(0),
62  apvFactory_(0),
63  m_cacheID_(0)
64 {
65  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals "
66  << " Constructing....... ";
67 }
68 //
69 // -- Destructor
70 //
72 {
73  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals "
74  << " Destructing...... ";
75  if (apvFactory_) {delete apvFactory_;}
76 }
77 //
78 // -- Begin Job
79 //
81  theEventInitNumber_ = pedsPSet_.getParameter<int>("NumberOfEventsForInit");
82  theEventIterNumber_ = pedsPSet_.getParameter<int>("NumberOfEventsForIteration");
83  NumCMstripsInGroup_ = pedsPSet_.getParameter<int>("NumCMstripsInGroup");
84  runTypeFlag_ = conf_.getParameter<std::string>("RunTypeFlag");
85 }
86 //
87 // -- BeginRun
88 //
90 
91  unsigned long long cacheID = eSetup.get<SiStripDetCablingRcd>().cacheIdentifier();
92  if (m_cacheID_ != cacheID) {
93  m_cacheID_ = cacheID;
94  eSetup.get<SiStripDetCablingRcd>().get( detcabling );
95  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::beginRun: "
96  << " Creating MEs for new Cabling ";
97  createMEs();
98  } else {
99  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::beginRun: "
100  << " Resetting MEs ";
101  for (std::map<uint32_t, ModMEs >::const_iterator idet = PedMEs.begin() ; idet!=PedMEs.end() ; idet++) {
102  resetMEs(idet->first);
103  }
104  }
106 }
107 //
108 // -- Create Monitor Elements
109 //
111  std::vector<uint32_t> SelectedDetIds;
112 
113  //ApvAnalysisFactory
114  if (apvFactory_) {delete apvFactory_;}
116 
117  detcabling->addActiveDetectorsRawIds(SelectedDetIds);
118 
119  // use SistripHistoId for producing histogram id (and title)
120  SiStripHistoId hidmanager;
121  // create SiStripFolderOrganizer
122  SiStripFolderOrganizer folder_organizer;
123 
124  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: "
125  << "Number of Detector Present in cabling " << SelectedDetIds.size();
126 
127  for (std::vector<uint32_t>::const_iterator idetid=SelectedDetIds.begin(), iEnd=SelectedDetIds.end();idetid!=iEnd;++idetid){
128 
129  uint32_t detid = *idetid;
130 
131  // Check consistency in DetId
132  if (detid == 0 || detid == 0xFFFFFFFF){
133  edm::LogError("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: "
134  << "Wrong DetId !!!!!! " << detid << " Neglecting !!!!!! ";
135  continue;
136  }
137 
138  unsigned int apv_pairs = detcabling->nApvPairs(detid);
139 
140  // Check consistency in Apv numbers
141  if (apv_pairs < 1 || apv_pairs > 3) {
142  edm::LogError("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: Wrong APV Pairs => detId "
143  << detid << " APV pairs " << apv_pairs << " Neglecting !!!!!! ";
144  continue;
145  }
146  unsigned int napvs = apv_pairs * 2;
147  unsigned int nStrip = napvs * 128;
148 
149  bool newDetId = apvFactory_->instantiateApvs(detid,napvs);
150 
151  if( newDetId ) {
152  ModMEs local_modmes;
153  local_modmes.PedsPerStrip = 0;
154  local_modmes.PedsDistribution = 0;
155  local_modmes.PedsEvolution = 0;
156  local_modmes.CMSubNoisePerStrip = 0;
157  local_modmes.RawNoisePerStrip = 0;
158  local_modmes.CMSubNoiseProfile = 0;
159  local_modmes.RawNoiseProfile = 0;
160  local_modmes.NoisyStrips = 0;
161  local_modmes.NoisyStripDistribution = 0;
162  local_modmes.CMDistribution = 0;
163  local_modmes.CMSlopeDistribution = 0;
164  local_modmes.PedsPerStripDB = 0;
165  local_modmes.CMSubNoisePerStripDB = 0;
166  local_modmes.BadStripsDB = 0;
167 
168  std::string hid;
169  // set appropriate folder using SiStripFolderOrganizer
170  folder_organizer.setDetectorFolder(detid); // pass the detid to this method
171 
172  // if the deid already exists in the map, then reset MEs otherwise create them
173  resetMEs(detid);
174 
175  if (runTypeFlag_ == RunMode1 || runTypeFlag_ == RunMode3 ) {
176  //Pedestals histos
177  hid = hidmanager.createHistoId("PedestalFromCondDB","det", detid);
178  local_modmes.PedsPerStripDB = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5); //to modify the size binning
179  dqmStore_->tag(local_modmes.PedsPerStripDB, detid);
180  (local_modmes.PedsPerStripDB)->setAxisTitle("Pedestal from CondDB(ADC) vs Strip Number",1);
181 
182  hid = hidmanager.createHistoId("NoiseFromCondDB","det", detid);
183  local_modmes.CMSubNoisePerStripDB = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
184  dqmStore_->tag(local_modmes.CMSubNoisePerStripDB, detid);
185  (local_modmes.CMSubNoisePerStripDB)->setAxisTitle("CMSubNoise from CondDB(ADC) vs Strip Number",1);
186 
187  hid = hidmanager.createHistoId("BadStripFlagCondDB","det", detid);
188  local_modmes.BadStripsDB = dqmStore_->book2D(hid, hid, nStrip,0.5,nStrip+0.5,6,-0.5,5.5);
189  dqmStore_->tag(local_modmes.BadStripsDB, detid);
190  (local_modmes.BadStripsDB)->setAxisTitle("Strip Flag from CondDB(ADC) vs Strip Number",1);
191  }
192  if (runTypeFlag_ == RunMode2 || runTypeFlag_ == RunMode3 ) {
193  //Pedestals histos
194  hid = hidmanager.createHistoId("PedsPerStrip","det", detid);
195  local_modmes.PedsPerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5); //to modify the size binning
196  dqmStore_->tag(local_modmes.PedsPerStrip, detid);
197  (local_modmes.PedsPerStrip)->setAxisTitle("Pedestal (ADC) vs Strip Number ",1);
198 
199  hid = hidmanager.createHistoId("PedsDistribution","det", detid);
200  local_modmes.PedsDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 300, 200, 500); //to modify the size binning
201  dqmStore_->tag(local_modmes.PedsDistribution, detid);
202  (local_modmes.PedsDistribution)->setAxisTitle("Apv Number",1);
203  (local_modmes.PedsDistribution)->setAxisTitle("Mean Pedestal Value (ADC)",2);
204 
205  hid = hidmanager.createHistoId("PedsEvolution","det", detid);
206  local_modmes.PedsEvolution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 50, 0., 50.); //to modify the size binning
207  dqmStore_->tag(local_modmes.PedsEvolution, detid);
208  (local_modmes.PedsEvolution)->setAxisTitle("Apv Number",1);
209  (local_modmes.PedsEvolution)->setAxisTitle("Iteration Number",2);
210 
211  //Noise histos
212  hid = hidmanager.createHistoId("CMSubNoisePerStrip","det", detid);
213  local_modmes.CMSubNoisePerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
214  dqmStore_->tag(local_modmes.CMSubNoisePerStrip, detid);
215  (local_modmes.CMSubNoisePerStrip)->setAxisTitle("CMSubNoise (ADC) vs Strip Number",1);
216 
217  hid = hidmanager.createHistoId("RawNoisePerStrip","det", detid);
218  local_modmes.RawNoisePerStrip = dqmStore_->book1D(hid, hid, nStrip,0.5,nStrip+0.5);
219  dqmStore_->tag(local_modmes.RawNoisePerStrip, detid);
220  (local_modmes.RawNoisePerStrip)->setAxisTitle("RawNoise(ADC) vs Strip Number",1);
221 
222  hid = hidmanager.createHistoId("CMSubNoiseProfile","det", detid);
223  local_modmes.CMSubNoiseProfile = dqmStore_->bookProfile(hid, hid, nStrip,0.5,nStrip+0.5, 100, 0., 100.);
224  dqmStore_->tag(local_modmes.CMSubNoiseProfile, detid);
225  (local_modmes.CMSubNoiseProfile)->setAxisTitle("Mean of CMSubNoise (ADC) vs Strip Number",1);
226 
227  hid = hidmanager.createHistoId("RawNoiseProfile","det", detid);
228  local_modmes.RawNoiseProfile = dqmStore_->bookProfile(hid, hid, nStrip,0.5,nStrip+0.5, 100, 0., 100.);
229  dqmStore_->tag(local_modmes.RawNoiseProfile, detid);
230  (local_modmes.RawNoiseProfile)->setAxisTitle("Mean of RawNoise (ADC) vs Strip Number",1);
231 
232  hid = hidmanager.createHistoId("NoisyStrips","det", detid);
233  local_modmes.NoisyStrips = dqmStore_->book2D(hid, hid, nStrip,0.5,nStrip+0.5,6,-0.5,5.5);
234  dqmStore_->tag(local_modmes.NoisyStrips, detid);
235  (local_modmes.NoisyStrips)->setAxisTitle("Strip Number",1);
236  (local_modmes.NoisyStrips)->setAxisTitle("Flag Value",2);
237 
238  hid = hidmanager.createHistoId("NoisyStripDistribution","det", detid);
239  local_modmes.NoisyStripDistribution = dqmStore_->book1D(hid, hid, 11, -0.5,10.5);
240  dqmStore_->tag(local_modmes.NoisyStripDistribution, detid);
241  (local_modmes.NoisyStripDistribution)->setAxisTitle("Flag Value",1);
242 
243  //Common Mode histos
244  hid = hidmanager.createHistoId("CMDistribution","det", detid);
245  local_modmes.CMDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 150, -15., 15.);
246  dqmStore_->tag(local_modmes.CMDistribution, detid);
247  (local_modmes.CMDistribution)->setAxisTitle("Common Mode (ADC) vs APV Number",1);
248 
249  hid = hidmanager.createHistoId("CMSlopeDistribution","det", detid);
250  local_modmes.CMSlopeDistribution = dqmStore_->book2D(hid, hid, napvs,-0.5,napvs-0.5, 100, -0.05, 0.05);
251  dqmStore_->tag(local_modmes.CMSlopeDistribution, detid);
252  (local_modmes.CMSlopeDistribution)->setAxisTitle("Common Mode Slope vs APV Number",1);
253 
254  }
255  // data from CondDB
256  // append to PedMEs
257  PedMEs.insert( std::make_pair(detid, local_modmes));
258  } //newDetId
259 
260  }
261  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::createMEs: Number of DETS used "
262  <<PedMEs.size();
263 }
264 // ------------ method called to produce the data ------------
266 {
267 
268  edm::LogInfo("SiStripMonitorPedestals") <<
269  "SiStripMonitorPedestals::analyze: Run " <<
270  iEvent.id().run() << " Event " << iEvent.id().event();
271 
272  eSetup.get<SiStripDetCablingRcd>().get( detcabling );
273 
274  if (runTypeFlag_ != RunMode2 && runTypeFlag_ != RunMode3 ) return;
275 
276  //Increment # of Events
277  nEvTot_++;
278 
279  // retrieve producer name of input StripDigiCollection
280  std::string digiProducer = conf_.getParameter<std::string>("DigiProducer");
281  // get DigiCollection object from Event
283  std::string digiType = "VirginRaw";
284  //you have a collection as there are all the digis for the event for every detector
285  iEvent.getByLabel(digiProducer, digiType, digi_collection);
286 
287  //Increase the number of iterations ...
289 
290 
291  // loop over all MEs
292  for (std::map<uint32_t, ModMEs >::const_iterator i = PedMEs.begin() ; i!=PedMEs.end() ; i++) {
293  uint32_t detid = i->first; ModMEs local_modmes = i->second;
294  // get iterators for digis belonging to one DetId, it is an iterator, i.e. one element of the vector
295  std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis = digi_collection->find( detid );
296  if (digis == digi_collection->end() ||
297  digis->data.size() == 0 ||
298  digis->data.size() > 768) {
299  if (digis == digi_collection->end()) {
300  edm::LogError("SiStripMonitorPedestals") << " SiStripMonitorPedestals::analyze: Event " << nEvTot_
301  << " DetId " << detid << " at the end of Digi Collection!!!";
302  } else {
303  edm::LogError("SiStripMonitorPedestals") << " [SiStripMonitorPedestals::analyze: Event " << nEvTot_
304  << " DetId " << detid << " # of Digis " << digis->data.size() ;
305  }
306  std::vector<const FedChannelConnection *> fed_conns = detcabling->getConnections(detid);
307  for (unsigned int k = 0; k < fed_conns.size() ; k++) {
308  if (k==0) edm::LogError("SiStripMonitorPedestals") <<" SiStripMonitorPedestals::analyze: Fed Id " <<
309  fed_conns[k]->fedId() << " Channel " << fed_conns[k]->fedCh();
310  else edm::LogError("SiStripMonitorPedestals") <<" SiStripMonitorPedestals::analyze: Channel " <<
311  fed_conns[k]->fedCh();
312  }
313  std::cout << std::endl;
314  continue;
315  }
316 
317  if ( digis->data.empty() ) {
318  edm::LogError("MonitorDigi_tmp") << "[SiStripRawDigiToRaw::createFedBuffers] Zero digis found!";
319  }
320  uint32_t id = detid;
321  // cout <<"Data size "<<digis->data.size()<<endl;
322  apvFactory_->update(id, (*digis));
323 
325  if(local_modmes.CMDistribution != NULL){
326  std::vector<float> tmp;
327  tmp.clear();
328  apvFactory_->getCommonMode(id, tmp);
329  //unpacking the info looking at the right topology
330  int numberCMBlocks = int(128. / NumCMstripsInGroup_);
331  int ibin=0;
332  for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
333  int iapv = int (ibin/numberCMBlocks);
334  (local_modmes.CMDistribution)->Fill(iapv,static_cast<float>(*iped));
335  ibin++;
336 
337  }
338  }
339  if(local_modmes.CMSlopeDistribution != NULL){
340  std::vector<float> tmp;
341  tmp.clear();
342  int iapv = 0;
344  for (std::vector<float>::const_iterator it=tmp.begin(); it!=tmp.end();it++) {
345  (local_modmes.CMSlopeDistribution)->Fill(iapv,static_cast<float>(*it));
346  iapv++;
347  }
348  }
349  }
350 
351  //asking for the status
353  {
354 
355  std::vector<float> tmp;
356  tmp.clear();
357  apvFactory_->getPedestal(id, tmp);
358  if(local_modmes.PedsPerStrip != NULL){
359  int numberOfApvs = int(tmp.size()/128.);
360  for(int i=0; i<numberOfApvs;i++){
361  std::vector<float> myPedPerApv;
362  apvFactory_->getPedestal(id, i, myPedPerApv);
363  float avarage = 0;
364  avarage = accumulate(myPedPerApv.begin(), myPedPerApv.end(), avarage);
365  avarage = avarage/128.;
366  (local_modmes.PedsEvolution)->setBinContent(i+1,nIteration_,avarage);
367 
368  }
369  int ibin=0;
370 
371  for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
372  int napv = int(ibin / 128.);
373  ibin++;
374  float last_value = (local_modmes.PedsPerStrip)->getBinContent(ibin);
375  if(last_value != 0.){
376  (local_modmes.PedsPerStrip)->setBinContent(ibin,(static_cast<float>(*iped) + last_value)/2.);
377  }else{
378  (local_modmes.PedsPerStrip)->setBinContent(ibin,static_cast<float>(*iped));
379  }
380  (local_modmes.PedsDistribution)->Fill(napv,static_cast<float>(*iped));
381  }
382  }
383 
384  if(local_modmes.CMSubNoisePerStrip != NULL && local_modmes.CMSubNoiseProfile != NULL){
385  tmp.clear();
386  apvFactory_->getNoise(id, tmp);
387  int ibin=0;
388  for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
389  ibin++;
390  (local_modmes.CMSubNoiseProfile)->Fill(static_cast<double>(ibin*1.),static_cast<float>(*iped));
391 
392  float last_value = (local_modmes.CMSubNoisePerStrip)->getBinContent(ibin);
393  if(last_value != 0.){
394  (local_modmes.CMSubNoisePerStrip)->setBinContent(ibin,(static_cast<float>(*iped)+last_value)/2.);
395  }else{
396  (local_modmes.CMSubNoisePerStrip)->setBinContent(ibin,static_cast<float>(*iped));
397  }
398  }
399  }
400 
401 
402  if(local_modmes.RawNoisePerStrip != NULL && local_modmes.RawNoiseProfile != NULL){
403  tmp.clear();
404  apvFactory_->getRawNoise(id, tmp);
405  int ibin=0;
406  for (std::vector<float>::const_iterator iped=tmp.begin(); iped!=tmp.end();iped++) {
407  ibin++;
408  (local_modmes.RawNoiseProfile)->Fill(static_cast<double>(ibin*1.),static_cast<float>(*iped));
409  float last_value = (local_modmes.RawNoisePerStrip)->getBinContent(ibin);
410  if(last_value != 0.){
411  (local_modmes.RawNoisePerStrip)->setBinContent(ibin,(static_cast<float>(*iped)+last_value)/2.);
412  }else{
413  (local_modmes.RawNoisePerStrip)->setBinContent(ibin,static_cast<float>(*iped));
414  }
415  }
416  }
417 
418  if(local_modmes.NoisyStrips != NULL){
420  apvFactory_->getMask(id, temp);
421  int ibin=0;
422  for (TkApvMask::MaskType::const_iterator iped=temp.begin(); iped!=temp.end();iped++) {
423  ibin++;
424 
425  if(nIteration_ <2){
426  if(*iped == 1)
427  (local_modmes.NoisyStrips)->Fill(ibin,3.);
428  if(*iped == 2)
429  (local_modmes.NoisyStrips)->Fill(ibin,4.);
430  if(*iped == 0)
431  (local_modmes.NoisyStrips)->Fill(ibin,0.);
432  }else{
433  (local_modmes.NoisyStrips)->Fill(ibin,static_cast<float>(*iped));
434  (local_modmes.NoisyStripDistribution)->Fill(static_cast<float>(*iped));
435  }
436  }
437  }
438 
439 
440  }
441  }
442  if (firstEvent) firstEvent=false;
443 }
444 //
445 // -- End Run
446 //
448  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
449  if (outputMEsInRootFile) {
450  std::string outPutFileName = conf_.getParameter<std::string>("OutPutFileName");
451 // dqmStore_->showDirStructure();
452  dqmStore_->save(outPutFileName);
453  }
454 }
455 //
456 // -- End Job
457 //
459  edm::LogInfo("SiStripMonitorPedestals") <<"SiStripMonitorPedestals::EndJob: "
460  << " Finishing!! ";
461 }
462 //
463 // -- Reset Monitor Elements corresponding to a detetor
464 //
466  std::map<uint32_t, ModMEs >::iterator pos = PedMEs.find(idet);
467  if (pos != PedMEs.end()) {
468  ModMEs mod_me = pos->second;
469 
470  if (runTypeFlag_ == RunMode1 || runTypeFlag_ == RunMode3 ) {
471  mod_me.PedsPerStripDB->Reset();
472  mod_me.CMSubNoisePerStripDB->Reset();
473  mod_me.BadStripsDB->Reset();
474  }
475  if (runTypeFlag_ == RunMode2 || runTypeFlag_ == RunMode3 ) {
476  mod_me.PedsPerStrip->Reset();
477  mod_me.PedsDistribution->Reset();
478  mod_me.PedsEvolution->Reset();
479  mod_me.CMSubNoisePerStrip->Reset();
480  mod_me.RawNoisePerStrip->Reset();
481  mod_me.CMSubNoiseProfile->Reset();
482  mod_me.RawNoiseProfile->Reset();
483  mod_me.NoisyStrips->Reset();
484  mod_me.CMDistribution->Reset();
485  mod_me.CMSlopeDistribution->Reset();
486  }
487  }
488 }
489 //
490 // -- Fill CondDB Monitoring Elements
491 //
493  //get Pedestal and Noise ES handle
494  edm::ESHandle<SiStripPedestals> pedestalHandle;
495  edm::ESHandle<SiStripNoises> noiseHandle;
496  edm::ESHandle<SiStripQuality> qualityHandle;
497 
498  eSetup.get<SiStripPedestalsRcd>().get(pedestalHandle);
499  eSetup.get<SiStripNoisesRcd>().get(noiseHandle);
500  std::string quality_label = conf_.getParameter<std::string>("StripQualityLabel");
501  eSetup.get<SiStripQualityRcd>().get(quality_label, qualityHandle);
502 
503  for (std::map<uint32_t, ModMEs >::const_iterator i = PedMEs.begin() ; i!=PedMEs.end() ; i++) {
504  uint32_t detid = i->first;
505  ModMEs local_modmes = i->second;
506  edm::LogInfo("SiStripMonitorPedestals") <<" SiStripMonitorPedestals::analyze: " <<
507  " Get Ped/Noise/Bad Strips from CondDb for DetId " << detid;
508  int nStrip = detcabling->nApvPairs(detid) * 256;
509  // Get range of pedestal and noise for the detid
510  SiStripNoises::Range noiseRange = noiseHandle->getRange(detid);
511  SiStripPedestals::Range pedRange = pedestalHandle->getRange(detid);
512  SiStripQuality::Range qualityRange = qualityHandle->getRange(detid);
513 
514  for(int istrip=0;istrip<nStrip;++istrip){
515  try{
516  //Fill Pedestals
517  (local_modmes.PedsPerStripDB)->Fill(istrip+1,pedestalHandle->getPed(istrip,pedRange));
518  }
519  catch(cms::Exception& e){
520  edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze] cms::Exception accessing SiStripPedestalsService_.getPedestal("<<detid<<","<<istrip<<") : " << " " << e.what() ;
521  }
522  try{
523  //Fill Noises
524  (local_modmes.CMSubNoisePerStripDB)->Fill(istrip+1,noiseHandle->getNoise(istrip,noiseRange));
525 
526  }
527  catch(cms::Exception& e){
528  edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze] cms::Exception accessing SiStripNoiseService_.getNoise("<<detid<<","<<istrip<<") : " << " " << e.what() ;
529  }
530  try{
531  //Fill BadStripsNoise
532  (local_modmes.BadStripsDB)->Fill(istrip+1,qualityHandle->IsStripBad(qualityRange,istrip)?1.:0.);
533 
534 
535  }
536  catch(cms::Exception& e){
537  edm::LogError("SiStripMonitorPedestals") << "[SiStripMonitorPedestals::analyze] cms::Exception accessing SiStripNoiseService_.getDisable("<<detid<<","<<istrip<<") : " << " " << e.what() ;
538  }
539  }//close istrip loop
540  }
541 }
std::vector< StripMaskType > MaskType
Definition: TkApvMask.h:17
RunNumber_t run() const
Definition: EventID.h:42
virtual void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
virtual char const * what() const
Definition: Exception.cc:141
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
void fillCondDBMEs(edm::EventSetup const &eSetup)
int i
Definition: DBlmapReader.cc:9
edm::ESHandle< SiStripDetCabling > detcabling
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void getPedestal(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
void getCommonModeSlope(uint32_t det_id, ApvAnalysis::PedestalType &tmp)
void getNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
void update(uint32_t det_id, const edm::DetSet< SiStripRawDigi > &in)
void getMask(uint32_t det_id, TkApvMask::MaskType &tmp)
#define NULL
Definition: scimark2.h:8
std::pair< ContainerIterator, ContainerIterator > Range
virtual void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
static const std::string RunMode1
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1354
int iEvent
Definition: GenABIO.cc:243
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static const std::string RunMode3
bool instantiateApvs(uint32_t det_id, int numberOfApvs)
SiStripMonitorPedestals(const edm::ParameterSet &)
ApvAnalysisFactory * apvFactory_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
void setDetectorFolder(uint32_t rawdetid=0)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void getCommonMode(uint32_t det_id, ApvAnalysis::PedestalType &tmp)
int k[5][pyjets_maxn]
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
const T & get() const
Definition: EventSetup.h:55
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:56
std::pair< ContainerIterator, ContainerIterator > Range
static const std::string RunMode2
tuple cout
Definition: gather_cfg.py:121
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< uint32_t, ModMEs > PedMEs
Definition: Run.h:33