62 {
63
64 MsgStream log(
msgSvc(), name() );
65 log << MSG::INFO << "in execute()" << endmsg;
66
67
68
69 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(), "/Event/EventHeader" );
70 if ( !eventHeader )
71 {
72 log << MSG::FATAL << "Could not find Event Header" << endmsg;
73 return ( StatusCode::FAILURE );
74 }
75
76 int eventId = eventHeader->eventNumber();
77 int runId = eventHeader->runNumber();
78 log << MSG::INFO << "DstEventMaker: retrieved event: "
79 << " Event Number " << eventId << " run: " << runId << endmsg;
80
81 StatusCode sc = StatusCode::SUCCESS;
82 int trackID;
83
84
85 DstEvent* dstEvt = new DstEvent();
86
87
89
90
91 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol( eventSvc(), "/Event/Recon/RecMdcTrackCol" );
92 if ( !recMdcTrackCol ) { log << MSG::INFO << "Could not find RecMdcTrackCol" << endmsg; }
93 else
94 {
96 RecMdcTrackCol::iterator iter_mdc = recMdcTrackCol->begin();
97 trackID = 0;
98 for ( ; iter_mdc != recMdcTrackCol->end(); iter_mdc++, trackID++ )
99 {
100 DstMdcTrack* dstMdcTrack = new DstMdcTrack();
101 *dstMdcTrack = **iter_mdc;
102 ( *dstMdcTrackCol ).push_back( dstMdcTrack );
103
104 log << MSG::INFO << " Mdc Track ID = " << trackID
105 <<
" Mdc Track Nster = " << ( *iter_mdc )->
nster() << endmsg;
106 }
108 }
109
110
111 SmartDataPtr<RecTofTrackCol> tofTrackCol( eventSvc(), "/Event/Recon/RecTofTrackCol" );
112 if ( !tofTrackCol ) { log << MSG::INFO << "Could not find TofTrackCol" << endmsg; }
113 else
114 {
116 RecTofTrackCol::iterator iter_tof = tofTrackCol->begin();
117 for ( ; iter_tof != tofTrackCol->end(); iter_tof++ )
118 {
119 DstTofTrack* dstTofTrack = new DstTofTrack();
120 *dstTofTrack = **iter_tof;
121 ( *dstTofTrackCol ).push_back( dstTofTrack );
122
123 log << MSG::INFO <<
"Tof Track ID = " << ( *iter_tof )->
tofTrackID()
124 << " Track ID = " << ( *iter_tof )->trackID()
125 << " Tof Counter ID = " << ( *iter_tof )->tofID()
126 << " Quality = " << ( *iter_tof )->quality() << endmsg;
127 }
129 }
130
131
132 SmartDataPtr<RecMucTrackCol> mucTrackCol( eventSvc(), "/Event/Recon/RecMucTrackCol" );
133 if ( !mucTrackCol ) { log << MSG::INFO << "Could not find RecMucTrackCol" << endmsg; }
134 else
135 {
137 RecMucTrackCol::iterator iter_muc = mucTrackCol->begin();
138 trackID = 0;
139 for ( ; iter_muc != mucTrackCol->end(); iter_muc++, trackID++ )
140 {
141 DstMucTrack* dstMucTrack = new DstMucTrack();
142 *dstMucTrack = **iter_muc;
143 ( *dstMucTrackCol ).push_back( dstMucTrack );
144 log << MSG::INFO << "Muc Track ID = " << trackID
145 << " Muc NumHits = " << ( *iter_muc )->GetTotalHits()
146 << " Muc Pos x = " << ( *iter_muc )->getMucPos().x()
147 << " Muc Pos y = " << ( *iter_muc )->getMucPos().y()
148 << " Muc Pos z = " << ( *iter_muc )->getMucPos().z() << endmsg;
149 }
151 }
152
153
154
155 SmartDataPtr<RecMdcDedxCol> mdcDedxCol( eventSvc(), "/Event/Recon/RecMdcDedxCol" );
156 if ( !mdcDedxCol ) { log << MSG::INFO << "Could not find RecMdcDedxCol" << endmsg; }
157 else
158 {
159 trackID = 0;
161 RecMdcDedxCol::iterator iter_dedx = mdcDedxCol->begin();
162 for ( ; iter_dedx != mdcDedxCol->end(); iter_dedx++, trackID++ )
163 {
164 DstMdcDedx* dstMdcDedx = new DstMdcDedx();
165 *dstMdcDedx = **iter_dedx;
166 ( *dstMdcDedxCol ).push_back( dstMdcDedx );
167 log << MSG::INFO << " Dedx TrackID = "
168 << trackID
169
170
171 << endmsg;
172 }
174 }
175
176
177
178 SmartDataPtr<RecEmcShowerCol> emcRecShowerCol( eventSvc(), "/Event/Recon/RecEmcShowerCol" );
179 if ( !emcRecShowerCol )
180 {
181 log << MSG::INFO << "Could not find RecEmcShowerCol" << endmsg;
182
183 }
184 else
185 {
186 trackID = 0;
188 RecEmcShowerCol::iterator iter_emc = emcRecShowerCol->begin();
189 for ( ; iter_emc != emcRecShowerCol->end(); iter_emc++, trackID++ )
190 {
191 DstEmcShower* dstEmcTrack = new DstEmcShower( *( *iter_emc ) );
192 ( *dstEmcTrackCol ).push_back( dstEmcTrack );
193 log << MSG::INFO << " Emc Track Id = "
194 << trackID
195
196 << endmsg;
197 }
199 }
200
201
202
203 SmartDataPtr<RecExtTrackCol> extTrackCol( eventSvc(), "/Event/Recon/RecExtTrackCol" );
204 if ( !extTrackCol )
205 {
206 log << MSG::INFO << "Could not find RecExtTrackCol" << endmsg;
207
208 }
209 else
210 {
211 trackID = 0;
213 RecExtTrackCol::iterator iter_ext = extTrackCol->begin();
214 for ( ; iter_ext != extTrackCol->end(); iter_ext++, trackID++ )
215 {
216 DstExtTrack* dstExtTrack = new DstExtTrack();
217 *dstExtTrack = **iter_ext;
218 ( *dstExtTrackCol ).push_back( dstExtTrack );
219 log << MSG::INFO << " Ext Track Id = " << trackID
221 << " Ext Tof1 Error Z = " << ( *iter_ext )->tof1PosSigmaAlongZ()
222 << " Ext Tof2 Error Z = " << ( *iter_ext )->tof2PosSigmaAlongZ()
223 << " Ext Emc Error theta = " << ( *iter_ext )->emcPosSigmaAlongTheta()
224 << " Ext Muc Error Z = " << ( *iter_ext )->mucPosSigmaAlongZ() << endmsg;
225 }
226
228 }
229
230
231 SmartDataPtr<RecMdcKalTrackCol> mdcKalTrackCol( eventSvc(),
232 "/Event/Recon/RecMdcKalTrackCol" );
233 if ( !mdcKalTrackCol )
234 {
235 log << MSG::INFO << "Could not find MdcKalTrackCol" << endmsg;
236
237 }
238 else
239 {
240 trackID = 0;
241 int nhits[5];
242 int stat[2][5];
243 float chisq[2][5];
244 int ndf[2][5];
245 int nster[2][5];
246 int fL[2][5];
247 int lL[2][5];
248
250 RecMdcKalTrackCol::iterator iter_kal = mdcKalTrackCol->begin();
251 for ( ; iter_kal != mdcKalTrackCol->end(); iter_kal++, trackID++ )
252 {
253 DstMdcKalTrack* dstMdcKalTrack = new DstMdcKalTrack();
254 *dstMdcKalTrack = **iter_kal;
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284 ( *dstMdcKalTrackCol ).push_back( dstMdcKalTrack );
285
286 log << MSG::INFO << " * * * * * * * * * * * * * * * * * * * * * * * * * * *" << endmsg;
287 for ( int i = 0; i < 5; i++ )
288 {
289 log << MSG::INFO << "dstMdcKalTrack ZHelix[" << i
290 <<
"] = " << dstMdcKalTrack->
getZHelix( i ) << endmsg;
291 log << MSG::INFO << "number of total hits contained [" << i << "]" << nhits[i]
292 << endmsg;
293 log << MSG::INFO << "status flag [" << i << "]" << stat[i] << endmsg;
294 log << MSG::INFO << "dstMdcKalTrack ZError [" << i << "]"
295 << dstMdcKalTrack->
getZError( i ) << endmsg;
296 log << MSG::INFO <<
"dstMdcKalTrack Poca [" << i <<
"]" << dstMdcKalTrack->
getPoca( i )
297 << endmsg;
298 }
299 }
301 }
302
303 return sc;
304}
ObjectVector< DstEmcShower > DstEmcShowerCol
ObjectVector< DstExtTrack > DstExtTrackCol
ObjectVector< DstMdcDedx > DstMdcDedxCol
ObjectVector< DstMdcKalTrack > DstMdcKalTrackCol
ObjectVector< DstMdcTrack > DstMdcTrackCol
ObjectVector< DstMucTrack > DstMucTrackCol
ObjectVector< DstTofTrack > DstTofTrackCol
const string tof1VolumeName() const
const HepVector & getZHelix(const int pid) const
const HepSymMatrix & getZError(const int pid) const
const HepPoint3D & getPoca(const int pid) const
_EXTERN_ std::string Event
_EXTERN_ std::string DstEmcShowerCol
_EXTERN_ std::string DstMdcKalTrackCol
_EXTERN_ std::string DstExtTrackCol
_EXTERN_ std::string DstMdcDedxCol
_EXTERN_ std::string DstTofTrackCol
_EXTERN_ std::string DstMdcTrackCol
_EXTERN_ std::string DstMucTrackCol