StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrackTowerEnergyListToFourVecList.cxx
1 // $Id: StjTrackTowerEnergyListToFourVecList.cxx,v 1.1 2008/11/27 07:09:38 tai Exp $
2 #include "StjTrackTowerEnergyListToFourVecList.h"
3 
4 #include "StjTrackToFourVec.h"
5 #include "StjTowerEnergyToFourVec.h"
6 
8 
9 StjFourVecList StjTrackTowerEnergyListToFourVecList::operator()(const std::pair<StjTrackList, StjTowerEnergyList>& inList)
10 {
11  return operator()(inList.first, inList.second);
12 }
13 
14 StjFourVecList StjTrackTowerEnergyListToFourVecList::operator()(const StjTrackList& trackList, const StjTowerEnergyList& energyList)
15 {
16  StjFourVecList ret;
17 
18  StjTrackToFourVec track2four;
19  StjTowerEnergyToFourVec tower2four;
20 
21  int fourvecId(1);
22  for(StjTrackList::const_iterator track = trackList.begin(); track != trackList.end(); ++track) {
23  StjFourVec four = track2four(*track);
24  four.fourvecId = fourvecId++;
25  ret.push_back(four);
26  }
27 
28  for(StjTowerEnergyList::const_iterator tower = energyList.begin(); tower != energyList.end(); ++tower) {
29  StjFourVec four = tower2four(*tower);
30  four.fourvecId = fourvecId++;
31  ret.push_back(four);
32  }
33 
34  return ret;
35 }