StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrackRegion.cxx
1 //
2 // Grant Webb <gdwebb@bnl.gov>
3 // Brookhaven National Lab
4 // 3 August 2015
5 //
6 
7 #include "StjTrackRegion.h"
8 
9 
10 ClassImp(StjTrackRegion);
11 
12 StjTrackList StjTrackRegion::Do( const StjTrackList& trackList, const StJetCandidate* leadingjet, const TString bname)
13 {
14  StjTrackList elist;
15  // Track loop
16 
17  for (StjTrackList::const_iterator iTrack = trackList.begin(); iTrack != trackList.end(); ++iTrack) {
18  StjTrack track = *iTrack;
19 
20  if(bname == "toward" ){
21  if(TMath::Abs(TVector2::Phi_mpi_pi( leadingjet->phi() - track.phi)) < (mphiplus * TMath::DegToRad()) && TMath::Abs(track.eta) < mdeta ){
22  elist.push_back(track);
23  }
24  }
25  if(bname == "away"){
26  if(TMath::Abs(TVector2::Phi_mpi_pi( leadingjet->phi() - track.phi)) > (mphiplus * TMath::DegToRad()) && TMath::Abs(track.eta) < mdeta ){
27  elist.push_back(track);
28  }
29  }
30  if(bname == "transP" || bname == "transM"){
31  if(TVector2::Phi_mpi_pi( leadingjet->phi() - track.phi) < (mphiplus * TMath::DegToRad()) && TVector2::Phi_mpi_pi( leadingjet->phi() - track.phi) > (mphiminus * TMath::DegToRad()) && TMath::Abs(track.eta) < mdeta ){
32  elist.push_back(track);
33  }
34  }
35  } // End track loop
36  return elist;
37 }