CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ZDCQIE10Task Class Reference

#include <ZDCQIE10Task.h>

Inheritance diagram for ZDCQIE10Task:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ZDCQIE10Task (edm::ParameterSet const &)
 
 ~ZDCQIE10Task () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 

Protected Attributes

std::map< uint32_t, MonitorElement * > _cADC_EChannel
 
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
 
edm::InputTag _tagQIE10
 
edm::EDGetTokenT< QIE10DigiCollection_tokQIE10
 

Detailed Description

Definition at line 13 of file ZDCQIE10Task.h.

Constructor & Destructor Documentation

ZDCQIE10Task::ZDCQIE10Task ( edm::ParameterSet const &  ps)

Definition at line 4 of file ZDCQIE10Task.cc.

References _tagQIE10, _tokQIE10, and edm::ParameterSet::getUntrackedParameter().

4  {
5  // tags
6  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10", edm::InputTag("hcalDigis", "ZDC"));
7  _tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
8 }
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:24
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:25
ZDCQIE10Task::~ZDCQIE10Task ( )
inlineoverride

Definition at line 16 of file ZDCQIE10Task.h.

References analyze(), and bookHistograms().

16 {}

Member Function Documentation

void ZDCQIE10Task::analyze ( edm::Event const &  e,
edm::EventSetup const &   
)
overrideprotected

Definition at line 94 of file ZDCQIE10Task.cc.

References _cADC_EChannel, _cADC_vs_TS_EChannel, _tagQIE10, _tokQIE10, ecalMGPA::adc(), edm::DataFrameContainer::begin(), DEFINE_FWK_MODULE, QIE10DataFrame::detid(), edm::DataFrameContainer::end(), edm::Event::getByToken(), mps_fire::i, edm::InputTag::instance(), edm::InputTag::label(), and QIE10DataFrame::samples().

Referenced by ~ZDCQIE10Task().

94  {
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 }
int samples() const
total number of samples in the digi
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:24
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:25
const_iterator begin() const
DetId detid() const
Get the detector id.
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:29
std::string const & label() const
Definition: InputTag.h:36
const_iterator end() const
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:28
std::string const & instance() const
Definition: InputTag.h:37
void ZDCQIE10Task::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 10 of file ZDCQIE10Task.cc.

References _cADC_EChannel, _cADC_vs_TS_EChannel, DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), HcalZDCDetId::EM, HcalZDCDetId::HAD, HcalZDCDetId::RPD, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~ZDCQIE10Task().

10  {
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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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.book1D(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 }
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:29
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:28

Member Data Documentation

std::map<uint32_t, MonitorElement*> ZDCQIE10Task::_cADC_EChannel
protected

Definition at line 28 of file ZDCQIE10Task.h.

Referenced by analyze(), and bookHistograms().

std::map<uint32_t, MonitorElement*> ZDCQIE10Task::_cADC_vs_TS_EChannel
protected

Definition at line 29 of file ZDCQIE10Task.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag ZDCQIE10Task::_tagQIE10
protected

Definition at line 24 of file ZDCQIE10Task.h.

Referenced by analyze(), and ZDCQIE10Task().

edm::EDGetTokenT<QIE10DigiCollection> ZDCQIE10Task::_tokQIE10
protected

Definition at line 25 of file ZDCQIE10Task.h.

Referenced by analyze(), and ZDCQIE10Task().