Skip to content

Commit

Permalink
apply code format
Browse files Browse the repository at this point in the history
  • Loading branch information
zuoxunwu committed Dec 6, 2021
1 parent 4cba4fa commit 06d5f02
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 77 deletions.
82 changes: 40 additions & 42 deletions DQM/L1TMonitor/src/L1TdeCSCTPGShower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,37 @@ L1TdeCSCTPGShower::L1TdeCSCTPGShower(const edm::ParameterSet& ps)
emulLCTShower_token_(consumes<CSCShowerDigiCollection>(ps.getParameter<edm::InputTag>("emulLCTShower"))),
monitorDir_(ps.getUntrackedParameter<std::string>("monitorDir")) {}



L1TdeCSCTPGShower::~L1TdeCSCTPGShower() {}

void L1TdeCSCTPGShower::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, const edm::EventSetup&) {
iBooker.setCurrentFolder(monitorDir_);

// 2D summary plots
lctShowerDataSummary_denom_ = iBooker.book2D("lct_cscshower_data_summary_denom", "Data LCT Shower All", 36, 1, 37, 18, 0, 18);
lctShowerDataSummary_num_ = iBooker.book2D("lct_cscshower_data_summary_num", "Data LCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);
alctShowerDataSummary_denom_ = iBooker.book2D("alct_cscshower_data_summary_denom", "Data ALCT Shower All", 36, 1, 37, 18, 0, 18);
alctShowerDataSummary_num_ = iBooker.book2D("alct_cscshower_data_summary_num", "Data ALCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);
clctShowerDataSummary_denom_ = iBooker.book2D("clct_cscshower_data_summary_denom", "Data CLCT Shower All", 36, 1, 37, 18, 0, 18);
clctShowerDataSummary_num_ = iBooker.book2D("clct_cscshower_data_summary_num", "Data CLCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);

lctShowerEmulSummary_denom_ = iBooker.book2D("lct_cscshower_emul_summary_denom", "Emul LCT Shower All", 36, 1, 37, 18, 0, 18);
lctShowerEmulSummary_num_ = iBooker.book2D("lct_cscshower_emul_summary_num", "Emul LCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);
alctShowerEmulSummary_denom_ = iBooker.book2D("alct_cscshower_emul_summary_denom", "Emul ALCT Shower All", 36, 1, 37, 18, 0, 18);
alctShowerEmulSummary_num_ = iBooker.book2D("alct_cscshower_emul_summary_num", "Emul ALCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);
clctShowerEmulSummary_denom_ = iBooker.book2D("clct_cscshower_emul_summary_denom", "Emul CLCT Shower All", 36, 1, 37, 18, 0, 18);
clctShowerEmulSummary_num_ = iBooker.book2D("clct_cscshower_emul_summary_num", "Emul CLCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);
lctShowerDataSummary_denom_ =
iBooker.book2D("lct_cscshower_data_summary_denom", "Data LCT Shower All", 36, 1, 37, 18, 0, 18);
lctShowerDataSummary_num_ =
iBooker.book2D("lct_cscshower_data_summary_num", "Data LCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);
alctShowerDataSummary_denom_ =
iBooker.book2D("alct_cscshower_data_summary_denom", "Data ALCT Shower All", 36, 1, 37, 18, 0, 18);
alctShowerDataSummary_num_ =
iBooker.book2D("alct_cscshower_data_summary_num", "Data ALCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);
clctShowerDataSummary_denom_ =
iBooker.book2D("clct_cscshower_data_summary_denom", "Data CLCT Shower All", 36, 1, 37, 18, 0, 18);
clctShowerDataSummary_num_ =
iBooker.book2D("clct_cscshower_data_summary_num", "Data CLCT Shower Emul Matched", 36, 1, 37, 18, 0, 18);

lctShowerEmulSummary_denom_ =
iBooker.book2D("lct_cscshower_emul_summary_denom", "Emul LCT Shower All", 36, 1, 37, 18, 0, 18);
lctShowerEmulSummary_num_ =
iBooker.book2D("lct_cscshower_emul_summary_num", "Emul LCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);
alctShowerEmulSummary_denom_ =
iBooker.book2D("alct_cscshower_emul_summary_denom", "Emul ALCT Shower All", 36, 1, 37, 18, 0, 18);
alctShowerEmulSummary_num_ =
iBooker.book2D("alct_cscshower_emul_summary_num", "Emul ALCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);
clctShowerEmulSummary_denom_ =
iBooker.book2D("clct_cscshower_emul_summary_denom", "Emul CLCT Shower All", 36, 1, 37, 18, 0, 18);
clctShowerEmulSummary_num_ =
iBooker.book2D("clct_cscshower_emul_summary_num", "Emul CLCT Shower Not Matched to Data", 36, 1, 37, 18, 0, 18);

// x labels
lctShowerDataSummary_denom_->setAxisTitle("Chamber", 1);
Expand Down Expand Up @@ -169,17 +179,15 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
alctShowerDataSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
alctShowerDataSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
alctShowerDataSummary_denom_->Fill(chamber, sr);
// check for least one matching ALCT
for (auto ealct = range_emulALCT.first; ealct != range_emulALCT.second; ealct++) {
if (ealct->isValid() and areSameShowers(*dalct, *ealct)) {
if (chamber20) {
alctShowerDataSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
alctShowerDataSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
alctShowerDataSummary_num_->Fill(chamber, sr);
}
}
Expand All @@ -192,8 +200,7 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
alctShowerEmulSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
alctShowerEmulSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
alctShowerEmulSummary_denom_->Fill(chamber, sr);
// check for least one matching ALCT
for (auto dalct = range_dataALCT.first; dalct != range_dataALCT.second; dalct++) {
Expand All @@ -206,8 +213,7 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
alctShowerEmulSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
alctShowerEmulSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
alctShowerEmulSummary_num_->Fill(chamber, sr);
}
}
Expand All @@ -222,17 +228,15 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
clctShowerDataSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
clctShowerDataSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
clctShowerDataSummary_denom_->Fill(chamber, sr);
// check for least one matching CLCT
for (auto eclct = range_emulCLCT.first; eclct != range_emulCLCT.second; eclct++) {
if (eclct->isValid() and areSameShowers(*dclct, *eclct)) {
if (chamber20) {
clctShowerDataSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
clctShowerDataSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
clctShowerDataSummary_num_->Fill(chamber, sr);
}
}
Expand All @@ -245,8 +249,7 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
clctShowerEmulSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
clctShowerEmulSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
clctShowerEmulSummary_denom_->Fill(chamber, sr);
// check for least one matching CLCT
for (auto dclct = range_dataCLCT.first; dclct != range_dataCLCT.second; dclct++) {
Expand All @@ -259,8 +262,7 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
clctShowerEmulSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
clctShowerEmulSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
clctShowerEmulSummary_num_->Fill(chamber, sr);
}
}
Expand All @@ -275,31 +277,28 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
lctShowerDataSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
lctShowerDataSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
lctShowerDataSummary_denom_->Fill(chamber, sr);
// check for least one matching LCT
for (auto elct = range_emulLCT.first; elct != range_emulLCT.second; elct++) {
if (elct->isValid() and areSameShowers(*dlct, *elct)) {
if (chamber20) {
lctShowerDataSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
lctShowerDataSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
lctShowerDataSummary_num_->Fill(chamber, sr);
}
}
}
}

for (auto elct = range_emulLCT.first; elct != range_emulLCT.second; elct++) {
bool isMatched = false;
if (elct->isValid()) {
if (chamber20) {
lctShowerEmulSummary_denom_->Fill(chamber * 2 - 1, sr, 0.5);
lctShowerEmulSummary_denom_->Fill(chamber * 2, sr, 0.5);
}
else
} else
lctShowerEmulSummary_denom_->Fill(chamber, sr);
// check for least one matching LCT
for (auto dlct = range_dataLCT.first; dlct != range_dataLCT.second; dlct++) {
Expand All @@ -312,8 +311,7 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (chamber20) {
lctShowerEmulSummary_num_->Fill(chamber * 2 - 1, sr, 0.5);
lctShowerEmulSummary_num_->Fill(chamber * 2, sr, 0.5);
}
else
} else
lctShowerEmulSummary_num_->Fill(chamber, sr);
}
}
Expand All @@ -327,8 +325,8 @@ void L1TdeCSCTPGShower::analyze(const edm::Event& e, const edm::EventSetup& c) {

bool L1TdeCSCTPGShower::areSameShowers(const CSCShowerDigi& lhs, const CSCShowerDigi& rhs) const {
bool returnValue = false;
if (lhs.isValid() == rhs.isValid() && lhs.getCSCID() == rhs.getCSCID() &&
lhs.bitsInTime() == rhs.bitsInTime() && lhs.bitsOutOfTime() == rhs.bitsOutOfTime()) {
if (lhs.isValid() == rhs.isValid() && lhs.getCSCID() == rhs.getCSCID() && lhs.bitsInTime() == rhs.bitsInTime() &&
lhs.bitsOutOfTime() == rhs.bitsOutOfTime()) {
returnValue = true;
}
return returnValue;
Expand Down
23 changes: 14 additions & 9 deletions DQM/L1TMonitor/src/L1TdeStage2Shower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include "DQM/L1TMonitor/interface/L1TdeStage2Shower.h"

L1TdeStage2Shower::L1TdeStage2Shower(const edm::ParameterSet& ps)
: data_EMTFShower_token_(consumes<l1t::RegionalMuonShowerBxCollection>(ps.getParameter<edm::InputTag>("dataSource"))),
emul_EMTFShower_token_(consumes<l1t::RegionalMuonShowerBxCollection>(ps.getParameter<edm::InputTag>("emulSource"))),
: data_EMTFShower_token_(
consumes<l1t::RegionalMuonShowerBxCollection>(ps.getParameter<edm::InputTag>("dataSource"))),
emul_EMTFShower_token_(
consumes<l1t::RegionalMuonShowerBxCollection>(ps.getParameter<edm::InputTag>("emulSource"))),
monitorDir_(ps.getUntrackedParameter<std::string>("monitorDir")) {}

L1TdeStage2Shower::~L1TdeStage2Shower() {}
Expand All @@ -13,10 +15,14 @@ void L1TdeStage2Shower::bookHistograms(DQMStore::IBooker& iBooker, const edm::Ru
iBooker.setCurrentFolder(monitorDir_);

// 2D summary plots
emtfShowerDataSummary_denom_ = iBooker.book2D("emtf_shower_data_summary_denom", "Data EMTF Shower All", 6, 1, 7, 2, 0, 2);
emtfShowerDataSummary_num_ = iBooker.book2D("emtf_shower_data_summary_num", "Data EMTF Shower Emul Matched", 6, 1, 7, 2, 0, 2);
emtfShowerEmulSummary_denom_ = iBooker.book2D("emtf_shower_emul_summary_denom", "Emul EMTF Shower All", 6, 1, 7, 2, 0, 2);
emtfShowerEmulSummary_num_ = iBooker.book2D("emtf_shower_emul_summary_num", "Emul EMTF Shower Not Matched to Data", 6, 1, 7, 2, 0, 2);
emtfShowerDataSummary_denom_ =
iBooker.book2D("emtf_shower_data_summary_denom", "Data EMTF Shower All", 6, 1, 7, 2, 0, 2);
emtfShowerDataSummary_num_ =
iBooker.book2D("emtf_shower_data_summary_num", "Data EMTF Shower Emul Matched", 6, 1, 7, 2, 0, 2);
emtfShowerEmulSummary_denom_ =
iBooker.book2D("emtf_shower_emul_summary_denom", "Emul EMTF Shower All", 6, 1, 7, 2, 0, 2);
emtfShowerEmulSummary_num_ =
iBooker.book2D("emtf_shower_emul_summary_num", "Emul EMTF Shower Not Matched to Data", 6, 1, 7, 2, 0, 2);

// x labels
emtfShowerDataSummary_denom_->setAxisTitle("Sector", 1);
Expand Down Expand Up @@ -53,7 +59,7 @@ void L1TdeStage2Shower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (dSh->isValid()) {
emtfShowerDataSummary_denom_->Fill(dSh->sector(), (dSh->endcap() == 1) ? 1.5 : 0.5);
for (auto eSh = emulShowers->begin(); eSh != emulShowers->end(); ++eSh) {
if (eSh->isValid() and dSh->sector() == eSh->sector() and dSh->endcap() == eSh->endcap() and *dSh == *eSh)
if (eSh->isValid() and dSh->sector() == eSh->sector() and dSh->endcap() == eSh->endcap() and *dSh == *eSh)
emtfShowerDataSummary_num_->Fill(dSh->sector(), (dSh->endcap() == 1) ? 1.5 : 0.5);
}
}
Expand All @@ -64,7 +70,7 @@ void L1TdeStage2Shower::analyze(const edm::Event& e, const edm::EventSetup& c) {
if (eSh->isValid()) {
emtfShowerEmulSummary_denom_->Fill(eSh->sector(), (eSh->endcap() == 1) ? 1.5 : 0.5);
for (auto dSh = dataShowers->begin(); dSh != dataShowers->end(); ++dSh) {
if (dSh->isValid() and eSh->sector() == dSh->sector() and eSh->endcap() == dSh->endcap() and *dSh == *eSh)
if (dSh->isValid() and eSh->sector() == dSh->sector() and eSh->endcap() == dSh->endcap() and *dSh == *eSh)
isMatched = true;
}
if (not isMatched) {
Expand All @@ -73,4 +79,3 @@ void L1TdeStage2Shower::analyze(const edm::Event& e, const edm::EventSetup& c) {
}
}
}

Loading

0 comments on commit 06d5f02

Please sign in to comment.