Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
9dd2e94
Jets from emulator 6/N
trtomei Jul 5, 2022
4cbc1c6
Removing L1PF reco, 7/N
trtomei Jul 5, 2022
bcd507b
MET from emulator 8/N
trtomei Jul 5, 2022
d29fc58
HT from emulator 9/N
trtomei Jul 5, 2022
37ba1b6
Removing L1T MET and HT reco
trtomei Jul 5, 2022
074cb8f
L1Trigger/Configuration/python/SimL1Emulator_cff.py
Jun 20, 2022
116e799
change event contnet
Jun 20, 2022
b3ffbca
first commit of the Phase-2 L1T Muon DQM validation
folguera Apr 5, 2022
32791da
fix bug on GenParticle matching to L1T
folguera Apr 5, 2022
170349d
final commit of this first version
folguera Apr 7, 2022
8014545
include Harvesting
folguera Apr 20, 2022
4194565
fix folder on Harvesting
folguera Apr 20, 2022
719126d
Changes to L1TrackerEtMissProducer if the L1TrackSelectionProducer is…
Dec 28, 2021
1bb391e
Rely on the L1TrackSelectionProducer for all of the track quality cut…
Dec 28, 2021
8e50f64
Update the track selection and et miss producer emulation files.
May 5, 2022
79fea11
Update the input files for CMSSW_12_3_X.
May 6, 2022
6cc466c
Switch to using edm::RefVector<C> as opposed to std::vector<edm::Ref<C>>
May 6, 2022
c4670bc
Remove an unnecessary input tag.
May 6, 2022
0691238
Make the MET emulation use the selection tool as opposed to its own i…
May 6, 2022
67b8dfd
Updates from the code format checks
May 6, 2022
26d8e9f
Drop old e/g simulation (TDR) from sequence and event content
cerminar May 24, 2022
4663a87
Fix customization to be able to read files containing old PFCandidate…
cerminar May 24, 2022
e44c90e
removing collections and configs
May 26, 2022
3c558ba
more config removal
May 26, 2022
85f2f6f
deleting old modules
May 26, 2022
2ad4f29
drop old muon simulation (TDR) from sequence and event content
folguera May 27, 2022
0ce1e79
drop old (TDR) modules for TkMuon collections, now they are generated…
folguera May 27, 2022
c34e04c
remove obsolete e/g plugins
cerminar Jun 13, 2022
6548be4
replacing kPrimaryVertex with VertexWord
sandeepbhowmik1 Jun 15, 2022
511f54a
remove olg eg content
BenjaminRS Jun 10, 2022
8df19dd
code format
Jun 20, 2022
a5ce90d
fix DQM collections and other fixes
Jun 21, 2022
205b320
L1TkMuons from emulator 1/N
trtomei Jun 26, 2022
292e0b5
L1TkMuons from emulator 2/N
trtomei Jun 26, 2022
1ebec17
TkElectrons from emulator 3/N
trtomei Jun 26, 2022
f31bba4
TkEm from emulator 4/N
trtomei Jun 26, 2022
55cf8c4
Removing TkPrimaryVertex from HLT 5/N
trtomei Jun 26, 2022
bf5c25e
Thiago's fix to L1TkPrimaryVertex and comment L1TkElectrons
Jul 19, 2022
4d3e135
First try of moving to new L1T MET
trtomei Jul 20, 2022
e9f0e56
New EtSum DataFormats for Phase-2
trtomei Jul 20, 2022
6103b6a
Adding STORM infrastructure for std::vector<l1t::EtSum>
trtomei Jul 20, 2022
0debcd1
WIP of moving to new L1T MET
trtomei Aug 1, 2022
3666732
L1T seeds based on l1t::EtSum now working
trtomei Aug 2, 2022
1f730ad
First changes to L1TTkMuon
trtomei Aug 3, 2022
cf91f20
L1TTkMuonFilter.cc almost ready
trtomei Aug 3, 2022
080a331
Migrating DataFormats/HLTReco to TrackerMuon
trtomei Aug 3, 2022
d097cfe
Moving whole HLT infrastructure to use TrackerMuon
trtomei Aug 3, 2022
4aab568
Update L2MuonSeedGeneratorFromL1TkMu to use TrackerMuons
trtomei Aug 3, 2022
a0ebbb8
Change all modules to use L1TkMuonsGmt
trtomei Aug 3, 2022
64f5398
Merged l1t-phase2all from repository cecilecaillol with cms-merge-topic
Aug 8, 2022
9de2c3a
change muon format
Aug 8, 2022
b1a9974
code format
Aug 8, 2022
17ec54c
clang warning
Aug 8, 2022
18a540a
Update InputTag of hltL1TEGammaHGCFilteredCollectionProducer
trtomei Aug 12, 2022
68b0ec3
Merge pull request #6 from cms-hlt-phase2/l1t-phase2all
cecilecaillol Aug 13, 2022
54a25d8
Merged l1t-phase2all from repository cecilecaillol with cms-merge-topic
Aug 15, 2022
fb2bed1
adriano's comments
Aug 15, 2022
7d34786
Update BuildFile.xml
trtomei Aug 17, 2022
cf2e7fa
Update BuildFile.xml
trtomei Aug 17, 2022
4001553
Update BuildFile.xml
trtomei Aug 17, 2022
eaa1447
Update classes_def.xml
trtomei Aug 17, 2022
e782cbb
Update L1TTkMuonFilter.cc
trtomei Aug 17, 2022
7662e95
Update hltTriggerSummaryAOD_cfi.py
trtomei Aug 17, 2022
0731750
Merge pull request #7 from cms-hlt-phase2/l1t-phase2all
cecilecaillol Aug 18, 2022
2f64a7a
Merged l1t-phase2all from repository cecilecaillol with cms-merge-topic
Aug 18, 2022
5f68a0a
code-format
Aug 18, 2022
4a48d24
Addressing second round of comments
trtomei Aug 18, 2022
aef00e1
Removing commented lines and cfi.py file of deprecated module
trtomei Aug 18, 2022
5c30bb2
Merge pull request #8 from cms-hlt-phase2/l1t-phase2all
cecilecaillol Aug 18, 2022
5799459
Merged l1t-phase2all from repository cecilecaillol with cms-merge-topic
Aug 18, 2022
5e891a8
try to fix failed tests
Aug 19, 2022
338d63c
andrea's comments
Aug 19, 2022
f6c5d02
fix cfi
Aug 19, 2022
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
192 changes: 192 additions & 0 deletions DQMOffline/L1Trigger/interface/L1TPhase2MuonOffline.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
#ifndef DQMOFFLINE_L1TRIGGER_L1TPHASE2MUONOFFLINE_H
#define DQMOFFLINE_L1TRIGGER_L1TPHASE2MUONOFFLINE_H

