Skip to content
New issue

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

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

Already on GitHub? # to your account

Scouting Offline DQM for 2025 data-taking (EGM+MUO+autoDQM) #47235

Merged
merged 29 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2289ea5
Setting up DQM infrustructure for scouting (first attempt, MUO example)
elfontan Jan 27, 2025
0168294
Same code, working with release 15_0_0_pre2
Jan 29, 2025
7649ec2
[DQM For Scouting Electron] Update to CMSSW_15_0_X
tihsu99 Jan 30, 2025
6f8a0f4
[Sct EGM DQM] fix typo
tihsu99 Jan 30, 2025
ef1b6d8
Style changes made by cms bot
Jan 30, 2025
b2a401f
Merged EF_dqm_CMSSW1502 from repository elfontan with cms-merge-topic
silviodonato Jan 31, 2025
ef27340
merge conflicts between EGM and MUO scouting DQM codes
silviodonato Jan 31, 2025
efe6f1b
code-checks code-format
silviodonato Jan 31, 2025
bf2a4ee
remove some warnings
silviodonato Jan 31, 2025
53f6025
Merge pull request #5 from silviodonato/scoutingDqmEgmMuo
elfontan Jan 31, 2025
2efc2d6
Merge branch 'EF_dqm_CMSSW1502' into dev_15_0_X-ScoutingDQM
elfontan Jan 31, 2025
4f83a78
Merge pull request #6 from JavierGarciadeCastro/dev_15_0_X-ScoutingDQM
elfontan Jan 31, 2025
8c6618f
Minor fixes while testing the full workflow (EGM+MUO)
elfontan Jan 31, 2025
4289d62
Minor fixes (v2) while testing the full workflow (EGM+MUO)
elfontan Jan 31, 2025
05faeb0
Merged EF_dqm_CMSSW1502 from repository elfontan with cms-merge-topic
tihsu99 Jan 31, 2025
c4fe109
[Analyzer] remove print out
tihsu99 Jan 31, 2025
1901eab
[Directory] change scouting egamma directory
tihsu99 Jan 31, 2025
b077e3a
[test] add test files for scouting egamma
tihsu99 Jan 31, 2025
a27c1bb
[efficiency] update to newest version
tihsu99 Jan 31, 2025
44ce79f
[test] clean the code
tihsu99 Jan 31, 2025
447a1e3
Merge pull request #7 from tihsu99/tihsu_dqm_CMSSW1502_for_PR
elfontan Jan 31, 2025
6cb200b
Code checks for new EGamma code
elfontan Jan 31, 2025
3727ca8
Fixing the configuration files
elfontan Jan 31, 2025
cbcad39
Implementation of suggested corrections in PR47235
elfontan Feb 4, 2025
76f52bd
Merged EF_dqm_CMSSW1502 from repository elfontan with cms-merge-topic
silviodonato Feb 4, 2025
7187aa8
code-format
silviodonato Feb 4, 2025
f046f45
Merge pull request #8 from silviodonato/fixDQMscouting
elfontan Feb 4, 2025
6651902
Implementation of suggested corrections in PR47235 (v2)
elfontan Feb 4, 2025
37cd45c
Implementation of suggested corrections in PR47235 (config files fix)
elfontan Feb 4, 2025
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
4 changes: 4 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
from DQM.TrackingMonitorClient.TrackingClientConfig_Tier0_cff import *
from DQMOffline.Muon.muonQualityTests_cff import *
from DQMOffline.EGamma.egammaPostProcessing_cff import *
from DQMOffline.HLTScouting.HLTScoutingPostProcessing_cff import *
from DQMOffline.Trigger.DQMOffline_Trigger_Client_cff import *
from DQMOffline.Trigger.DQMOffline_HLT_Client_cff import *
from DQMOffline.RecoB.dqmCollector_cff import *
Expand Down Expand Up @@ -267,6 +268,9 @@

DQMHarvestBTag = cms.Sequence( bTagCollectorSequenceDATA )

# HLT Scouting trigger sequence
DQMHarvestHLTScouting = cms.Sequence( hltScoutingPostProcessing )

from PhysicsTools.NanoAOD.nanoDQM_cff import *
from Validation.RecoParticleFlow.DQMForPF_MiniAOD_cff import *
from DQMOffline.RecoB.bTagMiniDQM_cff import *
Expand Down
4 changes: 4 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from DQMServices.Components.DQMProvInfo_cfi import *
from DQMServices.Components.DQMFastTimerService_cff import *

