StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrackListReader.cxx
1 // $Id: StjTrackListReader.cxx,v 1.5 2008/08/11 03:51:00 tai Exp $
2 #include "StjTrackListReader.h"
3 
4 #include <TTree.h>
5 
6 ClassImp(StjTrackListReader)
7 
8 void StjTrackListReader::SetBranchAddress(TTree *tree)
9 {
10  tree->SetBranchAddress("eventId" , &_eventId );
11  tree->SetBranchAddress("nTracks" , &_nTracks );
12  tree->SetBranchAddress("pt" , _pt );
13  tree->SetBranchAddress("eta" , _eta );
14  tree->SetBranchAddress("phi" , _phi );
15  tree->SetBranchAddress("exitEta" , _exitEta );
16  tree->SetBranchAddress("exitPhi" , _exitPhi );
17  tree->SetBranchAddress("trackId" , _trackId );
18  tree->SetBranchAddress("flag" , _flag );
19  tree->SetBranchAddress("nHits" , _nHits );
20  tree->SetBranchAddress("charge" , _charge );
21  tree->SetBranchAddress("nHitsPoss" , _nHitsPoss );
22  tree->SetBranchAddress("nHitsDedx" , _nHitsDedx );
23  tree->SetBranchAddress("nHitsFit" , _nHitsFit );
24  tree->SetBranchAddress("nSigmaPion" , _nSigmaPion );
25  tree->SetBranchAddress("Tdca" , _Tdca );
26  tree->SetBranchAddress("dcaZ" , _dcaZ );
27  tree->SetBranchAddress("dcaD" , _dcaD );
28  tree->SetBranchAddress("BField" , &_BField );
29  tree->SetBranchAddress("bemcRadius" , &_bemcRadius );
30  tree->SetBranchAddress("dEdx" , _dEdx );
31  tree->SetBranchAddress("trackIndex" , _trackIndex );
32  tree->SetBranchAddress("exitDetectorId" , _exitDetectorId );
33  tree->SetBranchAddress("exitTowerId" , _exitTowerId );
34  tree->SetBranchAddress("vertexZ" , &_vertexZ );
35  tree->SetBranchAddress("detectorId" , &_detectorId );
36  tree->SetBranchAddress("runNumber" , &_runNumber );
37 }
38 
39 void StjTrackListReader::clearEntry()
40 {
41  _list.clear();
42 }
43 
44 void StjTrackListReader::readEntry()
45 {
46  clearEntry();
47 
48  for(int i = 0; i < _nTracks; ++i) {
49 
51 
52  track.runNumber = _runNumber;
53  track.eventId = _eventId;
54  track.detectorId = _detectorId;
55  track.pt = _pt[i];
56  track.eta = _eta[i];
57  track.phi = _phi[i];
58  track.flag = _flag[i];
59  track.nHits = _nHits[i];
60  track.charge = _charge[i];
61  track.nHitsPoss = _nHitsPoss[i];
62  track.nHitsDedx = _nHitsDedx[i];
63  track.nHitsFit = _nHitsFit[i];
64  track.nSigmaPion = _nSigmaPion[i];
65  track.Tdca = _Tdca[i];
66  track.dcaZ = _dcaZ[i];
67  track.dcaD = _dcaD[i];
68  track.BField = _BField;
69  track.bemcRadius = _bemcRadius;
70  track.exitDetectorId = _exitDetectorId[i];
71  track.exitTowerId = _exitTowerId[i];
72  track.exitEta = _exitEta[i];
73  track.exitPhi = _exitPhi[i];
74  track.dEdx = _dEdx[i];
75  track.trackIndex = _trackIndex[i];
76  track.id = _trackId[i];
77  track.vertexZ = _vertexZ;
78 
79  _list.push_back(track);
80  }
81 }