Skip to content

Commit

Permalink
Merge pull request #32075 from jsalfeld/changeDispMuMuVtxProducer111X
Browse files Browse the repository at this point in the history
"Update disp mu mu producer (11.1.x)"
  • Loading branch information
cmsbuild committed Nov 10, 2020
2 parents b96b2a6 + 05c67c4 commit fc5f429
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HLTrigger/btau/plugins/HLTDisplacedmumuVtxProducer.cc
Expand Up @@ -37,6 +37,7 @@ HLTDisplacedmumuVtxProducer::HLTDisplacedmumuVtxProducer(const edm::ParameterSet
srcToken_(consumes<reco::RecoChargedCandidateCollection>(srcTag_)),
previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
matchToPrevious_(iConfig.getParameter<bool>("matchToPrevious")),
maxEta_(iConfig.getParameter<double>("MaxEta")),
minPt_(iConfig.getParameter<double>("MinPt")),
minPtPair_(iConfig.getParameter<double>("MinPtPair")),
Expand All @@ -52,6 +53,7 @@ void HLTDisplacedmumuVtxProducer::fillDescriptions(edm::ConfigurationDescription
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
desc.add<bool>("matchToPrevious", true);
desc.add<double>("MaxEta", 2.5);
desc.add<double>("MinPt", 0.0);
desc.add<double>("MinPtPair", 0.0);
Expand Down Expand Up @@ -85,18 +87,20 @@ void HLTDisplacedmumuVtxProducer::produce(edm::StreamID, edm::Event& iEvent, con

// get the objects passing the previous filter
Handle<TriggerFilterObjectWithRefs> previousCands;
iEvent.getByToken(previousCandToken_, previousCands);
if (matchToPrevious_)
iEvent.getByToken(previousCandToken_, previousCands);

vector<RecoChargedCandidateRef> vPrevCands;
previousCands->getObjects(TriggerMuon, vPrevCands);
if (matchToPrevious_)
previousCands->getObjects(TriggerMuon, vPrevCands);

for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
TrackRef tk1 = cand1->get<TrackRef>();
LogDebug("HLTDisplacedMumuFilter") << " 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
<< ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();

//first check if this muon passed the previous filter
if (!checkPreviousCand(tk1, vPrevCands))
if (matchToPrevious_ && !checkPreviousCand(tk1, vPrevCands))
continue;

// cuts
Expand All @@ -115,7 +119,7 @@ void HLTDisplacedmumuVtxProducer::produce(edm::StreamID, edm::Event& iEvent, con
<< " 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt() << ", eta= " << cand2->eta()
<< ", hits= " << tk2->numberOfValidHits() << ", d0= " << tk2->d0();
//first check if this muon passed the previous filter
if (!checkPreviousCand(tk2, vPrevCands))
if (matchToPrevious_ && !checkPreviousCand(tk2, vPrevCands))
continue;

// cuts
Expand Down
1 change: 1 addition & 0 deletions HLTrigger/btau/plugins/HLTDisplacedmumuVtxProducer.h
Expand Up @@ -41,6 +41,7 @@ class HLTDisplacedmumuVtxProducer : public edm::global::EDProducer<> {
const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> srcToken_;
const edm::InputTag previousCandTag_;
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> previousCandToken_;
const bool matchToPrevious_;
const double maxEta_;
const double minPt_;
const double minPtPair_;
Expand Down

0 comments on commit fc5f429

Please sign in to comment.