StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjeTrackListToStMuTrackFourVecList.cxx
1 // $Id: StjeTrackListToStMuTrackFourVecList.cxx,v 1.10 2012/03/23 05:44:20 pibero Exp $
2 #include "StjeTrackListToStMuTrackFourVecList.h"
3 
4 #include "StjTrackToTLorentzVector.h"
5 
6 #include "../emulator/StMuTrackEmu.h"
7 #include "../emulator/StMuTrackFourVec.h"
8 
9 StjeTrackListToStMuTrackFourVecList::StjeTrackListToStMuTrackFourVecList()
10  : _trackTo4p(*(new StjTrackToTLorentzVector)) { }
11 
12 
13 FourList StjeTrackListToStMuTrackFourVecList::operator()(const StjTrackList& trackList)
14 {
15  FourList ret;
16 
17  for(StjTrackList::const_iterator track = trackList.begin(); track != trackList.end(); ++track) {
18 
19  StMuTrackEmu *trackEmu = createTrackEmu(*track);
20 
21  TLorentzVector p4 = _trackTo4p(*track);
22 
23  StMuTrackFourVec* pmu = new StMuTrackFourVec(trackEmu, 0, 0, p4, (*track).charge, (*track).trackIndex, kTpcId);
24  ret.push_back(pmu);
25  }
26 
27  return ret;
28 }
29 
30 StMuTrackEmu* StjeTrackListToStMuTrackFourVecList::createTrackEmu(const StjTrack& track)
31 {
32  StMuTrackEmu *ret = new StMuTrackEmu();
33 
34  TVector3 momentum;
35  momentum.SetPtEtaPhi(track.pt, track.eta, track.phi);
36 
37  ret->_px = momentum.Px() ;
38  ret->_py = momentum.Py() ;
39  ret->_pz = momentum.Pz() ;
40  ret->_flag = track.flag ;
41  ret->_nHits = track.nHits ;
42  ret->_charge = track.charge ;
43  ret->_nHitsPoss = track.nHitsPoss ;
44  ret->_nHitsDedx = track.nHitsDedx ;
45  ret->_nHitsFit = track.nHitsFit ;
46  ret->_nSigmaPion = track.nSigmaPion ;
47  ret->_nSigmaKaon = track.nSigmaKaon ;
48  ret->_nSigmaProton = track.nSigmaProton ;
49  ret->_nSigmaElectron = track.nSigmaElectron ;
50  ret->_Tdca = track.Tdca ;
51  ret->_dcaX = track.dcaX ;
52  ret->_dcaY = track.dcaY ;
53  ret->_dcaZ = track.dcaZ ;
54  ret->_dcaD = track.dcaD ;
55  ret->_chi2 = track.chi2 ;
56  ret->_chi2prob = track.chi2prob ;
57  ret->_BField = track.BField ;
58  ret->_bemcRadius = track.bemcRadius ;
59  ret->_etaext = track.exitEta ;
60  ret->_phiext = track.exitPhi ;
61  ret->_exitTowerId = track.exitTowerId ;
62  ret->_exitDetectorId = track.exitDetectorId ;
63  ret->_dEdx = track.dEdx ;
64  ret->_beta = track.beta ;
65  ret->_firstPoint = track.firstPoint ;
66  ret->_lastPoint = track.lastPoint ;
67  ret->_trackIndex = track.trackIndex ;
68  ret->_id = track.id ;
69  ret->_idTruth = track.idTruth ;
70  ret->_qaTruth = track.qaTruth ;
71  ret->_detectorId = track.detectorId ;
72  ret->_btofTrayId = track.btofTrayId ;
73  ret->_nSigmaTofPion = track.nSigmaTofPion ;
74  ret->_nSigmaTofKaon = track.nSigmaTofKaon ;
75  ret->_nSigmaTofProton = track.nSigmaTofProton ;
76  ret->_nSigmaTofElectron = track.nSigmaTofElectron ;
77 
78  return ret;
79 }