from DQMOffline.HLTScouting.HLTScoutingDqmOffline_cff import *
from DQMOffline.L1Trigger.L1TriggerDqmOffline_cff import *
from DQMOffline.Ecal.ecal_dqm_source_offline_cff import *
from DQM.EcalPreshowerMonitorModule.es_dqm_source_offline_cff import *
Expand All @@ -28,6 +29,9 @@
dqmProvInfo.dcsRecord = cms.untracked.InputTag("onlineMetaDataDigis")
DQMOfflineDCS = cms.Sequence( dqmProvInfo )

# HLT Scouting trigger sequence
DQMOfflineScouting = cms.Sequence( hltScoutingDqmOffline )

# L1 trigger sequences
DQMOfflineL1T = cms.Sequence( l1TriggerDqmOffline ) # L1 emulator is run within this sequence for real data

Expand Down
16 changes: 12 additions & 4 deletions DQMOffline/Configuration/python/autoDQM.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
'PostDQMOffline',
'@dcs+@DQMMessageLogger+@hlt+@beam+@fed+dqmFastTimerServiceClient'],

'common': ['@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@castor+@physics',
'PostDQMOffline',
'@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@fed+dqmFastTimerServiceClient'],
'common': ['@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@castor+@physics',
'PostDQMOffline',
'@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@fed+dqmFastTimerServiceClient'],

'commonWithScouting': ['@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@castor+@physics+@hltScouting',
'PostDQMOffline',
'@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@hlt+@beam+@fed+dqmFastTimerServiceClient'],

'commonFakeHLT': ['@dcs+@DQMMessageLogger+@stripCommon+@pixel+@tracking+@beam+@castor+@physics',
'PostDQMOffline',
Expand Down Expand Up @@ -141,7 +145,7 @@
'physics': ['DQMOfflinePhysics',
'PostDQMOffline',
'DQMNone'],

'heavyFlavor': ['DQMOfflineHeavyFlavor',
'PostDQMOffline',
'DQMNone'],
Expand Down Expand Up @@ -219,6 +223,10 @@
'PostDQMOffline',
'dqmHarvesting'],

'hltScouting': ['DQMOfflineScouting',
'PostDQMOffline',
'DQMHarvestHLTScouting'],

'standardDQMExpress': ['DQMOfflineExpress',
'PostDQMOffline',
'dqmHarvestingExpress'],
Expand Down
47 changes: 47 additions & 0 deletions DQMOffline/HLTScouting/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<use name="CalibFormats/SiStripObjects"/>
<use name="CalibTracker/Records"/>
<use name="CommonTools/TriggerUtils"/>
<use name="CondFormats/DTObjects"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/SiStripObjects"/>
<use name="DQMServices/Core"/>
<use name="DataFormats/CaloTowers"/>
<use name="DataFormats/CSCDigi"/>
<use name="DataFormats/CSCRecHit"/>
<use name="DataFormats/DTRecHit"/>
<use name="DataFormats/DetId"/>
<use name="DataFormats/EcalDetId"/>
<use name="DataFormats/EgammaCandidates"/>
<use name="DataFormats/EgammaReco"/>
<use name="DataFormats/FEDRawData"/>
<use name="DataFormats/HcalDetId"/>
<use name="DataFormats/HcalRecHit"/>
<use name="DataFormats/JetReco"/>
<use name="DataFormats/METReco"/>
<use name="DataFormats/Math"/>
<use name="DataFormats/MuonReco"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/SiStripCluster"/>
<use name="DataFormats/SiStripDetId"/>
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/TrackerRecHit2D"/>
<use name="DataFormats/TrackingRecHit"/>
<use name="EventFilter/CSCRawToDigi"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you alpha-order here?

<use name="FWCore/Framework"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/Utilities"/>
<use name="Geometry/CaloGeometry"/>
<use name="Geometry/CSCGeometry"/>
<use name="Geometry/HcalTowerAlgo"/>
<use name="HLTrigger/HLTcore"/>
<use name="HLTriggerOffline/Scouting"/>
<use name="JetMETCorrections/JetCorrector"/>
<use name="MagneticField/Engine"/>
<use name="MagneticField/Records"/>
<use name="RecoJets/JetAssociationAlgorithms"/>
<use name="RecoJets/JetProducers"/>
<use name="RecoMuon/TrackingTools"/>
<use name="TrackingTools/Records"/>
<use name="TrackingTools/TransientTrack"/>
<flags EDM_PLUGIN="1"/>
21 changes: 21 additions & 0 deletions DQMOffline/HLTScouting/python/HLTScoutingDqmOffline_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'''
Scouting DQM sequences for offline DQM developed for 2025 pp data-taking
and used by DQM GUI (DQMOffline/Configuration):
currently running EGM and MUO monitoring modules.
'''

import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester

