CMS 3D CMS Logo

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.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 }
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 
ZDCQIE10Task::ZDCQIE10Task
ZDCQIE10Task(edm::ParameterSet const &)
Definition: ZDCQIE10Task.cc:4
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
ZDCQIE10Task::_cADC_EChannel
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:28
ZDCQIE10Task::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ZDCQIE10Task.cc:10
mps_fire.i
i
Definition: mps_fire.py:355
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
HcalZDCDetId::HAD
Definition: HcalZDCDetId.h:23
QIE10DataFrame::samples
constexpr int samples() const
total number of samples in the digi
Definition: QIE10DataFrame.h:86
edm::Run
Definition: Run.h:45
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
HcalZDCDetId
Definition: HcalZDCDetId.h:16
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ZDCQIE10Task::_tagQIE10
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:24
QIE10DataFrame::detid
constexpr DetId detid() const
Get the detector id.
Definition: QIE10DataFrame.h:76
ZDCQIE10Task::_cADC_vs_TS_EChannel
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
HcalZDCDetId::RPD
Definition: HcalZDCDetId.h:23
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
cuy.ib
ib
Definition: cuy.py:662
edm::EventSetup
Definition: EventSetup.h:57
ZDCQIE10Task.h
ZDCQIE10Task
Definition: ZDCQIE10Task.h:13
ZDCQIE10Task::_tokQIE10
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:25
alignCSCRings.r
r
Definition: alignCSCRings.py:93
ZDCQIE10Task::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: ZDCQIE10Task.cc:94
QIE10DataFrame
Definition: QIE10DataFrame.h:11
dqm::implementation::IBooker
Definition: DQMStore.h:43
edm::Event
Definition: Event.h:73
HcalZDCDetId::EM
Definition: HcalZDCDetId.h:23
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37