CMS 3D CMS Logo

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

#include <L1TdeStage2EMTF.h>

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

Public Member Functions

 L1TdeStage2EMTF (const edm::ParameterSet &ps)
 
 ~L1TdeStage2EMTF () 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 (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< l1t::RegionalMuonCandBxCollectiondataToken
 
MonitorElementemtfComparenMuonsEvent
 
MonitorElementemtfDataBX
 
MonitorElementemtfDatahwEta
 
MonitorElementemtfDatahwPhi
 
MonitorElementemtfDatahwPt
 
MonitorElementemtfDatahwQual
 
MonitorElementemtfEmulBX
 
MonitorElementemtfEmulhwEta
 
MonitorElementemtfEmulhwPhi
 
MonitorElementemtfEmulhwPt
 
MonitorElementemtfEmulhwQual
 
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollectionemulToken
 
std::string monitorDir
 
bool verbose
 

Detailed Description

Definition at line 14 of file L1TdeStage2EMTF.h.

Constructor & Destructor Documentation

L1TdeStage2EMTF::L1TdeStage2EMTF ( const edm::ParameterSet ps)

Definition at line 6 of file L1TdeStage2EMTF.cc.

7  : dataToken(consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("dataSource"))),
8  emulToken(consumes<l1t::RegionalMuonCandBxCollection>(ps.getParameter<edm::InputTag>("emulSource"))),
9  monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
10  verbose(ps.getUntrackedParameter<bool>("verbose", false)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > dataToken
std::string monitorDir
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > emulToken
L1TdeStage2EMTF::~L1TdeStage2EMTF ( )
override

Definition at line 12 of file L1TdeStage2EMTF.cc.

12 {}

Member Function Documentation

void L1TdeStage2EMTF::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Definition at line 94 of file L1TdeStage2EMTF.cc.

References BXVector< T >::begin(), dataToken, emtfComparenMuonsEvent, emtfDataBX, emtfDatahwEta, emtfDatahwPhi, emtfDatahwPt, emtfDatahwQual, emtfEmulBX, emtfEmulhwEta, emtfEmulhwPhi, emtfEmulhwPt, emtfEmulhwQual, emulToken, BXVector< T >::end(), MonitorElement::Fill(), edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), and BXVector< T >::size().

94  {
95 
96  if (verbose) edm::LogInfo("L1TdeStage2EMTF") << "L1TdeStage2EMTF: analyze..." << std::endl;
97 
99  e.getByToken(dataToken, dataMuons);
100 
102  e.getByToken(emulToken, emulMuons);
103 
104  emtfComparenMuonsEvent->Fill(dataMuons->size(), emulMuons->size());
105 
106  for (int itBX = dataMuons->getFirstBX(); itBX <= dataMuons->getLastBX(); ++itBX) {
107  for (l1t::RegionalMuonCandBxCollection::const_iterator dataMuon = dataMuons->begin(itBX); dataMuon != dataMuons->end(itBX); ++dataMuon) {
108  emtfDataBX->Fill(itBX);
109  emtfDatahwPt->Fill(dataMuon->hwPt());
110  emtfDatahwEta->Fill(dataMuon->hwEta());
111  emtfDatahwPhi->Fill(dataMuon->hwPhi());
112  emtfDatahwQual->Fill(dataMuon->hwQual());
113  }
114  }
115 
116  for (int itBX = emulMuons->getFirstBX(); itBX <= emulMuons->getLastBX(); ++itBX) {
117  for (l1t::RegionalMuonCandBxCollection::const_iterator emulMuon = emulMuons->begin(itBX); emulMuon != emulMuons->end(itBX); ++emulMuon) {
118  emtfEmulBX->Fill(itBX);
119  emtfEmulhwPt->Fill(emulMuon->hwPt());
120  emtfEmulhwEta->Fill(emulMuon->hwEta());
121  emtfEmulhwPhi->Fill(emulMuon->hwPhi());
122  emtfEmulhwQual->Fill(emulMuon->hwQual());
123  }
124  }
125 }
MonitorElement * emtfEmulhwEta
const_iterator end(int bx) const
MonitorElement * emtfDatahwPhi
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > dataToken
unsigned size(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MonitorElement * emtfDatahwEta
MonitorElement * emtfComparenMuonsEvent
MonitorElement * emtfEmulhwPt
void Fill(long long x)
MonitorElement * emtfDatahwQual
MonitorElement * emtfEmulhwPhi
MonitorElement * emtfDataBX
MonitorElement * emtfEmulhwQual
int getFirstBX() const
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > emulToken
MonitorElement * emtfEmulBX
MonitorElement * emtfDatahwPt
int getLastBX() const
const_iterator begin(int bx) const
std::vector< RegionalMuonCand >::const_iterator const_iterator
Definition: BXVector.h:20
void L1TdeStage2EMTF::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 17 of file L1TdeStage2EMTF.cc.

References stringResolutionProvider_cfi::bin, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), emtfComparenMuonsEvent, emtfDataBX, emtfDatahwEta, emtfDatahwPhi, emtfDatahwPt, emtfDatahwQual, emtfEmulBX, emtfEmulhwEta, emtfEmulhwPhi, emtfEmulhwPt, emtfEmulhwQual, monitorDir, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