from HLTriggerOffline.Scouting.ScoutingMuonTriggerAnalyzer_cfi import *
from HLTriggerOffline.Scouting.ScoutingMuonTagProbeAnalyzer_cfi import *
from HLTriggerOffline.Scouting.ScoutingMuonMonitoring_Client_cff import *

from HLTriggerOffline.Scouting.HLTScoutingEGammaDqmOffline_cff import *

hltScoutingMuonDqmOffline = cms.Sequence(scoutingMonitoringTagProbeMuonNoVtx
* scoutingMonitoringTagProbeMuonVtx
* scoutingMonitoringTriggerMuon
)

hltScoutingDqmOffline = cms.Sequence(hltScoutingMuonDqmOffline + hltScoutingEGammaDqmOffline)
19 changes: 19 additions & 0 deletions DQMOffline/HLTScouting/python/HLTScoutingPostProcessing_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'''
Scouting DQM sequences for offline DQM developed for 2025 pp data-taking
and used by DQM GUI (DQMOffline/Configuration):
currently running EGM and MUO monitoring modules.
'''

import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQMOffline.HLTScouting.HLTScoutingDqmOffline_cff import *

from HLTriggerOffline.Scouting.ScoutingMuonMonitoring_Client_cff import *
from HLTriggerOffline.Scouting.HLTScoutingEGammaPostProcessing_cff import *

hltScoutingMuonPostProcessing = cms.Sequence(muonEfficiencyNoVtx
* muonEfficiencyVtx
* muonTriggerEfficiency
)

hltScoutingPostProcessing = cms.Sequence(hltScoutingMuonPostProcessing + hltScoutingEGammaPostProcessing)
14 changes: 14 additions & 0 deletions HLTriggerOffline/Scouting/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<use name="FWCore/Framework"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/ParameterSet"/>
<use name="DQMServices/Core"/>
<use name="CLHEP"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/Scouting"/>
<use name="L1Trigger/L1TGlobal"/>
<use name="DataFormats/L1TGlobal"/>
<use name="FWCore/Utilities"/>
<use name="TrackingTools/Records"/>
<use name="HLTrigger/HLTcore"/>
<use name="DataFormats/HLTReco"/>
<flags EDM_PLUGIN="1"/>
101 changes: 101 additions & 0 deletions HLTriggerOffline/Scouting/plugins/ElectronEfficiencyPlotter.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#include "ElectronEfficiencyPlotter.h"

// Framework
#include <cmath>
#include <string>

#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "TF1.h"
#include "TH1F.h"

using namespace edm;
using namespace std;

// Constructor
ElectronEfficiencyPlotter::ElectronEfficiencyPlotter(const edm::ParameterSet &ps) {
ptBin_ = ps.getParameter<int>("ptBin");
ptMin_ = ps.getParameter<double>("ptMin");
ptMax_ = ps.getParameter<double>("ptMax");

ID_ = ps.getParameter<string>("sctElectronID");
theFolder_ = ps.getParameter<string>("folder");
sourceFolder_ = ps.getParameter<string>("srcFolder");
}

