Skip to content

Commit

Permalink
Added back inverse beta switch
Browse files Browse the repository at this point in the history
  • Loading branch information
cericeci committed Apr 14, 2020
1 parent 366abb2 commit 9347528
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
17 changes: 12 additions & 5 deletions PhysicsTools/PatAlgos/plugins/PATMuonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ PATMuonProducer::PATMuonProducer(const edm::ParameterSet& iConfig, PATMuonHeavyO
embedTpfmsMuon_ = iConfig.getParameter<bool>("embedTpfmsMuon");
embedDytMuon_ = iConfig.getParameter<bool>("embedDytMuon");
// embedding of inverse beta variable information
muonTimeExtraToken_ =
consumes<edm::ValueMap<reco::MuonTimeExtra>>(iConfig.getParameter<edm::InputTag>("sourceMuonTimeExtra"));
addInverseBeta_ = iConfig.getParameter<bool>("addInverseBeta");
if (addInverseBeta_) {
muonTimeExtraToken_ =
consumes<edm::ValueMap<reco::MuonTimeExtra>>(iConfig.getParameter<edm::InputTag>("sourceMuonTimeExtra"));
}
// Monte Carlo matching
addGenMatch_ = iConfig.getParameter<bool>("addGenMatch");
if (addGenMatch_) {
Expand Down Expand Up @@ -519,8 +522,10 @@ void PATMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
}

edm::Handle<edm::ValueMap<reco::MuonTimeExtra>> muonsTimeExtra;
// get MuonTimerExtra value map
iEvent.getByToken(muonTimeExtraToken_, muonsTimeExtra);
if (addInverseBeta_) {
// get MuonTimerExtra value map
iEvent.getByToken(muonTimeExtraToken_, muonsTimeExtra);
}

for (edm::View<reco::Muon>::const_iterator itMuon = muons->begin(); itMuon != muons->end(); ++itMuon) {
// construct the Muon from the ref -> save ref to original object
Expand Down Expand Up @@ -612,7 +617,9 @@ void PATMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
}
}
}
aMuon.readTimeExtra((*muonsTimeExtra)[muonRef]);
if (addInverseBeta_) {
aMuon.readTimeExtra((*muonsTimeExtra)[muonRef]);
}
// MC info
aMuon.initSimInfo();
if (simInfoIsAvailalbe) {
Expand Down
4 changes: 3 additions & 1 deletion PhysicsTools/PatAlgos/plugins/PATMuonProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ namespace pat {
bool embedTpfmsMuon_;
/// embed track from DYT muon fit into the muon
bool embedDytMuon_;
/// input tag for reading timing information
/// add combined inverse beta measurement into the muon
bool addInverseBeta_;
/// input tag for reading inverse beta
edm::EDGetTokenT<edm::ValueMap<reco::MuonTimeExtra>> muonTimeExtraToken_;
/// add generator match information
bool addGenMatch_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@
# deltaR = cms.double(0.3)
# )),
),

# Where to read and store from the timing information
# Read and store combined inverse beta
addInverseBeta = cms.bool(True),
sourceMuonTimeExtra = cms.InputTag("muons","combined"), #Use combined info, not only csc or dt

# mc matching
addGenMatch = cms.bool(True),
embedGenMatch = cms.bool(True),
Expand Down

0 comments on commit 9347528

Please sign in to comment.