Skip to content

Commit

Permalink
Add missing GEM DetID vars and use patMuons
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Battilana committed Jun 1, 2023
1 parent 2ceed12 commit 307ff10
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions DPGAnalysis/MuonTools/plugins/MuCSCTnPFlatTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ void MuCSCTnPFlatTableProducer::getFromES(const edm::EventSetup& environment) {

void MuCSCTnPFlatTableProducer::fillTable(edm::Event& ev) {
unsigned int m_nZCands = 0; // the # of digis (size of all following vectors)
int nMuon = 0;

// Muon track tag variables
std::vector<float> m_muonPt; // muon pT [GeV/c]
Expand Down Expand Up @@ -323,8 +322,6 @@ void MuCSCTnPFlatTableProducer::fillTable(edm::Event& ev) {
if (muons.isValid() && tracks.isValid() && segments.isValid() && primaryVertices.isValid() &&
m_transientTrackBuilder.isValid()) {
for (const auto& muon : (*muons)) {
nMuon++;

if (!muonTagSelection(muon))
continue;

Expand Down
5 changes: 3 additions & 2 deletions DPGAnalysis/MuonTools/plugins/MuDTMuonExtTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

#include "DataFormats/Common/interface/View.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
Expand Down Expand Up @@ -60,7 +61,7 @@ class MuDTMuonExtTableProducer : public MuBaseFlatTableProducer {

private:
/// Tokens
nano_mu::EDTokenHandle<reco::MuonCollection> m_muToken;
nano_mu::EDTokenHandle<edm::View<reco::Muon>> m_muToken;
nano_mu::EDTokenHandle<DTRecSegment4DCollection> m_dtSegmentToken;

nano_mu::EDTokenHandle<edm::TriggerResults> m_trigResultsToken;
Expand Down Expand Up @@ -110,7 +111,7 @@ void MuDTMuonExtTableProducer::fillDescriptions(edm::ConfigurationDescriptions&
edm::ParameterSetDescription desc;

desc.add<std::string>("name", "muon");
desc.add<edm::InputTag>("src", edm::InputTag{"muons"});
desc.add<edm::InputTag>("src", edm::InputTag{"patMuons"});
desc.add<edm::InputTag>("dtSegmentSrc", edm::InputTag{"dt4DSegments"});
desc.add<edm::InputTag>("trigEventSrc", edm::InputTag{"hltTriggerSummaryAOD::HLT"});
desc.add<edm::InputTag>("trigResultsSrc", edm::InputTag{"TriggerResults::HLT"});
Expand Down
5 changes: 3 additions & 2 deletions DPGAnalysis/MuonTools/plugins/MuGEMMuonExtTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

#include "DataFormats/Common/interface/View.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"

Expand Down Expand Up @@ -43,7 +44,7 @@ class MuGEMMuonExtTableProducer : public MuBaseFlatTableProducer {

private:
/// The RECO mu token
nano_mu::EDTokenHandle<reco::MuonCollection> m_token;
nano_mu::EDTokenHandle<edm::View<reco::Muon>> m_token;

/// Fill matches table
bool m_fillPropagated;
Expand Down Expand Up @@ -77,7 +78,7 @@ void MuGEMMuonExtTableProducer::fillDescriptions(edm::ConfigurationDescriptions&
edm::ParameterSetDescription desc;

desc.add<std::string>("name", "muon");
desc.add<edm::InputTag>("src", edm::InputTag{"muons"});
desc.add<edm::InputTag>("src", edm::InputTag{"patMuons"});

desc.add<bool>("fillPropagated", true);
desc.setAllowAnything();
Expand Down
6 changes: 5 additions & 1 deletion DPGAnalysis/MuonTools/python/nano_mu_digi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@
region = DetIdVar("region()", "int8", doc = "GE11 region where the digi is detected"
"<br />(int, positive endcap: +1, negative endcap: -1)"),
roll = DetIdVar("roll()", "int8", doc = "roll id (also known as eta partition)"
"<br />(partitions numbered from 1 to 8)")
"<br />(partitions numbered from 1 to 8)"),
chamber = DetIdVar("chamber()", "int8", doc = "GE11 superchamber where the hit is reconstructed"
"<br />(chambers numbered from 0 to 35)"),
layer = DetIdVar("layer()", "int8", doc = "GE11 layer where the hit is reconstructed"
"<br />(layer1: 1, layer2: 2)")
)


Expand Down
2 changes: 2 additions & 0 deletions DPGAnalysis/MuonTools/python/nano_mu_local_reco_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
"<br />(int, positive endcap: +1, negative endcap: -1)"),
ring = DetIdVar("ring()", "int8", doc = ""),
station = DetIdVar("station()", "int8", doc = "GEM station <br />(always 1 for GE1/1)"),
chamber = DetIdVar("chamber()", "int8", doc = "GE11 superchamber where the hit is reconstructed"
"<br />(chambers numbered from 0 to 35)")
)

gemSegmentFlatTableProducer.globalPosVariables = cms.PSet(
Expand Down

0 comments on commit 307ff10

Please sign in to comment.