17  {
18 
20 
21  emtfComparenMuonsEvent = ibooker.book2D("emtfComparenMuonsEvent", "Number of EMTF Muon Cands per Event", 12, 0, 12, 12, 0, 12);
22  for (int axis = 1; axis <= 2; ++axis) {
23  std::string axisTitle = (axis == 1) ? "Data" : "Emulator";
24  emtfComparenMuonsEvent->setAxisTitle(axisTitle, axis);
25  for (int bin = 1; bin <= 12; ++bin) {
26  std::string binLabel = (bin == 12) ? "Overflow" : std::to_string(bin - 1);
27  emtfComparenMuonsEvent->setBinLabel(bin, binLabel, axis);
28  }
29  }
30 
31  emtfDataBX = ibooker.book1D("emtfDataBX", "EMTF Muon Cand BX", 7, -3, 4);
32  emtfDataBX->setAxisTitle("BX", 1);
33 
34  emtfEmulBX = ibooker.book1D("emtfEmulBX", "EMTF Emulated Muon Cand BX", 7, -3, 4);
35  emtfEmulBX->setAxisTitle("BX", 1);
36 
37  for (int bin = 1, bin_label = -3; bin <= 7; ++bin, ++bin_label) {
38  emtfDataBX->setBinLabel(bin, std::to_string(bin_label), 1);
39  emtfEmulBX->setBinLabel(bin, std::to_string(bin_label), 1);
40  }
41 
42  emtfDatahwPt = ibooker.book1D("emtfDatahwPt", "EMTF Muon Cand p_{T}", 512, 0, 512);
43  emtfDatahwPt->setAxisTitle("Hardware p_{T}", 1);
44 
45  emtfEmulhwPt = ibooker.book1D("emtfEmulhwPt", "EMTF Emulated Muon Cand p_{T}", 512, 0, 512);
46  emtfEmulhwPt->setAxisTitle("Hardware p_{T}", 1);
47 
48  emtfDatahwEta = ibooker.book1D("emtfDatahwEta", "EMTF Muon Cand #eta", 460, -230, 230);
49  emtfDatahwEta->setAxisTitle("Hardware #eta", 1);
50 
51  emtfEmulhwEta = ibooker.book1D("emtfEmulhwEta", "EMTF Emulated Muon Cand #eta", 460, -230, 230);
52  emtfEmulhwEta->setAxisTitle("Hardware #eta", 1);
53 
54  emtfDatahwPhi = ibooker.book1D("emtfDatahwPhi", "EMTF Muon Cand #phi", 125, -20, 105);
55  emtfDatahwPhi->setAxisTitle("Hardware #phi", 1);
56 
57  emtfEmulhwPhi = ibooker.book1D("emtfEmulhwPhi", "EMTF Emulated Muon Cand #phi", 125, -20, 105);
58  emtfEmulhwPhi->setAxisTitle("Hardware #phi", 1);
59 
60  emtfDatahwQual = ibooker.book1D("emtfDatahwQual", "EMTF Muon Cand Quality", 16, 0, 16);
61  emtfDatahwQual->setAxisTitle("Quality", 1);
62 
63  emtfEmulhwQual = ibooker.book1D("emtfEmulhwQual", "EMTF Emulated Muon Cand Quality", 16, 0, 16);
64  emtfEmulhwQual->setAxisTitle("Quality", 1);
65 
66  for (int bin = 1; bin <= 16; ++bin) {
67  emtfDatahwQual->setBinLabel(bin, std::to_string(bin - 1), 1);
68  emtfEmulhwQual->setBinLabel(bin, std::to_string(bin - 1), 1);
69  }
70 
71  // Comparison plots reserved for updated emulator.
72  /*emtfComparehwPt = ibooker.book2D("emtfComparehwPt", "EMTF Muon Cand p_{T}", 512, 0, 512, 512, 0, 512);
73  emtfComparehwPt->setAxisTitle("Hardware p_{T}", 1);
74  emtfComparehwPt->setAxisTitle("Emulator Hardware p_{T}", 2);
75 
76  emtfComparehwEta = ibooker.book2D("emtfComparehwEta", "EMTF Muon Cand #eta", 460, -230, 230, 460, -230, 230);
77  emtfComparehwEta->setAxisTitle("Hardware #eta", 1);
78  emtfComparehwEta->setAxisTitle("Emulator Hardware #eta", 2);
79 
80  emtfComparehwPhi = ibooker.book2D("emtfComparehwPhi", "EMTF Muon Cand #phi", 125, -20, 105, 125, -20, 105);
81  emtfComparehwPhi->setAxisTitle("Hardware #phi", 1);
82  emtfComparehwPhi->setAxisTitle("Emulator Hardware #phi", 2);
83 
84  emtfComparehwQual = ibooker.book2D("emtfComparehwQual", "EMTF Muon Cand Quality", 16, 0, 16, 16, 0, 16);
85  for (int axis = 1; axis <= 2; ++axis) {
86  std::string axisTitle = (axis == 1) ? "Quality" : "Emulator Quality";
87  emtfComparehwQual->setAxisTitle(axisTitle, axis);
88  for (int bin = 1; bin <= 16; ++bin) {
89  emtfComparehwQual->setBinLabel(bin, std::to_string(bin - 1), axis);
90  }
91  }*/
92 }
MonitorElement * emtfEmulhwEta
MonitorElement * emtfDatahwPhi
MonitorElement * emtfDatahwEta
MonitorElement * emtfComparenMuonsEvent
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * emtfEmulhwPt
std::string monitorDir
MonitorElement * emtfDatahwQual
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * emtfEmulhwPhi
MonitorElement * emtfDataBX
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * emtfEmulhwQual
bin
set the eta bin as selection string.
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * emtfEmulBX
MonitorElement * emtfDatahwPt
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void L1TdeStage2EMTF::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 14 of file L1TdeStage2EMTF.cc.

14 {}

Member Data Documentation

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TdeStage2EMTF::dataToken
private

Definition at line 29 of file L1TdeStage2EMTF.h.

Referenced by analyze().

MonitorElement* L1TdeStage2EMTF::emtfComparenMuonsEvent
private

Definition at line 34 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfDataBX
private

Definition at line 36 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfDatahwEta
private

Definition at line 40 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfDatahwPhi
private

Definition at line 42 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfDatahwPt
private

Definition at line 38 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfDatahwQual
private

Definition at line 44 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfEmulBX
private

Definition at line 37 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfEmulhwEta
private

Definition at line 41 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfEmulhwPhi
private

Definition at line 43 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfEmulhwPt
private

Definition at line 39 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TdeStage2EMTF::emtfEmulhwQual
private

Definition at line 45 of file L1TdeStage2EMTF.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TdeStage2EMTF::emulToken
private

Definition at line 30 of file L1TdeStage2EMTF.h.

Referenced by analyze().

std::string L1TdeStage2EMTF::monitorDir
private

Definition at line 31 of file L1TdeStage2EMTF.h.

Referenced by bookHistograms().

bool L1TdeStage2EMTF::verbose
private