/**
* \file L1TPhase2MuonOffline.h
*
* \author S. Folgueras
*
*/

// DataFormats
#include "DataFormats/L1Trigger/interface/Muon.h"
#include "DataFormats/L1TMuonPhase2/interface/SAMuon.h"
#include "DataFormats/L1TMuonPhase2/interface/MuonStub.h"
#include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
#include "DataFormats/Math/interface/deltaR.h"
#include "DataFormats/Math/interface/deltaPhi.h"

// FWCore
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

// DQMServices
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"

// HLTrigger
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"

// Common tools
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "TrackingTools/TransientTrack/interface/TrackTransientTrack.h"
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
#include "TrackingTools/PatternTools/interface/Trajectory.h"
#include "TrackingTools/Records/interface/TransientTrackRecord.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"

#include <memory>
#include "TRegexp.h"
#include <utility>
#include <vector>

class GenMuonGMTPair;

//
// DQM class declaration
//

class L1TPhase2MuonOffline : public DQMEDAnalyzer {
public:
L1TPhase2MuonOffline(const edm::ParameterSet& ps);
~L1TPhase2MuonOffline() override;

enum MuType { kSAMuon, kTkMuon, kNMuTypes };
enum VarType { kPt, kEta, kPhi, kIso, kQual, kZ0, kD0, kNVarTypes };
enum EffType { kEffPt, kEffPhi, kEffEta, kEffTypes };
enum ResType { kResPt, kRes1OverPt, kResQOverPt, kResPhi, kResEta, kResCh, kNResTypes };
enum EtaRegion { kEtaRegionAll, kEtaRegionBmtf, kEtaRegionOmtf, kEtaRegionEmtf, kNEtaRegions };
enum QualLevel { kQualOpen, kQualDouble, kQualSingle, kNQualLevels };

protected:
void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
void analyze(const edm::Event& e, const edm::EventSetup& c) override;

void bookControlHistos(DQMStore::IBooker&, MuType type);
void bookEfficiencyHistos(DQMStore::IBooker& ibooker, MuType type);
void bookResolutionHistos(DQMStore::IBooker& ibooker, MuType type);
void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;

//Fill Histos
void fillControlHistos();
void fillEfficiencyHistos();
void fillResolutionHistos();

private:
// Cut and Matching
void getMuonGmtPairs(edm::Handle<l1t::MuonBxCollection>& gmtCands);

// Handles and Tokens
edm::EDGetTokenT<l1t::SAMuonCollection> gmtMuonToken_;
edm::EDGetTokenT<l1t::TrackerMuonCollection> gmtTkMuonToken_;
edm::EDGetTokenT<std::vector<reco::GenParticle>> genParticleToken_;

edm::Handle<l1t::SAMuonCollection> gmtSAMuon_;
edm::Handle<l1t::TrackerMuonCollection> gmtTkMuon_;
edm::Handle<std::vector<reco::GenParticle>> genparticles_;

// PropagateToMuon muonpropagator_;

// vectors of enum values to loop over (and store quantities)
const std::vector<MuType> muonTypes_;
const std::vector<EffType> effTypes_;
const std::vector<ResType> resTypes_;
const std::vector<VarType> varTypes_;
const std::vector<EtaRegion> etaRegions_;
const std::vector<QualLevel> qualLevels_;

// maps with histogram name bits
std::map<EffType, std::string> effNames_;
std::map<EffType, std::string> effLabels_;
std::map<ResType, std::string> resNames_;
std::map<ResType, std::string> resLabels_;
std::map<EtaRegion, std::string> etaNames_;
std::map<QualLevel, std::string> qualNames_;
std::map<MuType, std::string> muonNames_;

// config params
const std::string histFolder_;
const std::vector<edm::ParameterSet> cutsVPSet_;

const std::vector<double> effVsPtBins_;
const std::vector<double> effVsPhiBins_;
const std::vector<double> effVsEtaBins_;

const double maxGmtMuonDR_;

// Helper methods
void matchMuonsToGen(std::vector<const reco::GenParticle*> genmus);
std::vector<float> getHistBinsEff(EffType eff);
std::tuple<int, double, double> getHistBinsRes(ResType res);

MonitorElement* efficiencyNum_[kNMuTypes][kNEtaRegions][kNQualLevels][kEffTypes];
MonitorElement* efficiencyDen_[kNMuTypes][kNEtaRegions][kNQualLevels][kEffTypes];
MonitorElement* resolutionHistos_[kNMuTypes][kNEtaRegions][kNQualLevels][kNResTypes];
MonitorElement* controlHistos_[kNMuTypes][kNVarTypes];

// helper variables
std::vector<GenMuonGMTPair> gmtSAMuonPairs_;
std::vector<GenMuonGMTPair> gmtTkMuonPairs_;
std::vector<std::pair<int, QualLevel>> cuts_;

float lsb_pt = Phase2L1GMT::LSBpt;
float lsb_phi = Phase2L1GMT::LSBphi;
float lsb_eta = Phase2L1GMT::LSBeta;
float lsb_z0 = Phase2L1GMT::LSBSAz0;
float lsb_d0 = Phase2L1GMT::LSBSAd0;
};

