Skip to content

Commit

Permalink
Merge pull request #89 from EmyrClement/master
Browse files Browse the repository at this point in the history
Add tracker muons to ntuples and and more synch
  • Loading branch information
kreczko committed Jun 4, 2014
2 parents 34fdea3 + 33b3cf4 commit 3ace596
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/BristolNTuple_Muons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void BristolNTuple_Muons::produce(edm::Event& iEvent, const edm::EventSetup& iSe
// exit from loop when you reach the required number of muons
if (px->size() >= maxSize)
break;
if (!it->isGlobalMuon())
if (!( it->isGlobalMuon() || it->isTrackerMuon() ) )
continue;

double trkd0 = it->track()->d0();
Expand Down Expand Up @@ -439,8 +439,14 @@ void BristolNTuple_Muons::produce(edm::Event& iEvent, const edm::EventSetup& iSe
trackValidFractionOfHits->push_back(validFraction(it->track()));

//associated global track
globalChi2->push_back(it->globalTrack()->normalizedChi2());
globalTrackNumberOfValidMuonHits->push_back(it->globalTrack()->hitPattern().numberOfValidMuonHits());
if ( !( it->globalTrack().isNull() ) ) {
globalChi2->push_back(it->globalTrack()->normalizedChi2());
globalTrackNumberOfValidMuonHits->push_back(it->globalTrack()->hitPattern().numberOfValidMuonHits());
}
else {
globalChi2->push_back(99999);
globalTrackNumberOfValidMuonHits->push_back(-1);
}

//associated inner track
innerTrackNumberOfValidHits->push_back(it->innerTrack()->numberOfValidHits());
Expand Down
8 changes: 5 additions & 3 deletions src/PatUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,19 @@ double getSmearedJetPtScale(const pat::Jet& jet, int jet_smearing_systematic) {
scaleFactor = 1.288;
}
}

//use raw scaleFactors from above to calculate the final factors to apply
double matchedGeneratedJetpt = jet.pt();
if(jet.genJet()){
matchedGeneratedJetpt = jet.genJet()->pt();
if ( jet.genJet()->energy() != 0 ) { // Check done in Analysis Tools
matchedGeneratedJetpt = jet.genJet()->pt();
}
}
double jetPt = jet.pt();
double factor = 1-scaleFactor;
double deltaPt = factor * (jetPt - matchedGeneratedJetpt);
double ptScale = std::max(0.0, ((jetPt + deltaPt)/jetPt));

return ptScale;

}
Expand Down

0 comments on commit 3ace596

Please sign in to comment.