Skip to content

Commit

Permalink
Merge pull request #15893 from davidlange6/8019p2
Browse files Browse the repository at this point in the history
HLTMUonDimuonL3Filter extension and nan calo-towers fixes
  • Loading branch information
davidlange6 authored Sep 17, 2016
2 parents 073f0fe + 4bff8a0 commit 14d060f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion HLTrigger/Muon/interface/HLTMuonDimuonL3Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class HLTMuonDimuonL3Filter : public HLTFilter {
edm::EDGetTokenT<reco::RecoChargedCandidateCollection> candToken_; // token identifying product contains muons
edm::InputTag previousCandTag_; // input tag identifying product contains muons passing the previous level
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> previousCandToken_; // tokenidentifying product contains muons passing the previous level

bool previousCandIsL2_;
bool fast_Accept_; // flag to save time: stop processing after identification of the first valid pair
int min_N_; // minimum number of muons to fire the trigger
double max_Eta_; // Eta cut
int min_Nhits_; // threshold on number of hits on muon
double max_Dr_; // impact parameter cut
Expand Down
17 changes: 13 additions & 4 deletions HLTrigger/Muon/src/HLTMuonDimuonL3Filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ HLTMuonDimuonL3Filter::HLTMuonDimuonL3Filter(const edm::ParameterSet& iConfig) :
candToken_ (consumes<reco::RecoChargedCandidateCollection>(candTag_)),
previousCandTag_ (iConfig.getParameter<InputTag > ("PreviousCandTag")),
previousCandToken_ (consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
previousCandIsL2_(iConfig.getParameter<bool> ("PreviousCandIsL2")),
fast_Accept_ (iConfig.getParameter<bool> ("FastAccept")),
min_N_ (iConfig.getParameter<int> ("MinN")),
max_Eta_ (iConfig.getParameter<double> ("MaxEta")),
min_Nhits_ (iConfig.getParameter<int> ("MinNhits")),
max_Dr_ (iConfig.getParameter<double> ("MaxDr")),
Expand All @@ -75,6 +77,7 @@ HLTMuonDimuonL3Filter::HLTMuonDimuonL3Filter(const edm::ParameterSet& iConfig) :
<< " CandTag/MinN/MaxEta/MinNhits/MaxDr/MaxDz/MinPt1/MinPt2/MinInvMass/MaxInvMass/MinAcop/MaxAcop/MinPtBalance/MaxPtBalance/NSigmaPt/MaxDzMuMu/MaxRapidityPair : "
<< candTag_.encode()
<< " " << fast_Accept_
<< " " << min_N_
<< " " << max_Eta_
<< " " << min_Nhits_
<< " " << max_Dr_
Expand All @@ -101,7 +104,9 @@ HLTMuonDimuonL3Filter::fillDescriptions(edm::ConfigurationDescriptions& descript
desc.add<edm::InputTag>("CandTag",edm::InputTag("hltL3MuonCandidates"));
// desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag("hltDiMuonL2PreFiltered0"));
desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag(""));
desc.add<bool>("PreviousCandIsL2",true);
desc.add<bool>("FastAccept",false);
desc.add<int>("MinN",1);
desc.add<double>("MaxEta",2.5);
desc.add<int>("MinNhits",0);
desc.add<double>("MaxDr",2.0);
Expand Down Expand Up @@ -163,9 +168,13 @@ HLTMuonDimuonL3Filter::hltFilter(edm::Event& iEvent, const edm::EventSetup& iSet
unsigned int maxI = mucands->size();
for (unsigned int i=0;i!=maxI;i++){
TrackRef tk = (*mucands)[i].track();
edm::Ref<L3MuonTrajectorySeedCollection> l3seedRef = tk->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
TrackRef staTrack = l3seedRef->l2Track();
L2toL3s[staTrack].push_back(RecoChargedCandidateRef(mucands,i));
if (previousCandIsL2_) {
edm::Ref<L3MuonTrajectorySeedCollection> l3seedRef = tk->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
TrackRef staTrack = l3seedRef->l2Track();
L2toL3s[staTrack].push_back(RecoChargedCandidateRef(mucands,i));
} else {
L2toL3s[tk].push_back(RecoChargedCandidateRef(mucands,i));
}
}

Handle<TriggerFilterObjectWithRefs> previousLevelCands;
Expand Down Expand Up @@ -383,7 +392,7 @@ HLTMuonDimuonL3Filter::hltFilter(edm::Event& iEvent, const edm::EventSetup& iSet
}//loop on the first L2

// filter decision
const bool accept (n >= 1);
const bool accept (n >= min_N_);

LogDebug("HLTMuonDimuonL3Filter") << " >>>>> Result of HLTMuonDimuonL3Filter is "<< accept << ", number of muon pairs passing thresholds= " << n;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,8 @@ void CaloTowersCreationAlgo::convert(const CaloTowerDetId& id, const MetaTower&

// insert in collection (remove and return if below threshold)
if unlikely ( (towerP4[3]==0) & (E_outer>0) ) {
collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, CaloTower::PolarLorentzVector(0,hadPoint.eta(), hadPoint.phi(),0), emPoint, hadPoint);
float val = theHOIsUsed ? 0 : 1E-9; // to keep backwards compatibility for theHOIsUsed == true
collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, CaloTower::PolarLorentzVector(val,hadPoint.eta(), hadPoint.phi(),0), emPoint, hadPoint);
} else {
collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, GlobalVector(towerP4), towerP4[3], mass2, emPoint, hadPoint);
}
Expand Down

0 comments on commit 14d060f

Please sign in to comment.