//
// helper class to manage GMT-GenMuon pairing
//
class GenMuonGMTPair {
public:
GenMuonGMTPair(const reco::GenParticle* mu, const l1t::L1Candidate* gmtmu);
GenMuonGMTPair(const GenMuonGMTPair& muongmtPair);
~GenMuonGMTPair(){};

float dR();
float pt() const { return mu_->pt(); };
float eta() const { return mu_->eta(); };
float phi() const { return mu_->phi(); };
int charge() const { return mu_->charge(); };

// Now properties of the L1 candidate:
float gmtPt() const { return gmtmu_ ? gmtmu_->pt() : -1.; };
float gmtEta() const { return gmtmu_ ? gmtEta_ : -5.; };
float gmtPhi() const { return gmtmu_ ? gmtPhi_ : -5.; };
int gmtCharge() const { return gmtmu_ ? gmtmu_->charge() : -5; };
int gmtQual() const { return gmtmu_ ? gmtmu_->hwQual() : -1; };

L1TPhase2MuonOffline::EtaRegion etaRegion() const;
double getDeltaVar(const L1TPhase2MuonOffline::ResType) const;
double getVar(const L1TPhase2MuonOffline::EffType) const;

private:
const reco::GenParticle* mu_;
const l1t::L1Candidate* gmtmu_;

// L1T muon eta and phi coordinates to be used
// Can be the coordinates from the 2nd muon station or from the vertex
float gmtEta_;
float gmtPhi_;

float muEta_;
float muPhi_;
};

