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().

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

Definition at line 17 of file ZDCQIE10Task.h.

References analyze(), and bookHistograms().

17 {}

Member Function Documentation

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

Definition at line 101 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().

102 {
104  if (!e.getByToken(_tokQIE10, digis))
105  edm::LogError("Collection QIE10DigiCollection for ZDC isn't available"
106  + _tagQIE10.label() + " " + _tagQIE10.instance());
107 
108  for ( auto it = digis->begin(); it != digis->end(); it++ ) {
109  const QIE10DataFrame digi = static_cast<const QIE10DataFrame>(*it);
110  HcalZDCDetId const& did = digi.detid();
111 
112  for ( int i = 0; i < digi.samples(); i++ ) {
113  // iter over all samples
114  if ( _cADC_EChannel.find( did()) != _cADC_EChannel.end() ) {
115  _cADC_EChannel[did()]->Fill(digi[i].adc());
116  }
117  if ( _cADC_vs_TS_EChannel.find( did() ) != _cADC_vs_TS_EChannel.end() ) {
118  _cADC_vs_TS_EChannel[did()]->Fill(i, digi[i].adc());
119  }
120 
121  }
122  }
123 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:31
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:26
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:27
const_iterator begin() const
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:30
DetId detid() const
Get the detector id.
std::string const & label() const
Definition: InputTag.h:36
const_iterator end() const
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 12 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().

14 {
15 
16  ib.cd();
17 
18  //book histos per channel
19  std::string histoname;
20  for ( int channel = 1; channel < 6; channel++ ) {
21  // EM Pos
22  HcalZDCDetId didp(HcalZDCDetId::EM, true, channel);
23  histoname = "EM_P_" + std::to_string(channel) + "_1";
24  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
25  _cADC_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
26  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
27  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
28  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
29  _cADC_vs_TS_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
30  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
31  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
32 
33  // EM Minus
34  HcalZDCDetId didm(HcalZDCDetId::EM, false, channel);
35  histoname = "EM_M_" + std::to_string(channel) + "_1";
36  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
37  _cADC_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
38  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
39  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
40  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
41  _cADC_vs_TS_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
42  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
43  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
44  }
45 
46  for ( int channel = 1; channel < 5; channel++ ) {
47  // HAD Pos
48  HcalZDCDetId didp(HcalZDCDetId::HAD, true, channel);
49  histoname = "HAD_P_" + std::to_string(channel) + "_" + std::to_string(channel+2);
50  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
51  _cADC_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
52  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
53  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
54  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
55  _cADC_vs_TS_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
56  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
57  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
58 
59  // HAD Minus
60  HcalZDCDetId didm(HcalZDCDetId::HAD, false, channel);
61  histoname = "HAD_M_" + std::to_string(channel) + "_" + std::to_string(channel+2);
62  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
63  _cADC_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
64  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
65  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
66  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
67  _cADC_vs_TS_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
68  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
69  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
70  }
71 
72  for ( int channel = 1; channel < 17; channel++ ) {
73  // RPD Pos
74  HcalZDCDetId didp(HcalZDCDetId::RPD, true, channel);
75  histoname = "RPD_P_" + std::to_string(channel) + "_2";
76  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
77  _cADC_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
78  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
79  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
80  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
81  _cADC_vs_TS_EChannel[didp()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
82  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
83  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
84 
85  // RPD Minus
86  HcalZDCDetId didm(HcalZDCDetId::RPD, false, channel);
87  histoname = "RPD_M_" + std::to_string(channel) + "_2";
88  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
89  _cADC_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
90  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
91  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
92  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
93  _cADC_vs_TS_EChannel[didm()] = ib.book1D( histoname.c_str(), histoname.c_str(), 10, 0, 10);
94  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
95  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
96  }
97 
98 }
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:31
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:30
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106

Member Data Documentation

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

Definition at line 30 of file ZDCQIE10Task.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 31 of file ZDCQIE10Task.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag ZDCQIE10Task::_tagQIE10
protected

Definition at line 26 of file ZDCQIE10Task.h.

Referenced by analyze(), and ZDCQIE10Task().

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

Definition at line 27 of file ZDCQIE10Task.h.

Referenced by analyze(), and ZDCQIE10Task().