StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBET4pMakerImp.cxx
1 // $Id: StBET4pMakerImp.cxx,v 1.7 2010/04/24 04:15:35 pibero Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StBET4pMakerImp.h"
4 
5 #include "StjTPC.h"
6 #include "StjBEMC.h"
7 #include "StjEEMC.h"
8 
9 #include "StjTrackListCut.h"
10 #include "StjTowerEnergyListCut.h"
11 
12 #include "StjAbstractTowerEnergyCorrectionForTracks.h"
13 
14 #include <iostream>
15 
16 using namespace std;
17 
18 StBET4pMakerImp::StBET4pMakerImp(StjTPC* tpc, StjTrackListCut* tpcCut,
19  StjBEMC* bemc, StjTowerEnergyListCut* bemcCut,
20  StjAbstractTowerEnergyCorrectionForTracks* correctTowerEnergyForTracks,
21  StjEEMC* eemc)
22  : _tpc(tpc), _bemc(bemc), _eemc(eemc)
23  , _tpcCut(tpcCut), _bemcCut(bemcCut)
24  , _correctTowerEnergyForTracks(correctTowerEnergyForTracks)
25 {
26 
27 }
28 
29 void StBET4pMakerImp::Init()
30 {
31  _tpc->Init();
32  _bemc->Init();
33  _eemc->Init();
34 }
35 
36 std::pair<StjTrackList, StjTowerEnergyList> StBET4pMakerImp::getTrackAndEnergyList()
37 {
38  StjTrackList trackList = _tpc->getTrackList();
39  StjTowerEnergyList bemcEnergyList = _bemc->getEnergyList();
40  StjTowerEnergyList eemcEnergyList = _eemc->getEnergyList();
41 
42  trackList = (*_tpcCut)(trackList);
43  bemcEnergyList = (*_bemcCut)(bemcEnergyList);
44 
45  StjTowerEnergyList energyList;
46  energyList.insert(energyList.end(),bemcEnergyList.begin(),bemcEnergyList.end());
47  energyList.insert(energyList.end(),eemcEnergyList.begin(),eemcEnergyList.end());
48 
49  energyList = (*_correctTowerEnergyForTracks)(energyList,trackList);
50 
51  return make_pair(trackList,energyList);
52 }
Definition: StjTPC.h:12