CMS 3D CMS Logo

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