#endif
4 changes: 2 additions & 2 deletions DQMOffline/L1Trigger/interface/L1TPhase2OuterTrackerTkMET.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "DataFormats/Common/interface/DetSetVectorNew.h"
#include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
// #include "DataFormats/L1TVertex/interface/Vertex.h"
#include "DataFormats/L1TCorrelator/interface/TkPrimaryVertex.h"
#include "DataFormats/L1Trigger/interface/VertexWord.h"

class DQMStore;
class L1TPhase2OuterTrackerTkMET : public DQMEDAnalyzer {
Expand All @@ -39,7 +39,7 @@ class L1TPhase2OuterTrackerTkMET : public DQMEDAnalyzer {
private:
edm::ParameterSet conf_;
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> m_topoToken;
edm::EDGetTokenT<l1t::TkPrimaryVertexCollection> pvToken;
edm::EDGetTokenT<l1t::VertexWordCollection> pvToken;
edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_> > > ttTrackToken_;

float maxZ0; // in cm
Expand Down
37 changes: 37 additions & 0 deletions DQMOffline/L1Trigger/python/L1TPhase2MuonDQMEfficiency_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import FWCore.ParameterSet.Config as cms

# generate the efficiency strings for the DQMGenericClient from the pt and quality cuts
def generateEfficiencyStrings(ptQualCuts):
numDenDir = "nums_and_dens/"
varStrings = ['Pt', 'Eta', 'Phi']
etaStrings = ['etaMin0_etaMax0p83', 'etaMin0p83_etaMax1p24', 'etaMin1p24_etaMax2p4', 'etaMin0_etaMax2p4']
qualStrings = {'qualOpen', 'qualDouble', 'qualSingle'}
muonStrings = ['SAMuon','TkMuon']

efficiencyStrings = []

for muonString in muonStrings:
for qualString in qualStrings:
for etaString in etaStrings:
effNumDenPrefix = numDenDir+"Eff_"+muonString+"_"+etaString+"_"+qualString+"_"
effNamePrefix = "efficiencies/eff_"+muonString+"_"+etaString+"_"+qualString+"_"

for varString in varStrings:
effDenName = effNumDenPrefix+varString+"_Den"
effNumName = effNumDenPrefix+varString+"_Num"
effName = effNamePrefix+varString

efficiencyStrings.append(effName+" '"+effName+";;L1 muon efficiency' "+effNumName+" "+effDenName)
return efficiencyStrings

from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQMOffline.L1Trigger.L1TPhase2MuonOffline_cfi import ptQualCuts

l1tPhase2MuonEfficiency = DQMEDHarvester("DQMGenericClient",
subDirs = cms.untracked.vstring(["L1T/L1TPhase2/Muons/SAMuon","L1T/L1TPhase2/Muons/TkMuon"]),
efficiency = cms.vstring(),
efficiencyProfile = cms.untracked.vstring(generateEfficiencyStrings(ptQualCuts)),
resolution = cms.vstring(),
outputFileName = cms.untracked.string(""),
verbose = cms.untracked.uint32(4)
)
54 changes: 54 additions & 0 deletions DQMOffline/L1Trigger/python/L1TPhase2MuonOffline_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from builtins import range
import FWCore.ParameterSet.Config as cms

# define binning for efficiency plots
# pt
import itertools
effVsPtBins=list(itertools.chain(range(0, 30, 1), range(30, 50, 2),
range(50, 70, 5), range(70, 100, 10),
range(100, 200, 25), range(200, 300, 50),
range(300, 500, 100), range(500, 700, 200),
range(700, 1000, 300)))
effVsPtBins.append(1000)

# phi
nPhiBins = 34
phiMin = -3.4
phiMax = 3.4
effVsPhiBins = [i*(phiMax-phiMin)/nPhiBins + phiMin for i in range(nPhiBins+1)]

# eta
nEtaBins = 50
etaMin = -2.5
etaMax = 2.5
effVsEtaBins = [i*(etaMax-etaMin)/nEtaBins + etaMin for i in range(nEtaBins+1)]

# vtx
effVsVtxBins = range(0, 101)

# A list of pt cut + quality cut pairs for which efficiency plots should be made
ptQualCuts = [[22, 12], [15, 8], [3, 4]]
cutsPSets = []
for ptQualCut in ptQualCuts:
cutsPSets.append(cms.untracked.PSet(ptCut = cms.untracked.int32(ptQualCut[0]),
qualCut = cms.untracked.int32(ptQualCut[1])))

from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
l1tPhase2MuonOffline = DQMEDAnalyzer('L1TPhase2MuonOffline',
histFolder = cms.untracked.string('L1T/L1TPhase2/Muons/'),
cuts = cms.untracked.VPSet(cutsPSets),
useL1AtVtxCoord = cms.untracked.bool(False),

genParticlesInputTag = cms.untracked.InputTag("genParticles"),
gmtMuonToken = cms.InputTag("L1SAMuonsGmt", "promptSAMuons"),
gmtTkMuonToken = cms.InputTag("L1TkMuonsGmt",""),

efficiencyVsPtBins = cms.untracked.vdouble(effVsPtBins),
efficiencyVsPhiBins = cms.untracked.vdouble(effVsPhiBins),
efficiencyVsEtaBins = cms.untracked.vdouble(effVsEtaBins),
efficiencyVsVtxBins = cms.untracked.vdouble(effVsVtxBins),

maxDR = cms.untracked.double(0.3),
)


12 changes: 7 additions & 5 deletions DQMOffline/L1Trigger/python/L1TPhase2Offline_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OuterTrackerTkMET = DQMEDAnalyzer('L1TPhase2OuterTrackerTkMET',
TopFolderName = cms.string('L1T/L1TPhase2/'),
TTTracksTag = cms.InputTag("TTTracksFromTrackletEmulation", "Level1TTTracks"),
L1VertexInputTag = cms.InputTag("L1TkPrimaryVertex"),
L1VertexInputTag = cms.InputTag("L1VertexFinderEmulator", "l1verticesEmulation"),
maxZ0 = cms.double ( 15. ) , # in cm
maxEta = cms.double ( 2.4 ) ,
chi2dofMax = cms.double( 10. ),
Expand Down Expand Up @@ -93,9 +93,9 @@
genParticlesInputTag = cms.untracked.InputTag("genParticles"),
isParticleGun = cms.bool(False),
objects = cms.PSet(
L1PF = cms.VInputTag("l1pfCandidates:PF",),
L1PF = cms.VInputTag("l1ctLayer1:PF",),
L1PF_sel = cms.string("pt > 0"),
L1Puppi = cms.VInputTag("l1pfCandidates:Puppi",),
L1Puppi = cms.VInputTag("l1ctLayer1:Puppi",),
L1Puppi_sel = cms.string("pt > 0"),
),

Expand Down Expand Up @@ -131,10 +131,12 @@
xmax=cms.untracked.double(5.),
),
),

)

from DQMOffline.L1Trigger.L1TPhase2MuonOffline_cfi import *

l1tPhase2OfflineDQM = cms.Sequence(
l1tPhase2CorrelatorOfflineDQM +
OuterTrackerTkMET
OuterTrackerTkMET +
l1tPhase2MuonOffline
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from DQMOffline.L1Trigger.L1TTauDiff_cfi import *

from DQMOffline.L1Trigger.L1TMuonDQMEfficiency_cff import *
from DQMOffline.L1Trigger.L1TPhase2MuonDQMEfficiency_cfi import *

# harvesting sequence for all datasets
DQMHarvestL1TMon = cms.Sequence(
Expand Down Expand Up @@ -52,6 +53,6 @@

# harvesting sequence for phase 2
DQMHarvestL1TPhase2 = cms.Sequence(

l1tPhase2MuonEfficiency
)

Loading