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