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