85 MsgStream log(
msgSvc(), name());
87 log << MSG::INFO <<
"in initialize()" << endmsg;
95 NTuplePtr trk0(
ntupleSvc(),
"FILE1/toftrk");
96 if ( trk0 ) trk_tuple = trk0;
97 else { trk_tuple =
ntupleSvc()->book (
"FILE1/toftrk", CLID_ColumnWiseTuple,
"ks N-Tuple example");
99 status = trk_tuple->addItem (
"trk_trackid", m_trk_trackid );
100 status = trk_tuple->addItem (
"trk_tofid", m_trk_tofid );
101 status = trk_tuple->addItem (
"trk_raw", m_trk_raw);
102 status = trk_tuple->addItem (
"trk_readout", m_trk_readout);
103 status = trk_tuple->addItem (
"trk_counter", m_trk_counter);
104 status = trk_tuple->addItem (
"trk_cluster", m_trk_cluster );
105 status = trk_tuple->addItem (
"trk_barrel", m_trk_barrel );
106 status = trk_tuple->addItem (
"trk_east", m_trk_east );
107 status = trk_tuple->addItem (
"trk_layer", m_trk_layer );
108 status = trk_tuple->addItem (
"trk_path", m_trk_path );
109 status = trk_tuple->addItem (
"trk_zrhit", m_trk_zrhit );
110 status = trk_tuple->addItem (
"trk_ph", m_trk_ph );
111 status = trk_tuple->addItem (
"trk_tof", m_trk_tof );
112 status = trk_tuple->addItem (
"trk_beta", m_trk_beta );
114 status = trk_tuple->addItem (
"trk_texpe", m_trk_texpe );
115 status = trk_tuple->addItem (
"trk_texpmu", m_trk_texpmu );
116 status = trk_tuple->addItem (
"trk_texppi", m_trk_texppi );
117 status = trk_tuple->addItem (
"trk_texpk", m_trk_texpk );
118 status = trk_tuple->addItem (
"trk_texpp", m_trk_texpp );
119 status = trk_tuple->addItem (
"trk_offe", m_trk_offe );
120 status = trk_tuple->addItem (
"trk_offmu", m_trk_offmu );
121 status = trk_tuple->addItem (
"trk_offpi", m_trk_offpi );
122 status = trk_tuple->addItem (
"trk_offk", m_trk_offk );
123 status = trk_tuple->addItem (
"trk_offp", m_trk_offp );
124 status = trk_tuple->addItem (
"trk_quality", m_trk_quality );
125 status = trk_tuple->addItem (
"trk_type", m_trk_type );
126 status = trk_tuple->addItem (
"trk_pidtype", m_trk_pidtype );
127 status = trk_tuple->addItem (
"trk_ppmdc", m_trk_ppmdc );
128 status = trk_tuple->addItem (
"trk_ppmdc", m_trk_ppmdc );
129 status = trk_tuple->addItem (
"trk_ptmdc", m_trk_ptmdc );
130 status = trk_tuple->addItem (
"trk_ppkal", m_trk_ppkal );
131 status = trk_tuple->addItem (
"trk_ptkal", m_trk_ptkal );
132 status = trk_tuple->addItem (
"trk_cosmdc", m_trk_cosmdc );
133 status = trk_tuple->addItem (
"trk_phimdc", m_trk_phimdc );
134 status = trk_tuple->addItem (
"trk_coskal", m_trk_coskal );
135 status = trk_tuple->addItem (
"trk_phikal", m_trk_phikal );
137 status = trk_tuple->addItem (
"trk_charge", m_trk_charge );
141 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(trk_tuple) << endmsg;
142 return StatusCode::FAILURE;
149 NTuplePtr nt1(
ntupleSvc(),
"FILE1/total4c");
150 if ( nt1 ) m_tuple1 = nt1;
152 m_tuple1 =
ntupleSvc()->book (
"FILE1/total4c", CLID_ColumnWiseTuple,
"ks N-Tuple example");
155 status = m_tuple1->addItem (
"run", m_run );
156 status = m_tuple1->addItem (
"rec", m_rec );
157 status = m_tuple1->addItem (
"mpprecall", m_mpprecall );
158 status = m_tuple1->addItem (
"meeall", m_meeall );
159 status = m_tuple1->addItem (
"ncgjs", m_ncgjs );
160 status = m_tuple1->addItem (
"cla2kpi", m_cla2kpi );
161 status = m_tuple1->addItem(
"indexmc", m_idxmc, 0, 100);
162 status = m_tuple1->addIndexedItem(
"pdgid", m_idxmc, m_pdgid);
164 status = m_tuple1->addIndexedItem(
"motheridx", m_idxmc, m_motheridx);
165 status = m_tuple1->addItem(
"indexmdc", m_idxmdc, 0, 5000);
166 status = m_tuple1->addIndexedItem (
"x0js", m_idxmdc, m_x0js);
167 status = m_tuple1->addIndexedItem (
"y0js", m_idxmdc, m_y0js);
168 status = m_tuple1->addIndexedItem (
"z0js",m_idxmdc, m_z0js);
169 status = m_tuple1->addIndexedItem (
"r0js",m_idxmdc, m_r0js);
170 status = m_tuple1->addIndexedItem (
"Rxyjs",m_idxmdc, m_Rxyjs);
171 status = m_tuple1->addIndexedItem (
"Rzjs",m_idxmdc, m_Rzjs);
172 status = m_tuple1->addIndexedItem (
"Rnxyjs",m_idxmdc, m_Rnxyjs);
173 status = m_tuple1->addIndexedItem (
"phinjs",m_idxmdc, m_phinjs);
174 status = m_tuple1->addIndexedItem (
"Rnzjs",m_idxmdc, m_Rnzjs);
175 status = m_tuple1->addItem (
"ncy20", m_ncy20);
176 status = m_tuple1->addItem (
"ncy30", m_ncy30);
177 status = m_tuple1->addIndexedItem(
"angjs5", m_idxmdc, m_angjs5);
178 status = m_tuple1->addIndexedItem(
"nearjs5", m_idxmdc, m_nearjs5);
179 status = m_tuple1->addIndexedItem(
"angjs6", m_idxmdc, m_angjs6);
180 status = m_tuple1->addIndexedItem(
"nearjs6", m_idxmdc, m_nearjs6);
181 status = m_tuple1->addIndexedItem(
"ang4pi5", m_idxmdc, m_ang4pi5);
182 status = m_tuple1->addIndexedItem(
"near4pi5", m_idxmdc, m_near4pi5);
183 status = m_tuple1->addIndexedItem(
"ang4pi6", m_idxmdc, m_ang4pi6);
184 status = m_tuple1->addIndexedItem(
"near4pi6", m_idxmdc, m_near4pi6);
185 status = m_tuple1->addIndexedItem(
"ppmdcjs", m_idxmdc, m_ppmdcjs);
186 status = m_tuple1->addIndexedItem(
"pxmdcjs", m_idxmdc, m_pxmdcjs);
187 status = m_tuple1->addIndexedItem(
"pymdcjs", m_idxmdc, m_pymdcjs);
188 status = m_tuple1->addIndexedItem(
"pzmdcjs", m_idxmdc, m_pzmdcjs);
189 status = m_tuple1->addIndexedItem(
"ppkaljs", m_idxmdc, m_ppkaljs);
190 status = m_tuple1->addIndexedItem(
"ptmdcjs", m_idxmdc, m_ptmdcjs);
191 status = m_tuple1->addIndexedItem(
"ptkaljs", m_idxmdc, m_ptkaljs);
192 status = m_tuple1->addIndexedItem(
"ppmdc2kpi", m_idxmdc, m_ppmdc2kpi);
193 status = m_tuple1->addIndexedItem(
"pxmdc2kpi", m_idxmdc, m_pxmdc2kpi);
194 status = m_tuple1->addIndexedItem(
"pymdc2kpi", m_idxmdc, m_pymdc2kpi);
195 status = m_tuple1->addIndexedItem(
"pzmdc2kpi", m_idxmdc, m_pzmdc2kpi);
196 status = m_tuple1->addIndexedItem(
"ppkal2kpi", m_idxmdc, m_ppkal2kpi);
197 status = m_tuple1->addIndexedItem(
"ptmdc2kpi", m_idxmdc, m_ptmdc2kpi);
198 status = m_tuple1->addIndexedItem(
"charge2kpi", m_idxmdc, m_charge2kpi);
199 status = m_tuple1->addIndexedItem(
"ptkal2kpi", m_idxmdc, m_ptkal2kpi);
200 status = m_tuple1->addItem (
"cy2pi", m_cy2kpi, 0, 100 );
201 status = m_tuple1->addIndexedItem(
"comcs2kpi", m_cy2kpi, m_comcs2kpi);
202 status = m_tuple1->addItem (
"chiejs", m_idxmdc, m_chiejs);
203 status = m_tuple1->addItem (
"chimujs", m_idxmdc, m_chimujs);
204 status = m_tuple1->addItem (
"chipijs", m_idxmdc, m_chipijs);
205 status = m_tuple1->addItem (
"chikjs", m_idxmdc, m_chikjs);
206 status = m_tuple1->addItem (
"chipjs", m_idxmdc, m_chipjs);
207 status = m_tuple1->addItem (
"ghitjs", m_idxmdc, m_ghitjs);
208 status = m_tuple1->addItem (
"thitjs", m_idxmdc, m_thitjs);
209 status = m_tuple1->addIndexedItem(
"probphjs", m_idxmdc, m_probphjs);
210 status = m_tuple1->addIndexedItem(
"normphjs", m_idxmdc, m_normphjs);
211 status = m_tuple1->addItem (
"pdg", m_idxmdc, m_pdg);
212 status = m_tuple1->addItem (
"cbmc", m_idxmdc, m_cbmc);
213 status = m_tuple1->addIndexedItem(
"sigmaetof2kpi", m_idxmdc, m_sigmaetof2kpi);
214 status = m_tuple1->addIndexedItem(
"sigmamutof2kpi", m_idxmdc, m_sigmamutof2kpi);
215 status = m_tuple1->addIndexedItem(
"sigmapitof2kpi", m_idxmdc, m_sigmapitof2kpi);
216 status = m_tuple1->addIndexedItem(
"sigmaktof2kpi", m_idxmdc, m_sigmaktof2kpi);
217 status = m_tuple1->addIndexedItem(
"sigmaprtof2kpi", m_idxmdc, m_sigmaprtof2kpi);
218 status = m_tuple1->addIndexedItem(
"t0tof2kpi", m_idxmdc, m_t0tof2kpi);
219 status = m_tuple1->addIndexedItem(
"errt0tof2kpi", m_idxmdc, m_errt0tof2kpi);
221 status = m_tuple1->addItem (
"chie2kpi", m_idxmdc, m_chie2kpi);
222 status = m_tuple1->addItem (
"chimu2kpi", m_idxmdc, m_chimu2kpi);
223 status = m_tuple1->addItem (
"chipi2kpi", m_idxmdc, m_chipi2kpi);
224 status = m_tuple1->addItem (
"chik2kpi", m_idxmdc, m_chik2kpi);
225 status = m_tuple1->addItem (
"chip2kpi", m_idxmdc, m_chip2kpi);
226 status = m_tuple1->addItem (
"ghit2kpi", m_idxmdc, m_ghit2kpi);
227 status = m_tuple1->addItem (
"thit2kpi", m_idxmdc, m_thit2kpi);
228 status = m_tuple1->addIndexedItem(
"probph2kpi", m_idxmdc, m_probph2kpi);
229 status = m_tuple1->addIndexedItem(
"normph2kpi", m_idxmdc, m_normph2kpi);
230 status = m_tuple1->addIndexedItem(
"pidnum2kpi", m_idxmdc, m_pidnum2kpi);
231 status = m_tuple1->addIndexedItem(
"bjmucjs", m_idxmdc, m_bjmucjs);
232 status = m_tuple1->addIndexedItem(
"bjmuc2kpi", m_idxmdc, m_bjmuc2kpi);
233 status = m_tuple1->addIndexedItem(
"bjemcjs", m_idxmdc, m_bjemcjs);
234 status = m_tuple1->addIndexedItem(
"bjemc2kpi", m_idxmdc, m_bjemc2kpi);
235 status = m_tuple1->addIndexedItem(
"bjtofjs", m_idxmdc, m_bjtofjs);
236 status = m_tuple1->addIndexedItem(
"bjtof2kpi", m_idxmdc, m_bjtof2kpi);
237 status = m_tuple1->addIndexedItem(
"bjtofvaljs", m_idxmdc, m_bjtofvaljs);
238 status = m_tuple1->addIndexedItem(
"bjtofval2kpi", m_idxmdc, m_bjtofval2kpi);
240 status = m_tuple1->addIndexedItem(
"emcjs", m_idxmdc, m_emcjs);
241 status = m_tuple1->addIndexedItem(
"evpjs", m_idxmdc, m_evpjs);
242 status = m_tuple1->addIndexedItem(
"timecgjs", m_idxmdc, m_timecgjs);
243 status = m_tuple1->addIndexedItem(
"depthjs", m_idxmdc, m_depthmucjs);
244 status = m_tuple1->addIndexedItem(
"layermucjs", m_idxmdc, m_layermucjs);
246 status = m_tuple1->addIndexedItem(
"emc2kpi", m_idxmdc, m_emc2kpi);
247 status = m_tuple1->addIndexedItem(
"evp2kpi", m_idxmdc, m_evp2kpi);
248 status = m_tuple1->addIndexedItem(
"timecg2kpi", m_idxmdc, m_timecg2kpi);
249 status = m_tuple1->addIndexedItem(
"depth2kpi", m_idxmdc, m_depthmuc2kpi);
250 status = m_tuple1->addIndexedItem(
"layermuc2kpi", m_idxmdc, m_layermuc2kpi);
252 status = m_tuple1->addIndexedItem(
"cotof1js", m_idxmdc, m_cotof1js);
253 status = m_tuple1->addIndexedItem(
"cotof2js", m_idxmdc, m_cotof2js);
254 status = m_tuple1->addIndexedItem(
"counterjs", m_idxmdc, m_counterjs);
255 status = m_tuple1->addIndexedItem(
"barreljs", m_idxmdc, m_barreljs);
256 status = m_tuple1->addIndexedItem(
"layertofjs", m_idxmdc, m_layertofjs);
257 status = m_tuple1->addIndexedItem(
"readoutjs", m_idxmdc, m_readoutjs);
258 status = m_tuple1->addIndexedItem(
"clusterjs", m_idxmdc, m_clusterjs);
259 status = m_tuple1->addIndexedItem(
"betajs", m_idxmdc, m_betajs);
260 status = m_tuple1->addIndexedItem(
"tofjs", m_idxmdc, m_tofjs);
261 status = m_tuple1->addIndexedItem(
"tofpathjs", m_idxmdc, m_tofpathjs);
262 status = m_tuple1->addIndexedItem(
"zhitjs", m_idxmdc, m_zhitjs);
263 status = m_tuple1->addIndexedItem(
"tofIDjs", m_idxmdc, m_tofIDjs);
264 status = m_tuple1->addIndexedItem(
"clusterIDjs", m_idxmdc, m_clusterIDjs);
265 status = m_tuple1->addIndexedItem(
"texejs", m_idxmdc, m_texejs);
266 status = m_tuple1->addIndexedItem(
"texmujs", m_idxmdc, m_texmujs);
267 status = m_tuple1->addIndexedItem(
"texpijs", m_idxmdc, m_texpijs);
268 status = m_tuple1->addIndexedItem(
"texkjs", m_idxmdc, m_texkjs);
269 status = m_tuple1->addIndexedItem(
"texprjs", m_idxmdc, m_texprjs);
270 status = m_tuple1->addIndexedItem(
"dtejs", m_idxmdc, m_dtejs);
271 status = m_tuple1->addIndexedItem(
"dtmujs", m_idxmdc, m_dtmujs);
272 status = m_tuple1->addIndexedItem(
"dtpijs", m_idxmdc, m_dtpijs);
273 status = m_tuple1->addIndexedItem(
"dtkjs", m_idxmdc, m_dtkjs);
274 status = m_tuple1->addIndexedItem(
"dtprjs", m_idxmdc, m_dtprjs);
275 status = m_tuple1->addIndexedItem(
"sigmaetofjs", m_idxmdc, m_sigmaetofjs);
276 status = m_tuple1->addIndexedItem(
"sigmamutofjs", m_idxmdc, m_sigmamutofjs);
277 status = m_tuple1->addIndexedItem(
"sigmapitofjs", m_idxmdc, m_sigmapitofjs);
278 status = m_tuple1->addIndexedItem(
"sigmaktofjs", m_idxmdc, m_sigmaktofjs);
279 status = m_tuple1->addIndexedItem(
"sigmaprtofjs", m_idxmdc, m_sigmaprtofjs);
280 status = m_tuple1->addIndexedItem(
"t0tofjs", m_idxmdc,m_t0tofjs);
281 status = m_tuple1->addIndexedItem(
"errt0tofjs", m_idxmdc,m_errt0tofjs);
282 status = m_tuple1->addIndexedItem(
"cotof12kpi", m_idxmdc, m_cotof12kpi);
283 status = m_tuple1->addIndexedItem(
"cotof22kpi", m_idxmdc, m_cotof22kpi);
284 status = m_tuple1->addIndexedItem(
"counter2kpi", m_idxmdc, m_counter2kpi);
285 status = m_tuple1->addIndexedItem(
"barrel2kpi", m_idxmdc, m_barrel2kpi);
286 status = m_tuple1->addIndexedItem(
"layertof2kpi", m_idxmdc, m_layertof2kpi);
287 status = m_tuple1->addIndexedItem(
"readout2kpi", m_idxmdc, m_readout2kpi);
288 status = m_tuple1->addIndexedItem(
"cluster2kpi", m_idxmdc, m_cluster2kpi);
289 status = m_tuple1->addIndexedItem(
"beta2kpi", m_idxmdc, m_beta2kpi);
290 status = m_tuple1->addIndexedItem(
"tof2kpi", m_idxmdc, m_tof2kpi);
291 status = m_tuple1->addIndexedItem(
"tofpath2kpi", m_idxmdc, m_tofpath2kpi);
292 status = m_tuple1->addIndexedItem(
"zhit2kpi", m_idxmdc, m_zhit2kpi);
293 status = m_tuple1->addIndexedItem(
"tofID2kpi", m_idxmdc, m_tofID2kpi);
294 status = m_tuple1->addIndexedItem(
"clusterID2kpi", m_idxmdc, m_clusterID2kpi);
295 status = m_tuple1->addIndexedItem(
"texe2kpi", m_idxmdc, m_texe2kpi);
296 status = m_tuple1->addIndexedItem(
"texmu2kpi", m_idxmdc, m_texmu2kpi);
297 status = m_tuple1->addIndexedItem(
"texpi2kpi", m_idxmdc, m_texpi2kpi);
298 status = m_tuple1->addIndexedItem(
"texk2kpi", m_idxmdc, m_texk2kpi);
299 status = m_tuple1->addIndexedItem(
"texpr2kpi", m_idxmdc, m_texpr2kpi);
300 status = m_tuple1->addIndexedItem(
"dte2kpi", m_idxmdc, m_dte2kpi);
301 status = m_tuple1->addIndexedItem(
"dtmu2kpi", m_idxmdc, m_dtmu2kpi);
302 status = m_tuple1->addIndexedItem(
"dtpi2kpi", m_idxmdc, m_dtpi2kpi);
303 status = m_tuple1->addIndexedItem(
"dtk2kpi", m_idxmdc, m_dtk2kpi);
304 status = m_tuple1->addIndexedItem(
"dtpr2kpi", m_idxmdc, m_dtpr2kpi);
305 status = m_tuple1->addIndexedItem(
"costpid2kpi", m_idxmdc, m_costpid2kpi);
306 status = m_tuple1->addIndexedItem(
"dedxpid2kpi", m_idxmdc, m_dedxpid2kpi);
307 status = m_tuple1->addIndexedItem(
"tof1pid2kpi", m_idxmdc, m_tof1pid2kpi);
308 status = m_tuple1->addIndexedItem(
"tof2pid2kpi", m_idxmdc, m_tof2pid2kpi);
309 status = m_tuple1->addIndexedItem(
"probe2kpi", m_idxmdc, m_probe2kpi);
310 status = m_tuple1->addIndexedItem(
"probmu2kpi", m_idxmdc, m_probmu2kpi);
311 status = m_tuple1->addIndexedItem(
"probpi2kpi", m_idxmdc, m_probpi2kpi);
312 status = m_tuple1->addIndexedItem(
"probk2kpi", m_idxmdc, m_probk2kpi);
313 status = m_tuple1->addIndexedItem(
"probpr2kpi", m_idxmdc, m_probpr2kpi);
315 status = m_tuple1->addIndexedItem(
"chipidxpid2kpi", m_idxmdc, m_chipidxpid2kpi);
316 status = m_tuple1->addIndexedItem(
"chipitof1pid2kpi", m_idxmdc, m_chipitof1pid2kpi);
317 status = m_tuple1->addIndexedItem(
"chipitof2pid2kpi", m_idxmdc, m_chipitof2pid2kpi);
318 status = m_tuple1->addIndexedItem(
"chipitofpid2kpi", m_idxmdc, m_chipitofpid2kpi);
319 status = m_tuple1->addIndexedItem(
"chipitofepid2kpi", m_idxmdc, m_chipitofepid2kpi);
320 status = m_tuple1->addIndexedItem(
"chipitofqpid2kpi", m_idxmdc, m_chipitofqpid2kpi);
321 status = m_tuple1->addIndexedItem(
"probpidxpid2kpi", m_idxmdc, m_probpidxpid2kpi);
322 status = m_tuple1->addIndexedItem(
"probpitofpid2kpi", m_idxmdc, m_probpitofpid2kpi);
323 status = m_tuple1->addIndexedItem(
"chikdxpid2kpi", m_idxmdc, m_chikdxpid2kpi);
324 status = m_tuple1->addIndexedItem(
"chiktof1pid2kpi", m_idxmdc, m_chiktof1pid2kpi);
325 status = m_tuple1->addIndexedItem(
"chiktof2pid2kpi", m_idxmdc, m_chiktof2pid2kpi);
326 status = m_tuple1->addIndexedItem(
"chiktofpid2kpi", m_idxmdc, m_chiktofpid2kpi);
327 status = m_tuple1->addIndexedItem(
"chiktofepid2kpi", m_idxmdc, m_chiktofepid2kpi);
328 status = m_tuple1->addIndexedItem(
"chiktofqpid2kpi", m_idxmdc, m_chiktofqpid2kpi);
329 status = m_tuple1->addIndexedItem(
"probkdxpid2kpi", m_idxmdc, m_probkdxpid2kpi);
330 status = m_tuple1->addIndexedItem(
"probktofpid2kpi", m_idxmdc, m_probktofpid2kpi);
332 status = m_tuple1->addIndexedItem(
"chiprdxpid2kpi", m_idxmdc, m_chiprdxpid2kpi);
333 status = m_tuple1->addIndexedItem(
"chiprtof1pid2kpi", m_idxmdc, m_chiprtof1pid2kpi);
334 status = m_tuple1->addIndexedItem(
"chiprtof2pid2kpi", m_idxmdc, m_chiprtof2pid2kpi);
335 status = m_tuple1->addIndexedItem(
"chiprtofpid2kpi", m_idxmdc, m_chiprtofpid2kpi);
336 status = m_tuple1->addIndexedItem(
"chiprtofepid2kpi", m_idxmdc, m_chiprtofepid2kpi);
337 status = m_tuple1->addIndexedItem(
"chiprtofqpid2kpi", m_idxmdc, m_chiprtofqpid2kpi);
338 status = m_tuple1->addIndexedItem(
"probprdxpid2kpi", m_idxmdc, m_probprdxpid2kpi);
339 status = m_tuple1->addIndexedItem(
"probprtofpid2kpi", m_idxmdc, m_probprtofpid2kpi);
341 status = m_tuple1->addIndexedItem(
"cosmdcjs", m_idxmdc, m_cosmdcjs);
342 status = m_tuple1->addIndexedItem(
"phimdcjs", m_idxmdc, m_phimdcjs);
343 status = m_tuple1->addIndexedItem(
"cosmdc2kpi", m_idxmdc, m_cosmdc2kpi);
344 status = m_tuple1->addIndexedItem(
"phimdc2kpi", m_idxmdc, m_phimdc2kpi);
346 status = m_tuple1->addIndexedItem(
"dedxpidjs", m_idxmdc, m_dedxpidjs);
347 status = m_tuple1->addIndexedItem(
"tof1pidjs", m_idxmdc, m_tof1pidjs);
348 status = m_tuple1->addIndexedItem(
"tof2pidjs", m_idxmdc, m_tof2pidjs);
349 status = m_tuple1->addIndexedItem(
"probejs", m_idxmdc, m_probejs);
350 status = m_tuple1->addIndexedItem(
"probmujs", m_idxmdc, m_probmujs);
351 status = m_tuple1->addIndexedItem(
"probpijs", m_idxmdc, m_probpijs);
352 status = m_tuple1->addIndexedItem(
"probkjs", m_idxmdc, m_probkjs);
353 status = m_tuple1->addIndexedItem(
"probprjs", m_idxmdc, m_probprjs);
354 status = m_tuple1->addItem (
"mchic2kpi", m_mchic2kpi);
355 status = m_tuple1->addItem (
"mpsip2kpi", m_mpsip2kpi);
356 status = m_tuple1->addItem (
"chis2kpi", m_chis2kpi);
357 status = m_tuple1->addItem (
"mchic4c2kpi", m_mchic4c2kpi);
358 status = m_tuple1->addItem (
"mpsip4c2kpi", m_mpsip4c2kpi);
359 status = m_tuple1->addItem (
"chis4c2kpi", m_chis4c2kpi);
361 status = m_tuple1->addItem(
"indexemc", m_idxemc, 0, 5000);
362 status = m_tuple1->addIndexedItem(
"numHits", m_idxemc, m_numHits);
363 status = m_tuple1->addIndexedItem(
"secmom", m_idxemc, m_secondmoment);
364 status = m_tuple1->addIndexedItem(
"latmom", m_idxemc, m_latmoment);
365 status = m_tuple1->addIndexedItem(
"timegm", m_idxemc, m_timegm);
366 status = m_tuple1->addIndexedItem(
"cellId", m_idxemc, m_cellId);
367 status = m_tuple1->addIndexedItem(
"module", m_idxemc, m_module);
368 status = m_tuple1->addIndexedItem(
"a20Moment", m_idxemc, m_a20Moment);
369 status = m_tuple1->addIndexedItem(
"a42Moment", m_idxemc, m_a42Moment);
370 status = m_tuple1->addIndexedItem(
"getEAll", m_idxemc, m_getEAll);
371 status = m_tuple1->addIndexedItem(
"getShowerId", m_idxemc, m_getShowerId);
372 status = m_tuple1->addIndexedItem(
"getClusterId", m_idxemc, m_getClusterId);
373 status = m_tuple1->addIndexedItem(
"x", m_idxemc, m_x);
374 status = m_tuple1->addIndexedItem(
"y", m_idxemc, m_y);
375 status = m_tuple1->addIndexedItem(
"z", m_idxemc, m_z);
376 status = m_tuple1->addIndexedItem(
"cosemc", m_idxemc, m_cosemc);
377 status = m_tuple1->addIndexedItem(
"phiemc", m_idxemc, m_phiemc);
378 status = m_tuple1->addIndexedItem(
"energy", m_idxemc, m_energy);
379 status = m_tuple1->addIndexedItem(
"e1", m_idxemc, m_eSeed);
380 status = m_tuple1->addIndexedItem(
"e9", m_idxemc, m_e3x3);
381 status = m_tuple1->addIndexedItem(
"e25", m_idxemc, m_e5x5);
382 status = m_tuple1->addIndexedItem(
"dang4c", m_idxemc, m_dang4c);
383 status = m_tuple1->addIndexedItem(
"dthe4c", m_idxemc, m_dthe4c);
384 status = m_tuple1->addIndexedItem(
"dphi4c", m_idxemc, m_dphi4c);
385 status = m_tuple1->addIndexedItem(
"dang4crt", m_idxemc, m_dang4crt);
386 status = m_tuple1->addIndexedItem(
"dthe4crt", m_idxemc, m_dthe4crt);
387 status = m_tuple1->addIndexedItem(
"dphi4crt", m_idxemc, m_dphi4crt);
388 status = m_tuple1->addIndexedItem(
"phtof", m_idxemc, 3, m_phgmtof,0.0,10000.0);
389 status = m_tuple1->addIndexedItem(
"phgmtof0", m_idxemc, m_phgmtof0);
390 status = m_tuple1->addIndexedItem(
"phgmtof1", m_idxemc, m_phgmtof1);
391 status = m_tuple1->addIndexedItem(
"phgmtof2", m_idxemc, m_phgmtof2);
395 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
396 return StatusCode::FAILURE;
405 sc = createSubAlgorithm(
"EventWriter",
"Selectgam4pi", m_subalg1);
406 if( sc.isFailure() ) {
407 log << MSG::ERROR <<
"Error creating Sub-Algorithm Selectgam4pi" <<endreq;
410 log << MSG::INFO <<
"Success creating Sub-Algorithm Selectgam4pi" <<endreq;
417 sc = createSubAlgorithm(
"EventWriter",
"Selectgam4k", m_subalg2);
418 if( sc.isFailure() ) {
419 log << MSG::ERROR <<
"Error creating Sub-Algorithm Selectgam4k" <<endreq;
422 log << MSG::INFO <<
"Success creating Sub-Algorithm Selectgam4k" <<endreq;
428 sc = createSubAlgorithm(
"EventWriter",
"Selectgam2pi2pr", m_subalg3);
429 if( sc.isFailure() ) {
430 log << MSG::ERROR <<
"Error creating Sub-Algorithm Selectgam2pi2pr" <<endreq;
433 log << MSG::INFO <<
"Success creating Sub-Algorithm Selectgam2pi2pr" <<endreq;
444 log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
445 return StatusCode::SUCCESS;
453 setFilterPassed(
false);
456 MsgStream log(
msgSvc(), name());
457 log << MSG::INFO <<
"in execute()" << endreq;
459 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
460 int run=eventHeader->runNumber();
461 int event=eventHeader->eventNumber();
462 log << MSG::DEBUG <<
"run, evtnum = "
474 log << MSG::DEBUG <<
"ncharg, nneu, tottks = "
475 << evtRecEvent->totalCharged() <<
" , "
476 << evtRecEvent->totalNeutral() <<
" , "
477 << evtRecEvent->totalTracks() <<endreq;
489 if (eventHeader->runNumber()<0)
491 SmartDataPtr<Event::McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
492 int m_numParticle = 0;
496 return StatusCode::FAILURE;
500 bool psipDecay =
false;
502 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
503 for (; iter_mc != mcParticleCol->end(); iter_mc++)
505 if ((*iter_mc)->primaryParticle())
continue;
506 if (!(*iter_mc)->decayFromGenerator())
continue;
507 if ((*iter_mc)->particleProperty()==100443)
510 rootIndex = (*iter_mc)->trackIndex();
512 if (!psipDecay)
continue;
513 int mcidx = ((*iter_mc)->mother()).trackIndex() - rootIndex;
514 int pdgid = (*iter_mc)->particleProperty();
515 m_pdgid[m_numParticle] = pdgid;
516 m_motheridx[m_numParticle] = mcidx;
520 m_idxmc = m_numParticle;
524 Vint iGood, ipip, ipim;
537 Hep3Vector vv(0,0,0);
540 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
548 vv.setX(vertexsigma[0]);
549 vv.setY(vertexsigma[1]);
550 vv.setZ(vertexsigma[2]);
566 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
567 if(i>=evtRecTrkCol->size())
break;
570 if(!(*itTrk)->isMdcTrackValid())
continue;
571 if (!(*itTrk)->isMdcKalTrackValid())
continue;
575 HepVector a = mdcTrk->
helix();
576 HepSymMatrix Ea = mdcTrk->
err();
581 HepVector
vec = helixp.
a();
582 pTrkCh.push_back(mdcTrk->
p()*mdcTrk->
charge());
583 iGood.push_back((*itTrk)->trackId());
584 nCharge += mdcTrk->
charge();
588 int nGood = iGood.size();
589 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endreq;
592 return StatusCode::SUCCESS;
602 for(
int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
604 if(i>=evtRecTrkCol->size())
break;
606 if(!(*itTrk)->isEmcShowerValid())
continue;
608 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
618 for(
int j = 0; j < evtRecEvent->totalCharged(); j++) {
619 if(j>=evtRecTrkCol->size())
break;
621 if(!(*jtTrk)->isExtTrackValid())
continue;
626 double angd = extpos.angle(emcpos);
627 double thed = extpos.theta() - emcpos.theta();
628 double phid = extpos.deltaPhi(emcpos);
629 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
630 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
636 if(angd < dang){ dang=angd;
643 double eraw = emcTrk->
energy();
644 dthe = dthe * 180 / (CLHEP::pi);
645 dphi = dphi * 180 / (CLHEP::pi);
646 dang = dang * 180 / (CLHEP::pi);
651 iGam.push_back((*itTrk)->trackId());
652 if(eraw < m_energyThreshold)
continue;
653 if(dang < 20.0)
continue;
654 iGamnofit.push_back((*itTrk)->trackId());
659 int nGam = iGam.size();
660 int nGamnofit = iGamnofit.size();
662 log << MSG::DEBUG <<
"num Good Photon " << nGam <<
" , " <<evtRecEvent->totalNeutral()<<endreq;
664 return StatusCode::SUCCESS;
668 if(nGood>20||nGam>30)
return StatusCode::SUCCESS;
678 for(
int i = 0; i < nGam; i++) {
681 double eraw = emcTrk->
energy();
682 double phi = emcTrk->
phi();
683 double the = emcTrk->
theta();
684 HepLorentzVector
ptrk;
692 pGam.push_back(
ptrk);
700 for(
int i = 0; i < nGood; i++) {
707 if(mdcKalTrk->
charge() >0) {
708 ipip.push_back(iGood[i]);
709 HepLorentzVector
ptrk;
710 ptrk.setPx(mdcKalTrk->
px());
711 ptrk.setPy(mdcKalTrk->
py());
712 ptrk.setPz(mdcKalTrk->
pz());
717 ppip.push_back(
ptrk);
719 ipim.push_back(iGood[i]);
720 HepLorentzVector
ptrk;
721 ptrk.setPx(mdcKalTrk->
px());
722 ptrk.setPy(mdcKalTrk->
py());
723 ptrk.setPz(mdcKalTrk->
pz());
729 ppim.push_back(
ptrk);
732 int npip = ipip.size();
733 int npim = ipim.size();
735 if((npip < 2)||(npim < 2))
return SUCCESS;
748 double chisqtrk = 9999.;
757 double mcompall=9999;
758 double mppreclst=9999;
760 double mchic2kpilst=9999;
761 double chis4c2kpilst=9999;
763 double dtpr2kpilst[4]={9999,9999,9999,9999};
768 HepLorentzVector pgam(0,0,0,0);
773 HepSymMatrix xem(3,0);
777 HepLorentzVector p4psipjs(0.011*m_ecms, 0.0, 0.0, m_ecms);
778 double psipBetajs = (p4psipjs.vect()).mag()/(p4psipjs.e());
779 HepLorentzVector p4psip(0.011*m_ecms, 0.0, 0.0, m_ecms);
780 double psipBeta = (p4psip.vect()).mag()/(p4psip.e());
782 for(
int ii = 0; ii < npip-1; ii++) {
783 RecMdcKalTrack *pip1Trk = (*(evtRecTrkCol->begin()+ipip[ii]))->mdcKalTrack();
784 for(
int ij = ii+1; ij < npip; ij++) {
785 RecMdcKalTrack *pip2Trk = (*(evtRecTrkCol->begin()+ipip[ij]))->mdcKalTrack();
786 for(
int ik = 0; ik < npim-1; ik++) {
787 RecMdcKalTrack *pim1Trk = (*(evtRecTrkCol->begin()+ipim[ik]))->mdcKalTrack();
788 for(
int il = ik+1; il < npim; il++) {
789 RecMdcKalTrack *pim2Trk = (*(evtRecTrkCol->begin()+ipim[il]))->mdcKalTrack();
790 double squar[3]={9999.,9999.,9999.};
791 double squarkpi[6]={9999.,9999.,9999.,9999.,9999.,9999.};
801 pTrkjs.push_back(pip1Trk->
p()*pip1Trk->
charge());
802 pTrkjs.push_back(pip2Trk->
p()*pip2Trk->
charge());
803 pTrkjs.push_back(pim1Trk->
p()*pim1Trk->
charge());
804 pTrkjs.push_back(pim2Trk->
p()*pim2Trk->
charge());
805 iGoodjs.push_back(ipip[ii]);
806 iGoodjs.push_back(ipip[ij]);
807 iGoodjs.push_back(ipim[ik]);
808 iGoodjs.push_back(ipim[il]);
810 Gam4pikp::BubbleSort(pTrkjs, iGoodjs);
815 Vint i4cpip1js, i4cpip2js, i4cpim1js, i4cpim2js;
820 i4cpip1js.push_back(iGoodjs[2]);
821 i4cpip2js.push_back(iGoodjs[3]);
822 i4cpim1js.push_back(iGoodjs[1]);
823 i4cpim2js.push_back(iGoodjs[0]);
824 jGoodjs.push_back(i4cpip1js[0]);
825 jGoodjs.push_back(i4cpim1js[0]);
826 jGoodjs.push_back(i4cpip2js[0]);
827 jGoodjs.push_back(i4cpim2js[0]);
829 for (
int i = 0; i < 4; i++)
832 if (!(*itTrk)->isMdcTrackValid())
continue;
834 if (!(*itTrk)->isMdcKalTrackValid())
continue;
837 HepLorentzVector p4trk;
841 ptrk = mdcKalTrk->
p();
842 p4trk.setPx(mdcKalTrk->
px());
843 p4trk.setPy(mdcKalTrk->
py());
844 p4trk.setPz(mdcKalTrk->
pz());
849 ptrk = mdcKalTrk->
p();
850 p4trk.setPx(mdcKalTrk->
px());
851 p4trk.setPy(mdcKalTrk->
py());
852 p4trk.setPz(mdcKalTrk->
pz());
855 p4trk.boost(-1.0*psipBetajs, 0.0, 0.0);
856 p4chTrkjs.push_back(p4trk);
858 p4psipjs.boost(-1.0*psipBetajs, 0.0, 0.0);
860 HepLorentzVector p4pipijs = p4chTrkjs[0] + p4chTrkjs[1];
861 HepLorentzVector p4eejs = p4chTrkjs[2] + p4chTrkjs[3];
862 HepLorentzVector p4pipirecjs = p4psipjs - p4pipijs;
863 double mpprecjs=p4pipirecjs.m();
864 double mpipijs=p4pipijs.m();
865 double meejs=p4eejs.m();
866 double mcomp=sqrt((mpprecjs-3.097)*(mpprecjs-3.097)+(meejs-3.097)*(meejs-3.097));
870 ipip1js=i4cpip1js[0];
871 ipim1js=i4cpim1js[0];
872 ipip2js=i4cpip2js[0];
873 ipim2js=i4cpim2js[0];
880 m_mpprecall=mppreclst;
902 return StatusCode::SUCCESS;
904 jsGood.push_back(ipip1js);
905 jsGood.push_back(ipim1js);
906 jsGood.push_back(ipip2js);
907 jsGood.push_back(ipim2js);
909 for(
int i = 0; i < evtRecEvent->totalCharged(); i++)
911 if(i>=evtRecTrkCol->size())
break;
913 if(!(*itTrk)->isMdcTrackValid())
continue;
914 if (!(*itTrk)->isMdcKalTrackValid())
continue;
916 if((i!=ipip1js)&&(i!=ipim1js)&&(i!=ipip2js)&&(i!=ipim2js))
922 int njsGood=jsGood.size();
926 for (
int i = 0; i < njsGood; i++)
929 if (!(*itTrk)->isMdcTrackValid())
continue;
931 if (!(*itTrk)->isMdcKalTrackValid())
continue;
934 ptrk = mdcKalTrk->
p();
935 m_x0js[i] = mdcTrk->
x();
936 m_y0js[i] = mdcTrk->
y();
937 m_z0js[i] = mdcTrk->
z();
938 m_r0js[i] = mdcTrk->
r();
939 m_ppmdcjs[i] = mdcTrk->
p();
940 m_pxmdcjs[i] = mdcTrk->
px();
941 m_pymdcjs[i] = mdcTrk->
py();
942 m_pzmdcjs[i] = mdcTrk->
pz();
943 m_ppkaljs[i] = mdcKalTrk->
p();
944 Hep3Vector p3jsi(mdcTrk->
px(),mdcTrk->
py(),mdcTrk->
pz());
948 Hep3Vector p3js5(mdcTrk5->
px(),mdcTrk5->
py(),mdcTrk5->
pz());
949 m_angjs5[i]=p3jsi.angle(p3js5);
950 m_nearjs5[i]=p3jsi.howNear(p3js5);
955 Hep3Vector p3js6(mdcTrk6->
px(),mdcTrk6->
py(),mdcTrk6->
pz());
956 m_angjs6[i]=p3jsi.angle(p3js6);
957 m_nearjs6[i]=p3jsi.howNear(p3js6);
961 m_ptmdcjs[i] = mdcTrk->
pxy();
962 m_ptkaljs[i] = mdcKalTrk->
pxy();
963 double x0=mdcTrk->
x();
964 double y0=mdcTrk->
y();
965 double z0=mdcTrk->
z();
966 double phi0=mdcTrk->
helix(1);
970 double Rxy=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
974 HepVector a = mdcTrk->
helix();
975 HepSymMatrix Ea = mdcTrk->
err();
980 HepVector
vec = helixp.
a();
985 if ((*itTrk)->isTofTrackValid())
988 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
989 SmartRefVector<RecTofTrack>::iterator iter_tof=tofTrkCol.begin();
990 for (;iter_tof != tofTrkCol.end(); iter_tof++ ){
992 status->
setStatus((*iter_tof)->status());
997 m_layertofjs[i] = status->
layer();
1001 m_betajs[i]= (*iter_tof)->beta();
1002 m_tofjs[i] = (*iter_tof)->tof();
1003 m_tofpathjs[i] = (*iter_tof)->path();
1004 m_zhitjs[i]= (*iter_tof)->zrhit();
1005 m_texejs[i] = (*iter_tof)->texpElectron();
1006 m_texmujs[i] = (*iter_tof)->texpMuon();
1007 m_texpijs[i] = (*iter_tof)->texpPion();
1008 m_texkjs[i] = (*iter_tof)->texpKaon();
1009 m_texprjs[i] = (*iter_tof)->texpProton();
1010 m_dtejs[i] = m_tofjs[i] - m_texejs[i];
1011 m_dtmujs[i] = m_tofjs[i] - m_texmujs[i];
1012 m_dtpijs[i] = m_tofjs[i] - m_texpijs[i];
1013 m_dtkjs[i] = m_tofjs[i] - m_texkjs[i];
1014 m_dtprjs[i] = m_tofjs[i] - m_texprjs[i];
1016 m_sigmaetofjs[i]=(*iter_tof)->sigma(0);
1017 m_sigmamutofjs[i]=(*iter_tof)->sigma(1);
1018 m_sigmapitofjs[i]=(*iter_tof)->sigma(2);
1019 m_sigmaktofjs[i]=(*iter_tof)->sigma(3);
1020 m_sigmaprtofjs[i]=(*iter_tof)->sigma(4);
1021 m_t0tofjs[i]=(*iter_tof)->t0();
1022 m_errt0tofjs[i]=(*iter_tof)->errt0();
1024 m_tofIDjs[i]=(*iter_tof)->tofID();
1025 m_clusterIDjs[i]=(*iter_tof)->tofTrackID();
1031 if ((*itTrk)->isMdcDedxValid())
1035 m_chiejs[i] = dedxTrk->
chiE();
1036 m_chimujs[i] = dedxTrk->
chiMu();
1037 m_chipijs[i] = dedxTrk->
chiPi();
1038 m_chikjs[i] = dedxTrk->
chiK();
1039 m_chipjs[i] = dedxTrk->
chiP();
1042 m_probphjs[i] = dedxTrk->
probPH();
1043 m_normphjs[i] = dedxTrk->
normPH();
1049 if ( (*itTrk)->isEmcShowerValid() )
1053 m_emcjs[i] = emcTrk->
energy();
1055 m_timecgjs[i] = emcTrk->
time();
1060 if ( (*itTrk)->isMucTrackValid() )
1063 double dpthp = mucTrk->
depth()/25.0;
1066 m_depthmucjs[i]=mucTrk->
depth();
1070 m_cosmdcjs[i] =
cos(mdcTrk->
theta());
1071 m_phimdcjs[i] = mdcTrk->
phi();
1083 m_dedxpidjs[i] = pid->
chiDedx(2);
1084 m_tof1pidjs[i] = pid->
chiTof1(2);
1085 m_tof2pidjs[i] = pid->
chiTof2(2);
1101 Vint iGood2kpi, ipip2kpi, ipim2kpi;
1105 Vp4 ppip2kpi, ppim2kpi;
1109 Vint ipipnofit, ipimnofit, ikpnofit, ikmnofit, ipropnofit, ipromnofit;
1116 Vp4 ppipnofit, ppimnofit, pkpnofit, pkmnofit, ppropnofit, ppromnofit;
1132 double chis2kpi=9999.;
1133 double m4piall=9999.;
1134 double m4kall=9999.;
1135 double mgam4piall=9999.;
1136 double mgam4kall=9999.;
1137 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
1138 if(i>=evtRecTrkCol->size())
break;
1140 if(!(*itTrk)->isMdcTrackValid())
continue;
1141 if (!(*itTrk)->isMdcKalTrackValid())
continue;
1143 double z02kpi = mdcTrk->
z();
1144 double r02kpi = mdcTrk->
r();
1145 HepVector a = mdcTrk->
helix();
1146 HepSymMatrix Ea = mdcTrk->
err();
1151 HepVector
vec = helixp.
a();
1152 double Rnxy02kpi=
vec[0];
1153 double Rnz02kpi=
vec[3];
1156 iGood2kpi.push_back((*itTrk)->trackId());
1158 int nGood2kpi = iGood2kpi.size();
1161 for(
int i = 0; i < nGood2kpi; i++) {
1165 if(mdcKalTrk->
charge() >0) {
1166 ipip2kpi.push_back(iGood2kpi[i]);
1167 p3pip2kpi.push_back(mdcKalTrk->
p());
1168 HepLorentzVector
ptrk;
1169 ptrk.setPx(mdcKalTrk->
px());
1170 ptrk.setPy(mdcKalTrk->
py());
1171 ptrk.setPz(mdcKalTrk->
pz());
1174 ppip2kpi.push_back(
ptrk);
1176 ipim2kpi.push_back(iGood2kpi[i]);
1177 p3pim2kpi.push_back(mdcKalTrk->
p());
1178 HepLorentzVector
ptrk;
1179 ptrk.setPx(mdcKalTrk->
px());
1180 ptrk.setPy(mdcKalTrk->
py());
1181 ptrk.setPz(mdcKalTrk->
pz());
1184 ppim2kpi.push_back(
ptrk);
1187 int npip2kpi = ipip2kpi.size();
1188 int npim2kpi = ipim2kpi.size();
1199 if((npip2kpi == 2)&&(npim2kpi == 2))
1207 xorigin2kpi[0]=9999.;
1208 xorigin2kpi[1]=9999.;
1209 xorigin2kpi[2]=9999.;
1210 HepSymMatrix xem2kpi(3,0);
1212 Gam4pikp::BubbleSort(p3pip2kpi, ipip2kpi);
1213 Gam4pikp::BubbleSort(p3pim2kpi, ipim2kpi);
1216 RecMdcKalTrack *pip12kpiTrk = (*(evtRecTrkCol->begin()+ipip2kpi[0]))->mdcKalTrack();
1217 RecMdcKalTrack *pip22kpiTrk = (*(evtRecTrkCol->begin()+ipip2kpi[1]))->mdcKalTrack();
1218 RecMdcKalTrack *pim12kpiTrk = (*(evtRecTrkCol->begin()+ipim2kpi[0]))->mdcKalTrack();
1219 RecMdcKalTrack *pim22kpiTrk = (*(evtRecTrkCol->begin()+ipim2kpi[1]))->mdcKalTrack();
1220 double squar2kpi[10]={9999.,9999.,9999.,9999.,9999.,9999.,9999.,9999.,9999.,9999.};
1221 double mc12kpi,mc22kpi,mc32kpi,mc42kpi;
1236 WTrackParameter wvpip12kpiTrk, wvpim12kpiTrk, wvpip22kpiTrk, wvpim22kpiTrk;
1237 for(
int k=0;k<6;k++)
1239 if(k==0){mc12kpi=
mpi;mc22kpi=
mpi;mc32kpi=
mpi;mc42kpi=
mpi;}
1240 if(k==1){mc12kpi=
mk;mc22kpi=
mk;mc32kpi=
mk;mc42kpi=
mk;}
1253 HepSymMatrix Evx(3, 0);
1265 vtxfit->
AddTrack(0, wvpip12kpiTrk);
1266 vtxfit->
AddTrack(1, wvpim12kpiTrk);
1267 vtxfit->
AddTrack(2, wvpip22kpiTrk);
1268 vtxfit->
AddTrack(3, wvpim22kpiTrk);
1270 if(!vtxfit->
Fit(0))
continue;
1280 xorigin2kpi = vtxfit->
vx(0);
1281 xem2kpi = vtxfit->
Evx(0);
1284 HepLorentzVector
ecms(0.040547,0,0,3.68632);
1286 double chisq = 9999.;
1288 for(
int i = 0; i < nGam; i++) {
1289 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+iGam[i]))->emcShower();
1300 bool oksq = kmfit->
Fit();
1302 double chi2 = kmfit->
chisq();
1311 if(squar2kpi[k]<200&&squar2kpi[k]<chis2kpi)
1314 chis2kpi=squar2kpi[k];
1315 if(squar2kpi[k]<20) n20=n20+1;
1316 if(squar2kpi[k]<30) n30=n30+1;
1318 icgp12kpi=ipip2kpi[0];
1319 icgp22kpi=ipip2kpi[1];
1320 icgm12kpi=ipim2kpi[0];
1321 icgm22kpi=ipim2kpi[1];
1323 wcgp12kpi=wpip12kpiys;
1324 wcgp22kpi=wpip22kpiys;
1325 wcgm12kpi=wpim12kpiys;
1326 wcgm22kpi=wpim22kpiys;
1330 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[0]);
1331 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[1]);
1335 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[0]);
1336 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[1]);
1341 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[0]);
1342 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[1]);
1346 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[1]);
1347 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[0]);
1351 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[1]);
1352 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[0]);
1356 itrak2kpi.push_back(ipip2kpi[1]); itrak2kpi.push_back(ipim2kpi[0]);
1357 itrak2kpi.push_back(ipip2kpi[0]); itrak2kpi.push_back(ipim2kpi[1]);
1364 RecEmcShower *g1Trk = (*(evtRecTrkCol->begin()+igam2kpi))->emcShower();
1374 bool oksq = kmfit->
Fit();
1376 HepLorentzVector pchic2kpi = kmfit->
pfit(0) + kmfit->
pfit(1)+kmfit->
pfit(2) + kmfit->
pfit(3);
1377 HepLorentzVector ppsip2kpi = kmfit->
pfit(0) + kmfit->
pfit(1)+kmfit->
pfit(2) + kmfit->
pfit(3) + kmfit->
pfit(4);
1378 mchic2kpilst=pchic2kpi.m();
1379 chis4c2kpilst=kmfit->
chisq();
1382 m_mchic2kpi = pchic2kpi.m();
1383 m_chis2kpi = kmfit->
chisq();
1384 m_mpsip2kpi=ppsip2kpi.m();
1405 type2kpilst=cls2kpi;
1410 for (
int i = 0; i < 4; i++)
1413 if (!(*itTrk)->isMdcTrackValid())
continue;
1415 if (!(*itTrk)->isMdcKalTrackValid())
continue;
1418 HepLorentzVector p4trk2kpi;
1422 ptrk2kpi = mdcKalTrk->
p();
1423 p4trk2kpi.setPx(mdcKalTrk->
px());
1424 p4trk2kpi.setPy(mdcKalTrk->
py());
1425 p4trk2kpi.setPz(mdcKalTrk->
pz());
1426 p4trk2kpi.setE(sqrt(ptrk2kpi*ptrk2kpi+
mk*
mk));
1427 p2kpi.push_back(p4trk2kpi);
1435 ptrk2kpi = mdcKalTrk->
p();
1436 p4trk2kpi.setPx(mdcKalTrk->
px());
1437 p4trk2kpi.setPy(mdcKalTrk->
py());
1438 p4trk2kpi.setPz(mdcKalTrk->
pz());
1439 p4trk2kpi.setE(sqrt(ptrk2kpi*ptrk2kpi+
mpi*
mpi));
1440 p2kpi.push_back(p4trk2kpi);
1445 ptrk2kpi = mdcKalTrk->
p();
1446 p4trk2kpi.setPx(mdcKalTrk->
px());
1447 p4trk2kpi.setPy(mdcKalTrk->
py());
1448 p4trk2kpi.setPz(mdcKalTrk->
pz());
1449 p4trk2kpi.setE(sqrt(ptrk2kpi*ptrk2kpi+
mpro*
mpro));
1450 p2kpi.push_back(p4trk2kpi);
1455 if(cls2kpi!=1&&cls2kpi!=2)
1458 ptrk2kpi = mdcKalTrk->
p();
1459 p4trk2kpi.setPx(mdcKalTrk->
px());
1460 p4trk2kpi.setPy(mdcKalTrk->
py());
1461 p4trk2kpi.setPz(mdcKalTrk->
pz());
1462 p4trk2kpi.setE(sqrt(ptrk2kpi*ptrk2kpi+
mpi*
mpi));
1463 p2kpi.push_back(p4trk2kpi);
1471 for (
int i = 0; i < 4; i++)
1474 if (!(*itTrk)->isMdcTrackValid())
continue;
1476 if (!(*itTrk)->isMdcKalTrackValid())
continue;
1478 if ((*itTrk)->isTofTrackValid())
1480 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
1481 SmartRefVector<RecTofTrack>::iterator iter_tof=tofTrkCol.begin();
1482 for (;iter_tof != tofTrkCol.end(); iter_tof++ ){
1484 status->
setStatus((*iter_tof)->status());
1485 if(status->
is_cluster()){ dtpr2kpilst[i]=((*iter_tof)->tof()-(*iter_tof)->texpProton());
1527 for (
int i = 0; i < 4; i++)
1530 if (!(*itTrk)->isMdcTrackValid())
continue;
1532 if (!(*itTrk)->isMdcKalTrackValid())
continue;
1534 m_ppmdc2kpi[i]=mdcTrk->
p();
1535 m_pxmdc2kpi[i]=mdcTrk->
px();
1536 m_pymdc2kpi[i]=mdcTrk->
py();
1537 m_pzmdc2kpi[i]=mdcTrk->
pz();
1538 m_ppkal2kpi[i]=mdcKalTrk->
p();
1539 m_charge2kpi[i]=mdcKalTrk->
charge();
1541 ptrk=mdcKalTrk->
p();
1543 if (eventHeader->runNumber()<0)
1545 SmartDataPtr<Event::McParticleCol> mcParticleCol(eventSvc(),
"/Event/MC/McParticleCol");
1546 int m_numParticle = 0;
1550 return StatusCode::FAILURE;
1554 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
1555 for (; iter_mc != mcParticleCol->end(); iter_mc++)
1557 int pdgcode = (*iter_mc)->particleProperty();
1559 px=(*iter_mc)->initialFourMomentum().x();
1560 py=(*iter_mc)->initialFourMomentum().y();
1561 pz=(*iter_mc)->initialFourMomentum().z();
1564 if(fabs(commc)<fabs(mcall))
1577 if ((*itTrk)->isTofTrackValid())
1578 { m_bjtofval2kpi[i]=1;
1580 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
1581 SmartRefVector<RecTofTrack>::iterator iter_tof=tofTrkCol.begin();
1582 for (;iter_tof != tofTrkCol.end(); iter_tof++ ){
1584 status->
setStatus((*iter_tof)->status());
1592 m_layertof2kpi[i] = status->
layer();
1596 m_beta2kpi[i]= (*iter_tof)->beta();
1597 m_tof2kpi[i] = (*iter_tof)->tof();
1598 m_tofpath2kpi[i] = (*iter_tof)->path();
1599 m_zhit2kpi[i]= (*iter_tof)->zrhit();
1600 m_texe2kpi[i] = (*iter_tof)->texpElectron();
1601 m_texmu2kpi[i] = (*iter_tof)->texpMuon();
1602 m_texpi2kpi[i] = (*iter_tof)->texpPion();
1603 m_texk2kpi[i] = (*iter_tof)->texpKaon();
1604 m_texpr2kpi[i] = (*iter_tof)->texpProton();
1605 m_dte2kpi[i] = m_tof2kpi[i] - m_texe2kpi[i];
1606 m_dtmu2kpi[i] = m_tof2kpi[i] - m_texmu2kpi[i];
1607 m_dtpi2kpi[i] = m_tof2kpi[i] - m_texpi2kpi[i];
1608 m_dtk2kpi[i] = m_tof2kpi[i] - m_texk2kpi[i];
1609 m_dtpr2kpi[i] = m_tof2kpi[i] - m_texpr2kpi[i];
1610 m_tofID2kpi[i]=(*iter_tof)->tofID();
1611 m_clusterID2kpi[i]=(*iter_tof)->tofTrackID();
1612 m_sigmaetof2kpi[i]=(*iter_tof)->sigma(0);
1613 m_sigmamutof2kpi[i]=(*iter_tof)->sigma(1);
1614 m_sigmapitof2kpi[i]=(*iter_tof)->sigma(2);
1615 m_sigmaktof2kpi[i]=(*iter_tof)->sigma(3);
1616 m_sigmaprtof2kpi[i]=(*iter_tof)->sigma(4);
1617 m_t0tof2kpi[i]=(*iter_tof)->t0();
1618 m_errt0tof2kpi[i]=(*iter_tof)->errt0();
1630 if ((*itTrk)->isMdcDedxValid())
1633 m_chie2kpi[i] = dedxTrk->
chiE();
1634 m_chimu2kpi[i] = dedxTrk->
chiMu();
1635 m_chipi2kpi[i] = dedxTrk->
chiPi();
1636 m_chik2kpi[i] = dedxTrk->
chiK();
1637 m_chip2kpi[i] = dedxTrk->
chiP();
1640 m_probph2kpi[i] = dedxTrk->
probPH();
1641 m_normph2kpi[i] = dedxTrk->
normPH();
1645 if ( (*itTrk)->isEmcShowerValid() )
1649 m_emc2kpi[i] = emcTrk->
energy();
1651 m_timecg2kpi[i] = emcTrk->
time();
1656 if ( (*itTrk)->isMucTrackValid() )
1659 double dpthp = mucTrk->
depth()/25.0;
1661 m_depthmuc2kpi[i]=mucTrk->
depth();
1662 m_layermuc2kpi[i] = mucTrk->
numLayers();
1665 m_cosmdc2kpi[i] =
cos(mdcTrk->
theta());
1666 m_phimdc2kpi[i] = mdcTrk->
phi();
1668 m_pidnum2kpi[i]=(*itTrk)->partId();
1672 if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==0)
1674 if(i<4) (*itTrk)->setPartId(3);
1677if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==1)
1679 if(i<4) (*itTrk)->setPartId(4);
1683if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==2)
1685 if(i==0||i==1) (*itTrk)->setPartId(3);
1686 if(i==2||i==3) (*itTrk)->setPartId(5);
1701 m_costpid2kpi[i] =
cos(mdcTrk->
theta());
1710 m_chipidxpid2kpi[i] = pid->
chiDedx(2);
1711 m_chipitof1pid2kpi[i] = pid->
chiTof1(2);
1712 m_chipitof2pid2kpi[i] = pid->
chiTof2(2);
1713 m_chipitofpid2kpi[i]=pid->
chiTof(2);
1714 m_chipitofepid2kpi[i]=pid->
chiTofE(2);
1715 m_chipitofqpid2kpi[i]=pid->
chiTofQ(2);
1716 m_probpidxpid2kpi[i]=pid->
probDedx(2);
1717 m_probpitofpid2kpi[i]=pid->
probTof(2);
1719 m_chikdxpid2kpi[i] = pid->
chiDedx(3);
1720 m_chiktof1pid2kpi[i] = pid->
chiTof1(3);
1721 m_chiktof2pid2kpi[i] = pid->
chiTof2(3);
1722 m_chiktofpid2kpi[i]=pid->
chiTof(3);
1723 m_chiktofepid2kpi[i]=pid->
chiTofE(3);
1724 m_chiktofqpid2kpi[i]=pid->
chiTofQ(3);
1725 m_probkdxpid2kpi[i]=pid->
probDedx(3);
1726 m_probktofpid2kpi[i]=pid->
probTof(3);
1728 m_chiprdxpid2kpi[i] = pid->
chiDedx(4);
1729 m_chiprtof1pid2kpi[i] = pid->
chiTof1(4);
1730 m_chiprtof2pid2kpi[i] = pid->
chiTof2(4);
1731 m_chiprtofpid2kpi[i]=pid->
chiTof(4);
1732 m_chiprtofepid2kpi[i]=pid->
chiTofE(4);
1733 m_chiprtofqpid2kpi[i]=pid->
chiTofQ(4);
1734 m_probprdxpid2kpi[i]=pid->
probDedx(4);
1735 m_probprtofpid2kpi[i]=pid->
probTof(4);
1738 if ((*itTrk)->isTofTrackValid())
1740 SmartRefVector<RecTofTrack> dstTofTrackCol = (*itTrk)->tofTrack();
1741 SmartRefVector<RecTofTrack>::iterator iter_tof = dstTofTrackCol.begin();
1742 for( ; iter_tof!=dstTofTrackCol.end(); iter_tof++ )
1747 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==0&&m_probpi2kpi[i]>m_probk2kpi[i]&&m_probpi2kpi[i]>m_probpr2kpi[i]))
1750 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==1&&m_probk2kpi[i]>m_probpi2kpi[i]&&m_probk2kpi[i]>m_probpr2kpi[i]))
1753 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==2&&m_probpr2kpi[i]>m_probpi2kpi[i]&&m_probpr2kpi[i]>m_probk2kpi[i]&&(i==2||i==3)))
1756 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==0))
1760 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==1))
1764 if((((m_mchic2kpi>3.39&&m_mchic2kpi<3.44)||(m_mchic2kpi>3.5&&m_mchic2kpi<3.57))&&m_chis2kpi<20&&m_mpprecall<3.06&&m_energy[0]<0.3&&m_energy[0]>0.1&&m_cla2kpi==2&&(i==2||i==3)))
1770 m_trk_trackid = (*iter_tof)->trackID();
1771 m_trk_tofid = (*iter_tof)->tofID();
1773 hitStatus->
setStatus( (*iter_tof)->status() );
1775 m_trk_raw = hitStatus->
is_raw();
1780 m_trk_east = hitStatus->
is_east();
1781 m_trk_layer = hitStatus->
layer();
1783 m_trk_path = (*iter_tof)->path();
1784 m_trk_zrhit = (*iter_tof)->zrhit();
1785 m_trk_ph = (*iter_tof)->ph();
1786 m_trk_tof = (*iter_tof)->tof();
1787 m_trk_beta = (*iter_tof)->beta();
1788 m_trk_texpe = (*iter_tof)->texpElectron();
1789 m_trk_texpmu = (*iter_tof)->texpMuon();
1790 m_trk_texppi = (*iter_tof)->texpPion();
1791 m_trk_texpk = (*iter_tof)->texpKaon();
1792 m_trk_texpp = (*iter_tof)->texpProton();
1794 m_trk_offe = (*iter_tof)->toffsetElectron();
1795 m_trk_offmu = (*iter_tof)->toffsetMuon();
1796 m_trk_offpi = (*iter_tof)->toffsetPion();
1797 m_trk_offk = (*iter_tof)->toffsetKaon();
1798 m_trk_offp = (*iter_tof)->toffsetProton();
1799 m_trk_quality = (*iter_tof)->quality();
1800 m_trk_ppmdc=mdcTrk->
p();
1801 m_trk_ppkal=mdcKalTrk->
p();
1803 m_trk_phimdc=mdcTrk->
phi();
1804 m_trk_coskal=
cos(mdcKalTrk->
theta());
1805 m_trk_phikal=mdcKalTrk->
phi();
1820if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==0)
1822 jGam2kpi.push_back(igam2kpi);
1825 for(
int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
1826 if(i>=evtRecTrkCol->size())
break;
1828 if(!(*itTrk)->isEmcShowerValid())
continue;
1829if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==0)
1831 if(i!=igam2kpi) jGam2kpi.push_back((*itTrk)->trackId());
1834 jGam2kpi.push_back((*itTrk)->trackId());
1839int ngam2kpi=jGam2kpi.size();
1843for(
int i = 0; i< ngam2kpi; i++) {
1844 if(i>=evtRecTrkCol->size())
break;
1846 if(!(*itTrk)->isEmcShowerValid())
continue;
1847 RecEmcShower *emcTrk = (*(evtRecTrkCol->begin()+jGam2kpi[i]))->emcShower();
1848 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
1855 for(
int j = 0; j < evtRecEvent->totalCharged(); j++) {
1856 if(j>=evtRecTrkCol->size())
break;
1858 if(!(*jtTrk)->isExtTrackValid())
continue;
1862 double angd = extpos.angle(emcpos);
1863 double thed = extpos.theta() - emcpos.theta();
1864 double phid = extpos.deltaPhi(emcpos);
1865 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
1866 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
1870 if(angd < dang) { dang = angd;
1876 if(dang>=200)
continue;
1877 double eraw = emcTrk->
energy();
1878 dthe = dthe * 180 / (CLHEP::pi);
1879 dphi = dphi * 180 / (CLHEP::pi);
1880 dang = dang * 180 / (CLHEP::pi);
1884 m_numHits[i]= emcTrk->
numHits();
1887 m_timegm[i] = emcTrk->
time();
1888 m_cellId[i]=emcTrk->
cellId();
1889 m_module[i]=emcTrk->
module();
1894 m_getEAll[i]=emcTrk->
getEAll();
1895 m_x[i]= emcTrk->
x();
1896 m_y[i]= emcTrk->
y();
1897 m_z[i]= emcTrk->
z();
1898 m_cosemc[i] =
cos(emcTrk->
theta());
1899 m_phiemc[i] = emcTrk->
phi();
1900 m_energy[i] = emcTrk->
energy();
1901 m_eSeed[i] = emcTrk->
eSeed();
1902 m_e3x3[i] = emcTrk->
e3x3();
1903 m_e5x5[i] = emcTrk->
e5x5();
1925if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==0)
1926 {m_subalg1->execute();
1935if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==1&&dtpr2kpilst[0]<-0.4&&dtpr2kpilst[1]<-0.4&&dtpr2kpilst[2]<-0.4&&dtpr2kpilst[3]<-0.4)
1936 {m_subalg2->execute();
1943if(mppreclst<3.06&&chis4c2kpilst<20&&((mchic2kpilst>3.39&&mchic2kpilst<3.44)||(mchic2kpilst>3.5&&mchic2kpilst<3.57))&&type2kpilst==2)
1944 {m_subalg3->execute();
1956if((mppreclst<3.06&&chis4c2kpilst<40)||((meelst>3.06&&meelst<3.12)&&(fabs(mppreclst-3.097)<0.01)))
1963 return StatusCode::SUCCESS;