Skip to content

Commit

Permalink
Added distJetAxis and decayLength cuts when counting the number of sh…
Browse files Browse the repository at this point in the history
…ared tracks
  • Loading branch information
ferencek committed Sep 10, 2013
1 parent 10dd711 commit 20c341f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
12 changes: 9 additions & 3 deletions interface/JetInfoBranches.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class JetInfoBranches {
int Jet_nseltracks[nMaxJets_];
int Jet_nsubjettracks[nMaxJets_];
int Jet_nsharedsubjettracks[nMaxJets_];
//$$
//$$$$
int Jet_nsharedtracks[nMaxJets_];
//$$$$
int Jet_flavour[nMaxJets_];
int Jet_nFirstTrack[nMaxJets_];
int Jet_nLastTrack[nMaxJets_];
Expand Down Expand Up @@ -505,7 +507,9 @@ class JetInfoBranches {
tree->Branch((name+"Jet_massPruned").c_str(), Jet_massPruned ,(name+"Jet_massPruned["+name+"nJet]/F").c_str());
tree->Branch((name+"Jet_tau1").c_str(), Jet_tau1 ,(name+"Jet_tau1["+name+"nJet]/F").c_str());
tree->Branch((name+"Jet_tau2").c_str(), Jet_tau2 ,(name+"Jet_tau2["+name+"nJet]/F").c_str());
//$$
//$$$$
tree->Branch((name+"Jet_nsharedtracks").c_str(), Jet_nsharedtracks ,(name+"Jet_nsharedtracks["+name+"nJet]/I").c_str());
//$$$$
tree->Branch((name+"Jet_nsubjettracks").c_str(), Jet_nsubjettracks ,(name+"Jet_nsubjettracks["+name+"nJet]/I").c_str());
tree->Branch((name+"Jet_nsharedsubjettracks").c_str(), Jet_nsharedsubjettracks ,(name+"Jet_nsharedsubjettracks["+name+"nJet]/I").c_str());
//$$
Expand Down Expand Up @@ -790,7 +794,9 @@ class JetInfoBranches {
tree->SetBranchAddress((name+"Jet_massPruned").c_str(), Jet_massPruned );
tree->SetBranchAddress((name+"Jet_tau1").c_str(), Jet_tau1 );
tree->SetBranchAddress((name+"Jet_tau2").c_str(), Jet_tau2 );
//$$
//$$$$
tree->SetBranchAddress((name+"Jet_nsharedtracks").c_str(), Jet_nsharedtracks );
//$$$$
tree->SetBranchAddress((name+"Jet_nsubjettracks").c_str(), Jet_nsubjettracks );
tree->SetBranchAddress((name+"Jet_nsharedsubjettracks").c_str(), Jet_nsharedsubjettracks );
//$$
Expand Down
31 changes: 28 additions & 3 deletions plugins/BTagAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,9 @@ void BTagAnalyzer::processJets(const edm::Handle<PatJetCollection>& jetsColl, co
}
}

//$$$$
int subjet1Idx = -1, subjet2Idx = -1;
//$$$$
if ( runSubJets_ && iJetColl == 1 )
{
// N-subjettiness
Expand Down Expand Up @@ -1019,7 +1022,7 @@ void BTagAnalyzer::processJets(const edm::Handle<PatJetCollection>& jetsColl, co
JetInfo[iJetColl].Jet_phiPruned[JetInfo[iJetColl].nJet] = fatJetToPrunedFatJetMap.find(&(*pjet))->second->phi();
JetInfo[iJetColl].Jet_massPruned[JetInfo[iJetColl].nJet] = fatJetToPrunedFatJetMap.find(&(*pjet))->second->mass();

int subjet1Idx=-1, subjet2Idx=-1;
//$$$$ int subjet1Idx=-1, subjet2Idx=-1;
for( PatJetCollection::const_iterator jIt = jetsColl2->begin(); jIt != jetsColl2->end(); ++jIt )
{
if( &(*jIt) == fatJetToPrunedFatJetMap.find(&(*pjet))->second->daughter(0) ) subjet1Idx = int( jIt - jetsColl2->begin() );
Expand Down Expand Up @@ -1082,7 +1085,9 @@ void BTagAnalyzer::processJets(const edm::Handle<PatJetCollection>& jetsColl, co

//$$
int nseltracks = 0;
//$$
//$$$$
int nsharedtracks = 0;
//$$$$

unsigned int trackSize = selected_tracks.size();
if ( !use_selected_tracks_ ) trackSize = no_sel_tracks.size();
Expand Down Expand Up @@ -1128,6 +1133,23 @@ void BTagAnalyzer::processJets(const edm::Handle<PatJetCollection>& jetsColl, co
&& deltaR < 0.3) nseltracks++;
//$$

//$$$$
if ( runSubJets_ && iJetColl == 1 && pass_cut_trk && subjet1Idx >= 0 && subjet2Idx >= 0 ) {

deta = ptrack.eta() - JetInfo[0].Jet_eta[subjet1Idx];
dphi = ptrack.phi() - JetInfo[0].Jet_phi[subjet1Idx];
if ( dphi > TMath::Pi() ) dphi = 2.*TMath::Pi() - dphi;
float dR1 = TMath::Sqrt(deta*deta + dphi*dphi);

deta = ptrack.eta() - JetInfo[0].Jet_eta[subjet2Idx];
dphi = ptrack.phi() - JetInfo[0].Jet_phi[subjet2Idx];
if ( dphi > TMath::Pi() ) dphi = 2.*TMath::Pi() - dphi;
float dR2 = TMath::Sqrt(deta*deta + dphi*dphi);

if ( dR1 < 0.3 && dR2 < 0.3 ) nsharedtracks++;
}
//$$$$

// track selection
if ( (use_selected_tracks_ && pass_cut_trk) || !use_selected_tracks_) {

Expand Down Expand Up @@ -1371,7 +1393,10 @@ void BTagAnalyzer::processJets(const edm::Handle<PatJetCollection>& jetsColl, co

//$$
JetInfo[iJetColl].Jet_nseltracks[JetInfo[iJetColl].nJet] = nseltracks;
//$$
//$$$$
if ( runSubJets_ && iJetColl == 1 )
JetInfo[iJetColl].Jet_nsharedtracks[JetInfo[iJetColl].nJet] = nsharedtracks;
//$$$$

JetInfo[iJetColl].Jet_nLastTrack[JetInfo[iJetColl].nJet] = JetInfo[iJetColl].nTrack;
JetInfo[iJetColl].Jet_nLastTrkInc[JetInfo[iJetColl].nJet] = JetInfo[iJetColl].nTrkInc;
Expand Down

0 comments on commit 20c341f

Please sign in to comment.