Skip to content

Commit

Permalink
throwing an error in case 2 flavors of Mu are attempted to be used in…
Browse files Browse the repository at this point in the history
… pflow
  • Loading branch information
theofil committed May 6, 2019
1 parent c93799f commit b5d07bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions L1Trigger/Phase2L1ParticleFlow/plugins/L1TPFProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,16 @@ L1TPFProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
}
}


/// ------ READ MUONS ----
if(useStandaloneMuons_ && !useTrackerMuons_) {

/// ------- first check that not more than one version of muons (standaloneMu or trackerMu) is set to be used in l1pflow
if (useStandaloneMuons_ && useTrackerMuons_) {
throw cms::Exception("Configuration", "setting useStandaloneMuons=True && useTrackerMuons=True is not to be done, as it would duplicate all muons\n");
}


if(useStandaloneMuons_) {
edm::Handle<l1t::MuonBxCollection> muons;
iEvent.getByToken(muCands_, muons);
for (auto it = muons->begin(0), ed = muons->end(0); it != ed; ++it) {
Expand All @@ -164,10 +172,8 @@ L1TPFProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
}
}

// typedef std::vector< L1TkMuonParticle > L1TkMuonParticleCollection ;


if(!useStandaloneMuons_ && useTrackerMuons_) {
if(useTrackerMuons_) {
edm::Handle<l1t::L1TkMuonParticleCollection> muons;
iEvent.getByToken(tkMuCands_, muons);
for (auto it = muons->begin(), ed = muons->end(); it != ed; ++it) {
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/Phase2L1ParticleFlow/python/l1pfProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
tracks = cms.InputTag('pfTracksFromL1Tracks'),
muons = cms.InputTag('simGmtStage2Digis',),
tkMuons = cms.InputTag('L1TkMuons'),
# type of muons to be used in PF (if both are set to true, none will be used)
# type of muons to be used in PF (enable only one at a time)
useStandaloneMuons = cms.bool(True),
useTrackerMuons = cms.bool(False),
emClusters = cms.VInputTag(cms.InputTag('pfClustersFromHGC3DClustersEM'), cms.InputTag('pfClustersFromL1EGClusters')),
Expand Down

0 comments on commit b5d07bc

Please sign in to comment.