Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2D plots for the comparison between data and emulator for L1TObjects - L1T&Online DQM - cmssw102X #23434

Merged
merged 2 commits into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion DQM/L1TMonitor/interface/L1TStage2MuonComp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class L1TStage2MuonComp : public DQMEDAnalyzer {
std::string summaryTitle;
std::vector<int> ignoreBin;
bool verbose;
bool enable2DComp; // Default value is false. Set to true in the configuration file for enabling 2D eta-phi histograms

MonitorElement* summary;
MonitorElement* errorSummaryNum;
Expand All @@ -60,6 +61,7 @@ class L1TStage2MuonComp : public DQMEDAnalyzer {
MonitorElement* muColl1hwQual;
MonitorElement* muColl1hwIso;
MonitorElement* muColl1Index;
MonitorElement* muColl1EtaPhimap; // This histogram will be filled only if enable2DComp is true

MonitorElement* muColl2BxRange;
MonitorElement* muColl2nMu;
Expand All @@ -73,7 +75,8 @@ class L1TStage2MuonComp : public DQMEDAnalyzer {
MonitorElement* muColl2hwQual;
MonitorElement* muColl2hwIso;
MonitorElement* muColl2Index;

MonitorElement* muColl2EtaPhimap; // This histogram will be filled only if enable2DComp is true

};

#endif
17 changes: 14 additions & 3 deletions DQM/L1TMonitor/interface/L1TdeStage2CaloLayer2.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ class L1TdeStage2CaloLayer2 : public DQMEDAnalyzer {
MonitorElement * jetEtEmul;
MonitorElement * jetEtaEmul;
MonitorElement * jetPhiEmul;
MonitorElement * jet2DEtaPhiData; // This histogram will be filled only if enable2DComp is true
MonitorElement * jet2DEtaPhiEmul; // This histogram will be filled only if enable2DComp is true

// histograms to store the properties of mismatched non-isolated e/g
MonitorElement * egEtData;
Expand All @@ -287,22 +289,28 @@ class L1TdeStage2CaloLayer2 : public DQMEDAnalyzer {
MonitorElement * egEtEmul;
MonitorElement * egEtaEmul;
MonitorElement * egPhiEmul;

MonitorElement * eg2DEtaPhiData; // This histogram will be filled only if enable2DComp is true
MonitorElement * eg2DEtaPhiEmul; // This histogram will be filled only if enable2DComp is true

// histograms to store the properties of mismatched isolated e/g
MonitorElement * isoEgEtData;
MonitorElement * isoEgEtaData;
MonitorElement * isoEgPhiData;
MonitorElement * isoEgEtEmul;
MonitorElement * isoEgEtaEmul;
MonitorElement * isoEgPhiEmul;

MonitorElement * isoEg2DEtaPhiData; // This histogram will be filled only if enable2DComp is true
MonitorElement * isoEg2DEtaPhiEmul; // This histogram will be filled only if enable2DComp is true

// histograms to store the properties of mismatched non-isolated taus
MonitorElement * tauEtData;
MonitorElement * tauEtaData;
MonitorElement * tauPhiData;
MonitorElement * tauEtEmul;
MonitorElement * tauEtaEmul;
MonitorElement * tauPhiEmul;
MonitorElement * tau2DEtaPhiData; // This histogram will be filled only if enable2DComp is true
MonitorElement * tau2DEtaPhiEmul; // This histogram will be filled only if enable2DComp is true

// histograms to store the properties of mismatched isolated taus
MonitorElement * isoTauEtData;
Expand All @@ -311,7 +319,9 @@ class L1TdeStage2CaloLayer2 : public DQMEDAnalyzer {
MonitorElement * isoTauEtEmul;
MonitorElement * isoTauEtaEmul;
MonitorElement * isoTauPhiEmul;

MonitorElement * isoTau2DEtaPhiData; // This histogram will be filled only if enable2DComp is true
MonitorElement * isoTau2DEtaPhiEmul; // This histogram will be filled only if enable2DComp is true

// histograms for mismatched ett sums
MonitorElement * ettData;
MonitorElement * ettEmul;
Expand Down Expand Up @@ -361,6 +371,7 @@ class L1TdeStage2CaloLayer2 : public DQMEDAnalyzer {
MonitorElement * towCountEmul;

bool verbose;
bool enable2DComp; // Default value is false. Set to true in the configuration file for enabling 2D eta-phi histograms

// use only bx = 0 since it only contains RAW data (needed for emulator)
const unsigned int currBx = 0;
Expand Down
3 changes: 2 additions & 1 deletion DQM/L1TMonitor/python/L1TdeStage2CaloLayer2_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
calol2TauCollectionEmul = cms.InputTag("valCaloStage2Layer2Digis"),
calol2EtSumCollectionData = cms.InputTag("caloStage2Digis", "EtSum"),
calol2EtSumCollectionEmul = cms.InputTag("valCaloStage2Layer2Digis"),
monitorDir = cms.untracked.string("L1TEMU/L1TStage2CaloLayer2/L1TdeStage2CaloLayer2")
monitorDir = cms.untracked.string("L1TEMU/L1TStage2CaloLayer2/L1TdeStage2CaloLayer2"),
enable2DComp = cms.untracked.bool(True) # When true eta-phi comparison plots are also produced
)
1 change: 1 addition & 0 deletions DQM/L1TMonitor/python/L1TdeStage2uGMT_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
muonCollection2Title = cms.untracked.string("uGMT emulator"),
summaryTitle = cms.untracked.string("Summary of comparison between uGMT muons and uGMT emulator muons"),
verbose = cms.untracked.bool(False),
enable2DComp = cms.untracked.bool(True), # When true eta-phi comparison plots are also produced
)

# compares the unpacked uGMT intermediate muon collection to the emulated uGMT intermediate muon collection
Expand Down
28 changes: 25 additions & 3 deletions DQM/L1TMonitor/src/L1TStage2MuonComp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ L1TStage2MuonComp::L1TStage2MuonComp(const edm::ParameterSet& ps)
muonColl2Title(ps.getUntrackedParameter<std::string>("muonCollection2Title")),
summaryTitle(ps.getUntrackedParameter<std::string>("summaryTitle")),
ignoreBin(ps.getUntrackedParameter<std::vector<int>>("ignoreBin")),
verbose(ps.getUntrackedParameter<bool>("verbose"))
verbose(ps.getUntrackedParameter<bool>("verbose")),
enable2DComp(ps.getUntrackedParameter<bool>("enable2DComp")) // When true eta-phi comparison plots are also produced
{
// First include all bins
for (unsigned int i = 1; i <= RIDX; i++) {
Expand All @@ -35,6 +36,7 @@ void L1TStage2MuonComp::fillDescriptions(edm::ConfigurationDescriptions& descrip
desc.addUntracked<std::string>("summaryTitle", "Summary")->setComment("Title of summary histogram.");
desc.addUntracked<std::vector<int>>("ignoreBin", std::vector<int>())->setComment("List of bins to ignore");
desc.addUntracked<bool>("verbose", false);
desc.addUntracked<bool>("enable2DComp", false);
descriptions.add("l1tStage2MuonComp", desc);
}

Expand Down Expand Up @@ -124,6 +126,13 @@ void L1TStage2MuonComp::bookHistograms(DQMStore::IBooker& ibooker, const edm::Ru
muColl1hwIso->setAxisTitle("Hardware isolation", 1);
muColl1Index = ibooker.book1D("muIndexColl1", (muonColl1Title+" mismatching Input muon index").c_str(), 108, -0.5, 107.5);
muColl1Index->setAxisTitle("Index", 1);

// if enable2DComp variable is True, book also the eta-phi map
if(enable2DComp){
muColl1EtaPhimap = ibooker.book2D("muEtaPhimapColl1", (muonColl1Title+" mismatching muon #eta-#phi map").c_str(),25,-2.5,2.5,25,-3.2,3.2);
muColl1EtaPhimap->setAxisTitle("#eta", 1);
muColl1EtaPhimap->setAxisTitle("#phi", 2);
}

muColl2BxRange = ibooker.book1D("muBxRangeColl2", (muonColl2Title+" mismatching BX range").c_str(), 5, -2.5, 2.5);
muColl2BxRange->setAxisTitle("BX range", 1);
Expand All @@ -149,6 +158,13 @@ void L1TStage2MuonComp::bookHistograms(DQMStore::IBooker& ibooker, const edm::Ru
muColl2hwIso->setAxisTitle("Hardware isolation", 1);
muColl2Index = ibooker.book1D("muIndexColl2", (muonColl2Title+" mismatching Input muon index").c_str(), 108, -0.5, 107.5);
muColl2Index->setAxisTitle("Index", 1);

// if enable2DdeMu variable is True, book also the eta-phi map
if(enable2DComp){
muColl2EtaPhimap = ibooker.book2D("muEtaPhimapColl2", (muonColl2Title+" mismatching muon #eta-#phi map").c_str(),25,-2.5,2.5,25,-3.2,3.2);
muColl2EtaPhimap->setAxisTitle("#eta", 1);
muColl2EtaPhimap->setAxisTitle("#phi", 2);
}
}

void L1TStage2MuonComp::analyze(const edm::Event& e, const edm::EventSetup& c) {
Expand Down Expand Up @@ -205,6 +221,7 @@ void L1TStage2MuonComp::analyze(const edm::Event& e, const edm::EventSetup& c) {
muColl1hwQual->Fill(muonIt1->hwQual());
muColl1hwIso->Fill(muonIt1->hwIso());
muColl1Index->Fill(muonIt1->tfMuonIndex());
if(enable2DComp) muColl1EtaPhimap->Fill(muonIt1->eta(),muonIt1->phi());
}
} else {
muonIt2 = muonBxColl2->begin(iBx) + muonBxColl1->size(iBx);
Expand All @@ -218,7 +235,8 @@ void L1TStage2MuonComp::analyze(const edm::Event& e, const edm::EventSetup& c) {
muColl2hwChargeValid->Fill(muonIt2->hwChargeValid());
muColl2hwQual->Fill(muonIt2->hwQual());
muColl2hwIso->Fill(muonIt2->hwIso());
muColl2Index->Fill(muonIt2->tfMuonIndex());
muColl2Index->Fill(muonIt2->tfMuonIndex());
if(enable2DComp) muColl2EtaPhimap->Fill(muonIt2->eta(), muonIt2->phi());
}
}
} else {
Expand Down Expand Up @@ -332,6 +350,7 @@ void L1TStage2MuonComp::analyze(const edm::Event& e, const edm::EventSetup& c) {
muColl1hwQual->Fill(muonIt1->hwQual());
muColl1hwIso->Fill(muonIt1->hwIso());
muColl1Index->Fill(muonIt1->tfMuonIndex());
if(enable2DComp) muColl1EtaPhimap->Fill(muonIt1->eta(),muonIt1->phi());

muColl2hwPt->Fill(muonIt2->hwPt());
muColl2hwEta->Fill(muonIt2->hwEta());
Expand All @@ -343,7 +362,10 @@ void L1TStage2MuonComp::analyze(const edm::Event& e, const edm::EventSetup& c) {
muColl2hwQual->Fill(muonIt2->hwQual());
muColl2hwIso->Fill(muonIt2->hwIso());
muColl2Index->Fill(muonIt2->tfMuonIndex());
} else {
if(enable2DComp) muColl2EtaPhimap->Fill(muonIt2->eta(),muonIt2->phi());

}
else {
summary->Fill(MUONGOOD);
}

Expand Down
Loading