void ElectronEfficiencyPlotter::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) {
ibooker.setCurrentFolder(theFolder_);

h_eff_pt_EB_doubleEG_HLT =
ibooker.book1D("Eff_pt_barrel_DSTdoubleEG", "DSTdoubleEG Eff. vs Pt (barrel)", ptBin_, ptMin_, ptMax_);
h_eff_pt_EE_doubleEG_HLT =
ibooker.book1D("Eff_pt_endcap_DSTdoubleEG", "DSTdoubleEG Eff. vs Pt (endcap)", ptBin_, ptMin_, ptMax_);
h_eff_pt_EB_singlePhoton_HLT =
ibooker.book1D("Eff_pt_barrel_DSTsinglePhoton", "DSTsinglePhoton Eff. vs Pt (barrel)", ptBin_, ptMin_, ptMax_);
h_eff_pt_EE_singlePhoton_HLT =
ibooker.book1D("Eff_pt_endcap_DSTsinglePhoton", "DSTsinglePhoton Eff. vs Pt (endcap)", ptBin_, ptMin_, ptMax_);

// Axis title
h_eff_pt_EB_singlePhoton_HLT->setAxisTitle("p_{T} (GeV)", 1);
h_eff_pt_EE_singlePhoton_HLT->setAxisTitle("p_{T} (GeV)", 1);
h_eff_pt_EB_doubleEG_HLT->setAxisTitle("p_{T} (GeV)", 1);
h_eff_pt_EE_doubleEG_HLT->setAxisTitle("p_{T} (GeV)", 1);

MonitorElement *Numerator_pt_barrel_doubleEG_hlt =
igetter.get(sourceFolder_ +
"/resonanceZ_Tag_pat_Probe_sctElectron_passDoubleEG_DST_"
"fireTrigObj_Pt_Barrel");
MonitorElement *Numerator_pt_endcap_doubleEG_hlt =
igetter.get(sourceFolder_ +
"/resonanceZ_Tag_pat_Probe_sctElectron_passDoubleEG_DST_"
"fireTrigObj_Pt_Endcap");
MonitorElement *Numerator_pt_barrel_singlePhoton_hlt =
igetter.get(sourceFolder_ +
"/resonanceZ_Tag_pat_Probe_sctElectron_passSinglePhoton_DST_"
"fireTrigObj_Pt_Barrel");
MonitorElement *Numerator_pt_endcap_singlePhoton_hlt =
igetter.get(sourceFolder_ +
"/resonanceZ_Tag_pat_Probe_sctElectron_passSinglePhoton_DST_"
"fireTrigObj_Pt_Endcap");
MonitorElement *Denominator_pt_barrel =
igetter.get(sourceFolder_ + "/resonanceZ_Tag_pat_Probe_sctElectron_Pt_Barrel");
MonitorElement *Denominator_pt_endcap =
igetter.get(sourceFolder_ + "/resonanceZ_Tag_pat_Probe_sctElectron_Pt_Endcap");

if (Numerator_pt_barrel_doubleEG_hlt && Denominator_pt_barrel)
calculateEfficiency(Numerator_pt_barrel_doubleEG_hlt, Denominator_pt_barrel, h_eff_pt_EB_doubleEG_HLT);
if (Numerator_pt_endcap_doubleEG_hlt && Denominator_pt_endcap)
calculateEfficiency(Numerator_pt_endcap_doubleEG_hlt, Denominator_pt_endcap, h_eff_pt_EE_doubleEG_HLT);
if (Numerator_pt_barrel_singlePhoton_hlt && Denominator_pt_barrel)
calculateEfficiency(Numerator_pt_barrel_singlePhoton_hlt, Denominator_pt_barrel, h_eff_pt_EB_singlePhoton_HLT);
if (Numerator_pt_endcap_singlePhoton_hlt && Denominator_pt_endcap)
calculateEfficiency(Numerator_pt_endcap_singlePhoton_hlt, Denominator_pt_endcap, h_eff_pt_EE_singlePhoton_HLT);
}

void ElectronEfficiencyPlotter::calculateEfficiency(MonitorElement *Numerator,
MonitorElement *Denominator,
MonitorElement *Efficiency) {
TH1F *h_numerator_pt = Numerator->getTH1F();
TH1F *h_denominator_pt = Denominator->getTH1F();
TH1F *h_eff_pt = Efficiency->getTH1F();
if (h_eff_pt->GetSumw2N() == 0)
h_eff_pt->Sumw2();

// ReBin
int nBins = h_eff_pt->GetNbinsX();
double *binEdges = new double[nBins + 1];
for (int i = 0; i <= nBins; i++)
binEdges[i] = h_eff_pt->GetBinLowEdge(i + 1);

TH1F *h_numerator_pt_rebin = (TH1F *)h_numerator_pt->Rebin(nBins, "num_pt_rebinned", binEdges);
TH1F *h_denominator_pt_rebin = (TH1F *)h_denominator_pt->Rebin(nBins, "num_pt_rebinned", binEdges);
h_eff_pt->Divide(h_numerator_pt_rebin, h_denominator_pt_rebin, 1., 1., "B");
}

DEFINE_FWK_MODULE(ElectronEfficiencyPlotter);
45 changes: 45 additions & 0 deletions HLTriggerOffline/Scouting/plugins/ElectronEfficiencyPlotter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef HLTriggerOffline_Scouting_ElectronEfficiencyPlotter_H
#define HLTriggerOffline_Scouting_ElectronEfficiencyPlotter_H

#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

class ElectronEfficiencyPlotter : public DQMEDHarvester {
public:
// Constructor
ElectronEfficiencyPlotter(const edm::ParameterSet& ps);
// Destructor
~ElectronEfficiencyPlotter() override = default;

protected:
// DQM Client Diagnostic
void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;

private:
// counters

int ptBin_;
double ptMin_;
double ptMax_;

std::string ID_;

MonitorElement* h_eff_pt_EB_doubleEG_HLT;
MonitorElement* h_eff_pt_EE_doubleEG_HLT;
MonitorElement* h_eff_pt_EB_singlePhoton_HLT;
MonitorElement* h_eff_pt_EE_singlePhoton_HLT;

std::string theFolder_;
std::string sourceFolder_;
void calculateEfficiency(MonitorElement* Numerator, MonitorElement* Denominator, MonitorElement* Efficiency);
};

#endif
Loading