Changeset 1372 in svn for trunk/modules/TrackCountingBTagging.cc
- Timestamp:
- Apr 17, 2014, 10:54:17 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/TrackCountingBTagging.cc
r1367 r1372 2 2 /** \class TrackCountingBTagging 3 3 * 4 * b tagging algorithm based on counting tracks with large impact parameterDetermines origin of jet,4 * b-tagging algorithm based on counting tracks with large impact parameter 5 5 * 6 6 * $Date: 2014-03-27 12:39:14 +0200 (Fri, 27 March 2014) $ … … 25 25 #include "TLorentzVector.h" 26 26 27 #include <algorithm> 27 #include <algorithm> 28 28 #include <stdexcept> 29 29 #include <iostream> … … 31 31 32 32 using namespace std; 33 34 33 35 34 //------------------------------------------------------------------------------ … … 50 49 void TrackCountingBTagging::Init() 51 50 { 52 53 51 fBitNumber = GetInt("BitNumber", 0); 54 52 55 53 fPtMin = GetDouble("TrackPtMin", 1.0); 56 54 fDeltaR = GetDouble("DeltaR", 0.3); 57 55 fIPmax = GetDouble("TrackIPMax", 2.0); 58 56 59 57 fSigMin = GetDouble("SigMin", 6.5); 60 fNtracks = GetInt("Ntracks", 3); 61 58 fNtracks = GetInt("Ntracks", 3); 59 62 60 // import input array(s) 63 61 64 62 fTrackInputArray = ImportArray(GetString("TrackInputArray", "Calorimeter/eflowTracks")); 65 63 fItTrackInputArray = fTrackInputArray->MakeIterator(); 66 64 67 65 fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets")); 68 66 fItJetInputArray = fJetInputArray->MakeIterator(); … … 82 80 { 83 81 Candidate *jet, *track; 84 82 85 83 Double_t jpx, jpy; 86 84 Double_t dr, tpx, tpy, tpt; 87 85 Double_t xd, yd, dxy, ddxy, ip, sip; 88 86 89 87 Int_t sign; 90 88 91 89 Int_t count; 92 90 93 91 // loop over all input jets 94 92 fItJetInputArray->Reset(); … … 98 96 jpx = jetMomentum.Px(); 99 97 jpy = jetMomentum.Py(); 100 98 101 99 // loop over all input tracks 102 100 fItTrackInputArray->Reset(); … … 104 102 while((track = static_cast<Candidate*>(fItTrackInputArray->Next()))) 105 103 { 106 const TLorentzVector &trkMomentum = track->Momentum; 107 108 dr = jetMomentum.DeltaR(trkMomentum); 109 110 tpt = trkMomentum.Pt(); 111 tpx = trkMomentum.Px(); 112 tpy = trkMomentum.Py(); 113 114 xd = track->Xd; 115 yd = track->Yd; 116 dxy = TMath::Abs(track->Dxy); 117 ddxy = track->SDxy; 118 119 if( tpt < fPtMin ) continue; 120 if( dr > fDeltaR ) continue; 121 if( dxy > fIPmax ) continue; 122 123 sign = ( jpx*xd + jpy*yd > 0.0 ) ? 1 : -1; 124 125 ip = sign*dxy; 126 sip = ip / TMath::Abs(ddxy); 127 128 if( sip > fSigMin ) count++; 129 104 const TLorentzVector &trkMomentum = track->Momentum; 105 106 dr = jetMomentum.DeltaR(trkMomentum); 107 108 tpt = trkMomentum.Pt(); 109 tpx = trkMomentum.Px(); 110 tpy = trkMomentum.Py(); 111 112 xd = track->Xd; 113 yd = track->Yd; 114 dxy = TMath::Abs(track->Dxy); 115 ddxy = track->SDxy; 116 117 if(tpt < fPtMin) continue; 118 if(dr > fDeltaR) continue; 119 if(dxy > fIPmax) continue; 120 121 sign = (jpx*xd + jpy*yd > 0.0) ? 1 : -1; 122 123 ip = sign*dxy; 124 sip = ip / TMath::Abs(ddxy); 125 126 if(sip > fSigMin) count++; 130 127 } 131 128 132 129 // set BTag flag to true if count >= Ntracks 133 jet->BTag |= ( count >= fNtracks) << fBitNumber;130 jet->BTag |= (count >= fNtracks) << fBitNumber; 134 131 } 135 132 }
Note:
See TracChangeset
for help on using the changeset viewer.