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