112 MsgStream log(
msgSvc(), name() );
114 log << MSG::INFO <<
"in initialize()" << endmsg;
118 status = service(
"THistSvc", m_thistsvc );
119 if ( status.isFailure() )
121 log << MSG::INFO <<
"Unable to retrieve pointer to THistSvc" << endmsg;
128 m_ee_mass =
new TH1F(
"ee_mass",
"ee_mass", 80, 2.8, 3.2 );
129 status = m_thistsvc->regHist(
"/VAL/PHY/ee_mass", m_ee_mass );
130 m_ee_acoll =
new TH1F(
"ee_acoll",
"ee_acoll", 60, 0, 6 );
131 status = m_thistsvc->regHist(
"/VAL/PHY/ee_acoll", m_ee_acoll );
132 m_ee_eop_ep =
new TH1F(
"ee_eop_ep",
"ee_eop_ep", 100, 0.4, 1.4 );
133 status = m_thistsvc->regHist(
"/VAL/PHY/ee_eop_ep", m_ee_eop_ep );
134 m_ee_eop_em =
new TH1F(
"ee_eop_em",
"ee_eop_em", 100, 0.4, 1.4 );
135 status = m_thistsvc->regHist(
"/VAL/PHY/ee_eop_em", m_ee_eop_em );
136 m_ee_costheta_ep =
new TH1F(
"ee_costheta_ep",
"ee_costheta_ep", 100, -1, 1 );
137 status = m_thistsvc->regHist(
"/VAL/PHY/ee_costheta_ep", m_ee_costheta_ep );
138 m_ee_costheta_em =
new TH1F(
"ee_costheta_em",
"ee_costheta_em", 100, -1, 1 );
139 status = m_thistsvc->regHist(
"/VAL/PHY/ee_costheta_em", m_ee_costheta_em );
141 m_ee_phi_ep =
new TH1F(
"ee_phi_ep",
"ee_phi_ep", 120, -3.2, 3.2 );
142 status = m_thistsvc->regHist(
"/VAL/PHY/ee_phi_ep", m_ee_phi_ep );
143 m_ee_phi_em =
new TH1F(
"ee_phi_em",
"ee_phi_em", 120, -3.2, 3.2 );
144 status = m_thistsvc->regHist(
"/VAL/PHY/ee_phi_em", m_ee_phi_em );
146 m_ee_nneu =
new TH1F(
"ee_nneu",
"ee_nneu", 5, 0, 5 );
147 status = m_thistsvc->regHist(
"/VAL/PHY/ee_nneu", m_ee_nneu );
149 m_ee_eemc_ep =
new TH1F(
"ee_eemc_ep",
"ee_eemc_ep", 100, 1.0, 2.0 );
150 status = m_thistsvc->regHist(
"/VAL/PHY/ee_eemc_ep", m_ee_eemc_ep );
151 m_ee_eemc_em =
new TH1F(
"ee_eemc_em",
"ee_eemc_em", 100, 1.0, 2.0 );
152 status = m_thistsvc->regHist(
"/VAL/PHY/ee_eemc_em", m_ee_eemc_em );
153 m_ee_x_ep =
new TH1F(
"ee_x_ep",
"ee_x_ep", 100, -1.0, 1.0 );
154 status = m_thistsvc->regHist(
"/VAL/PHY/ee_x_ep", m_ee_x_ep );
155 m_ee_y_ep =
new TH1F(
"ee_y_ep",
"ee_y_ep", 100, -1.0, 1.0 );
156 status = m_thistsvc->regHist(
"/VAL/PHY/ee_y_ep", m_ee_y_ep );
157 m_ee_z_ep =
new TH1F(
"ee_z_ep",
"ee_z_ep", 100, -10.0, 10.0 );
158 status = m_thistsvc->regHist(
"/VAL/PHY/ee_z_ep", m_ee_z_ep );
159 m_ee_x_em =
new TH1F(
"ee_x_em",
"ee_x_em", 100, -1.0, 1.0 );
160 status = m_thistsvc->regHist(
"/VAL/PHY/ee_x_em", m_ee_x_em );
161 m_ee_y_em =
new TH1F(
"ee_y_em",
"ee_y_em", 100, -1.0, 1.0 );
162 status = m_thistsvc->regHist(
"/VAL/PHY/ee_y_em", m_ee_y_em );
163 m_ee_z_em =
new TH1F(
"ee_z_em",
"ee_z_em", 100, -10.0, 10.0 );
164 status = m_thistsvc->regHist(
"/VAL/PHY/ee_z_em", m_ee_z_em );
166 m_ee_px_ep =
new TH1F(
"ee_px_ep",
"ee_px_ep", 200, -2.0, 2.0 );
167 status = m_thistsvc->regHist(
"/VAL/PHY/ee_px_ep", m_ee_px_ep );
168 m_ee_py_ep =
new TH1F(
"ee_py_ep",
"ee_py_ep", 200, -2.0, 2.0 );
169 status = m_thistsvc->regHist(
"/VAL/PHY/ee_py_ep", m_ee_py_ep );
170 m_ee_pz_ep =
new TH1F(
"ee_pz_ep",
"ee_pz_ep", 200, -2.0, 2.0 );
171 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pz_ep", m_ee_pz_ep );
172 m_ee_p_ep =
new TH1F(
"ee_p_ep",
"ee_p_ep", 100, 1.0, 2.0 );
173 status = m_thistsvc->regHist(
"/VAL/PHY/ee_p_ep", m_ee_p_ep );
174 m_ee_px_em =
new TH1F(
"ee_px_em",
"ee_px_em", 100, -2.0, 2.0 );
175 status = m_thistsvc->regHist(
"/VAL/PHY/ee_px_em", m_ee_px_em );
176 m_ee_py_em =
new TH1F(
"ee_py_em",
"ee_py_em", 100, -2.0, 2.0 );
177 status = m_thistsvc->regHist(
"/VAL/PHY/ee_py_em", m_ee_py_em );
178 m_ee_pz_em =
new TH1F(
"ee_pz_em",
"ee_pz_em", 100, -2.0, 2.0 );
179 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pz_em", m_ee_pz_em );
180 m_ee_p_em =
new TH1F(
"ee_p_em",
"ee_p_em", 100, 1.0, 2.0 );
181 status = m_thistsvc->regHist(
"/VAL/PHY/ee_p_em", m_ee_p_em );
182 m_ee_deltatof =
new TH1F(
"ee_deltatof",
"ee_deltatof", 50, 0.0, 10.0 );
183 status = m_thistsvc->regHist(
"/VAL/PHY/ee_deltatof", m_ee_deltatof );
185 m_ee_pidchidedx_ep =
new TH1F(
"ee_pidchidedx_ep",
"ee_pidchidedx_ep", 160, -4, 4 );
186 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchidedx_ep", m_ee_pidchidedx_ep );
187 m_ee_pidchidedx_em =
new TH1F(
"ee_pidchidedx_em",
"ee_pidchidedx_em", 160, -4, 4 );
188 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchidedx_em", m_ee_pidchidedx_em );
189 m_ee_pidchitof1_ep =
new TH1F(
"ee_pidchitof1_ep",
"ee_pidchitof1_ep", 160, -4, 4 );
190 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchitof1_ep", m_ee_pidchitof1_ep );
191 m_ee_pidchitof1_em =
new TH1F(
"ee_pidchitof1_em",
"ee_pidchitof1_em", 160, -4, 4 );
192 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchitof1_em", m_ee_pidchitof1_em );
193 m_ee_pidchitof2_ep =
new TH1F(
"ee_pidchitof2_ep",
"ee_pidchitof2_ep", 160, -4, 4 );
194 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchitof2_ep", m_ee_pidchitof2_ep );
195 m_ee_pidchitof2_em =
new TH1F(
"ee_pidchitof2_em",
"ee_pidchitof2_em", 160, -4, 4 );
196 status = m_thistsvc->regHist(
"/VAL/PHY/ee_pidchitof2_em", m_ee_pidchitof2_em );
202 m_mumu_mass =
new TH1F(
"mumu_mass",
"mumu_mass", 80, 2.8, 3.2 );
203 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_mass", m_mumu_mass );
204 m_mumu_acoll =
new TH1F(
"mumu_acoll",
"mumu_acoll", 60, 0, 6 );
205 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_acoll", m_mumu_acoll );
206 m_mumu_eop_mup =
new TH1F(
"mumu_eop_mup",
"mumu_eop_mup", 100, 0., 0.5 );
207 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_eop_mup", m_mumu_eop_mup );
208 m_mumu_eop_mum =
new TH1F(
"mumu_eop_mum",
"mumu_eop_mum", 100, 0., 0.5 );
209 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_eop_mum", m_mumu_eop_mum );
210 m_mumu_costheta_mup =
new TH1F(
"mumu_costheta_mup",
"mumu_costheta_mup", 100, -1, 1 );
211 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_costheta_mup", m_mumu_costheta_mup );
212 m_mumu_costheta_mum =
new TH1F(
"mumu_costheta_mum",
"mumu_costheta_mum", 100, -1, 1 );
213 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_costheta_mum", m_mumu_costheta_mum );
215 m_mumu_phi_mup =
new TH1F(
"mumu_phi_mup",
"mumu_phi_mup", 120, -3.2, 3.2 );
216 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_phi_mup", m_mumu_phi_mup );
217 m_mumu_phi_mum =
new TH1F(
"mumu_phi_mum",
"mumu_phi_mum", 120, -3.2, 3.2 );
218 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_phi_mum", m_mumu_phi_mum );
220 m_mumu_nneu =
new TH1F(
"mumu_nneu",
"mumu_nneu", 5, 0, 5 );
221 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_nneu", m_mumu_nneu );
222 m_mumu_nlay =
new TH1F(
"mumu_nlay",
"mumu_nlay", 9, 0, 10 );
223 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_nlay", m_mumu_nlay );
224 m_mumu_nhit =
new TH1F(
"mumu_nhit",
"mumu_nhit", 19, 0, 20 );
225 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_nhit", m_mumu_nhit );
227 m_mumu_eemc_mup =
new TH1F(
"mumu_eemc_mup",
"mumu_eemc_mup", 100, 0.0, 1.0 );
228 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_eemc_mup", m_mumu_eemc_mup );
229 m_mumu_eemc_mum =
new TH1F(
"mumu_eemc_mum",
"mumu_eemc_mum", 100, 0.0, 1.0 );
230 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_eemc_mum", m_mumu_eemc_mum );
231 m_mumu_x_mup =
new TH1F(
"mumu_x_mup",
"mumu_x_mup", 100, -1.0, 1.0 );
232 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_x_mup", m_mumu_x_mup );
233 m_mumu_y_mup =
new TH1F(
"mumu_y_mup",
"mumu_y_mup", 100, -1.0, 1.0 );
234 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_y_mup", m_mumu_y_mup );
235 m_mumu_z_mup =
new TH1F(
"mumu_z_mup",
"mumu_z_mup", 100, -10.0, 10.0 );
236 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_z_mup", m_mumu_z_mup );
237 m_mumu_x_mum =
new TH1F(
"mumu_x_mum",
"mumu_x_mum", 100, -1.0, 1.0 );
238 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_x_mum", m_mumu_x_mum );
239 m_mumu_y_mum =
new TH1F(
"mumu_y_mum",
"mumu_y_mum", 100, -1.0, 1.0 );
240 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_y_mum", m_mumu_y_mum );
241 m_mumu_z_mum =
new TH1F(
"mumu_z_mum",
"mumu_z_mum", 100, -10.0, 10.0 );
242 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_z_mum", m_mumu_z_mum );
244 m_mumu_px_mup =
new TH1F(
"mumu_px_mup",
"mumu_px_mup", 200, -2.0, 2.0 );
245 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_px_mup", m_mumu_px_mup );
246 m_mumu_py_mup =
new TH1F(
"mumu_py_mup",
"mumu_py_mup", 200, -2.0, 2.0 );
247 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_py_mup", m_mumu_py_mup );
248 m_mumu_pz_mup =
new TH1F(
"mumu_pz_mup",
"mumu_pz_mup", 200, -2.0, 2.0 );
249 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pz_mup", m_mumu_pz_mup );
250 m_mumu_p_mup =
new TH1F(
"mumu_p_mup",
"mumu_p_mup", 100, 1.0, 2.0 );
251 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_p_mup", m_mumu_p_mup );
252 m_mumu_px_mum =
new TH1F(
"mumu_px_mum",
"mumu_px_mum", 100, -2.0, 2.0 );
253 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_px_mum", m_mumu_px_mum );
254 m_mumu_py_mum =
new TH1F(
"mumu_py_mum",
"mumu_py_mum", 100, -2.0, 2.0 );
255 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_py_mum", m_mumu_py_mum );
256 m_mumu_pz_mum =
new TH1F(
"mumu_pz_mum",
"mumu_pz_mum", 100, -2.0, 2.0 );
257 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pz_mum", m_mumu_pz_mum );
258 m_mumu_p_mum =
new TH1F(
"mumu_p_mum",
"mumu_p_mum", 100, 1.0, 2.0 );
259 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_p_mum", m_mumu_p_mum );
260 m_mumu_deltatof =
new TH1F(
"mumu_deltatof",
"mumu_deltatof", 50, 0.0, 10.0 );
261 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_deltatof", m_mumu_deltatof );
263 m_mumu_pidchidedx_mup =
264 new TH1F(
"mumu_pidchidedx_mup",
"mumu_pidchidedx_mup", 160, -4, 4 );
265 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchidedx_mup", m_mumu_pidchidedx_mup );
266 m_mumu_pidchidedx_mum =
267 new TH1F(
"mumu_pidchidedx_mum",
"mumu_pidchidedx_mum", 160, -4, 4 );
268 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchidedx_mum", m_mumu_pidchidedx_mum );
269 m_mumu_pidchitof1_mup =
270 new TH1F(
"mumu_pidchitof1_mup",
"mumu_pidchitof1_mup", 160, -4, 4 );
271 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchitof1_mup", m_mumu_pidchitof1_mup );
272 m_mumu_pidchitof1_mum =
273 new TH1F(
"mumu_pidchitof1_mum",
"mumu_pidchitof1_mum", 160, -4, 4 );
274 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchitof1_mum", m_mumu_pidchitof1_mum );
275 m_mumu_pidchitof2_mup =
276 new TH1F(
"mumu_pidchitof2_mup",
"mumu_pidchitof2_mup", 160, -4, 4 );
277 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchitof2_mup", m_mumu_pidchitof2_mup );
278 m_mumu_pidchitof2_mum =
279 new TH1F(
"mumu_pidchitof2_mum",
"mumu_pidchitof2_mum", 160, -4, 4 );
280 status = m_thistsvc->regHist(
"/VAL/PHY/mumu_pidchitof2_mum", m_mumu_pidchitof2_mum );
283 if ( m_mcdump && ( m_tagBhabha || m_tagDimu ) )
285 NTuplePtr nt001(
ntupleSvc(),
"FILE1/mc" );
286 if ( nt001 ) m_tuple001 = nt001;
290 ntupleSvc()->book(
"FILE1/mc", CLID_ColumnWiseTuple,
"Bhabha N-Tuple example" );
293 status = m_tuple001->addItem(
"mc_ep_e", m_mc_ep_e );
294 status = m_tuple001->addItem(
"mc_ep_px", m_mc_ep_px );
295 status = m_tuple001->addItem(
"mc_ep_py", m_mc_ep_py );
296 status = m_tuple001->addItem(
"mc_ep_pz", m_mc_ep_pz );
297 status = m_tuple001->addItem(
"mc_ep_costheta", m_mc_ep_costheta );
298 status = m_tuple001->addItem(
"mc_em_e", m_mc_em_e );
299 status = m_tuple001->addItem(
"mc_em_px", m_mc_em_px );
300 status = m_tuple001->addItem(
"mc_em_py", m_mc_em_py );
301 status = m_tuple001->addItem(
"mc_em_pz", m_mc_em_pz );
302 status = m_tuple001->addItem(
"mc_em_costheta", m_mc_em_costheta );
307 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple001 ) << endmsg;
308 return StatusCode::FAILURE;
313 NTuplePtr nt1(
ntupleSvc(),
"FILE1/signal" );
314 if ( nt1 ) m_tuple1 = nt1;
317 m_tuple1 =
ntupleSvc()->book(
"FILE1/signal", CLID_ColumnWiseTuple,
"N-Tuple" );
320 status = m_tuple1->addItem(
"irun", m_run );
321 status = m_tuple1->addItem(
"ievent", m_event );
322 status = m_tuple1->addItem(
"Nchrg", m_nchrg );
323 status = m_tuple1->addItem(
"Nneu", m_nneu, 0, 40 );
324 status = m_tuple1->addItem(
"NGch", m_ngch, 0, 40 );
325 status = m_tuple1->addItem(
"NGam", m_nGam );
327 status = m_tuple1->addItem(
"bhabhatag", m_bhabhatag );
328 status = m_tuple1->addItem(
"dimutag", m_dimutag );
329 status = m_tuple1->addItem(
"hadrontag", m_hadrontag );
330 status = m_tuple1->addItem(
"sbhabhatag", m_sbhabhatag );
331 status = m_tuple1->addItem(
"sdimutag", m_sdimutag );
333 status = m_tuple1->addItem(
"acoll", m_acoll );
334 status = m_tuple1->addItem(
"acopl", m_acopl );
335 status = m_tuple1->addItem(
"deltatof", m_deltatof );
336 status = m_tuple1->addItem(
"eop1", m_eop1 );
337 status = m_tuple1->addItem(
"eop2", m_eop2 );
338 status = m_tuple1->addItem(
"eoeb1", m_eoeb1 );
339 status = m_tuple1->addItem(
"eoeb2", m_eoeb2 );
340 status = m_tuple1->addItem(
"poeb1", m_poeb1 );
341 status = m_tuple1->addItem(
"poeb2", m_poeb2 );
342 status = m_tuple1->addItem(
"etoeb1", m_etoeb1 );
343 status = m_tuple1->addItem(
"etoeb2", m_etoeb2 );
344 status = m_tuple1->addItem(
"mucinfo1", m_mucinfo1 );
345 status = m_tuple1->addItem(
"mucinfo2", m_mucinfo2 );
347 status = m_tuple1->addIndexedItem(
"delang", m_nneu, m_delang );
348 status = m_tuple1->addIndexedItem(
"delphi", m_nneu, m_delphi );
349 status = m_tuple1->addIndexedItem(
"delthe", m_nneu, m_delthe );
350 status = m_tuple1->addIndexedItem(
"nemchits", m_nneu, m_nemchits );
351 status = m_tuple1->addIndexedItem(
"x", m_nneu, m_x );
352 status = m_tuple1->addIndexedItem(
"y", m_nneu, m_y );
353 status = m_tuple1->addIndexedItem(
"z", m_nneu, m_z );
354 status = m_tuple1->addIndexedItem(
"theta", m_nneu, m_theta );
355 status = m_tuple1->addIndexedItem(
"phi", m_nneu, m_phi );
356 status = m_tuple1->addIndexedItem(
"dx", m_nneu, m_dx );
357 status = m_tuple1->addIndexedItem(
"dy", m_nneu, m_dy );
358 status = m_tuple1->addIndexedItem(
"dz", m_nneu, m_dz );
359 status = m_tuple1->addIndexedItem(
"dtheta", m_nneu, m_dtheta );
360 status = m_tuple1->addIndexedItem(
"dphi", m_nneu, m_dphi );
361 status = m_tuple1->addIndexedItem(
"energy", m_nneu, m_energy );
362 status = m_tuple1->addIndexedItem(
"dE", m_nneu, m_dE );
363 status = m_tuple1->addIndexedItem(
"eSeed", m_nneu, m_eSeed );
364 status = m_tuple1->addIndexedItem(
"e3x3", m_nneu, m_e3x3 );
365 status = m_tuple1->addIndexedItem(
"e5x5", m_nneu, m_e5x5 );
366 status = m_tuple1->addIndexedItem(
"secondMoment", m_nneu, m_secondMoment );
367 status = m_tuple1->addIndexedItem(
"latMoment", m_nneu, m_latMoment );
368 status = m_tuple1->addIndexedItem(
"a20Moment", m_nneu, m_a20Moment );
369 status = m_tuple1->addIndexedItem(
"a42Moment", m_nneu, m_a42Moment );
370 status = m_tuple1->addIndexedItem(
"getTime", m_nneu, m_getTime );
371 status = m_tuple1->addIndexedItem(
"getEAll", m_nneu, m_getEAll );
378 status = m_tuple1->addIndexedItem(
"charge", m_ngch, m_charge );
379 status = m_tuple1->addIndexedItem(
"vx", m_ngch, m_vx0 );
380 status = m_tuple1->addIndexedItem(
"vy", m_ngch, m_vy0 );
381 status = m_tuple1->addIndexedItem(
"vz", m_ngch, m_vz0 );
383 status = m_tuple1->addIndexedItem(
"px", m_ngch, m_px );
384 status = m_tuple1->addIndexedItem(
"py", m_ngch, m_py );
385 status = m_tuple1->addIndexedItem(
"pz", m_ngch, m_pz );
386 status = m_tuple1->addIndexedItem(
"p", m_ngch, m_p );
388 status = m_tuple1->addIndexedItem(
"kal_vx", m_ngch, m_kal_vx0 );
389 status = m_tuple1->addIndexedItem(
"kal_vy", m_ngch, m_kal_vy0 );
390 status = m_tuple1->addIndexedItem(
"kal_vz", m_ngch, m_kal_vz0 );
392 status = m_tuple1->addIndexedItem(
"kal_px", m_ngch, m_kal_px );
393 status = m_tuple1->addIndexedItem(
"kal_py", m_ngch, m_kal_py );
394 status = m_tuple1->addIndexedItem(
"kal_pz", m_ngch, m_kal_pz );
395 status = m_tuple1->addIndexedItem(
"kal_p", m_ngch, m_kal_p );
397 status = m_tuple1->addIndexedItem(
"probPH", m_ngch, m_probPH );
398 status = m_tuple1->addIndexedItem(
"normPH", m_ngch, m_normPH );
399 status = m_tuple1->addIndexedItem(
"chie", m_ngch, m_chie );
400 status = m_tuple1->addIndexedItem(
"chimu", m_ngch, m_chimu );
401 status = m_tuple1->addIndexedItem(
"chipi", m_ngch, m_chipi );
402 status = m_tuple1->addIndexedItem(
"chik", m_ngch, m_chik );
403 status = m_tuple1->addIndexedItem(
"chip", m_ngch, m_chip );
404 status = m_tuple1->addIndexedItem(
"ghit", m_ngch, m_ghit );
405 status = m_tuple1->addIndexedItem(
"thit", m_ngch, m_thit );
407 status = m_tuple1->addIndexedItem(
"e_emc", m_ngch, m_e_emc );
408 status = m_tuple1->addIndexedItem(
"phi_emc", m_ngch, m_phi_emc );
409 status = m_tuple1->addIndexedItem(
"theta_emc", m_ngch, m_theta_emc );
411 status = m_tuple1->addIndexedItem(
"nhit_muc", m_ngch, m_nhit_muc );
412 status = m_tuple1->addIndexedItem(
"nlay_muc", m_ngch, m_nlay_muc );
413 status = m_tuple1->addIndexedItem(
"t_btof", m_ngch, m_t_btof );
414 status = m_tuple1->addIndexedItem(
"t_etof", m_ngch, m_t_etof );
415 status = m_tuple1->addIndexedItem(
"qual_etof", m_ngch, m_qual_etof );
416 status = m_tuple1->addIndexedItem(
"tof_etof", m_ngch, m_tof_etof );
417 status = m_tuple1->addIndexedItem(
"te_etof", m_ngch, m_te_etof );
418 status = m_tuple1->addIndexedItem(
"tmu_etof", m_ngch, m_tmu_etof );
419 status = m_tuple1->addIndexedItem(
"tpi_etof", m_ngch, m_tpi_etof );
420 status = m_tuple1->addIndexedItem(
"tk_etof", m_ngch, m_tk_etof );
421 status = m_tuple1->addIndexedItem(
"tp_etof", m_ngch, m_tp_etof );
423 status = m_tuple1->addIndexedItem(
"qual_btof1", m_ngch, m_qual_btof1 );
424 status = m_tuple1->addIndexedItem(
"tof_btof1", m_ngch, m_tof_btof1 );
425 status = m_tuple1->addIndexedItem(
"te_btof1", m_ngch, m_te_btof1 );
426 status = m_tuple1->addIndexedItem(
"tmu_btof1", m_ngch, m_tmu_btof1 );
427 status = m_tuple1->addIndexedItem(
"tpi_btof1", m_ngch, m_tpi_btof1 );
428 status = m_tuple1->addIndexedItem(
"tk_btof1", m_ngch, m_tk_btof1 );
429 status = m_tuple1->addIndexedItem(
"tp_btof1", m_ngch, m_tp_btof1 );
431 status = m_tuple1->addIndexedItem(
"qual_btof2", m_ngch, m_qual_btof2 );
432 status = m_tuple1->addIndexedItem(
"tof_btof2", m_ngch, m_tof_btof2 );
433 status = m_tuple1->addIndexedItem(
"te_btof2", m_ngch, m_te_btof2 );
434 status = m_tuple1->addIndexedItem(
"tmu_btof2", m_ngch, m_tmu_btof2 );
435 status = m_tuple1->addIndexedItem(
"tpi_btof2", m_ngch, m_tpi_btof2 );
436 status = m_tuple1->addIndexedItem(
"tk_btof2", m_ngch, m_tk_btof2 );
437 status = m_tuple1->addIndexedItem(
"tp_btof2", m_ngch, m_tp_btof2 );
438 status = m_tuple1->addIndexedItem(
"pidcode", m_ngch, m_pidcode );
439 status = m_tuple1->addIndexedItem(
"pidprob", m_ngch, m_pidprob );
440 status = m_tuple1->addIndexedItem(
"pidchiDedx", m_ngch, m_pidchiDedx );
441 status = m_tuple1->addIndexedItem(
"pidchiTof1", m_ngch, m_pidchiTof1 );
442 status = m_tuple1->addIndexedItem(
"pidchiTof2", m_ngch, m_pidchiTof2 );
444 status = m_tuple1->addItem(
"px_cms_ep", m_px_cms_ep );
445 status = m_tuple1->addItem(
"py_cms_ep", m_py_cms_ep );
446 status = m_tuple1->addItem(
"pz_cms_ep", m_pz_cms_ep );
447 status = m_tuple1->addItem(
"e_cms_ep", m_e_cms_ep );
448 status = m_tuple1->addItem(
"cos_ep", m_cos_ep );
449 status = m_tuple1->addItem(
"px_cms_em", m_px_cms_em );
450 status = m_tuple1->addItem(
"py_cms_em", m_py_cms_em );
451 status = m_tuple1->addItem(
"pz_cms_em", m_pz_cms_em );
452 status = m_tuple1->addItem(
"e_cms_em", m_e_cms_em );
453 status = m_tuple1->addItem(
"cos_em", m_cos_em );
454 status = m_tuple1->addItem(
"mass_ee", m_mass_ee );
455 status = m_tuple1->addItem(
"emax", m_emax );
456 status = m_tuple1->addItem(
"esum", m_esum );
457 status = m_tuple1->addItem(
"npip", m_npip );
458 status = m_tuple1->addItem(
"npim", m_npim );
459 status = m_tuple1->addItem(
"nkp", m_nkp );
460 status = m_tuple1->addItem(
"nkm", m_nkm );
461 status = m_tuple1->addItem(
"np", m_np );
462 status = m_tuple1->addItem(
"npb", m_npb );
464 status = m_tuple1->addItem(
"nep", m_nep );
465 status = m_tuple1->addItem(
"nem", m_nem );
466 status = m_tuple1->addItem(
"nmup", m_nmup );
467 status = m_tuple1->addItem(
"nmum", m_nmum );
471 log << MSG::ERROR <<
" Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
472 return StatusCode::FAILURE;
480 log << MSG::INFO <<
"successfully return from initialize()" << endmsg;
481 return StatusCode::SUCCESS;
487 const double beamEnergy = m_ecms / 2.;
488 const HepLorentzVector
p_cms( m_ecms *
sin( m_beamangle * 0.5 ), 0.0, 0.0, m_ecms );
489 const Hep3Vector
u_cms = -
p_cms.boostVector();
490 MsgStream log(
msgSvc(), name() );
491 log << MSG::INFO <<
"in execute()" << endmsg;
493 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(),
"/Event/EventHeader" );
497 m_run = eventHeader->runNumber();
498 m_event = eventHeader->eventNumber();
499 m_nchrg = evtRecEvent->totalCharged();
500 m_nneu = evtRecEvent->totalNeutral();
502 log << MSG::INFO <<
"get event tag OK" << endmsg;
504 if ( m_mcdump && ( m_tagBhabha || m_tagDimu ) )
506 SmartDataPtr<Event::McParticleCol> mcParticleCol( eventSvc(),
"/Event/MC/McParticleCol" );
507 if ( !mcParticleCol )
509 log << MSG::ERROR <<
"Can not find mcParticleCol" << endmsg;
510 return StatusCode::FAILURE;
513 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
514 for ( ; iter_mc != mcParticleCol->end(); iter_mc++ )
516 if ( ( *iter_mc )->particleProperty() == -11 || ( *iter_mc )->particleProperty() == -13 )
519 m_mc_ep_px = ( *iter_mc )->initialFourMomentum().px() * 0.001;
520 m_mc_ep_py = ( *iter_mc )->initialFourMomentum().py() * 0.001;
521 m_mc_ep_pz = ( *iter_mc )->initialFourMomentum().pz() * 0.001;
522 m_mc_ep_e = ( *iter_mc )->initialFourMomentum().e() * 0.001;
523 m_mc_ep_costheta =
cos( ( *iter_mc )->initialFourMomentum().theta() );
526 if ( ( *iter_mc )->particleProperty() == 11 || ( *iter_mc )->particleProperty() == 13 )
529 m_mc_em_px = ( *iter_mc )->initialFourMomentum().px() * 0.001;
530 m_mc_em_py = ( *iter_mc )->initialFourMomentum().py() * 0.001;
531 m_mc_em_pz = ( *iter_mc )->initialFourMomentum().pz() * 0.001;
532 m_mc_em_e = ( *iter_mc )->initialFourMomentum().e() * 0.001;
533 m_mc_em_costheta =
cos( ( *iter_mc )->initialFourMomentum().theta() );
553 int nneu = evtRecEvent->totalNeutral();
555 for (
int i = 0; i < evtRecEvent->totalCharged(); i++ )
557 if ( i >= evtRecTrkCol->size() )
break;
559 if ( !( *itTrk )->isMdcTrackValid() )
continue;
560 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
562 double vz0 = mdcTrk->
z();
563 double vr0 = mdcTrk->
r();
564 if ( !( *itTrk )->isEmcShowerValid() )
continue;
566 if ( fabs( vz0 ) >= m_vz0cut )
continue;
567 if ( vr0 >= m_vr0cut )
continue;
568 double cost =
cos( mdcTrk->
theta() );
569 if ( fabs( cost ) >= m_coscut )
continue;
571 iGood.push_back( ( *itTrk )->trackId() );
572 nCharge += mdcTrk->
charge();
578 m_ngch = iGood.size();
579 if ( m_ngch == 0 ) n0prong++;
580 if ( m_ngch < 0 || m_ngch > 2 || (
abs( nCharge ) > 1 ) || m_nneu > 40 )
581 {
return StatusCode::SUCCESS; }
587 if ( m_ngch == 2 && nCharge == 0 ) n2prong++;
588 if ( m_ngch == 4 && nCharge == 0 ) n4prong++;
589 if ( m_ngch > 4 ) ng4prong++;
593 Vint ipip, ipim, ikp, ikm, ipp, ipm, iep, iem, imup, imum;
604 Vp4 p_pip, p_pim, p_kp, p_km, p_pp, p_pm;
613 for (
int i = 0; i < m_ngch; i++ )
634 if ( ( *itTrk )->isMdcKalTrackValid() ) mdcKalTrk = ( *itTrk )->mdcKalTrack();
642 HepLorentzVector ptrk;
643 ptrk.setPx( mdcTrk->
px() );
644 ptrk.setPy( mdcTrk->
py() );
645 ptrk.setPz( mdcTrk->
pz() );
646 double p3 = ptrk.mag();
648 if ( prob_pi > prob_K && prob_pi > prob_p )
651 m_pidprob[i] = pid->
prob( 2 );
652 m_pidchiDedx[i] = pid->
chiDedx( 2 );
653 m_pidchiTof1[i] = pid->
chiTof1( 2 );
654 m_pidchiTof2[i] = pid->
chiTof2( 2 );
656 ptrk.setE( sqrt( p3 * p3 +
xmass[2] *
xmass[2] ) );
657 if ( mdcTrk->
charge() > 0 )
659 ipip.push_back( iGood[i] );
660 p_pip.push_back( ptrk );
662 if ( mdcTrk->
charge() < 0 )
664 ipim.push_back( iGood[i] );
665 p_pim.push_back( ptrk );
669 if ( prob_K > prob_pi && prob_K > prob_p )
672 m_pidprob[i] = pid->
prob( 3 );
673 m_pidchiDedx[i] = pid->
chiDedx( 3 );
674 m_pidchiTof1[i] = pid->
chiTof1( 3 );
675 m_pidchiTof2[i] = pid->
chiTof2( 3 );
676 ptrk.setE( sqrt( p3 * p3 +
xmass[3] *
xmass[3] ) );
677 if ( mdcTrk->
charge() > 0 )
679 ikp.push_back( iGood[i] );
680 p_kp.push_back( ptrk );
682 if ( mdcTrk->
charge() < 0 )
684 ikm.push_back( iGood[i] );
685 p_km.push_back( ptrk );
689 if ( prob_p > prob_pi && prob_p > prob_K )
692 m_pidprob[i] = pid->
prob( 4 );
693 m_pidchiDedx[i] = pid->
chiDedx( 4 );
694 m_pidchiTof1[i] = pid->
chiTof1( 4 );
695 m_pidchiTof2[i] = pid->
chiTof2( 4 );
696 ptrk.setE( sqrt( p3 * p3 +
xmass[4] *
xmass[4] ) );
697 if ( mdcTrk->
charge() > 0 )
699 ipp.push_back( iGood[i] );
700 p_pp.push_back( ptrk );
702 if ( mdcTrk->
charge() < 0 )
704 ipm.push_back( iGood[i] );
705 p_pm.push_back( ptrk );
712 m_pidprob[i] = pid->
prob( 0 );
713 m_pidchiDedx[i] = pid->
chiDedx( 0 );
714 m_pidchiTof1[i] = pid->
chiTof1( 0 );
715 m_pidchiTof2[i] = pid->
chiTof2( 0 );
716 if ( mdcTrk->
charge() > 0 ) { iep.push_back( iGood[i] ); }
717 if ( mdcTrk->
charge() < 0 ) { iem.push_back( iGood[i] ); }
723 m_pidprob[i] = pid->
prob( 1 );
724 m_pidchiDedx[i] = pid->
chiDedx( 1 );
725 m_pidchiTof1[i] = pid->
chiTof1( 1 );
726 m_pidchiTof2[i] = pid->
chiTof2( 1 );
727 if ( mdcTrk->
charge() > 0 ) { imup.push_back( iGood[i] ); }
728 if ( mdcTrk->
charge() < 0 ) { imum.push_back( iGood[i] ); }
731 m_npip = ipip.size();
732 m_npim = ipim.size();
739 m_nmup = imup.size();
740 m_nmum = imum.size();
750 for (
int i = evtRecEvent->totalCharged(); i < evtRecEvent->totalTracks(); i++ )
752 if ( i >= evtRecTrkCol->size() )
break;
754 if ( !( *itTrk )->isEmcShowerValid() )
continue;
756 Hep3Vector emcpos( emcTrk->
x(), emcTrk->
y(), emcTrk->
z() );
759 double x = emcTrk->
x();
760 double y = emcTrk->
y();
761 double z = emcTrk->
z();
762 double dx = emcTrk->
dx();
763 double dy = emcTrk->
dy();
764 double dth = emcTrk->
dtheta();
765 double dph = emcTrk->
dphi();
766 double dz = emcTrk->
dz();
768 double dE = emcTrk->
dE();
769 double eSeed = emcTrk->
eSeed();
770 double e3x3 = emcTrk->
e3x3();
771 double e5x5 = emcTrk->
e5x5();
774 double getTime = emcTrk->
time();
775 double getEAll = emcTrk->
getEAll();
785 m_nemchits[i - m_nchrg] =
n;
786 m_theta[i - m_nchrg] = EmcPos.theta();
787 m_phi[i - m_nchrg] = EmcPos.phi();
788 m_x[i - m_nchrg] = x;
789 m_y[i - m_nchrg] = y;
790 m_z[i - m_nchrg] = z;
791 m_dx[i - m_nchrg] = dx;
792 m_dy[i - m_nchrg] = dy;
793 m_dz[i - m_nchrg] = dz;
794 m_dtheta[i - m_nchrg] = dth;
795 m_dphi[i - m_nchrg] = dph;
796 m_energy[i - m_nchrg] =
energy;
797 m_dE[i - m_nchrg] = dE;
798 m_eSeed[i - m_nchrg] = eSeed;
799 m_e3x3[i - m_nchrg] = e3x3;
800 m_e5x5[i - m_nchrg] = e5x5;
801 m_secondMoment[i - m_nchrg] = secondMoment;
802 m_latMoment[i - m_nchrg] = latMoment;
803 m_getTime[i - m_nchrg] = getTime;
804 m_getEAll[i - m_nchrg] = getEAll;
805 m_a20Moment[i - m_nchrg] = a20Moment;
806 m_a42Moment[i - m_nchrg] = a42Moment;
818 for (
int j = 0; j < m_ngch; j++ )
822 if ( !( *jtTrk )->isMdcTrackValid() )
continue;
824 double jtcharge = jtmdcTrk->
charge();
825 if ( !( *jtTrk )->isExtTrackValid() )
continue;
830 double angd = extpos.angle( emcpos );
831 double thed = extpos.theta() - emcpos.theta();
832 double phid = extpos.deltaPhi( emcpos );
833 thed = fmod( thed + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
834 phid = fmod( phid + CLHEP::twopi + CLHEP::twopi +
pi, CLHEP::twopi ) - CLHEP::pi;
836 if ( fabs( thed ) < fabs( dthe ) ) dthe = thed;
837 if ( fabs( phid ) < fabs( dphi ) ) dphi = phid;
838 if ( angd < dang ) dang = angd;
845 dthe = dthe * 180 / ( CLHEP::pi );
846 dphi = dphi * 180 / ( CLHEP::pi );
847 dang = dang * 180 / ( CLHEP::pi );
848 double eraw = emcTrk->
energy();
849 double phi = emcTrk->
phi();
850 double the = emcTrk->
theta();
852 m_delphi[i - m_nchrg] = dphi;
853 m_delthe[i - m_nchrg] = dthe;
854 m_delang[i - m_nchrg] = dang;
855 if ( eraw < m_energyThreshold )
continue;
857 if ( dang < m_gammaTrkCut )
continue;
858 iGam.push_back( ( *itTrk )->trackId() );
861 int nGam = iGam.size();
874 for (
int i = 0; i < m_nGam; i++ )
877 if ( !( *itTrk )->isEmcShowerValid() )
continue;
879 double eraw = emcTrk->
energy();
880 double phi = emcTrk->
phi();
881 double the = emcTrk->
theta();
882 HepLorentzVector ptrk;
883 ex_gam += eraw *
sin( the ) *
cos( phi );
884 ey_gam += eraw *
sin( the ) *
sin( phi );
885 ez_gam += eraw *
cos( the );
886 et_gam += eraw *
sin( the );
888 if ( eraw >= egam_ext ) { egam_ext = eraw; }
903 for (
int i = 0; i < m_ngch; i++ )
908 if ( !( *itTrk )->isMdcTrackValid() )
continue;
909 if ( !( *itTrk )->isMdcKalTrackValid() )
continue;
917 m_charge[ii] = mdcTrk->
charge();
918 m_vx0[ii] = mdcTrk->
x();
919 m_vy0[ii] = mdcTrk->
y();
920 m_vz0[ii] = mdcTrk->
z();
922 m_px[ii] = mdcTrk->
px();
923 m_py[ii] = mdcTrk->
py();
924 m_pz[ii] = mdcTrk->
pz();
925 m_p[ii] = mdcTrk->
p();
932 m_kal_vx0[ii] = mdcKalTrk->
x();
933 m_kal_vy0[ii] = mdcKalTrk->
y();
934 m_kal_vz0[ii] = mdcKalTrk->
z();
936 m_kal_px[ii] = mdcKalTrk->
px();
937 m_kal_py[ii] = mdcKalTrk->
py();
938 m_kal_pz[ii] = mdcKalTrk->
pz();
939 m_kal_p[ii] = mdcKalTrk->
p();
941 px_had += mdcKalTrk->
px();
942 py_had += mdcKalTrk->
py();
943 pz_had += mdcKalTrk->
pz();
944 pt_had += mdcKalTrk->
pxy();
945 p_had += mdcKalTrk->
p();
946 e_had += sqrt( mdcKalTrk->
p() * mdcKalTrk->
p() + mdcKalTrk->
mass() * mdcKalTrk->
mass() );
948 double ptrk = mdcKalTrk->
p();
950 if ( ( *itTrk )->isMdcDedxValid() )
954 m_probPH[ii] = dedxTrk->
probPH();
955 m_normPH[ii] = dedxTrk->
normPH();
957 m_chie[ii] = dedxTrk->
chiE();
958 m_chimu[ii] = dedxTrk->
chiMu();
959 m_chipi[ii] = dedxTrk->
chiPi();
960 m_chik[ii] = dedxTrk->
chiK();
961 m_chip[ii] = dedxTrk->
chiP();
966 if ( ( *itTrk )->isEmcShowerValid() )
970 m_e_emc[ii] = emcTrk->
energy();
971 m_phi_emc[ii] = emcTrk->
phi();
972 m_theta_emc[ii] = emcTrk->
theta();
975 if ( ( *itTrk )->isMucTrackValid() )
979 m_nhit_muc[ii] = mucTrk->
numHits();
983 if ( ( *itTrk )->isTofTrackValid() )
986 SmartRefVector<RecTofTrack> tofTrkCol = ( *itTrk )->tofTrack();
988 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
990 for ( ; iter_tof != tofTrkCol.end(); iter_tof++ )
993 status->
setStatus( ( *iter_tof )->status() );
997 if ( ( status->
is_cluster() ) ) m_t_etof[ii] = ( *iter_tof )->tof();
999 if ( status->
layer() != 0 )
continue;
1000 double path = ( *iter_tof )->path();
1001 double tof = ( *iter_tof )->tof();
1002 double ph = ( *iter_tof )->ph();
1003 double rhit = ( *iter_tof )->zrhit();
1004 double qual = 0.0 + ( *iter_tof )->quality();
1005 double cntr = 0.0 + ( *iter_tof )->tofID();
1007 for (
int j = 0; j < 5; j++ )
1009 double gb = ptrk /
xmass[j];
1010 double beta = gb / sqrt( 1 + gb * gb );
1011 texp[j] = path / beta /
velc;
1014 m_qual_etof[ii] = qual;
1015 m_tof_etof[ii] = tof;
1019 if ( ( status->
is_cluster() ) ) m_t_btof[ii] = ( *iter_tof )->tof();
1021 if ( status->
layer() == 1 )
1023 double path = ( *iter_tof )->path();
1024 double tof = ( *iter_tof )->tof();
1025 double ph = ( *iter_tof )->ph();
1026 double rhit = ( *iter_tof )->zrhit();
1027 double qual = 0.0 + ( *iter_tof )->quality();
1028 double cntr = 0.0 + ( *iter_tof )->tofID();
1030 for (
int j = 0; j < 5; j++ )
1032 double gb = ptrk /
xmass[j];
1033 double beta = gb / sqrt( 1 + gb * gb );
1034 texp[j] = path / beta /
velc;
1037 m_qual_btof1[ii] = qual;
1038 m_tof_btof1[ii] = tof;
1041 if ( status->
layer() == 2 )
1043 double path = ( *iter_tof )->path();
1044 double tof = ( *iter_tof )->tof();
1045 double ph = ( *iter_tof )->ph();
1046 double rhit = ( *iter_tof )->zrhit();
1047 double qual = 0.0 + ( *iter_tof )->quality();
1048 double cntr = 0.0 + ( *iter_tof )->tofID();
1050 for (
int j = 0; j < 5; j++ )
1052 double gb = ptrk /
xmass[j];
1053 double beta = gb / sqrt( 1 + gb * gb );
1054 texp[j] = path / beta /
velc;
1057 m_qual_btof2[ii] = qual;
1058 m_tof_btof2[ii] = tof;
1075 if ( ( m_ngch == 1 ) || ( m_ngch == 2 && nCharge == 0 ) )
1085 HepLorentzVector p41e, p42e, p4le;
1086 Hep3Vector p31e, p32e, p3le;
1087 HepLorentzVector p41m, p42m, p4lm;
1088 Hep3Vector p31m, p32m, p3lm;
1089 HepLorentzVector p41h, p42h, p4lh;
1090 Hep3Vector p31h, p32h, p3lh;
1095 for (
int i = 0; i < m_ngch; i++ )
1097 if ( m_charge[i] > 0 ) itTrk1 = evtRecTrkCol->begin() + iGood[i];
1098 if ( m_charge[i] < 0 ) itTrk2 = evtRecTrkCol->begin() + iGood[i];
1099 if ( m_charge[i] > 0 ) mdcKalTrk1 = ( *itTrk1 )->mdcKalTrack();
1100 if ( m_charge[i] < 0 ) mdcKalTrk2 = ( *itTrk2 )->mdcKalTrack();
1101 if ( m_charge[i] > 0 ) iip = i;
1102 if ( m_charge[i] < 0 ) iim = i;
1106 if ( m_charge[i] > 0 )
1109 if ( m_charge[i] < 0 )
1112 if ( m_charge[i] > 0 ) p41e = w1_ini.
p();
1113 if ( m_charge[i] < 0 ) p42e = w2_ini.
p();
1114 if ( m_charge[i] > 0 ) p41e.boost(
u_cms );
1115 if ( m_charge[i] < 0 ) p42e.boost(
u_cms );
1116 if ( m_charge[i] > 0 ) p31e = p41e.vect();
1117 if ( m_charge[i] < 0 ) p32e = p42e.vect();
1123 if ( m_charge[i] > 0 )
1126 if ( m_charge[i] < 0 )
1129 if ( m_charge[i] > 0 ) p41m = w1_ini.
p();
1130 if ( m_charge[i] < 0 ) p42m = w2_ini.
p();
1131 if ( m_charge[i] > 0 ) p41m.boost(
u_cms );
1132 if ( m_charge[i] < 0 ) p42m.boost(
u_cms );
1133 if ( m_charge[i] > 0 ) p31m = p41m.vect();
1134 if ( m_charge[i] < 0 ) p32m = p42m.vect();
1139 if ( m_charge[i] > 0 )
1141 m_px_cms_ep = p41e.px();
1142 m_py_cms_ep = p41e.py();
1143 m_pz_cms_ep = p41e.pz();
1144 m_e_cms_ep = p41e.e();
1146 if ( m_charge[i] < 0 )
1148 m_px_cms_em = p42e.px();
1149 m_py_cms_em = p42e.py();
1150 m_pz_cms_em = p42e.pz();
1151 m_e_cms_em = p42e.e();
1156 if ( m_charge[i] > 0 )
1158 m_px_cms_ep = p41m.px();
1159 m_py_cms_ep = p41m.py();
1160 m_pz_cms_ep = p41m.pz();
1161 m_e_cms_ep = p41m.e();
1163 if ( m_charge[i] < 0 )
1165 m_px_cms_em = p42m.px();
1166 m_py_cms_em = p42m.py();
1167 m_pz_cms_em = p42m.pz();
1168 m_e_cms_em = p42m.e();
1173 double e01 = ( iip != -1 ) ? m_e_emc[iip] : 0;
1174 double e02 = ( iim != -1 ) ? m_e_emc[iim] : 0;
1175 int ilarge = ( e01 > e02 ) ? iip : iim;
1176 p4le = ( e01 > e02 ) ? p41e : p42e;
1177 p4lm = ( e01 > e02 ) ? p41m : p42m;
1179 p3le = ( e01 > e02 ) ? p31e : p32e;
1180 p3lm = ( e01 > e02 ) ? p31m : p32m;
1182 double acolle = 180. - p31e.angle( p32e ) * 180.0 / CLHEP::pi;
1183 double acople = 180. - ( p31e.perpPart() ).angle( p32e.perpPart() ) * 180.0 / CLHEP::pi;
1184 double poeb1e = p41e.rho() / beamEnergy;
1185 double poeb2e = p42e.rho() / beamEnergy;
1186 double poeble = p4le.rho() / beamEnergy;
1187 double acollm = 180. - p31m.angle( p32m ) * 180.0 / CLHEP::pi;
1188 double acoplm = 180. - ( p31m.perpPart() ).angle( p32m.perpPart() ) * 180.0 / CLHEP::pi;
1189 double poeb1m = p41m.rho() / beamEnergy;
1190 double poeb2m = p42m.rho() / beamEnergy;
1191 double poeblm = p4lm.rho() / beamEnergy;
1193 double eemc1 = m_e_emc[iip];
1194 double eemc2 = m_e_emc[iim];
1196 double ex1 = m_kal_vx0[iip];
1197 double ey1 = m_kal_vy0[iip];
1198 double ez1 = m_kal_vz0[iip];
1199 double epx1 = m_kal_px[iip];
1200 double epy1 = m_kal_py[iip];
1201 double epz1 = m_kal_pz[iip];
1202 double epp1 = m_kal_p[iip];
1203 double ex2 = m_kal_vx0[iim];
1204 double ey2 = m_kal_vy0[iim];
1205 double ez2 = m_kal_vz0[iim];
1206 double epx2 = m_kal_px[iim];
1207 double epy2 = m_kal_py[iim];
1208 double epz2 = m_kal_pz[iim];
1209 double epp2 = m_kal_p[iim];
1211 double pidchidedx1 = m_pidchiDedx[iip];
1212 double pidchitof11 = m_pidchiTof1[iip];
1213 double pidchitof21 = m_pidchiTof2[iip];
1214 double pidchidedx2 = m_pidchiDedx[iim];
1215 double pidchitof12 = m_pidchiTof1[iim];
1216 double pidchitof22 = m_pidchiTof2[iim];
1218 double eoeb1 = m_e_emc[iip] / beamEnergy;
1219 double eoeb2 = m_e_emc[iim] / beamEnergy;
1222 if ( p41e.rho() > 0 ) eope1 = m_e_emc[iip] / p41e.rho();
1224 if ( p42e.rho() > 0 ) eope2 = m_e_emc[iim] / p42e.rho();
1226 if ( p41m.rho() > 0 ) eopm1 = m_e_emc[iip] / p41m.rho();
1228 if ( p42m.rho() > 0 ) eopm2 = m_e_emc[iim] / p42m.rho();
1231 m_e_emc[iip] *
sin( m_theta_emc[iip] ) *
cos( m_phi_emc[iip] ) / beamEnergy;
1233 m_e_emc[iip] *
sin( m_theta_emc[iip] ) *
sin( m_phi_emc[iip] ) / beamEnergy;
1234 double ezoeb1 = m_e_emc[iip] *
cos( m_theta_emc[iip] ) / beamEnergy;
1235 double etoeb1 = m_e_emc[iip] *
sin( m_theta_emc[iip] ) / beamEnergy;
1238 m_e_emc[iim] *
sin( m_theta_emc[iim] ) *
cos( m_phi_emc[iim] ) / beamEnergy;
1240 m_e_emc[iim] *
sin( m_theta_emc[iim] ) *
sin( m_phi_emc[iim] ) / beamEnergy;
1241 double ezoeb2 = m_e_emc[iim] *
cos( m_theta_emc[iim] ) / beamEnergy;
1242 double etoeb2 = m_e_emc[iim] *
sin( m_theta_emc[iim] ) / beamEnergy;
1244 double eoebl = m_e_emc[ilarge] / beamEnergy;
1247 if ( p4lh.rho() > 0 ) eopl = m_e_emc[ilarge] / p4lh.rho();
1250 m_e_emc[ilarge] *
sin( m_theta_emc[ilarge] ) *
cos( m_phi_emc[ilarge] ) / beamEnergy;
1252 m_e_emc[ilarge] *
sin( m_theta_emc[ilarge] ) *
sin( m_phi_emc[ilarge] ) / beamEnergy;
1253 double ezoebl = m_e_emc[ilarge] *
cos( m_theta_emc[ilarge] ) / beamEnergy;
1254 double etoebl = m_e_emc[ilarge] *
sin( m_theta_emc[ilarge] ) / beamEnergy;
1256 int mucinfo1 = ( m_nhit_muc[iip] >= 2 && m_nlay_muc[iip] >= 2 ) ? 1 : 0;
1257 int mucinfo2 = ( m_nhit_muc[iim] >= 2 && m_nlay_muc[iim] >= 2 ) ? 1 : 0;
1258 int mucinfol = ( m_nhit_muc[ilarge] >= 2 && m_nlay_muc[ilarge] >= 2 ) ? 1 : 0;
1259 int pidel = ( e01 > e02 ) ? m_nep : m_nem;
1260 int pidmul = ( e01 > e02 ) ? m_nmup : m_nmum;
1261 double deltatof = 0;
1276 if ( m_t_btof[iip] * m_t_btof[iim] != 0 ) deltatof = fabs( m_t_btof[iip] - m_t_btof[iim] );
1306 if ( acolle < m_acoll_e_cut ) m_bhabhatag += 1;
1307 if ( acople < m_acopl_e_cut ) m_bhabhatag += 10;
1308 if ( sqrt( ( eoeb1 - 1 ) * ( eoeb1 - 1 ) + ( eoeb2 - 1 ) * ( eoeb2 - 1 ) ) <
1311 if ( !m_useTOF || ( deltatof < m_dtof_e_cut ) ) m_bhabhatag += 1000;
1312 if ( poeb1e > m_tpoeb_e_cut || poeb2e > m_tpoeb_e_cut ||
1313 ( sqrt( ( poeb1e - 1 ) * ( poeb1e - 1 ) + ( poeb2e - 1 ) * ( poeb2e - 1 ) ) <
1315 m_bhabhatag += 10000;
1316 if ( !m_useMUC || ( mucinfo1 == 0 || mucinfo2 == 0 ) ) m_bhabhatag += 100000;
1317 if ( !m_usePID || ( m_nep == 1 && m_nem == 1 ) ) m_bhabhatag += 1000000;
1320 if ( m_ngch == 1 || ( m_ngch == 2 && acolle < m_acoll_e_cut ) ) m_sbhabhatag += 1;
1321 if ( m_ngch == 1 || ( m_ngch == 2 && acople < m_acopl_e_cut ) ) m_sbhabhatag += 10;
1322 if ( ( fabs( poeble - 1 ) < m_poeb_e_cut ) ) m_sbhabhatag += 100;
1323 if ( m_ngch == 1 || !m_useTOF || ( deltatof < m_dtof_e_cut ) ) m_sbhabhatag += 1000;
1324 if ( !m_useMUC || ( mucinfol == 0 ) ) m_sbhabhatag += 10000;
1325 if ( !m_useEMC || ( eoebl > m_eoeb_e_cut ) ) m_sbhabhatag += 100000;
1326 if ( !m_useEMC || ( m_ngch == 1 || eoeb1 + eoeb2 > m_etotal_e_cut ) )
1327 m_sbhabhatag += 1000000;
1328 if ( !m_usePID || ( pidel == 1 ) ) m_sbhabhatag += 10000000;
1337 if ( acollm < m_acoll_mu_cut ) m_dimutag += 1;
1338 if ( acoplm < m_acopl_mu_cut ) m_dimutag += 10;
1339 if ( ( sqrt( ( ( poeb1m - poeb2m ) / 0.35 ) * ( ( poeb1m - poeb2m ) / 0.35 ) +
1340 ( ( poeb1m + poeb2m - 1.68 ) / 0.125 ) *
1341 ( ( poeb1m + poeb2m - 1.68 ) / 0.125 ) ) > m_tptotal_mu_cut ) &&
1342 ( ( ( poeb1m >= m_tpoebh_mu_cut ) && ( poeb2m >= m_tpoebl_mu_cut ) ) ||
1343 ( ( poeb2m >= m_tpoebh_mu_cut ) && ( poeb1m >= m_tpoebl_mu_cut ) ) ) )
1345 if ( !m_useTOF || ( deltatof < m_dtof_mu_cut ) ) m_dimutag += 1000;
1346 if ( !m_useMUC || ( mucinfo1 == 1 || mucinfo2 == 1 ) ) m_dimutag += 10000;
1347 if ( etoeb1 < m_eoeb_mu_cut && eoeb2 < m_eoeb_mu_cut ) m_dimutag += 100000;
1348 if ( etoeb1 + etoeb2 < m_etotal_mu_cut ) m_dimutag += 1000000;
1349 if ( !m_usePID || ( m_nmup == 1 && m_nmum == 1 ) ) m_dimutag += 10000000;
1352 if ( m_ngch == 1 || ( m_ngch == 2 && acollm < m_acoll_mu_cut ) ) m_sdimutag += 1;
1353 if ( m_ngch == 1 || ( m_ngch == 2 && acoplm < m_acopl_mu_cut ) ) m_sdimutag += 10;
1354 if ( ( fabs( poeblm - 1 ) < m_poeb_mu_cut ) ) m_sdimutag += 100;
1355 if ( m_ngch == 1 || !m_useTOF || ( deltatof < m_dtof_mu_cut ) ) m_sdimutag += 1000;
1356 if ( !m_useMUC || ( mucinfo1 == 1 || mucinfo2 == 1 ) ) m_sdimutag += 10000;
1357 if ( !m_useEMC || ( etoebl < m_eoeb_mu_cut ) ) m_sdimutag += 100000;
1358 if ( !m_useEMC || ( m_ngch == 1 || etoeb1 + etoeb2 < m_etotal_mu_cut ) )
1359 m_sdimutag += 1000000;
1360 if ( !m_usePID || ( pidmul == 1 ) ) m_sdimutag += 10000000;
1371 m_cos_ep = p41e.cosTheta();
1372 m_cos_em = p42e.cosTheta();
1373 m_mass_ee = ( p41e + p42e ).m();
1377 if ( m_bhabhatag == 1111111 )
1380 m_ee_mass->Fill( ( p41e + p42e ).m() );
1381 m_ee_acoll->Fill( acolle );
1382 m_ee_eop_ep->Fill( eope1 );
1383 m_ee_eop_em->Fill( eope2 );
1384 m_ee_costheta_ep->Fill( p41e.cosTheta() );
1385 m_ee_costheta_em->Fill( p42e.cosTheta() );
1386 m_ee_phi_ep->Fill( p41e.phi() );
1387 m_ee_phi_em->Fill( p42e.phi() );
1388 m_ee_nneu->Fill( nneu );
1390 m_ee_eemc_ep->Fill( eemc1 );
1391 m_ee_eemc_em->Fill( eemc2 );
1393 m_ee_x_ep->Fill( ex1 );
1394 m_ee_y_ep->Fill( ey1 );
1395 m_ee_z_ep->Fill( ez1 );
1397 m_ee_x_em->Fill( ex2 );
1398 m_ee_y_em->Fill( ey2 );
1399 m_ee_z_em->Fill( ez2 );
1401 m_ee_px_ep->Fill( epx1 );
1402 m_ee_py_ep->Fill( epy1 );
1403 m_ee_pz_ep->Fill( epz1 );
1404 m_ee_p_ep->Fill( epp1 );
1406 m_ee_px_em->Fill( epx2 );
1407 m_ee_py_em->Fill( epy2 );
1408 m_ee_pz_em->Fill( epz2 );
1409 m_ee_p_em->Fill( epp2 );
1411 m_ee_deltatof->Fill( deltatof );
1413 m_ee_pidchidedx_ep->Fill( pidchidedx1 );
1414 m_ee_pidchidedx_em->Fill( pidchidedx2 );
1415 m_ee_pidchitof1_ep->Fill( pidchitof11 );
1416 m_ee_pidchitof1_em->Fill( pidchitof12 );
1417 m_ee_pidchitof2_ep->Fill( pidchitof21 );
1418 m_ee_pidchitof2_em->Fill( pidchitof22 );
1429 m_cos_ep = p41m.cosTheta();
1430 m_cos_em = p42m.cosTheta();
1431 m_mass_ee = ( p41m + p42m ).m();
1435 if ( m_dimutag == 11111111 )
1438 m_mumu_mass->Fill( ( p41m + p42m ).m() );
1439 m_mumu_acoll->Fill( acollm );
1440 m_mumu_eop_mup->Fill( eopm1 );
1441 m_mumu_eop_mum->Fill( eopm2 );
1442 m_mumu_costheta_mup->Fill( p41m.cosTheta() );
1443 m_mumu_costheta_mum->Fill( p42m.cosTheta() );
1444 m_mumu_phi_mup->Fill( p41m.phi() );
1445 m_mumu_phi_mum->Fill( p42m.phi() );
1446 m_mumu_nneu->Fill( nneu );
1447 m_mumu_nhit->Fill( m_nhit_muc[ilarge] );
1448 m_mumu_nlay->Fill( m_nlay_muc[ilarge] );
1450 m_mumu_eemc_mup->Fill( eemc1 );
1451 m_mumu_eemc_mum->Fill( eemc2 );
1453 m_mumu_x_mup->Fill( ex1 );
1454 m_mumu_y_mup->Fill( ey1 );
1455 m_mumu_z_mup->Fill( ez1 );
1457 m_mumu_x_mum->Fill( ex2 );
1458 m_mumu_y_mum->Fill( ey2 );
1459 m_mumu_z_mum->Fill( ez2 );
1461 m_mumu_px_mup->Fill( epx1 );
1462 m_mumu_py_mup->Fill( epy1 );
1463 m_mumu_pz_mup->Fill( epz1 );
1464 m_mumu_p_mup->Fill( epp1 );
1466 m_mumu_px_mum->Fill( epx2 );
1467 m_mumu_py_mum->Fill( epy2 );
1468 m_mumu_pz_mum->Fill( epz2 );
1469 m_mumu_p_mum->Fill( epp2 );
1471 m_mumu_deltatof->Fill( deltatof );
1473 m_mumu_pidchidedx_mup->Fill( pidchidedx1 );
1474 m_mumu_pidchidedx_mum->Fill( pidchidedx2 );
1475 m_mumu_pidchitof1_mup->Fill( pidchitof11 );
1476 m_mumu_pidchitof1_mum->Fill( pidchitof12 );
1477 m_mumu_pidchitof2_mup->Fill( pidchitof21 );
1478 m_mumu_pidchitof2_mum->Fill( pidchitof22 );
1482 m_deltatof = deltatof;
1489 m_mucinfo1 = mucinfo1;
1490 m_mucinfo2 = mucinfo2;
1497 if ( ( m_tagDimu && m_dimutag == 11111111 ) || ( m_tagBhabha && m_bhabhatag == 1111111 ) )
1500 else m_tuple1->write();
1502 return StatusCode::SUCCESS;