test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripBaselineValidator.cc
Go to the documentation of this file.
1 // Original Author: Ivan Amos Cali
2 // Created: Mon Jul 28 14:10:52 CEST 2008
3 //
4 //
5 
6 
7 // system include files
8 #include <memory>
9 #include <iostream>
10 
11 // user include files
21 
22 
23 //ROOT inclusion
24 #include "TH1F.h"
25 #include "TH2F.h"
26 #include "TString.h"
27 #include <cassert>
28 #include <fstream>
29 
30 class TFile;
31 
32 
33 
34 using namespace edm;
35 using namespace std;
36 
38 
39  srcProcessedRawDigi_ = conf.getParameter<edm::InputTag>( "srcProcessedRawDigi" );
40  moduleRawDigiToken_ = consumes<edm::DetSetVector<SiStripRawDigi> >(conf.getParameter<edm::InputTag>( "srcProcessedRawDigi" ) );
41 }
42 
44 {
45 }
46 
48 {
50  ibooker.setCurrentFolder("SiStrip/BaselineValidator");
51 
52  h1NumbadAPVsRes_ = ibooker.book1D("ResAPVs",";#ResAPVs", 100, 1.0, 10001);
53  ibooker.tag(h1NumbadAPVsRes_,1);
54 
55  h1ADC_vs_strip_ = ibooker.book2D("ADCvsAPVs",";ADCvsAPVs", 768,-0.5,767.5, 1023, -0.5, 1022.5);
56  ibooker.tag(h1ADC_vs_strip_,2);
57 
58  return;
59 }
60 
62 {
64  e.getByToken( moduleRawDigiToken_, moduleRawDigi );
65  edm::DetSetVector<SiStripRawDigi>::const_iterator itRawDigis = moduleRawDigi->begin();
66 
67  int NumResAPVs=0;
68  for (; itRawDigis != moduleRawDigi->end(); ++itRawDigis) {
69 
70 
72  int strip =0, totADC=0;
73 
74  for(;itRaw != itRawDigis->end(); ++itRaw, ++strip){
75 
76  float adc = itRaw->adc();
77  h1ADC_vs_strip_->Fill(strip,adc);
78 
79 
80 
81  totADC+= adc;
82 
83  if(strip%127 ==0){
84  if(totADC!= 0){
85  totADC =0;
86 
87  NumResAPVs++;
88 
89  }
90  }
91 
92  }
93 
94 
95  }
96 
98 
99  h1NumbadAPVsRes_->Fill(NumResAPVs);
100 
101 
102 
103 }
104 
105 //define this as a plug-in
107 
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
SiStripBaselineValidator(const edm::ParameterSet &)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
tuple conf
Definition: dbtoconf.py:185
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:350
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108
Definition: Run.h:43