BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
TDisTrack.cxx
Go to the documentation of this file.
1#include "RootEventData/TDisTrack.h"
2#include <iostream>
3#include "TCollection.h" // Declares TIter
4
6
7// Allocate the TObjArray just once
8
9//***************************************************************
11{
12 //Dst Track
13 //Rec Track
14 // if (!m_recMdcTrackCol) {
15
16 m_recMdcTrackCol = new TObjArray();
17 // }
18 m_recMdcHitCol = new TObjArray();
19 m_recTofTrackCol = new TObjArray();
20 m_recMucTrackCol = new TObjArray();
21 m_recEmcShowerCol = new TObjArray();
22 /* m_recTofTrackCol = s_staticTofTrackCol;
23
24
25 Clear();*/
26
27}
28
29//*****************************************************************
31
32
33 /**************************** Dst Track *************************/
34
35 // delete m_recMdcTrackCol;
36 if(m_recMdcTrackCol){ //m_recMdcTrackCol->Clear();
37 m_recMdcTrackCol->Delete();
38 delete m_recMdcTrackCol;}
39 m_recMdcTrackCol = 0;
40
41 if(m_recMdcHitCol){ //m_recMdcHitCol->Clear();
42 m_recMdcHitCol->Delete();
43 delete m_recMdcHitCol;}
44 m_recMdcHitCol = 0;
45
46 if(m_recTofTrackCol){// m_recTofTrackCol->Clear();
47 m_recTofTrackCol->Delete();
48 delete m_recTofTrackCol;}
49 m_recTofTrackCol = 0;
50
51 if(m_recMucTrackCol){ //m_recMucTrackCol->Clear();
52 m_recMucTrackCol->Delete();
53 delete m_recMucTrackCol;}
54 m_recMucTrackCol = 0;
55
56 if(m_recEmcShowerCol){//m_recEmcShowerCol->Clear();
57 m_recEmcShowerCol->Delete();
58 delete m_recEmcShowerCol;}
59 m_recEmcShowerCol =0;
60
61}
62
63//*****************************************************************
65}
66
67//*****************************************************************
68void TDisTrack::Clear(Option_t *option) {
69 if(m_recMdcTrackCol){// m_recMdcTrackCol->Clear();
70 std::cout<<"step1"<<std::endl;
71 // m_recMdcTrackCol->Delete();
72 delete m_recMdcTrackCol;}
73 m_recMdcTrackCol = 0;
74
75 if(m_recMdcHitCol){ //m_recMdcHitCol->Clear();
76 std::cout<<"step2"<<std::endl;
77 // m_recMdcHitCol->Delete();
78 delete m_recMdcHitCol;}
79 m_recMdcHitCol = 0;
80
81 if(m_recTofTrackCol){ //m_recTofTrackCol->Clear();
82 std::cout<<"step3"<<std::endl;
83// m_recTofTrackCol->Delete();
84delete m_recTofTrackCol;}
85 m_recTofTrackCol = 0;
86
87 if(m_recMucTrackCol){ //m_recMucTrackCol->Clear();
88 std::cout<<"step4"<<std::endl;
89//; m_recMucTrackCol->Delete();
90 delete m_recMucTrackCol;}
91 m_recMucTrackCol = 0;
92
93 if(m_recEmcShowerCol){//m_recEmcShowerCol->Clear();
94 std::cout<<"step5"<<std::endl;
95// m_recEmcShowerCol->Delete();
96 delete m_recEmcShowerCol;}
97 m_recEmcShowerCol =0;
98
99}
100
101//*****************************************************************************
102void TDisTrack::Print(Option_t *option) const {
103 TObject::Print(option);
104}
105
106
107/**************** Dst Track ************************/
108/// Mdc
110 m_recMdcTrackCol->Add(Track);
111 }
112
114 if (Int_t(i) >= m_recMdcTrackCol->GetEntries())
115 return 0;
116 return (TRecMdcTrack*)m_recMdcTrackCol->At(i);
117 }
118
119//MdcHits
121 m_recMdcHitCol->Add(Hit);
122 }
123
124const TRecMdcHit* TDisTrack::getRecMdcHit(Int_t i) const {
125 if (Int_t(i) >= m_recMdcHitCol->GetEntries())
126 return 0;
127 return (TRecMdcHit*)m_recMdcHitCol->At(i);
128 }
129
130//TOF
132 m_recTofTrackCol->Add(Track);
133}
135 if(Int_t(i) >=m_recTofTrackCol->GetEntries())
136 return 0;
137 return (TRecTofTrack*) m_recTofTrackCol->At(i);
138}
139
140 ///Muc
142 m_recMucTrackCol->Add(Track);
143 }
144
145 const TRecMucTrack* TDisTrack::getMucTrack(Int_t i) const {
146 if(Int_t(i) >=m_recMucTrackCol->GetEntries())
147 return 0;
148 return (TRecMucTrack*) m_recMucTrackCol->At(i);
149 }
150
151//EmcShowers
153 m_recEmcShowerCol->Add(Track);
154}
155
156 /// retrieve a EmcShower from the collection, using the index into the array
158 if(Int_t(i) >=m_recEmcShowerCol->GetEntries())
159 return 0;
160 return (TRecEmcShower*) m_recEmcShowerCol->At(i);
161 }
162
164 std::cout<<"getMdcTrackNum step1"<<std::endl;
165 if(m_recMdcTrackCol){
166 std::cout<<"getMdcTrackNum step2"<<std::endl;
167 return m_recMdcTrackCol->GetEntries();
168}
169 std::cout<<"getMdcTrackNum step3"<<std::endl;
170 return 0;
171}
172
174 std::cout<<"getTofTrackNum step1"<<std::endl;
175 if(m_recTofTrackCol){
176 std::cout<<"getTofTrackNum step2"<<std::endl;
177 return m_recTofTrackCol->GetEntries();
178}
179 std::cout<<"getTofTrackNum step3"<<std::endl;
180 return 0;
181}
182
184 std::cout<<"getEmcShowerNum step1"<<std::endl;
185 if(m_recEmcShowerCol){
186 std::cout<<"getEmcShowerNum step2"<<std::endl;
187 return m_recEmcShowerCol->GetEntries();
188}
189std::cout<<"getEmcShowerNum step3"<<std::endl;
190 return 0;
191}
192
194 std::cout<<"getMucTrackNum step1"<<std::endl;
195 if(m_recMucTrackCol){
196 std::cout<<"getMucTrackNum step2"<<std::endl;
197 return m_recMucTrackCol->GetEntries();
198}
199 std::cout<<"getMucTrackNum step3"<<std::endl;
200 return 0;
201}
202
204 std::cout<<"getMdcHitkNum step1"<<std::endl;
205 if(m_recMdcHitCol){
206 std::cout<<"getMdcHitkNum step2"<<std::endl;
207 return m_recMdcHitCol->GetEntries();
208}
209 std::cout<<"getMdcHitkNum step3"<<std::endl;
210 return 0;
211}
212
213
ClassImp(TDisTrack) TDisTrack
Definition: TDisTrack.cxx:5
void addRecMdcTrack(TRecMdcTrack *Track)
Add a TkrTrack into the Mdc data collection.
Definition: TDisTrack.cxx:109
int getMdcHitNum()
Definition: TDisTrack.cxx:203
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:134
void initialize()
Definition: TDisTrack.cxx:64
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:145
void addTofTrack(TRecTofTrack *Track)
Definition: TDisTrack.cxx:131
void addMucTrack(TRecMucTrack *Track)
Add a MucTrack into the TOF Data collection.
Definition: TDisTrack.cxx:141
void Clear(Option_t *option="")
Definition: TDisTrack.cxx:68
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
Definition: TDisTrack.cxx:157
int getMdcTrackNum()
Definition: TDisTrack.cxx:163
const TRecMdcHit * getRecMdcHit(Int_t i) const
retrieve a RecMdcHit from the collection, using the index into the array
Definition: TDisTrack.cxx:124
int getMucTrackNum()
Definition: TDisTrack.cxx:193
int getEmcShowerNum()
Definition: TDisTrack.cxx:183
int getTofTrackNum()
Definition: TDisTrack.cxx:173
void Print(Option_t *option="") const
Definition: TDisTrack.cxx:102
void addRecMdcHit(TRecMdcHit *Hit)
Add a Rec Mdc Hit into the Mdc data collection.
Definition: TDisTrack.cxx:120
void addEmcShower(TRecEmcShower *Track)
Add a TkrTrack into the Emc data collection.
Definition: TDisTrack.cxx:152
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
Definition: TDisTrack.cxx:113
virtual ~TDisTrack()
Definition: TDisTrack.cxx:30