Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions interface/MuonAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class MuonAnalyzer: public JME::LeptonAnalyzer {
std::vector<bool>& isTight_ = tree["isTight"].write<std::vector<bool>>();
std::vector<bool>& isHighPt_ = tree["isHighPt"].write<std::vector<bool>>();

std::vector<bool>& isTruthMatch_PromptMuon_ = tree["isTruthMatch_PromptMuon"].write<std::vector<bool>>();
std::vector<bool>& isTruthMatch_NonTauPromptMuon_ = tree["isTruthMatch_NonTauPromptMuon"].write<std::vector<bool>>();

std::vector<std::map<std::string, bool>>& ids_ = tree["ids"].write<std::vector<std::map<std::string, bool>>>();

std::vector<float>& neutralHadronIsoR04_pfWeighted_ = tree["neutralHadronIsoR04_pfWeighted"].write<std::vector<float>>();
Expand Down
21 changes: 21 additions & 0 deletions src/MuonAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ void MuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet
extractBasicProperties(muon);
extractGenProperties(muon.genLepton());

{
const long PDGID_MUON = 13 ;
const reco::GenParticle * truth_mu = muon.genLepton();

const bool b_matched_to_prompt_muon =
( truth_mu != 0 )
&&
abs( truth_mu -> pdgId())== PDGID_MUON // just a sanity check.
&&
truth_mu -> isPromptFinalState() ;

const bool b_matched_to_nonTauprompt_muon =
b_matched_to_prompt_muon
&&
( ! ( truth_mu -> isDirectPromptTauDecayProductFinalState() ) ) ;

isTruthMatch_PromptMuon_ . push_back ( b_matched_to_prompt_muon );
isTruthMatch_NonTauPromptMuon_ . push_back ( b_matched_to_nonTauprompt_muon );
}


reco::MuonPFIsolation pfIso = muon.pfIsolationR03();
computeRelativeIsolationR03(muon, pfIso.sumChargedHadronPt, pfIso.sumNeutralHadronEt, pfIso.sumPhotonEt, pfIso.sumPUPt, muon.eta(), rho);

Expand Down