70 MsgStream log(
msgSvc(), name() );
72 log << MSG::INFO <<
"in initialize()" << endmsg;
79 NTuplePtr trk0(
ntupleSvc(),
"FILE1/toftrk" );
80 if ( trk0 ) trk_tuple = trk0;
84 ntupleSvc()->book(
"FILE1/toftrk", CLID_ColumnWiseTuple,
"ks N-Tuple example" );
87 status = trk_tuple->addItem(
"trk_trackid", m_trk_trackid );
88 status = trk_tuple->addItem(
"trk_tofid", m_trk_tofid );
89 status = trk_tuple->addItem(
"trk_raw", m_trk_raw );
90 status = trk_tuple->addItem(
"trk_readout", m_trk_readout );
91 status = trk_tuple->addItem(
"trk_counter", m_trk_counter );
92 status = trk_tuple->addItem(
"trk_cluster", m_trk_cluster );
93 status = trk_tuple->addItem(
"trk_barrel", m_trk_barrel );
94 status = trk_tuple->addItem(
"trk_east", m_trk_east );
95 status = trk_tuple->addItem(
"trk_layer", m_trk_layer );
96 status = trk_tuple->addItem(
"trk_path", m_trk_path );
97 status = trk_tuple->addItem(
"trk_zrhit", m_trk_zrhit );
98 status = trk_tuple->addItem(
"trk_ph", m_trk_ph );
99 status = trk_tuple->addItem(
"trk_tof", m_trk_tof );
100 status = trk_tuple->addItem(
"trk_beta", m_trk_beta );
102 status = trk_tuple->addItem(
"trk_texpe", m_trk_texpe );
103 status = trk_tuple->addItem(
"trk_texpmu", m_trk_texpmu );
104 status = trk_tuple->addItem(
"trk_texppi", m_trk_texppi );
105 status = trk_tuple->addItem(
"trk_texpk", m_trk_texpk );
106 status = trk_tuple->addItem(
"trk_texpp", m_trk_texpp );
107 status = trk_tuple->addItem(
"trk_offe", m_trk_offe );
108 status = trk_tuple->addItem(
"trk_offmu", m_trk_offmu );
109 status = trk_tuple->addItem(
"trk_offpi", m_trk_offpi );
110 status = trk_tuple->addItem(
"trk_offk", m_trk_offk );
111 status = trk_tuple->addItem(
"trk_offp", m_trk_offp );
112 status = trk_tuple->addItem(
"trk_quality", m_trk_quality );
113 status = trk_tuple->addItem(
"trk_type", m_trk_type );
114 status = trk_tuple->addItem(
"trk_pidtype", m_trk_pidtype );
115 status = trk_tuple->addItem(
"trk_ppmdc", m_trk_ppmdc );
116 status = trk_tuple->addItem(
"trk_ppmdc", m_trk_ppmdc );
117 status = trk_tuple->addItem(
"trk_ptmdc", m_trk_ptmdc );
118 status = trk_tuple->addItem(
"trk_ppkal", m_trk_ppkal );
119 status = trk_tuple->addItem(
"trk_ptkal", m_trk_ptkal );
120 status = trk_tuple->addItem(
"trk_cosmdc", m_trk_cosmdc );
121 status = trk_tuple->addItem(
"trk_phimdc", m_trk_phimdc );
122 status = trk_tuple->addItem(
"trk_coskal", m_trk_coskal );
123 status = trk_tuple->addItem(
"trk_phikal", m_trk_phikal );
125 status = trk_tuple->addItem(
"trk_charge", m_trk_charge );
129 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( trk_tuple ) << endmsg;
130 return StatusCode::FAILURE;
134 NTuplePtr nt1(
ntupleSvc(),
"FILE1/total4c" );
135 if ( nt1 ) m_tuple1 = nt1;
139 ntupleSvc()->book(
"FILE1/total4c", CLID_ColumnWiseTuple,
"ks N-Tuple example" );
143 status = m_tuple1->addItem(
"run", m_run );
144 status = m_tuple1->addItem(
"rec", m_rec );
145 status = m_tuple1->addItem(
"mpprecall", m_mpprecall );
146 status = m_tuple1->addItem(
"meeall", m_meeall );
147 status = m_tuple1->addItem(
"ncgjs", m_ncgjs );
148 status = m_tuple1->addItem(
"cla2kpi", m_cla2kpi );
149 status = m_tuple1->addItem(
"indexmc", m_idxmc, 0, 100 );
150 status = m_tuple1->addIndexedItem(
"pdgid", m_idxmc, m_pdgid );
152 status = m_tuple1->addIndexedItem(
"motheridx", m_idxmc, m_motheridx );
153 status = m_tuple1->addItem(
"indexmdc", m_idxmdc, 0, 5000 );
154 status = m_tuple1->addIndexedItem(
"x0js", m_idxmdc, m_x0js );
155 status = m_tuple1->addIndexedItem(
"y0js", m_idxmdc, m_y0js );
156 status = m_tuple1->addIndexedItem(
"z0js", m_idxmdc, m_z0js );
157 status = m_tuple1->addIndexedItem(
"r0js", m_idxmdc, m_r0js );
158 status = m_tuple1->addIndexedItem(
"Rxyjs", m_idxmdc, m_Rxyjs );
159 status = m_tuple1->addIndexedItem(
"Rzjs", m_idxmdc, m_Rzjs );
160 status = m_tuple1->addIndexedItem(
"Rnxyjs", m_idxmdc, m_Rnxyjs );
161 status = m_tuple1->addIndexedItem(
"phinjs", m_idxmdc, m_phinjs );
162 status = m_tuple1->addIndexedItem(
"Rnzjs", m_idxmdc, m_Rnzjs );
163 status = m_tuple1->addItem(
"ncy20", m_ncy20 );
164 status = m_tuple1->addItem(
"ncy30", m_ncy30 );
165 status = m_tuple1->addIndexedItem(
"angjs5", m_idxmdc, m_angjs5 );
166 status = m_tuple1->addIndexedItem(
"nearjs5", m_idxmdc, m_nearjs5 );
167 status = m_tuple1->addIndexedItem(
"angjs6", m_idxmdc, m_angjs6 );
168 status = m_tuple1->addIndexedItem(
"nearjs6", m_idxmdc, m_nearjs6 );
169 status = m_tuple1->addIndexedItem(
"ang4pi5", m_idxmdc, m_ang4pi5 );
170 status = m_tuple1->addIndexedItem(
"near4pi5", m_idxmdc, m_near4pi5 );
171 status = m_tuple1->addIndexedItem(
"ang4pi6", m_idxmdc, m_ang4pi6 );
172 status = m_tuple1->addIndexedItem(
"near4pi6", m_idxmdc, m_near4pi6 );
173 status = m_tuple1->addIndexedItem(
"ppmdcjs", m_idxmdc, m_ppmdcjs );
174 status = m_tuple1->addIndexedItem(
"pxmdcjs", m_idxmdc, m_pxmdcjs );
175 status = m_tuple1->addIndexedItem(
"pymdcjs", m_idxmdc, m_pymdcjs );
176 status = m_tuple1->addIndexedItem(
"pzmdcjs", m_idxmdc, m_pzmdcjs );
177 status = m_tuple1->addIndexedItem(
"ppkaljs", m_idxmdc, m_ppkaljs );
178 status = m_tuple1->addIndexedItem(
"ptmdcjs", m_idxmdc, m_ptmdcjs );
179 status = m_tuple1->addIndexedItem(
"ptkaljs", m_idxmdc, m_ptkaljs );
180 status = m_tuple1->addIndexedItem(
"ppmdc2kpi", m_idxmdc, m_ppmdc2kpi );
181 status = m_tuple1->addIndexedItem(
"pxmdc2kpi", m_idxmdc, m_pxmdc2kpi );
182 status = m_tuple1->addIndexedItem(
"pymdc2kpi", m_idxmdc, m_pymdc2kpi );
183 status = m_tuple1->addIndexedItem(
"pzmdc2kpi", m_idxmdc, m_pzmdc2kpi );
184 status = m_tuple1->addIndexedItem(
"ppkal2kpi", m_idxmdc, m_ppkal2kpi );
185 status = m_tuple1->addIndexedItem(
"ptmdc2kpi", m_idxmdc, m_ptmdc2kpi );
186 status = m_tuple1->addIndexedItem(
"charge2kpi", m_idxmdc, m_charge2kpi );
187 status = m_tuple1->addIndexedItem(
"ptkal2kpi", m_idxmdc, m_ptkal2kpi );
188 status = m_tuple1->addItem(
"cy2pi", m_cy2kpi, 0, 100 );
189 status = m_tuple1->addIndexedItem(
"comcs2kpi", m_cy2kpi, m_comcs2kpi );
190 status = m_tuple1->addItem(
"chiejs", m_idxmdc, m_chiejs );
191 status = m_tuple1->addItem(
"chimujs", m_idxmdc, m_chimujs );
192 status = m_tuple1->addItem(
"chipijs", m_idxmdc, m_chipijs );
193 status = m_tuple1->addItem(
"chikjs", m_idxmdc, m_chikjs );
194 status = m_tuple1->addItem(
"chipjs", m_idxmdc, m_chipjs );
195 status = m_tuple1->addItem(
"ghitjs", m_idxmdc, m_ghitjs );
196 status = m_tuple1->addItem(
"thitjs", m_idxmdc, m_thitjs );
197 status = m_tuple1->addIndexedItem(
"probphjs", m_idxmdc, m_probphjs );
198 status = m_tuple1->addIndexedItem(
"normphjs", m_idxmdc, m_normphjs );
199 status = m_tuple1->addItem(
"pdg", m_idxmdc, m_pdg );
200 status = m_tuple1->addItem(
"cbmc", m_idxmdc, m_cbmc );
201 status = m_tuple1->addIndexedItem(
"sigmaetof2kpi", m_idxmdc, m_sigmaetof2kpi );
202 status = m_tuple1->addIndexedItem(
"sigmamutof2kpi", m_idxmdc, m_sigmamutof2kpi );
203 status = m_tuple1->addIndexedItem(
"sigmapitof2kpi", m_idxmdc, m_sigmapitof2kpi );
204 status = m_tuple1->addIndexedItem(
"sigmaktof2kpi", m_idxmdc, m_sigmaktof2kpi );
205 status = m_tuple1->addIndexedItem(
"sigmaprtof2kpi", m_idxmdc, m_sigmaprtof2kpi );
206 status = m_tuple1->addIndexedItem(
"t0tof2kpi", m_idxmdc, m_t0tof2kpi );
207 status = m_tuple1->addIndexedItem(
"errt0tof2kpi", m_idxmdc, m_errt0tof2kpi );
209 status = m_tuple1->addItem(
"chie2kpi", m_idxmdc, m_chie2kpi );
210 status = m_tuple1->addItem(
"chimu2kpi", m_idxmdc, m_chimu2kpi );
211 status = m_tuple1->addItem(
"chipi2kpi", m_idxmdc, m_chipi2kpi );
212 status = m_tuple1->addItem(
"chik2kpi", m_idxmdc, m_chik2kpi );
213 status = m_tuple1->addItem(
"chip2kpi", m_idxmdc, m_chip2kpi );
214 status = m_tuple1->addItem(
"ghit2kpi", m_idxmdc, m_ghit2kpi );
215 status = m_tuple1->addItem(
"thit2kpi", m_idxmdc, m_thit2kpi );
216 status = m_tuple1->addIndexedItem(
"probph2kpi", m_idxmdc, m_probph2kpi );
217 status = m_tuple1->addIndexedItem(
"normph2kpi", m_idxmdc, m_normph2kpi );
218 status = m_tuple1->addIndexedItem(
"pidnum2kpi", m_idxmdc, m_pidnum2kpi );
219 status = m_tuple1->addIndexedItem(
"bjmucjs", m_idxmdc, m_bjmucjs );
220 status = m_tuple1->addIndexedItem(
"bjmuc2kpi", m_idxmdc, m_bjmuc2kpi );
221 status = m_tuple1->addIndexedItem(
"bjemcjs", m_idxmdc, m_bjemcjs );
222 status = m_tuple1->addIndexedItem(
"bjemc2kpi", m_idxmdc, m_bjemc2kpi );
223 status = m_tuple1->addIndexedItem(
"bjtofjs", m_idxmdc, m_bjtofjs );
224 status = m_tuple1->addIndexedItem(
"bjtof2kpi", m_idxmdc, m_bjtof2kpi );
225 status = m_tuple1->addIndexedItem(
"bjtofvaljs", m_idxmdc, m_bjtofvaljs );
226 status = m_tuple1->addIndexedItem(
"bjtofval2kpi", m_idxmdc, m_bjtofval2kpi );
228 status = m_tuple1->addIndexedItem(
"emcjs", m_idxmdc, m_emcjs );
229 status = m_tuple1->addIndexedItem(
"evpjs", m_idxmdc, m_evpjs );
230 status = m_tuple1->addIndexedItem(
"timecgjs", m_idxmdc, m_timecgjs );
231 status = m_tuple1->addIndexedItem(
"depthjs", m_idxmdc, m_depthmucjs );
232 status = m_tuple1->addIndexedItem(
"layermucjs", m_idxmdc, m_layermucjs );
234 status = m_tuple1->addIndexedItem(
"emc2kpi", m_idxmdc, m_emc2kpi );
235 status = m_tuple1->addIndexedItem(
"evp2kpi", m_idxmdc, m_evp2kpi );
236 status = m_tuple1->addIndexedItem(
"timecg2kpi", m_idxmdc, m_timecg2kpi );
237 status = m_tuple1->addIndexedItem(
"depth2kpi", m_idxmdc, m_depthmuc2kpi );
238 status = m_tuple1->addIndexedItem(
"layermuc2kpi", m_idxmdc, m_layermuc2kpi );
240 status = m_tuple1->addIndexedItem(
"cotof1js", m_idxmdc, m_cotof1js );
241 status = m_tuple1->addIndexedItem(
"cotof2js", m_idxmdc, m_cotof2js );
242 status = m_tuple1->addIndexedItem(
"counterjs", m_idxmdc, m_counterjs );
243 status = m_tuple1->addIndexedItem(
"barreljs", m_idxmdc, m_barreljs );
244 status = m_tuple1->addIndexedItem(
"layertofjs", m_idxmdc, m_layertofjs );
245 status = m_tuple1->addIndexedItem(
"readoutjs", m_idxmdc, m_readoutjs );
246 status = m_tuple1->addIndexedItem(
"clusterjs", m_idxmdc, m_clusterjs );
247 status = m_tuple1->addIndexedItem(
"betajs", m_idxmdc, m_betajs );
248 status = m_tuple1->addIndexedItem(
"tofjs", m_idxmdc, m_tofjs );
249 status = m_tuple1->addIndexedItem(
"tofpathjs", m_idxmdc, m_tofpathjs );
250 status = m_tuple1->addIndexedItem(
"zhitjs", m_idxmdc, m_zhitjs );
251 status = m_tuple1->addIndexedItem(
"tofIDjs", m_idxmdc, m_tofIDjs );
252 status = m_tuple1->addIndexedItem(
"clusterIDjs", m_idxmdc, m_clusterIDjs );
253 status = m_tuple1->addIndexedItem(
"texejs", m_idxmdc, m_texejs );
254 status = m_tuple1->addIndexedItem(
"texmujs", m_idxmdc, m_texmujs );
255 status = m_tuple1->addIndexedItem(
"texpijs", m_idxmdc, m_texpijs );
256 status = m_tuple1->addIndexedItem(
"texkjs", m_idxmdc, m_texkjs );
257 status = m_tuple1->addIndexedItem(
"texprjs", m_idxmdc, m_texprjs );
258 status = m_tuple1->addIndexedItem(
"dtejs", m_idxmdc, m_dtejs );
259 status = m_tuple1->addIndexedItem(
"dtmujs", m_idxmdc, m_dtmujs );
260 status = m_tuple1->addIndexedItem(
"dtpijs", m_idxmdc, m_dtpijs );
261 status = m_tuple1->addIndexedItem(
"dtkjs", m_idxmdc, m_dtkjs );
262 status = m_tuple1->addIndexedItem(
"dtprjs", m_idxmdc, m_dtprjs );
263 status = m_tuple1->addIndexedItem(
"sigmaetofjs", m_idxmdc, m_sigmaetofjs );
264 status = m_tuple1->addIndexedItem(
"sigmamutofjs", m_idxmdc, m_sigmamutofjs );
265 status = m_tuple1->addIndexedItem(
"sigmapitofjs", m_idxmdc, m_sigmapitofjs );
266 status = m_tuple1->addIndexedItem(
"sigmaktofjs", m_idxmdc, m_sigmaktofjs );
267 status = m_tuple1->addIndexedItem(
"sigmaprtofjs", m_idxmdc, m_sigmaprtofjs );
268 status = m_tuple1->addIndexedItem(
"t0tofjs", m_idxmdc, m_t0tofjs );
269 status = m_tuple1->addIndexedItem(
"errt0tofjs", m_idxmdc, m_errt0tofjs );
270 status = m_tuple1->addIndexedItem(
"cotof12kpi", m_idxmdc, m_cotof12kpi );
271 status = m_tuple1->addIndexedItem(
"cotof22kpi", m_idxmdc, m_cotof22kpi );
272 status = m_tuple1->addIndexedItem(
"counter2kpi", m_idxmdc, m_counter2kpi );
273 status = m_tuple1->addIndexedItem(
"barrel2kpi", m_idxmdc, m_barrel2kpi );
274 status = m_tuple1->addIndexedItem(
"layertof2kpi", m_idxmdc, m_layertof2kpi );
275 status = m_tuple1->addIndexedItem(
"readout2kpi", m_idxmdc, m_readout2kpi );
276 status = m_tuple1->addIndexedItem(
"cluster2kpi", m_idxmdc, m_cluster2kpi );
277 status = m_tuple1->addIndexedItem(
"beta2kpi", m_idxmdc, m_beta2kpi );
278 status = m_tuple1->addIndexedItem(
"tof2kpi", m_idxmdc, m_tof2kpi );
279 status = m_tuple1->addIndexedItem(
"tofpath2kpi", m_idxmdc, m_tofpath2kpi );
280 status = m_tuple1->addIndexedItem(
"zhit2kpi", m_idxmdc, m_zhit2kpi );
281 status = m_tuple1->addIndexedItem(
"tofID2kpi", m_idxmdc, m_tofID2kpi );
282 status = m_tuple1->addIndexedItem(
"clusterID2kpi", m_idxmdc, m_clusterID2kpi );
283 status = m_tuple1->addIndexedItem(
"texe2kpi", m_idxmdc, m_texe2kpi );
284 status = m_tuple1->addIndexedItem(
"texmu2kpi", m_idxmdc, m_texmu2kpi );
285 status = m_tuple1->addIndexedItem(
"texpi2kpi", m_idxmdc, m_texpi2kpi );
286 status = m_tuple1->addIndexedItem(
"texk2kpi", m_idxmdc, m_texk2kpi );
287 status = m_tuple1->addIndexedItem(
"texpr2kpi", m_idxmdc, m_texpr2kpi );
288 status = m_tuple1->addIndexedItem(
"dte2kpi", m_idxmdc, m_dte2kpi );
289 status = m_tuple1->addIndexedItem(
"dtmu2kpi", m_idxmdc, m_dtmu2kpi );
290 status = m_tuple1->addIndexedItem(
"dtpi2kpi", m_idxmdc, m_dtpi2kpi );
291 status = m_tuple1->addIndexedItem(
"dtk2kpi", m_idxmdc, m_dtk2kpi );
292 status = m_tuple1->addIndexedItem(
"dtpr2kpi", m_idxmdc, m_dtpr2kpi );
293 status = m_tuple1->addIndexedItem(
"costpid2kpi", m_idxmdc, m_costpid2kpi );
294 status = m_tuple1->addIndexedItem(
"dedxpid2kpi", m_idxmdc, m_dedxpid2kpi );
295 status = m_tuple1->addIndexedItem(
"tof1pid2kpi", m_idxmdc, m_tof1pid2kpi );
296 status = m_tuple1->addIndexedItem(
"tof2pid2kpi", m_idxmdc, m_tof2pid2kpi );
297 status = m_tuple1->addIndexedItem(
"probe2kpi", m_idxmdc, m_probe2kpi );
298 status = m_tuple1->addIndexedItem(
"probmu2kpi", m_idxmdc, m_probmu2kpi );
299 status = m_tuple1->addIndexedItem(
"probpi2kpi", m_idxmdc, m_probpi2kpi );
300 status = m_tuple1->addIndexedItem(
"probk2kpi", m_idxmdc, m_probk2kpi );
301 status = m_tuple1->addIndexedItem(
"probpr2kpi", m_idxmdc, m_probpr2kpi );
303 status = m_tuple1->addIndexedItem(
"chipidxpid2kpi", m_idxmdc, m_chipidxpid2kpi );
304 status = m_tuple1->addIndexedItem(
"chipitof1pid2kpi", m_idxmdc, m_chipitof1pid2kpi );
305 status = m_tuple1->addIndexedItem(
"chipitof2pid2kpi", m_idxmdc, m_chipitof2pid2kpi );
306 status = m_tuple1->addIndexedItem(
"chipitofpid2kpi", m_idxmdc, m_chipitofpid2kpi );
307 status = m_tuple1->addIndexedItem(
"chipitofepid2kpi", m_idxmdc, m_chipitofepid2kpi );
308 status = m_tuple1->addIndexedItem(
"chipitofqpid2kpi", m_idxmdc, m_chipitofqpid2kpi );
309 status = m_tuple1->addIndexedItem(
"probpidxpid2kpi", m_idxmdc, m_probpidxpid2kpi );
310 status = m_tuple1->addIndexedItem(
"probpitofpid2kpi", m_idxmdc, m_probpitofpid2kpi );
311 status = m_tuple1->addIndexedItem(
"chikdxpid2kpi", m_idxmdc, m_chikdxpid2kpi );
312 status = m_tuple1->addIndexedItem(
"chiktof1pid2kpi", m_idxmdc, m_chiktof1pid2kpi );
313 status = m_tuple1->addIndexedItem(
"chiktof2pid2kpi", m_idxmdc, m_chiktof2pid2kpi );
314 status = m_tuple1->addIndexedItem(
"chiktofpid2kpi", m_idxmdc, m_chiktofpid2kpi );
315 status = m_tuple1->addIndexedItem(
"chiktofepid2kpi", m_idxmdc, m_chiktofepid2kpi );
316 status = m_tuple1->addIndexedItem(
"chiktofqpid2kpi", m_idxmdc, m_chiktofqpid2kpi );
317 status = m_tuple1->addIndexedItem(
"probkdxpid2kpi", m_idxmdc, m_probkdxpid2kpi );
318 status = m_tuple1->addIndexedItem(
"probktofpid2kpi", m_idxmdc, m_probktofpid2kpi );
320 status = m_tuple1->addIndexedItem(
"chiprdxpid2kpi", m_idxmdc, m_chiprdxpid2kpi );
321 status = m_tuple1->addIndexedItem(
"chiprtof1pid2kpi", m_idxmdc, m_chiprtof1pid2kpi );
322 status = m_tuple1->addIndexedItem(
"chiprtof2pid2kpi", m_idxmdc, m_chiprtof2pid2kpi );
323 status = m_tuple1->addIndexedItem(
"chiprtofpid2kpi", m_idxmdc, m_chiprtofpid2kpi );
324 status = m_tuple1->addIndexedItem(
"chiprtofepid2kpi", m_idxmdc, m_chiprtofepid2kpi );
325 status = m_tuple1->addIndexedItem(
"chiprtofqpid2kpi", m_idxmdc, m_chiprtofqpid2kpi );
326 status = m_tuple1->addIndexedItem(
"probprdxpid2kpi", m_idxmdc, m_probprdxpid2kpi );
327 status = m_tuple1->addIndexedItem(
"probprtofpid2kpi", m_idxmdc, m_probprtofpid2kpi );
329 status = m_tuple1->addIndexedItem(
"cosmdcjs", m_idxmdc, m_cosmdcjs );
330 status = m_tuple1->addIndexedItem(
"phimdcjs", m_idxmdc, m_phimdcjs );
331 status = m_tuple1->addIndexedItem(
"cosmdc2kpi", m_idxmdc, m_cosmdc2kpi );
332 status = m_tuple1->addIndexedItem(
"phimdc2kpi", m_idxmdc, m_phimdc2kpi );
334 status = m_tuple1->addIndexedItem(
"dedxpidjs", m_idxmdc, m_dedxpidjs );
335 status = m_tuple1->addIndexedItem(
"tof1pidjs", m_idxmdc, m_tof1pidjs );
336 status = m_tuple1->addIndexedItem(
"tof2pidjs", m_idxmdc, m_tof2pidjs );
337 status = m_tuple1->addIndexedItem(
"probejs", m_idxmdc, m_probejs );
338 status = m_tuple1->addIndexedItem(
"probmujs", m_idxmdc, m_probmujs );
339 status = m_tuple1->addIndexedItem(
"probpijs", m_idxmdc, m_probpijs );
340 status = m_tuple1->addIndexedItem(
"probkjs", m_idxmdc, m_probkjs );
341 status = m_tuple1->addIndexedItem(
"probprjs", m_idxmdc, m_probprjs );
342 status = m_tuple1->addItem(
"mchic2kpi", m_mchic2kpi );
343 status = m_tuple1->addItem(
"mpsip2kpi", m_mpsip2kpi );
344 status = m_tuple1->addItem(
"chis2kpi", m_chis2kpi );
345 status = m_tuple1->addItem(
"mchic4c2kpi", m_mchic4c2kpi );
346 status = m_tuple1->addItem(
"mpsip4c2kpi", m_mpsip4c2kpi );
347 status = m_tuple1->addItem(
"chis4c2kpi", m_chis4c2kpi );
349 status = m_tuple1->addItem(
"indexemc", m_idxemc, 0, 5000 );
350 status = m_tuple1->addIndexedItem(
"numHits", m_idxemc, m_numHits );
351 status = m_tuple1->addIndexedItem(
"secmom", m_idxemc, m_secondmoment );
352 status = m_tuple1->addIndexedItem(
"latmom", m_idxemc, m_latmoment );
353 status = m_tuple1->addIndexedItem(
"timegm", m_idxemc, m_timegm );
354 status = m_tuple1->addIndexedItem(
"cellId", m_idxemc, m_cellId );
355 status = m_tuple1->addIndexedItem(
"module", m_idxemc, m_module );
356 status = m_tuple1->addIndexedItem(
"a20Moment", m_idxemc, m_a20Moment );
357 status = m_tuple1->addIndexedItem(
"a42Moment", m_idxemc, m_a42Moment );
358 status = m_tuple1->addIndexedItem(
"getEAll", m_idxemc, m_getEAll );
359 status = m_tuple1->addIndexedItem(
"getShowerId", m_idxemc, m_getShowerId );
360 status = m_tuple1->addIndexedItem(
"getClusterId", m_idxemc, m_getClusterId );
361 status = m_tuple1->addIndexedItem(
"x", m_idxemc, m_x );
362 status = m_tuple1->addIndexedItem(
"y", m_idxemc, m_y );
363 status = m_tuple1->addIndexedItem(
"z", m_idxemc, m_z );
364 status = m_tuple1->addIndexedItem(
"cosemc", m_idxemc, m_cosemc );
365 status = m_tuple1->addIndexedItem(
"phiemc", m_idxemc, m_phiemc );
366 status = m_tuple1->addIndexedItem(
"energy", m_idxemc, m_energy );
367 status = m_tuple1->addIndexedItem(
"e1", m_idxemc, m_eSeed );
368 status = m_tuple1->addIndexedItem(
"e9", m_idxemc, m_e3x3 );
369 status = m_tuple1->addIndexedItem(
"e25", m_idxemc, m_e5x5 );
370 status = m_tuple1->addIndexedItem(
"dang4c", m_idxemc, m_dang4c );
371 status = m_tuple1->addIndexedItem(
"dthe4c", m_idxemc, m_dthe4c );
372 status = m_tuple1->addIndexedItem(
"dphi4c", m_idxemc, m_dphi4c );
373 status = m_tuple1->addIndexedItem(
"dang4crt", m_idxemc, m_dang4crt );
374 status = m_tuple1->addIndexedItem(
"dthe4crt", m_idxemc, m_dthe4crt );
375 status = m_tuple1->addIndexedItem(
"dphi4crt", m_idxemc, m_dphi4crt );
376 status = m_tuple1->addIndexedItem(
"phtof", m_idxemc, 3, m_phgmtof, 0.0, 10000.0 );
377 status = m_tuple1->addIndexedItem(
"phgmtof0", m_idxemc, m_phgmtof0 );
378 status = m_tuple1->addIndexedItem(
"phgmtof1", m_idxemc, m_phgmtof1 );
379 status = m_tuple1->addIndexedItem(
"phgmtof2", m_idxemc, m_phgmtof2 );
383 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
384 return StatusCode::FAILURE;
392 sc = toolSvc()->retrieveTool(
"EventWriter",
"Selectgam4pi", m_tool1,
this );
393 if ( sc.isFailure() )
395 log << MSG::ERROR <<
"Error retrieve IEventWriterTool Selectgam4pi" << endmsg;
398 else { log << MSG::INFO <<
"Success retrieve IEventWriterTool Selectgam4pi" << endmsg; }
403 sc = toolSvc()->retrieveTool(
"EventWriter",
"Selectgam4k", m_tool2,
this );
404 if ( sc.isFailure() )
406 log << MSG::ERROR <<
"Error retrieve IEventWriterTool Selectgam4k" << endmsg;
409 else { log << MSG::INFO <<
"Success retrieve IEventWriterTool Selectgam4k" << endmsg; }
414 sc = toolSvc()->retrieveTool(
"EventWriter",
"Selectgam2pi2pr", m_tool3,
this );
415 if ( sc.isFailure() )
417 log << MSG::ERROR <<
"Error retrieve IEventWriterTool Selectgam2pi2pr" << endmsg;
420 else { log << MSG::INFO <<
"Success retrieve IEventWriterTool Selectgam2pi2pr" << endmsg; }
427 log << MSG::INFO <<
"successfully return from initialize()" << endmsg;
428 return StatusCode::SUCCESS;
435 setFilterPassed(
false );
437 MsgStream log(
msgSvc(), name() );
438 log << MSG::INFO <<
"in execute()" << endmsg;
440 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
441 int run = eventHeader->runNumber();
442 int event = eventHeader->eventNumber();
443 log << MSG::DEBUG <<
"run, evtnum = " << run <<
" , " <<
event << endmsg;
453 log << MSG::DEBUG <<
"ncharg, nneu, tottks = " << evtRecEvent->totalCharged() <<
" , "
454 << evtRecEvent->totalNeutral() <<
" , " << evtRecEvent->totalTracks() << endmsg;
458 if ( m_rootput ) { Gam4pikp::InitVar(); }
463 if ( eventHeader->runNumber() < 0 )
465 SmartDataPtr<Event::McParticleCol> mcParticleCol( eventSvc(),
466 "/Event/MC/McParticleCol" );
467 int m_numParticle = 0;
468 if ( !mcParticleCol )
471 return StatusCode::FAILURE;
475 bool psipDecay =
false;
477 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
478 for ( ; iter_mc != mcParticleCol->end(); iter_mc++ )
480 if ( ( *iter_mc )->primaryParticle() )
continue;
481 if ( !( *iter_mc )->decayFromGenerator() )
continue;
482 if ( ( *iter_mc )->particleProperty() == 100443 )
485 rootIndex = ( *iter_mc )->trackIndex();
487 if ( !psipDecay )
continue;
488 int mcidx = ( ( *iter_mc )->mother() ).trackIndex() - rootIndex;
489 int pdgid = ( *iter_mc )->particleProperty();
490 m_pdgid[m_numParticle] = pdgid;
491 m_motheridx[m_numParticle] = mcidx;
495 m_idxmc = m_numParticle;
499 Vint iGood, ipip, ipim;
511 Hep3Vector
v( 0, 0, 0 );
512 Hep3Vector vv( 0, 0, 0 );
515 service(
"VertexDbSvc", vtxsvc ).ignore();
523 vv.setX( vertexsigma[0] );
524 vv.setY( vertexsigma[1] );
525 vv.setZ( vertexsigma[2] );
538 for (
int i = 0; i < evtRecEvent->totalCharged(); i++ )
540 if ( i >= evtRecTrkCol->size() )
break;
543 if ( !( *itTrk )->isMdcTrackValid() )
continue;
544 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
548 HepVector a = mdcTrk->
helix();
549 HepSymMatrix Ea = mdcTrk->
err();
552 VFHelix helixp( pivot, a, Ea );
554 HepVector
vec = helixp.
a();
555 pTrkCh.push_back( mdcTrk->
p() * mdcTrk->
charge() );
556 iGood.push_back( ( *itTrk )->trackId() );
557 nCharge += mdcTrk->
charge();
560 int nGood = iGood.size();
561 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endmsg;
562 if ( ( nGood < 4 ) ) {
return StatusCode::SUCCESS; }
571 for (
int i = evtRecEvent->totalCharged(); i < evtRecEvent->totalTracks(); i++ )
574 if ( i >= evtRecTrkCol->size() )
break;
576 if ( !( *itTrk )->isEmcShowerValid() )
continue;
578 Hep3Vector emcpos( emcTrk->
x(), emcTrk->
y(), emcTrk->
z() );
588 for (
int j = 0; j < evtRecEvent->totalCharged(); j++ )
590 if ( j >= evtRecTrkCol->size() )
break;
592 if ( !( *jtTrk )->isExtTrackValid() )
continue;
597 double angd = extpos.angle( emcpos );
598 double thed = extpos.theta() - emcpos.theta();
599 double phid = extpos.deltaPhi( emcpos );
600 thed = fmod( thed + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
601 phid = fmod( phid + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
615 double eraw = emcTrk->
energy();
616 dthe = dthe * 180 / ( CLHEP::pi );
617 dphi = dphi * 180 / ( CLHEP::pi );
618 dang = dang * 180 / ( CLHEP::pi );
623 iGam.push_back( ( *itTrk )->trackId() );
624 if ( eraw < m_energyThreshold )
continue;
625 if ( dang < 20.0 )
continue;
626 iGamnofit.push_back( ( *itTrk )->trackId() );
630 int nGam = iGam.size();
631 int nGamnofit = iGamnofit.size();
633 log << MSG::DEBUG <<
"num Good Photon " << nGam <<
" , " << evtRecEvent->totalNeutral()
635 if ( nGam < 1 ) {
return StatusCode::SUCCESS; }
638 if ( nGood > 20 || nGam > 30 )
return StatusCode::SUCCESS;
648 for (
int i = 0; i < nGam; i++ )
652 double eraw = emcTrk->
energy();
653 double phi = emcTrk->
phi();
654 double the = emcTrk->
theta();
655 HepLorentzVector ptrk;
656 ptrk.setPx( eraw *
sin( the ) *
cos( phi ) );
657 ptrk.setPy( eraw *
sin( the ) *
sin( phi ) );
658 ptrk.setPz( eraw *
cos( the ) );
663 pGam.push_back( ptrk );
670 for (
int i = 0; i < nGood; i++ )
676 ( *itTrk )->mdcKalTrack();
682 if ( mdcKalTrk->
charge() > 0 )
684 ipip.push_back( iGood[i] );
685 HepLorentzVector ptrk;
686 ptrk.setPx( mdcKalTrk->
px() );
687 ptrk.setPy( mdcKalTrk->
py() );
688 ptrk.setPz( mdcKalTrk->
pz() );
689 double p3 = ptrk.mag();
690 ptrk.setE( sqrt( p3 * p3 +
mpi *
mpi ) );
692 ppip.push_back( ptrk );
696 ipim.push_back( iGood[i] );
697 HepLorentzVector ptrk;
698 ptrk.setPx( mdcKalTrk->
px() );
699 ptrk.setPy( mdcKalTrk->
py() );
700 ptrk.setPz( mdcKalTrk->
pz() );
701 double p3 = ptrk.mag();
702 ptrk.setE( sqrt( p3 * p3 +
mpi *
mpi ) );
706 ppim.push_back( ptrk );
709 int npip = ipip.size();
710 int npim = ipim.size();
712 if ( ( npip < 2 ) || ( npim < 2 ) )
return StatusCode::SUCCESS;
725 double chisqtrk = 9999.;
734 double mcompall = 9999;
735 double mppreclst = 9999;
736 double meelst = 9999;
738 double mchic2kpilst = 9999;
739 double chis4c2kpilst = 9999;
741 double dtpr2kpilst[4] = { 9999, 9999, 9999, 9999 };
744 double mchic01 = 0.0;
746 HepLorentzVector pgam( 0, 0, 0, 0 );
751 HepSymMatrix xem( 3, 0 );
755 HepLorentzVector p4psipjs( 0.011 * m_ecms, 0.0, 0.0, m_ecms );
756 double psipBetajs = ( p4psipjs.vect() ).mag() / ( p4psipjs.e() );
757 HepLorentzVector p4psip( 0.011 * m_ecms, 0.0, 0.0, m_ecms );
758 double psipBeta = ( p4psip.vect() ).mag() / ( p4psip.e() );
760 for (
int ii = 0; ii < npip - 1; ii++ )
762 RecMdcKalTrack* pip1Trk = ( *( evtRecTrkCol->begin() + ipip[ii] ) )->mdcKalTrack();
763 for (
int ij = ii + 1; ij < npip; ij++ )
765 RecMdcKalTrack* pip2Trk = ( *( evtRecTrkCol->begin() + ipip[ij] ) )->mdcKalTrack();
766 for (
int ik = 0; ik < npim - 1; ik++ )
768 RecMdcKalTrack* pim1Trk = ( *( evtRecTrkCol->begin() + ipim[ik] ) )->mdcKalTrack();
769 for (
int il = ik + 1; il < npim; il++ )
771 RecMdcKalTrack* pim2Trk = ( *( evtRecTrkCol->begin() + ipim[il] ) )->mdcKalTrack();
772 double squar[3] = { 9999., 9999., 9999. };
773 double squarkpi[6] = { 9999., 9999., 9999., 9999., 9999., 9999. };
781 pTrkjs.push_back( pip1Trk->
p() * pip1Trk->
charge() );
782 pTrkjs.push_back( pip2Trk->
p() * pip2Trk->
charge() );
783 pTrkjs.push_back( pim1Trk->
p() * pim1Trk->
charge() );
784 pTrkjs.push_back( pim2Trk->
p() * pim2Trk->
charge() );
785 iGoodjs.push_back( ipip[ii] );
786 iGoodjs.push_back( ipip[ij] );
787 iGoodjs.push_back( ipim[ik] );
788 iGoodjs.push_back( ipim[il] );
790 Gam4pikp::BubbleSort( pTrkjs, iGoodjs );
795 Vint i4cpip1js, i4cpip2js, i4cpim1js, i4cpim2js;
800 i4cpip1js.push_back( iGoodjs[2] );
801 i4cpip2js.push_back( iGoodjs[3] );
802 i4cpim1js.push_back( iGoodjs[1] );
803 i4cpim2js.push_back( iGoodjs[0] );
804 jGoodjs.push_back( i4cpip1js[0] );
805 jGoodjs.push_back( i4cpim1js[0] );
806 jGoodjs.push_back( i4cpip2js[0] );
807 jGoodjs.push_back( i4cpim2js[0] );
809 for (
int i = 0; i < 4; i++ )
812 if ( !( *itTrk )->isMdcTrackValid() )
continue;
814 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
817 HepLorentzVector p4trk;
821 ptrk = mdcKalTrk->
p();
822 p4trk.setPx( mdcKalTrk->
px() );
823 p4trk.setPy( mdcKalTrk->
py() );
824 p4trk.setPz( mdcKalTrk->
pz() );
825 p4trk.setE( sqrt( ptrk * ptrk +
mpi *
mpi ) );
830 ptrk = mdcKalTrk->
p();
831 p4trk.setPx( mdcKalTrk->
px() );
832 p4trk.setPy( mdcKalTrk->
py() );
833 p4trk.setPz( mdcKalTrk->
pz() );
834 p4trk.setE( sqrt( ptrk * ptrk +
xmass[0] *
xmass[0] ) );
836 p4trk.boost( -1.0 * psipBetajs, 0.0, 0.0 );
837 p4chTrkjs.push_back( p4trk );
839 p4psipjs.boost( -1.0 * psipBetajs, 0.0, 0.0 );
841 HepLorentzVector p4pipijs = p4chTrkjs[0] + p4chTrkjs[1];
842 HepLorentzVector p4eejs = p4chTrkjs[2] + p4chTrkjs[3];
843 HepLorentzVector p4pipirecjs = p4psipjs - p4pipijs;
844 double mpprecjs = p4pipirecjs.m();
845 double mpipijs = p4pipijs.m();
846 double meejs = p4eejs.m();
847 double mcomp = sqrt( ( mpprecjs - 3.097 ) * ( mpprecjs - 3.097 ) +
848 ( meejs - 3.097 ) * ( meejs - 3.097 ) );
849 if ( mcomp < mcompall )
852 ipip1js = i4cpip1js[0];
853 ipim1js = i4cpim1js[0];
854 ipip2js = i4cpip2js[0];
855 ipim2js = i4cpim2js[0];
856 mppreclst = mpprecjs;
862 m_mpprecall = mppreclst;
882 if ( mcompall > 9997 )
return StatusCode::SUCCESS;
884 jsGood.push_back( ipip1js );
885 jsGood.push_back( ipim1js );
886 jsGood.push_back( ipip2js );
887 jsGood.push_back( ipim2js );
889 for (
int i = 0; i < evtRecEvent->totalCharged(); i++ )
891 if ( i >= evtRecTrkCol->size() )
break;
893 if ( !( *itTrk )->isMdcTrackValid() )
continue;
894 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
896 if ( ( i != ipip1js ) && ( i != ipim1js ) && ( i != ipip2js ) && ( i != ipim2js ) )
897 { jsGood.push_back( i ); }
900 int njsGood = jsGood.size();
904 for (
int i = 0; i < njsGood; i++ )
907 if ( !( *itTrk )->isMdcTrackValid() )
continue;
909 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
912 ptrk = mdcKalTrk->
p();
913 m_x0js[i] = mdcTrk->
x();
914 m_y0js[i] = mdcTrk->
y();
915 m_z0js[i] = mdcTrk->
z();
916 m_r0js[i] = mdcTrk->
r();
917 m_ppmdcjs[i] = mdcTrk->
p();
918 m_pxmdcjs[i] = mdcTrk->
px();
919 m_pymdcjs[i] = mdcTrk->
py();
920 m_pzmdcjs[i] = mdcTrk->
pz();
921 m_ppkaljs[i] = mdcKalTrk->
p();
922 Hep3Vector p3jsi( mdcTrk->
px(), mdcTrk->
py(), mdcTrk->
pz() );
927 Hep3Vector p3js5( mdcTrk5->
px(), mdcTrk5->
py(), mdcTrk5->
pz() );
928 m_angjs5[i] = p3jsi.angle( p3js5 );
929 m_nearjs5[i] = p3jsi.howNear( p3js5 );
935 Hep3Vector p3js6( mdcTrk6->
px(), mdcTrk6->
py(), mdcTrk6->
pz() );
936 m_angjs6[i] = p3jsi.angle( p3js6 );
937 m_nearjs6[i] = p3jsi.howNear( p3js6 );
940 m_ptmdcjs[i] = mdcTrk->
pxy();
941 m_ptkaljs[i] = mdcKalTrk->
pxy();
942 double x0 = mdcTrk->
x();
943 double y0 = mdcTrk->
y();
944 double z0 = mdcTrk->
z();
945 double phi0 = mdcTrk->
helix( 1 );
949 double Rxy = ( x0 - xv ) *
cos( phi0 ) + ( y0 - yv ) *
sin( phi0 );
953 HepVector a = mdcTrk->
helix();
954 HepSymMatrix Ea = mdcTrk->
err();
957 VFHelix helixp( pivot, a, Ea );
959 HepVector
vec = helixp.
a();
960 m_Rnxyjs[i] =
vec[0];
962 m_phinjs[i] =
vec[1];
964 if ( ( *itTrk )->isTofTrackValid() )
968 SmartRefVector<RecTofTrack> tofTrkCol = ( *itTrk )->tofTrack();
969 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
970 for ( ; iter_tof != tofTrkCol.end(); iter_tof++ )
973 status->
setStatus( ( *iter_tof )->status() );
979 m_layertofjs[i] = status->
layer();
983 m_betajs[i] = ( *iter_tof )->beta();
984 m_tofjs[i] = ( *iter_tof )->tof();
985 m_tofpathjs[i] = ( *iter_tof )->path();
986 m_zhitjs[i] = ( *iter_tof )->zrhit();
987 m_texejs[i] = ( *iter_tof )->texpElectron();
988 m_texmujs[i] = ( *iter_tof )->texpMuon();
989 m_texpijs[i] = ( *iter_tof )->texpPion();
990 m_texkjs[i] = ( *iter_tof )->texpKaon();
991 m_texprjs[i] = ( *iter_tof )->texpProton();
992 m_dtejs[i] = m_tofjs[i] - m_texejs[i];
993 m_dtmujs[i] = m_tofjs[i] - m_texmujs[i];
994 m_dtpijs[i] = m_tofjs[i] - m_texpijs[i];
995 m_dtkjs[i] = m_tofjs[i] - m_texkjs[i];
996 m_dtprjs[i] = m_tofjs[i] - m_texprjs[i];
998 m_sigmaetofjs[i] = ( *iter_tof )->sigma( 0 );
999 m_sigmamutofjs[i] = ( *iter_tof )->sigma( 1 );
1000 m_sigmapitofjs[i] = ( *iter_tof )->sigma( 2 );
1001 m_sigmaktofjs[i] = ( *iter_tof )->sigma( 3 );
1002 m_sigmaprtofjs[i] = ( *iter_tof )->sigma( 4 );
1003 m_t0tofjs[i] = ( *iter_tof )->t0();
1004 m_errt0tofjs[i] = ( *iter_tof )->errt0();
1006 m_tofIDjs[i] = ( *iter_tof )->tofID();
1007 m_clusterIDjs[i] = ( *iter_tof )->tofTrackID();
1013 if ( ( *itTrk )->isMdcDedxValid() )
1017 m_chiejs[i] = dedxTrk->
chiE();
1018 m_chimujs[i] = dedxTrk->
chiMu();
1019 m_chipijs[i] = dedxTrk->
chiPi();
1020 m_chikjs[i] = dedxTrk->
chiK();
1021 m_chipjs[i] = dedxTrk->
chiP();
1024 m_probphjs[i] = dedxTrk->
probPH();
1025 m_normphjs[i] = dedxTrk->
normPH();
1029 if ( ( *itTrk )->isEmcShowerValid() )
1033 m_emcjs[i] = emcTrk->
energy();
1034 m_evpjs[i] = emcTrk->
energy() / ptrk;
1035 m_timecgjs[i] = emcTrk->
time();
1040 if ( ( *itTrk )->isMucTrackValid() )
1043 double dpthp = mucTrk->
depth() / 25.0;
1046 m_depthmucjs[i] = mucTrk->
depth();
1050 m_cosmdcjs[i] =
cos( mdcTrk->
theta() );
1051 m_phimdcjs[i] = mdcTrk->
phi();
1063 m_dedxpidjs[i] = pid->
chiDedx( 2 );
1064 m_tof1pidjs[i] = pid->
chiTof1( 2 );
1065 m_tof2pidjs[i] = pid->
chiTof2( 2 );
1077 Vint iGood2kpi, ipip2kpi, ipim2kpi;
1081 Vp4 ppip2kpi, ppim2kpi;
1085 Vint ipipnofit, ipimnofit, ikpnofit, ikmnofit, ipropnofit, ipromnofit;
1092 Vp4 ppipnofit, ppimnofit, pkpnofit, pkmnofit, ppropnofit, ppromnofit;
1108 double chis2kpi = 9999.;
1109 double m4piall = 9999.;
1110 double m4kall = 9999.;
1111 double mgam4piall = 9999.;
1112 double mgam4kall = 9999.;
1113 for (
int i = 0; i < evtRecEvent->totalCharged(); i++ )
1115 if ( i >= evtRecTrkCol->size() )
break;
1117 if ( !( *itTrk )->isMdcTrackValid() )
continue;
1118 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
1120 double z02kpi = mdcTrk->
z();
1121 double r02kpi = mdcTrk->
r();
1122 HepVector a = mdcTrk->
helix();
1123 HepSymMatrix Ea = mdcTrk->
err();
1126 VFHelix helixp( pivot, a, Ea );
1128 HepVector
vec = helixp.
a();
1129 double Rnxy02kpi =
vec[0];
1130 double Rnz02kpi =
vec[3];
1133 iGood2kpi.push_back( ( *itTrk )->trackId() );
1135 int nGood2kpi = iGood2kpi.size();
1136 if ( nGood2kpi == 4 )
1138 for (
int i = 0; i < nGood2kpi; i++ )
1143 if ( mdcKalTrk->
charge() > 0 )
1145 ipip2kpi.push_back( iGood2kpi[i] );
1146 p3pip2kpi.push_back( mdcKalTrk->
p() );
1147 HepLorentzVector ptrk;
1148 ptrk.setPx( mdcKalTrk->
px() );
1149 ptrk.setPy( mdcKalTrk->
py() );
1150 ptrk.setPz( mdcKalTrk->
pz() );
1151 double p3 = ptrk.mag();
1152 ptrk.setE( sqrt( p3 * p3 +
mpi *
mpi ) );
1153 ppip2kpi.push_back( ptrk );
1157 ipim2kpi.push_back( iGood2kpi[i] );
1158 p3pim2kpi.push_back( mdcKalTrk->
p() );
1159 HepLorentzVector ptrk;
1160 ptrk.setPx( mdcKalTrk->
px() );
1161 ptrk.setPy( mdcKalTrk->
py() );
1162 ptrk.setPz( mdcKalTrk->
pz() );
1163 double p3 = ptrk.mag();
1164 ptrk.setE( sqrt( p3 * p3 +
mpi *
mpi ) );
1165 ppim2kpi.push_back( ptrk );
1168 int npip2kpi = ipip2kpi.size();
1169 int npim2kpi = ipim2kpi.size();
1173 if ( m_rootput ) { m_cy2kpi = 6; }
1175 if ( ( npip2kpi == 2 ) && ( npim2kpi == 2 ) )
1182 xorigin2kpi[0] = 9999.;
1183 xorigin2kpi[1] = 9999.;
1184 xorigin2kpi[2] = 9999.;
1185 HepSymMatrix xem2kpi( 3, 0 );
1187 Gam4pikp::BubbleSort( p3pip2kpi, ipip2kpi );
1188 Gam4pikp::BubbleSort( p3pim2kpi, ipim2kpi );
1192 ( *( evtRecTrkCol->begin() + ipip2kpi[0] ) )->mdcKalTrack();
1194 ( *( evtRecTrkCol->begin() + ipip2kpi[1] ) )->mdcKalTrack();
1196 ( *( evtRecTrkCol->begin() + ipim2kpi[0] ) )->mdcKalTrack();
1198 ( *( evtRecTrkCol->begin() + ipim2kpi[1] ) )->mdcKalTrack();
1199 double squar2kpi[10] = { 9999., 9999., 9999., 9999., 9999.,
1200 9999., 9999., 9999., 9999., 9999. };
1201 double mc12kpi = 0.0, mc22kpi = 0.0, mc32kpi = 0.0, mc42kpi = 0.0;
1212 double m2kpi = 9999;
1216 WTrackParameter wvpip12kpiTrk, wvpim12kpiTrk, wvpip22kpiTrk, wvpim22kpiTrk;
1217 for (
int k = 0; k < 6; k++ )
1271 HepSymMatrix Evx( 3, 0 );
1275 Evx[0][0] = bx * bx;
1276 Evx[1][1] = by * by;
1277 Evx[2][2] = bz * bz;
1283 vtxfit->
AddTrack( 0, wvpip12kpiTrk );
1284 vtxfit->
AddTrack( 1, wvpim12kpiTrk );
1285 vtxfit->
AddTrack( 2, wvpip22kpiTrk );
1286 vtxfit->
AddTrack( 3, wvpim22kpiTrk );
1287 vtxfit->
AddVertex( 0, vxpar, 0, 1, 2, 3 );
1288 if ( !vtxfit->
Fit( 0 ) )
continue;
1298 xorigin2kpi = vtxfit->
vx( 0 );
1299 xem2kpi = vtxfit->
Evx( 0 );
1302 HepLorentzVector
ecms( 0.040547, 0, 0, 3.68632 );
1304 double chisq = 9999.;
1306 for (
int i = 0; i < nGam; i++ )
1308 RecEmcShower* g1Trk = ( *( evtRecTrkCol->begin() + iGam[i] ) )->emcShower();
1319 bool oksq = kmfit->
Fit();
1322 double chi2 = kmfit->
chisq();
1326 squar2kpi[k] = chi2;
1331 if ( squar2kpi[k] < 200 && squar2kpi[k] < chis2kpi )
1334 chis2kpi = squar2kpi[k];
1335 if ( squar2kpi[k] < 20 ) n20 = n20 + 1;
1336 if ( squar2kpi[k] < 30 ) n30 = n30 + 1;
1338 icgp12kpi = ipip2kpi[0];
1339 icgp22kpi = ipip2kpi[1];
1340 icgm12kpi = ipim2kpi[0];
1341 icgm22kpi = ipim2kpi[1];
1343 wcgp12kpi = wpip12kpiys;
1344 wcgp22kpi = wpip22kpiys;
1345 wcgm12kpi = wpim12kpiys;
1346 wcgm22kpi = wpim22kpiys;
1351 itrak2kpi.push_back( ipip2kpi[0] );
1352 itrak2kpi.push_back( ipim2kpi[0] );
1353 itrak2kpi.push_back( ipip2kpi[1] );
1354 itrak2kpi.push_back( ipim2kpi[1] );
1359 itrak2kpi.push_back( ipip2kpi[0] );
1360 itrak2kpi.push_back( ipim2kpi[0] );
1361 itrak2kpi.push_back( ipip2kpi[1] );
1362 itrak2kpi.push_back( ipim2kpi[1] );
1367 itrak2kpi.push_back( ipip2kpi[0] );
1368 itrak2kpi.push_back( ipim2kpi[0] );
1369 itrak2kpi.push_back( ipip2kpi[1] );
1370 itrak2kpi.push_back( ipim2kpi[1] );
1375 itrak2kpi.push_back( ipip2kpi[1] );
1376 itrak2kpi.push_back( ipim2kpi[1] );
1377 itrak2kpi.push_back( ipip2kpi[0] );
1378 itrak2kpi.push_back( ipim2kpi[0] );
1383 itrak2kpi.push_back( ipip2kpi[0] );
1384 itrak2kpi.push_back( ipim2kpi[1] );
1385 itrak2kpi.push_back( ipip2kpi[1] );
1386 itrak2kpi.push_back( ipim2kpi[0] );
1391 itrak2kpi.push_back( ipip2kpi[1] );
1392 itrak2kpi.push_back( ipim2kpi[0] );
1393 itrak2kpi.push_back( ipip2kpi[0] );
1394 itrak2kpi.push_back( ipim2kpi[1] );
1397 RecEmcShower* g1Trk = ( *( evtRecTrkCol->begin() + igam2kpi ) )->emcShower();
1407 bool oksq = kmfit->
Fit();
1410 HepLorentzVector pchic2kpi =
1412 HepLorentzVector ppsip2kpi = kmfit->
pfit( 0 ) + kmfit->
pfit( 1 ) +
1413 kmfit->
pfit( 2 ) + kmfit->
pfit( 3 ) +
1415 mchic2kpilst = pchic2kpi.m();
1416 chis4c2kpilst = kmfit->
chisq();
1419 m_mchic2kpi = pchic2kpi.m();
1420 m_chis2kpi = kmfit->
chisq();
1421 m_mpsip2kpi = ppsip2kpi.m();
1427 if ( chis2kpi < 200 )
1434 m_cla2kpi = cls2kpi;
1436 type2kpilst = cls2kpi;
1441 for (
int i = 0; i < 4; i++ )
1444 if ( !( *itTrk )->isMdcTrackValid() )
continue;
1446 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
1449 HepLorentzVector p4trk2kpi;
1453 ptrk2kpi = mdcKalTrk->
p();
1454 p4trk2kpi.setPx( mdcKalTrk->
px() );
1455 p4trk2kpi.setPy( mdcKalTrk->
py() );
1456 p4trk2kpi.setPz( mdcKalTrk->
pz() );
1457 p4trk2kpi.setE( sqrt( ptrk2kpi * ptrk2kpi +
mk *
mk ) );
1458 p2kpi.push_back( p4trk2kpi );
1466 ptrk2kpi = mdcKalTrk->
p();
1467 p4trk2kpi.setPx( mdcKalTrk->
px() );
1468 p4trk2kpi.setPy( mdcKalTrk->
py() );
1469 p4trk2kpi.setPz( mdcKalTrk->
pz() );
1470 p4trk2kpi.setE( sqrt( ptrk2kpi * ptrk2kpi +
mpi *
mpi ) );
1471 p2kpi.push_back( p4trk2kpi );
1476 ptrk2kpi = mdcKalTrk->
p();
1477 p4trk2kpi.setPx( mdcKalTrk->
px() );
1478 p4trk2kpi.setPy( mdcKalTrk->
py() );
1479 p4trk2kpi.setPz( mdcKalTrk->
pz() );
1480 p4trk2kpi.setE( sqrt( ptrk2kpi * ptrk2kpi +
mpro *
mpro ) );
1481 p2kpi.push_back( p4trk2kpi );
1484 if ( cls2kpi != 1 && cls2kpi != 2 )
1487 ptrk2kpi = mdcKalTrk->
p();
1488 p4trk2kpi.setPx( mdcKalTrk->
px() );
1489 p4trk2kpi.setPy( mdcKalTrk->
py() );
1490 p4trk2kpi.setPz( mdcKalTrk->
pz() );
1491 p4trk2kpi.setE( sqrt( ptrk2kpi * ptrk2kpi +
mpi *
mpi ) );
1492 p2kpi.push_back( p4trk2kpi );
1496 for (
int i = 0; i < 4; i++ )
1499 if ( !( *itTrk )->isMdcTrackValid() )
continue;
1501 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
1503 if ( ( *itTrk )->isTofTrackValid() )
1505 SmartRefVector<RecTofTrack> tofTrkCol = ( *itTrk )->tofTrack();
1506 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
1507 for ( ; iter_tof != tofTrkCol.end(); iter_tof++ )
1510 status->
setStatus( ( *iter_tof )->status() );
1512 { dtpr2kpilst[i] = ( ( *iter_tof )->tof() - ( *iter_tof )->texpProton() ); }
1553 for (
int i = 0; i < 4; i++ )
1556 if ( !( *itTrk )->isMdcTrackValid() )
continue;
1558 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
1560 m_ppmdc2kpi[i] = mdcTrk->
p();
1561 m_pxmdc2kpi[i] = mdcTrk->
px();
1562 m_pymdc2kpi[i] = mdcTrk->
py();
1563 m_pzmdc2kpi[i] = mdcTrk->
pz();
1564 m_ppkal2kpi[i] = mdcKalTrk->
p();
1565 m_charge2kpi[i] = mdcKalTrk->
charge();
1567 ptrk = mdcKalTrk->
p();
1569 if ( eventHeader->runNumber() < 0 )
1571 double mcall = 9999;
1572 SmartDataPtr<Event::McParticleCol> mcParticleCol( eventSvc(),
1573 "/Event/MC/McParticleCol" );
1574 int m_numParticle = 0;
1575 if ( !mcParticleCol )
1579 return StatusCode::FAILURE;
1583 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
1584 for ( ; iter_mc != mcParticleCol->end(); iter_mc++ )
1587 int pdgcode = ( *iter_mc )->particleProperty();
1589 px = ( *iter_mc )->initialFourMomentum().x();
1590 py = ( *iter_mc )->initialFourMomentum().y();
1591 pz = ( *iter_mc )->initialFourMomentum().z();
1593 commc = ptrk * ptrk - px * px - py * py - pz * pz;
1594 if ( fabs( commc ) < fabs( mcall ) )
1604 if ( ( *itTrk )->isTofTrackValid() )
1606 m_bjtofval2kpi[i] = 1;
1607 m_cotof12kpi[i] = 1;
1608 SmartRefVector<RecTofTrack> tofTrkCol = ( *itTrk )->tofTrack();
1609 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
1610 for ( ; iter_tof != tofTrkCol.end(); iter_tof++ )
1613 status->
setStatus( ( *iter_tof )->status() );
1621 m_layertof2kpi[i] = status->
layer();
1624 m_cotof22kpi[i] = 2;
1625 m_beta2kpi[i] = ( *iter_tof )->beta();
1626 m_tof2kpi[i] = ( *iter_tof )->tof();
1627 m_tofpath2kpi[i] = ( *iter_tof )->path();
1628 m_zhit2kpi[i] = ( *iter_tof )->zrhit();
1629 m_texe2kpi[i] = ( *iter_tof )->texpElectron();
1630 m_texmu2kpi[i] = ( *iter_tof )->texpMuon();
1631 m_texpi2kpi[i] = ( *iter_tof )->texpPion();
1632 m_texk2kpi[i] = ( *iter_tof )->texpKaon();
1633 m_texpr2kpi[i] = ( *iter_tof )->texpProton();
1634 m_dte2kpi[i] = m_tof2kpi[i] - m_texe2kpi[i];
1635 m_dtmu2kpi[i] = m_tof2kpi[i] - m_texmu2kpi[i];
1636 m_dtpi2kpi[i] = m_tof2kpi[i] - m_texpi2kpi[i];
1637 m_dtk2kpi[i] = m_tof2kpi[i] - m_texk2kpi[i];
1638 m_dtpr2kpi[i] = m_tof2kpi[i] - m_texpr2kpi[i];
1639 m_tofID2kpi[i] = ( *iter_tof )->tofID();
1640 m_clusterID2kpi[i] = ( *iter_tof )->tofTrackID();
1641 m_sigmaetof2kpi[i] = ( *iter_tof )->sigma( 0 );
1642 m_sigmamutof2kpi[i] = ( *iter_tof )->sigma( 1 );
1643 m_sigmapitof2kpi[i] = ( *iter_tof )->sigma( 2 );
1644 m_sigmaktof2kpi[i] = ( *iter_tof )->sigma( 3 );
1645 m_sigmaprtof2kpi[i] = ( *iter_tof )->sigma( 4 );
1646 m_t0tof2kpi[i] = ( *iter_tof )->t0();
1647 m_errt0tof2kpi[i] = ( *iter_tof )->errt0();
1653 if ( ( *itTrk )->isMdcDedxValid() )
1656 m_chie2kpi[i] = dedxTrk->
chiE();
1657 m_chimu2kpi[i] = dedxTrk->
chiMu();
1658 m_chipi2kpi[i] = dedxTrk->
chiPi();
1659 m_chik2kpi[i] = dedxTrk->
chiK();
1660 m_chip2kpi[i] = dedxTrk->
chiP();
1663 m_probph2kpi[i] = dedxTrk->
probPH();
1664 m_normph2kpi[i] = dedxTrk->
normPH();
1668 if ( ( *itTrk )->isEmcShowerValid() )
1672 m_emc2kpi[i] = emcTrk->
energy();
1673 m_evp2kpi[i] = emcTrk->
energy() / ptrk;
1674 m_timecg2kpi[i] = emcTrk->
time();
1678 if ( ( *itTrk )->isMucTrackValid() )
1681 double dpthp = mucTrk->
depth() / 25.0;
1683 m_depthmuc2kpi[i] = mucTrk->
depth();
1684 m_layermuc2kpi[i] = mucTrk->
numLayers();
1687 m_cosmdc2kpi[i] =
cos( mdcTrk->
theta() );
1688 m_phimdc2kpi[i] = mdcTrk->
phi();
1690 m_pidnum2kpi[i] = ( *itTrk )->partId();
1694 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1695 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1696 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1699 if ( i < 4 ) ( *itTrk )->setPartId( 3 );
1702 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1703 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1704 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1707 if ( i < 4 ) ( *itTrk )->setPartId( 4 );
1710 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1711 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1712 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1715 if ( i == 0 || i == 1 ) ( *itTrk )->setPartId( 3 );
1716 if ( i == 2 || i == 3 ) ( *itTrk )->setPartId( 5 );
1730 m_costpid2kpi[i] =
cos( mdcTrk->
theta() );
1738 m_chipidxpid2kpi[i] = pid->
chiDedx( 2 );
1739 m_chipitof1pid2kpi[i] = pid->
chiTof1( 2 );
1740 m_chipitof2pid2kpi[i] = pid->
chiTof2( 2 );
1741 m_chipitofpid2kpi[i] = pid->
chiTof( 2 );
1742 m_chipitofepid2kpi[i] = pid->
chiTofE( 2 );
1743 m_chipitofqpid2kpi[i] = pid->
chiTofQ( 2 );
1744 m_probpidxpid2kpi[i] = pid->
probDedx( 2 );
1745 m_probpitofpid2kpi[i] = pid->
probTof( 2 );
1747 m_chikdxpid2kpi[i] = pid->
chiDedx( 3 );
1748 m_chiktof1pid2kpi[i] = pid->
chiTof1( 3 );
1749 m_chiktof2pid2kpi[i] = pid->
chiTof2( 3 );
1750 m_chiktofpid2kpi[i] = pid->
chiTof( 3 );
1751 m_chiktofepid2kpi[i] = pid->
chiTofE( 3 );
1752 m_chiktofqpid2kpi[i] = pid->
chiTofQ( 3 );
1753 m_probkdxpid2kpi[i] = pid->
probDedx( 3 );
1754 m_probktofpid2kpi[i] = pid->
probTof( 3 );
1756 m_chiprdxpid2kpi[i] = pid->
chiDedx( 4 );
1757 m_chiprtof1pid2kpi[i] = pid->
chiTof1( 4 );
1758 m_chiprtof2pid2kpi[i] = pid->
chiTof2( 4 );
1759 m_chiprtofpid2kpi[i] = pid->
chiTof( 4 );
1760 m_chiprtofepid2kpi[i] = pid->
chiTofE( 4 );
1761 m_chiprtofqpid2kpi[i] = pid->
chiTofQ( 4 );
1762 m_probprdxpid2kpi[i] = pid->
probDedx( 4 );
1763 m_probprtofpid2kpi[i] = pid->
probTof( 4 );
1765 if ( ( *itTrk )->isTofTrackValid() )
1767 SmartRefVector<RecTofTrack> dstTofTrackCol = ( *itTrk )->tofTrack();
1768 SmartRefVector<RecTofTrack>::iterator iter_tof = dstTofTrackCol.begin();
1769 for ( ; iter_tof != dstTofTrackCol.end(); iter_tof++ )
1774 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1775 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1776 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1777 m_energy[0] > 0.1 && m_cla2kpi == 0 &&
1778 m_probpi2kpi[i] > m_probk2kpi[i] &&
1779 m_probpi2kpi[i] > m_probpr2kpi[i] ) )
1782 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1783 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1784 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1785 m_energy[0] > 0.1 && m_cla2kpi == 1 &&
1786 m_probk2kpi[i] > m_probpi2kpi[i] && m_probk2kpi[i] > m_probpr2kpi[i] ) )
1789 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1790 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1791 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1792 m_energy[0] > 0.1 && m_cla2kpi == 2 &&
1793 m_probpr2kpi[i] > m_probpi2kpi[i] && m_probpr2kpi[i] > m_probk2kpi[i] &&
1794 ( i == 2 || i == 3 ) ) )
1797 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1798 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1799 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1800 m_energy[0] > 0.1 && m_cla2kpi == 0 ) )
1805 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1806 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1807 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1808 m_energy[0] > 0.1 && m_cla2kpi == 1 ) )
1813 if ( ( ( ( m_mchic2kpi > 3.39 && m_mchic2kpi < 3.44 ) ||
1814 ( m_mchic2kpi > 3.5 && m_mchic2kpi < 3.57 ) ) &&
1815 m_chis2kpi < 20 && m_mpprecall < 3.06 && m_energy[0] < 0.3 &&
1816 m_energy[0] > 0.1 && m_cla2kpi == 2 && ( i == 2 || i == 3 ) ) )
1821 m_trk_trackid = ( *iter_tof )->trackID();
1822 m_trk_tofid = ( *iter_tof )->tofID();
1824 hitStatus->
setStatus( ( *iter_tof )->status() );
1826 m_trk_raw = hitStatus->
is_raw();
1831 m_trk_east = hitStatus->
is_east();
1832 m_trk_layer = hitStatus->
layer();
1834 m_trk_path = ( *iter_tof )->path();
1835 m_trk_zrhit = ( *iter_tof )->zrhit();
1836 m_trk_ph = ( *iter_tof )->ph();
1837 m_trk_tof = ( *iter_tof )->tof();
1838 m_trk_beta = ( *iter_tof )->beta();
1839 m_trk_texpe = ( *iter_tof )->texpElectron();
1840 m_trk_texpmu = ( *iter_tof )->texpMuon();
1841 m_trk_texppi = ( *iter_tof )->texpPion();
1842 m_trk_texpk = ( *iter_tof )->texpKaon();
1843 m_trk_texpp = ( *iter_tof )->texpProton();
1845 m_trk_offe = ( *iter_tof )->toffsetElectron();
1846 m_trk_offmu = ( *iter_tof )->toffsetMuon();
1847 m_trk_offpi = ( *iter_tof )->toffsetPion();
1848 m_trk_offk = ( *iter_tof )->toffsetKaon();
1849 m_trk_offp = ( *iter_tof )->toffsetProton();
1850 m_trk_quality = ( *iter_tof )->quality();
1851 m_trk_ppmdc = mdcTrk->
p();
1852 m_trk_ppkal = mdcKalTrk->
p();
1853 m_trk_cosmdc =
cos( mdcTrk->
theta() );
1854 m_trk_phimdc = mdcTrk->
phi();
1855 m_trk_coskal =
cos( mdcKalTrk->
theta() );
1856 m_trk_phikal = mdcKalTrk->
phi();
1858 if ( i == 0 || i == 2 ) m_trk_charge = 1;
1859 if ( i == 2 || i == 3 ) m_trk_charge = 2;
1860 trk_tuple->write().ignore();
1868 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1869 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1870 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1872 { jGam2kpi.push_back( igam2kpi ); }
1874 for (
int i = evtRecEvent->totalCharged(); i < evtRecEvent->totalTracks(); i++ )
1876 if ( i >= evtRecTrkCol->size() )
break;
1878 if ( !( *itTrk )->isEmcShowerValid() )
continue;
1879 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1880 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1881 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1884 if ( i != igam2kpi ) jGam2kpi.push_back( ( *itTrk )->trackId() );
1886 else { jGam2kpi.push_back( ( *itTrk )->trackId() ); }
1889 int ngam2kpi = jGam2kpi.size();
1893 for (
int i = 0; i < ngam2kpi; i++ )
1895 if ( i >= evtRecTrkCol->size() )
break;
1897 if ( !( *itTrk )->isEmcShowerValid() )
continue;
1898 RecEmcShower* emcTrk = ( *( evtRecTrkCol->begin() + jGam2kpi[i] ) )->emcShower();
1899 Hep3Vector emcpos( emcTrk->
x(), emcTrk->
y(), emcTrk->
z() );
1906 for (
int j = 0; j < evtRecEvent->totalCharged(); j++ )
1908 if ( j >= evtRecTrkCol->size() )
break;
1910 if ( !( *jtTrk )->isExtTrackValid() )
continue;
1914 double angd = extpos.angle( emcpos );
1915 double thed = extpos.theta() - emcpos.theta();
1916 double phid = extpos.deltaPhi( emcpos );
1917 thed = fmod( thed + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
1918 phid = fmod( phid + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
1929 if ( dang >= 200 )
continue;
1930 double eraw = emcTrk->
energy();
1931 dthe = dthe * 180 / ( CLHEP::pi );
1932 dphi = dphi * 180 / ( CLHEP::pi );
1933 dang = dang * 180 / ( CLHEP::pi );
1937 m_numHits[i] = emcTrk->
numHits();
1940 m_timegm[i] = emcTrk->
time();
1941 m_cellId[i] = emcTrk->
cellId();
1942 m_module[i] = emcTrk->
module();
1947 m_getEAll[i] = emcTrk->
getEAll();
1948 m_x[i] = emcTrk->
x();
1949 m_y[i] = emcTrk->
y();
1950 m_z[i] = emcTrk->
z();
1951 m_cosemc[i] =
cos( emcTrk->
theta() );
1952 m_phiemc[i] = emcTrk->
phi();
1953 m_energy[i] = emcTrk->
energy();
1954 m_eSeed[i] = emcTrk->
eSeed();
1955 m_e3x3[i] = emcTrk->
e3x3();
1956 m_e5x5[i] = emcTrk->
e5x5();
1972 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1973 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1974 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1977 m_tool1->write().ignore();
1986 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
1987 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
1988 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
1989 type2kpilst == 1 && dtpr2kpilst[0] < -0.4 && dtpr2kpilst[1] < -0.4 &&
1990 dtpr2kpilst[2] < -0.4 && dtpr2kpilst[3] < -0.4 )
1992 m_tool2->write().ignore();
1999 if ( mppreclst < 3.06 && chis4c2kpilst < 20 &&
2000 ( ( mchic2kpilst > 3.39 && mchic2kpilst < 3.44 ) ||
2001 ( mchic2kpilst > 3.5 && mchic2kpilst < 3.57 ) ) &&
2004 m_tool3->write().ignore();
2014 if ( ( mppreclst < 3.06 && chis4c2kpilst < 40 ) ||
2015 ( ( meelst > 3.06 && meelst < 3.12 ) && ( fabs( mppreclst - 3.097 ) < 0.01 ) ) )
2018 m_tuple1->write().ignore();
2022 return StatusCode::SUCCESS;