CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
TDisTrack.cxx
Go to the documentation of this file.
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_recCgemTrackCol = new TObjArray();
20 m_recCgemSegmentCol = new TObjArray();
21 m_recCgemHitCol = new TObjArray();
22 m_recTofTrackCol = new TObjArray();
23 m_recMucTrackCol = new TObjArray();
24 m_recEmcShowerCol = new TObjArray();
25 /* m_recTofTrackCol = s_staticTofTrackCol;
26
27
28 Clear();*/
29
30}
31
32//*****************************************************************
34
35
36 /**************************** Dst Track *************************/
37
38 // delete m_recMdcTrackCol;
39 if(m_recMdcTrackCol){ //m_recMdcTrackCol->Clear();
40 m_recMdcTrackCol->Delete();
41 delete m_recMdcTrackCol;}
42 m_recMdcTrackCol = 0;
43
44 if(m_recMdcHitCol){ //m_recMdcHitCol->Clear();
45 m_recMdcHitCol->Delete();
46 delete m_recMdcHitCol;}
47 m_recMdcHitCol = 0;
48
49 // delete m_recCgemTrackCol;
50 if(m_recCgemTrackCol){ //m_recCgemTrackCol->Clear();
51 m_recCgemTrackCol->Delete();
52 delete m_recCgemTrackCol;}
53 m_recCgemTrackCol = 0;
54
55 // delete m_recCgemSegmentCol;
56 if(m_recCgemSegmentCol){ //m_recCgemSegmentCol->Clear();
57 m_recCgemSegmentCol->Delete();
58 delete m_recCgemSegmentCol;}
59 m_recCgemSegmentCol = 0;
60
61 if(m_recCgemHitCol){ //m_recCgemHitCol->Clear();
62 m_recCgemHitCol->Delete();
63 delete m_recCgemHitCol;}
64 m_recCgemHitCol = 0;
65
66 if(m_recTofTrackCol){// m_recTofTrackCol->Clear();
67 m_recTofTrackCol->Delete();
68 delete m_recTofTrackCol;}
69 m_recTofTrackCol = 0;
70
71 if(m_recMucTrackCol){ //m_recMucTrackCol->Clear();
72 m_recMucTrackCol->Delete();
73 delete m_recMucTrackCol;}
74 m_recMucTrackCol = 0;
75
76 if(m_recEmcShowerCol){//m_recEmcShowerCol->Clear();
77 m_recEmcShowerCol->Delete();
78 delete m_recEmcShowerCol;}
79 m_recEmcShowerCol =0;
80
81}
82
83//*****************************************************************
86
87//*****************************************************************
88void TDisTrack::Clear(Option_t *option) {
89 if(m_recMdcTrackCol){// m_recMdcTrackCol->Clear();
90 std::cout<<"step1"<<std::endl;
91 // m_recMdcTrackCol->Delete();
92 delete m_recMdcTrackCol;}
93 m_recMdcTrackCol = 0;
94
95 if(m_recMdcHitCol){ //m_recMdcHitCol->Clear();
96 std::cout<<"step2"<<std::endl;
97 // m_recMdcHitCol->Delete();
98 delete m_recMdcHitCol;}
99 m_recMdcHitCol = 0;
100
101 if(m_recCgemTrackCol){// m_recCgemTrackCol->Clear();
102 std::cout<<"step1"<<std::endl;
103 // m_recCgemTrackCol->Delete();
104 delete m_recCgemTrackCol;}
105 m_recCgemTrackCol = 0;
106
107 if(m_recCgemSegmentCol){// m_recCgemSegmentCol->Clear();
108 std::cout<<"step1"<<std::endl;
109 // m_recCgemSegmentCol->Delete();
110 delete m_recCgemSegmentCol;}
111 m_recCgemSegmentCol = 0;
112
113 if(m_recCgemHitCol){ //m_recCgemHitCol->Clear();
114 std::cout<<"step2"<<std::endl;
115 // m_recCgemHitCol->Delete();
116 delete m_recCgemHitCol;}
117 m_recCgemHitCol = 0;
118
119 if(m_recTofTrackCol){ //m_recTofTrackCol->Clear();
120 std::cout<<"step3"<<std::endl;
121// m_recTofTrackCol->Delete();
122delete m_recTofTrackCol;}
123 m_recTofTrackCol = 0;
124
125 if(m_recMucTrackCol){ //m_recMucTrackCol->Clear();
126 std::cout<<"step4"<<std::endl;
127//; m_recMucTrackCol->Delete();
128 delete m_recMucTrackCol;}
129 m_recMucTrackCol = 0;
130
131 if(m_recEmcShowerCol){//m_recEmcShowerCol->Clear();
132 std::cout<<"step5"<<std::endl;
133// m_recEmcShowerCol->Delete();
134 delete m_recEmcShowerCol;}
135 m_recEmcShowerCol =0;
136
137}
138
139//*****************************************************************************
140void TDisTrack::Print(Option_t *option) const {
141 TObject::Print(option);
142}
143
144
145/**************** Dst Track ************************/
146/// Mdc
148 m_recMdcTrackCol->Add(Track);
149 }
150
152 if (Int_t(i) >= m_recMdcTrackCol->GetEntries())
153 return 0;
154 return (TRecMdcTrack*)m_recMdcTrackCol->At(i);
155 }
156
157//MdcHits
159 m_recMdcHitCol->Add(Hit);
160 }
161
162const TRecMdcHit* TDisTrack::getRecMdcHit(Int_t i) const {
163 if (Int_t(i) >= m_recMdcHitCol->GetEntries())
164 return 0;
165 return (TRecMdcHit*)m_recMdcHitCol->At(i);
166 }
167
168/// Cgem
170 m_recCgemSegmentCol->Add(Segment);
171 }
172
174 if (Int_t(i) >= m_recCgemSegmentCol->GetEntries())
175 return 0;
176 return (TRecCgemSegment*)m_recCgemSegmentCol->At(i);
177 }
178
180 m_recCgemTrackCol->Add(Track);
181 }
182
184 if (Int_t(i) >= m_recCgemTrackCol->GetEntries())
185 return 0;
186 return (TRecCgemTrack*)m_recCgemTrackCol->At(i);
187 }
188
189//CgemHits
191 m_recCgemHitCol->Add(Hit);
192 }
193
195 if (Int_t(i) >= m_recCgemHitCol->GetEntries())
196 return 0;
197 return (TRecCgemHit*)m_recCgemHitCol->At(i);
198 }
199
200//TOF
202 m_recTofTrackCol->Add(Track);
203}
205 if(Int_t(i) >=m_recTofTrackCol->GetEntries())
206 return 0;
207 return (TRecTofTrack*) m_recTofTrackCol->At(i);
208}
209
210 ///Muc
212 m_recMucTrackCol->Add(Track);
213 }
214
215 const TRecMucTrack* TDisTrack::getMucTrack(Int_t i) const {
216 if(Int_t(i) >=m_recMucTrackCol->GetEntries())
217 return 0;
218 return (TRecMucTrack*) m_recMucTrackCol->At(i);
219 }
220
221//EmcShowers
223 m_recEmcShowerCol->Add(Track);
224}
225
226 /// retrieve a EmcShower from the collection, using the index into the array
228 if(Int_t(i) >=m_recEmcShowerCol->GetEntries())
229 return 0;
230 return (TRecEmcShower*) m_recEmcShowerCol->At(i);
231 }
232
234 std::cout<<"getMdcTrackNum step1"<<std::endl;
235 if(m_recMdcTrackCol){
236 std::cout<<"getMdcTrackNum step2"<<std::endl;
237 return m_recMdcTrackCol->GetEntries();
238}
239 std::cout<<"getMdcTrackNum step3"<<std::endl;
240 return 0;
241}
242
244 std::cout<<"getCgemSegmentNum step1"<<std::endl;
245 if(m_recCgemSegmentCol){
246 std::cout<<"getCgemSegmentNum step2"<<std::endl;
247 return m_recCgemSegmentCol->GetEntries();
248}
249 std::cout<<"getCgemSegmentNum step3"<<std::endl;
250 return 0;
251}
252
254 std::cout<<"getCgemTrackNum step1"<<std::endl;
255 if(m_recCgemTrackCol){
256 std::cout<<"getCgemTrackNum step2"<<std::endl;
257 return m_recCgemTrackCol->GetEntries();
258}
259 std::cout<<"getCgemTrackNum step3"<<std::endl;
260 return 0;
261}
262
264 std::cout<<"getTofTrackNum step1"<<std::endl;
265 if(m_recTofTrackCol){
266 std::cout<<"getTofTrackNum step2"<<std::endl;
267 return m_recTofTrackCol->GetEntries();
268}
269 std::cout<<"getTofTrackNum step3"<<std::endl;
270 return 0;
271}
272
274 std::cout<<"getEmcShowerNum step1"<<std::endl;
275 if(m_recEmcShowerCol){
276 std::cout<<"getEmcShowerNum step2"<<std::endl;
277 return m_recEmcShowerCol->GetEntries();
278}
279std::cout<<"getEmcShowerNum step3"<<std::endl;
280 return 0;
281}
282
284 std::cout<<"getMucTrackNum step1"<<std::endl;
285 if(m_recMucTrackCol){
286 std::cout<<"getMucTrackNum step2"<<std::endl;
287 return m_recMucTrackCol->GetEntries();
288}
289 std::cout<<"getMucTrackNum step3"<<std::endl;
290 return 0;
291}
292
294 std::cout<<"getMdcHitkNum step1"<<std::endl;
295 if(m_recMdcHitCol){
296 std::cout<<"getMdcHitkNum step2"<<std::endl;
297 return m_recMdcHitCol->GetEntries();
298}
299 std::cout<<"getMdcHitkNum step3"<<std::endl;
300 return 0;
301}
302
304 std::cout<<"getCgemHitkNum step1"<<std::endl;
305 if(m_recCgemHitCol){
306 std::cout<<"getCgemHitkNum step2"<<std::endl;
307 return m_recCgemHitCol->GetEntries();
308}
309 std::cout<<"getCgemHitkNum step3"<<std::endl;
310 return 0;
311}
312
313
ClassImp(TDisTrack) TDisTrack
Definition TDisTrack.cxx:5
#define Segment
Definition TTrackBase.h:31
#define Track
Definition TTrackBase.h:30
void addRecMdcTrack(TRecMdcTrack *Track)
Add a TkrTrack into the Mdc data collection.
void addRecCgemHit(TRecCgemHit *Hit)
Add a Rec Cgem Hit into the Cgem data collection.
int getMdcHitNum()
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
const TRecCgemTrack * getRecCgemTrack(Int_t i) const
retrieve a CgemTrack from the collection, using the index into the array
void initialize()
Definition TDisTrack.cxx:84
const TRecCgemSegment * getRecCgemSegment(Int_t i) const
retrieve a CgemSegment from the collection, using the index into the array
int getCgemSegmentNum()
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
void addRecCgemTrack(TRecCgemTrack *Track)
Add a TkrTrack into the Cgem data collection.
void addTofTrack(TRecTofTrack *Track)
void addMucTrack(TRecMucTrack *Track)
Add a MucTrack into the TOF Data collection.
void Clear(Option_t *option="")
Definition TDisTrack.cxx:88
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
int getMdcTrackNum()
const TRecMdcHit * getRecMdcHit(Int_t i) const
retrieve a RecMdcHit from the collection, using the index into the array
int getMucTrackNum()
int getEmcShowerNum()
int getTofTrackNum()
void Print(Option_t *option="") const
void addRecMdcHit(TRecMdcHit *Hit)
Add a Rec Mdc Hit into the Mdc data collection.
const TRecCgemHit * getRecCgemHit(Int_t i) const
retrieve a RecCgemHit from the collection, using the index into the array
int getCgemTrackNum()
void addEmcShower(TRecEmcShower *Track)
Add a TkrTrack into the Emc data collection.
int getCgemHitNum()
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
void addRecCgemSegment(TRecCgemSegment *Segment)
Add a TkrSegment into the Cgem data collection.
virtual ~TDisTrack()
Definition TDisTrack.cxx:33