CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ZDCQIE10Task.cc
Go to the documentation of this file.
1 
3 
5  // tags
6  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10", edm::InputTag("hcalDigis", "ZDC"));
7  _tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
8 }
9 
11  ib.cd();
12 
13  //book histos per channel
14  std::string histoname;
15  for (int channel = 1; channel < 6; channel++) {
16  // EM Pos
17  HcalZDCDetId didp(HcalZDCDetId::EM, true, channel);
18  histoname = "EM_P_" + std::to_string(channel) + "_1";
19  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
20  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
21  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
22  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
23  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
24  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
25  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
26  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
27 
28  // EM Minus
29  HcalZDCDetId didm(HcalZDCDetId::EM, false, channel);
30  histoname = "EM_M_" + std::to_string(channel) + "_1";
31  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
32  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
33  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
34  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
35  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
36  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
37  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
38  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
39  }
40 
41  for (int channel = 1; channel < 5; channel++) {
42  // HAD Pos
43  HcalZDCDetId didp(HcalZDCDetId::HAD, true, channel);
44  histoname = "HAD_P_" + std::to_string(channel) + "_" + std::to_string(channel + 2);
45  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
46  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
47  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
48  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
49  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
50  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
51  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
52  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
53 
54  // HAD Minus
55  HcalZDCDetId didm(HcalZDCDetId::HAD, false, channel);
56  histoname = "HAD_M_" + std::to_string(channel) + "_" + std::to_string(channel + 2);
57  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
58  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
59  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
60  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
61  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
62  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
63  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
64  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
65  }
66 
67  for (int channel = 1; channel < 17; channel++) {
68  // RPD Pos
69  HcalZDCDetId didp(HcalZDCDetId::RPD, true, channel);
70  histoname = "RPD_P_" + std::to_string(channel) + "_2";
71  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
72  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
73  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
74  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
75  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
76  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
77  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
78  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
79 
80  // RPD Minus
81  HcalZDCDetId didm(HcalZDCDetId::RPD, false, channel);
82  histoname = "RPD_M_" + std::to_string(channel) + "_2";
83  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
84  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
85  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
86  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
87  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
88  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 0, 10);
89  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
90  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
91  }
92 }
93 
94 /* virtual */ void ZDCQIE10Task::analyze(edm::Event const& e, edm::EventSetup const&) {
96  if (!e.getByToken(_tokQIE10, digis))
97  edm::LogError("Collection QIE10DigiCollection for ZDC isn't available" + _tagQIE10.label() + " " +
99 
100  for (auto it = digis->begin(); it != digis->end(); it++) {
101  const QIE10DataFrame digi = static_cast<const QIE10DataFrame>(*it);
102  HcalZDCDetId const& did = digi.detid();
103 
104  for (int i = 0; i < digi.samples(); i++) {
105  // iter over all samples
106  if (_cADC_EChannel.find(did()) != _cADC_EChannel.end()) {
107  _cADC_EChannel[did()]->Fill(digi[i].adc());
108  }
109  if (_cADC_vs_TS_EChannel.find(did()) != _cADC_vs_TS_EChannel.end()) {
110  _cADC_vs_TS_EChannel[did()]->Fill(i, digi[i].adc());
111  }
112  }
113  }
114 }
115 
T getUntrackedParameter(std::string const &, T const &) const
int ib
Definition: cuy.py:661
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
ZDCQIE10Task(edm::ParameterSet const &)
Definition: ZDCQIE10Task.cc:4
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:24
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:25
constexpr DetId detid() const
Get the detector id.
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:155
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ZDCQIE10Task.cc:10
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:29
constexpr int samples() const
total number of samples in the digi
std::string const & label() const
Definition: InputTag.h:36
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:28
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: ZDCQIE10Task.cc:94
std::string const & instance() const
Definition: InputTag.h:37
Definition: Run.h:45
uint16_t *__restrict__ uint16_t const *__restrict__ adc