104 MsgStream log(
msgSvc(), name());
106 log << MSG::INFO <<
"in initialize()" << endmsg;
108 status = service(
"THistSvc", m_thistsvc);
109 if(status.isFailure() ){
110 log << MSG::INFO <<
"Unable to retrieve pointer to THistSvc" << endreq;
117 m_mumu_mass =
new TH1F(
"mumu_mass",
"mumu_mass", 80, m_ecms-0.3, m_ecms+0.5);
118 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_mass", m_mumu_mass);
119 m_mumu_acoll =
new TH1F(
"mumu_acoll",
"mumu_acoll", 60, 0, 6 );
120 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_acoll", m_mumu_acoll);
121 m_mumu_eop_mup =
new TH1F(
"mumu_eop_mup",
"mumu_eop_mup", 100,0.,0.5 );
122 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_eop_mup", m_mumu_eop_mup);
123 m_mumu_eop_mum =
new TH1F(
"mumu_eop_mum",
"mumu_eop_mum", 100,0.,0.5 );
124 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_eop_mum", m_mumu_eop_mum);
125 m_mumu_costheta_mup =
new TH1F(
"mumu_costheta_mup",
"mumu_costheta_mup", 100,-1,1 );
126 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_costheta_mup", m_mumu_costheta_mup);
127 m_mumu_costheta_mum =
new TH1F(
"mumu_costheta_mum",
"mumu_costheta_mum", 100,-1,1 );
128 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_costheta_mum", m_mumu_costheta_mum);
130 m_mumu_phi_mup =
new TH1F(
"mumu_phi_mup",
"mumu_phi_mup", 120,-3.2,3.2 );
131 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_phi_mup", m_mumu_phi_mup);
132 m_mumu_phi_mum =
new TH1F(
"mumu_phi_mum",
"mumu_phi_mum", 120,-3.2,3.2 );
133 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_phi_mum", m_mumu_phi_mum);
135 m_mumu_nneu =
new TH1F(
"mumu_nneu",
"mumu_nneu", 5,0,5 );
136 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_nneu", m_mumu_nneu);
137 m_mumu_nlay =
new TH1F(
"mumu_nlay",
"mumu_nlay", 9,0,10 );
138 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_nlay", m_mumu_nlay);
139 m_mumu_nhit =
new TH1F(
"mumu_nhit",
"mumu_nhit", 19,0,20 );
140 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_nhit", m_mumu_nhit);
142 m_mumu_eemc_mup=
new TH1F(
"mumu_eemc_mup",
"mumu_eemc_mup",100,0.0,1.0);
143 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_eemc_mup", m_mumu_eemc_mup);
144 m_mumu_eemc_mum=
new TH1F(
"mumu_eemc_mum",
"mumu_eemc_mum",100,0.0,1.0);
145 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_eemc_mum", m_mumu_eemc_mum);
146 m_mumu_x_mup=
new TH1F(
"mumu_x_mup",
"mumu_x_mup",100,-1.0,1.0);
147 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_x_mup", m_mumu_x_mup);
148 m_mumu_y_mup=
new TH1F(
"mumu_y_mup",
"mumu_y_mup",100,-1.0,1.0);
149 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_y_mup", m_mumu_y_mup);
150 m_mumu_z_mup=
new TH1F(
"mumu_z_mup",
"mumu_z_mup",100,-10.0,10.0);
151 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_z_mup", m_mumu_z_mup);
152 m_mumu_x_mum=
new TH1F(
"mumu_x_mum",
"mumu_x_mum",100,-1.0,1.0);
153 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_x_mum", m_mumu_x_mum);
154 m_mumu_y_mum=
new TH1F(
"mumu_y_mum",
"mumu_y_mum",100,-1.0,1.0);
155 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_y_mum", m_mumu_y_mum);
156 m_mumu_z_mum=
new TH1F(
"mumu_z_mum",
"mumu_z_mum",100,-10.0,10.0);
157 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_z_mum", m_mumu_z_mum);
159 m_mumu_px_mup=
new TH1F(
"mumu_px_mup",
"mumu_px_mup",200,-2.0,2.0);
160 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_px_mup", m_mumu_px_mup);
161 m_mumu_py_mup=
new TH1F(
"mumu_py_mup",
"mumu_py_mup",200,-2.0,2.0);
162 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_py_mup", m_mumu_py_mup);
163 m_mumu_pz_mup=
new TH1F(
"mumu_pz_mup",
"mumu_pz_mup",200,-2.0,2.0);
164 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pz_mup", m_mumu_pz_mup);
165 m_mumu_p_mup=
new TH1F(
"mumu_p_mup",
"mumu_p_mup",100,1.0,2.0);
166 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_p_mup", m_mumu_p_mup);
167 m_mumu_px_mum=
new TH1F(
"mumu_px_mum",
"mumu_px_mum",100,-2.0,2.0);
168 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_px_mum", m_mumu_px_mum);
169 m_mumu_py_mum=
new TH1F(
"mumu_py_mum",
"mumu_py_mum",100,-2.0,2.0);
170 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_py_mum", m_mumu_py_mum);
171 m_mumu_pz_mum=
new TH1F(
"mumu_pz_mum",
"mumu_pz_mum",100,-2.0,2.0);
172 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pz_mum", m_mumu_pz_mum);
173 m_mumu_p_mum=
new TH1F(
"mumu_p_mum",
"mumu_p_mum",100,1.0,2.0);
174 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_p_mum", m_mumu_p_mum);
175 m_mumu_deltatof=
new TH1F(
"mumu_deltatof",
"mumu_deltatof",50,0.0,10.0);
176 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_deltatof", m_mumu_deltatof);
178 m_mumu_pidchidedx_mup=
new TH1F(
"mumu_pidchidedx_mup",
"mumu_pidchidedx_mup",160,-4,4);
179 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchidedx_mup", m_mumu_pidchidedx_mup);
180 m_mumu_pidchidedx_mum=
new TH1F(
"mumu_pidchidedx_mum",
"mumu_pidchidedx_mum",160,-4,4);
181 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchidedx_mum", m_mumu_pidchidedx_mum);
182 m_mumu_pidchitof1_mup=
new TH1F(
"mumu_pidchitof1_mup",
"mumu_pidchitof1_mup",160,-4,4);
183 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchitof1_mup", m_mumu_pidchitof1_mup);
184 m_mumu_pidchitof1_mum=
new TH1F(
"mumu_pidchitof1_mum",
"mumu_pidchitof1_mum",160,-4,4);
185 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchitof1_mum", m_mumu_pidchitof1_mum);
186 m_mumu_pidchitof2_mup=
new TH1F(
"mumu_pidchitof2_mup",
"mumu_pidchitof2_mup",160,-4,4);
187 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchitof2_mup", m_mumu_pidchitof2_mup);
188 m_mumu_pidchitof2_mum=
new TH1F(
"mumu_pidchitof2_mum",
"mumu_pidchitof2_mum",160,-4,4);
189 status = m_thistsvc->regHist(
"/DQAHist/Dimu/mumu_pidchitof2_mum", m_mumu_pidchitof2_mum);
195NTuplePtr nt1(
ntupleSvc(),
"DQAFILE/Dimu");
196if ( nt1 ) m_tuple1 = nt1;
198 m_tuple1 =
ntupleSvc()->book (
"DQAFILE/Dimu", CLID_ColumnWiseTuple,
"N-Tuple");
200 status = m_tuple1->addItem (
"run", m_run);
201 status = m_tuple1->addItem (
"rec", m_rec);
202 status = m_tuple1->addItem (
"Nchrg", m_ncharg);
203 status = m_tuple1->addItem (
"Nneu", m_nneu,0,40);
204 status = m_tuple1->addItem (
"NGch", m_ngch, 0, 40);
205 status = m_tuple1->addItem (
"NGam", m_nGam);
208 status = m_tuple1->addItem (
"dimutag", m_dimutag);
210 status = m_tuple1->addItem (
"acoll", m_acoll);
211 status = m_tuple1->addItem (
"acopl", m_acopl);
212 status = m_tuple1->addItem (
"deltatof", m_deltatof);
213 status = m_tuple1->addItem (
"eop1", m_eop1);
214 status = m_tuple1->addItem (
"eop2", m_eop2);
215 status = m_tuple1->addItem (
"eoeb1", m_eoeb1);
216 status = m_tuple1->addItem (
"eoeb2", m_eoeb2);
217 status = m_tuple1->addItem (
"poeb1", m_poeb1);
218 status = m_tuple1->addItem (
"poeb2", m_poeb2);
219 status = m_tuple1->addItem (
"etoeb1", m_etoeb1);
220 status = m_tuple1->addItem (
"etoeb2", m_etoeb2);
221 status = m_tuple1->addItem (
"mucinfo1", m_mucinfo1);
222 status = m_tuple1->addItem (
"mucinfo2", m_mucinfo2);
225 status = m_tuple1->addIndexedItem (
"delang",m_nneu, m_delang);
226 status = m_tuple1->addIndexedItem (
"delphi",m_nneu, m_delphi);
227 status = m_tuple1->addIndexedItem (
"delthe",m_nneu, m_delthe);
228 status = m_tuple1->addIndexedItem (
"npart",m_nneu, m_npart);
229 status = m_tuple1->addIndexedItem (
"nemchits",m_nneu, m_nemchits);
230 status = m_tuple1->addIndexedItem (
"module",m_nneu, m_module);
231 status = m_tuple1->addIndexedItem (
"x",m_nneu, m_x);
232 status = m_tuple1->addIndexedItem (
"y",m_nneu, m_y);
233 status = m_tuple1->addIndexedItem (
"z",m_nneu, m_z);
234 status = m_tuple1->addIndexedItem (
"px",m_nneu, m_px);
235 status = m_tuple1->addIndexedItem (
"py",m_nneu, m_py);
236 status = m_tuple1->addIndexedItem (
"pz",m_nneu, m_pz);
237 status = m_tuple1->addIndexedItem (
"theta",m_nneu, m_theta);
238 status = m_tuple1->addIndexedItem (
"phi",m_nneu, m_phi);
239 status = m_tuple1->addIndexedItem (
"dx",m_nneu, m_dx);
240 status = m_tuple1->addIndexedItem (
"dy",m_nneu, m_dy);
241 status = m_tuple1->addIndexedItem (
"dz",m_nneu, m_dz);
242 status = m_tuple1->addIndexedItem (
"dtheta",m_nneu, m_dtheta);
243 status = m_tuple1->addIndexedItem (
"dphi",m_nneu, m_dphi);
244 status = m_tuple1->addIndexedItem (
"energy",m_nneu, m_energy);
245 status = m_tuple1->addIndexedItem (
"dE",m_nneu, m_dE);
246 status = m_tuple1->addIndexedItem (
"eSeed",m_nneu, m_eSeed);
247 status = m_tuple1->addIndexedItem (
"nSeed",m_nneu, m_nSeed);
248 status = m_tuple1->addIndexedItem (
"e3x3",m_nneu, m_e3x3);
249 status = m_tuple1->addIndexedItem (
"e5x5",m_nneu, m_e5x5);
250 status = m_tuple1->addIndexedItem (
"secondMoment",m_nneu, m_secondMoment);
251 status = m_tuple1->addIndexedItem (
"latMoment",m_nneu, m_latMoment);
252 status = m_tuple1->addIndexedItem (
"a20Moment",m_nneu, m_a20Moment);
253 status = m_tuple1->addIndexedItem (
"a42Moment",m_nneu, m_a42Moment);
254 status = m_tuple1->addIndexedItem (
"getTime",m_nneu, m_getTime);
255 status = m_tuple1->addIndexedItem (
"getEAll",m_nneu, m_getEAll);
259 status = m_tuple1->addIndexedItem(
"charge", m_ngch, m_charge);
260 status = m_tuple1->addIndexedItem (
"vx", m_ngch, m_vx0);
261 status = m_tuple1->addIndexedItem (
"vy", m_ngch, m_vy0);
262 status = m_tuple1->addIndexedItem (
"vz", m_ngch, m_vz0);
265 status = m_tuple1->addIndexedItem (
"px", m_ngch, m_px) ;
266 status = m_tuple1->addIndexedItem (
"py", m_ngch, m_py) ;
267 status = m_tuple1->addIndexedItem (
"pz", m_ngch, m_pz) ;
268 status = m_tuple1->addIndexedItem (
"p", m_ngch, m_p) ;
272 status = m_tuple1->addIndexedItem (
"kal_vx", m_ngch, m_kal_vx0);
273 status = m_tuple1->addIndexedItem (
"kal_vy", m_ngch, m_kal_vy0);
274 status = m_tuple1->addIndexedItem (
"kal_vz", m_ngch, m_kal_vz0);
277 status = m_tuple1->addIndexedItem (
"kal_px", m_ngch, m_kal_px) ;
278 status = m_tuple1->addIndexedItem (
"kal_py", m_ngch, m_kal_py) ;
279 status = m_tuple1->addIndexedItem (
"kal_pz", m_ngch, m_kal_pz) ;
280 status = m_tuple1->addIndexedItem (
"kal_p", m_ngch, m_kal_p) ;
283 status = m_tuple1->addIndexedItem (
"probPH" , m_ngch, m_probPH) ;
284 status = m_tuple1->addIndexedItem (
"normPH" , m_ngch, m_normPH) ;
285 status = m_tuple1->addIndexedItem (
"chie" , m_ngch, m_chie) ;
286 status = m_tuple1->addIndexedItem (
"chimu" , m_ngch, m_chimu) ;
287 status = m_tuple1->addIndexedItem (
"chipi" , m_ngch, m_chipi) ;
288 status = m_tuple1->addIndexedItem (
"chik" , m_ngch, m_chik) ;
289 status = m_tuple1->addIndexedItem (
"chip" , m_ngch, m_chip) ;
290 status = m_tuple1->addIndexedItem (
"ghit" , m_ngch, m_ghit) ;
291 status = m_tuple1->addIndexedItem (
"thit" , m_ngch, m_thit) ;
293 status = m_tuple1->addIndexedItem (
"e_emc" , m_ngch, m_e_emc) ;
294 status = m_tuple1->addIndexedItem (
"phi_emc" , m_ngch, m_phi_emc) ;
295 status = m_tuple1->addIndexedItem (
"theta_emc" , m_ngch, m_theta_emc) ;
297 status = m_tuple1->addIndexedItem (
"nhit_muc" , m_ngch, m_nhit_muc) ;
298 status = m_tuple1->addIndexedItem (
"nlay_muc" , m_ngch, m_nlay_muc) ;
299 status = m_tuple1->addIndexedItem (
"t_btof" , m_ngch, m_t_btof );
300 status = m_tuple1->addIndexedItem (
"t_etof" , m_ngch, m_t_etof );
301 status = m_tuple1->addIndexedItem (
"qual_etof" , m_ngch, m_qual_etof );
302 status = m_tuple1->addIndexedItem (
"tof_etof" , m_ngch, m_tof_etof );
303 status = m_tuple1->addIndexedItem (
"te_etof" , m_ngch, m_te_etof );
304 status = m_tuple1->addIndexedItem (
"tmu_etof" , m_ngch, m_tmu_etof );
305 status = m_tuple1->addIndexedItem (
"tpi_etof" , m_ngch, m_tpi_etof );
306 status = m_tuple1->addIndexedItem (
"tk_etof" , m_ngch, m_tk_etof );
307 status = m_tuple1->addIndexedItem (
"tp_etof" , m_ngch, m_tp_etof );
309 status = m_tuple1->addIndexedItem (
"qual_btof1", m_ngch, m_qual_btof1 );
310 status = m_tuple1->addIndexedItem (
"tof_btof1" , m_ngch, m_tof_btof1 );
311 status = m_tuple1->addIndexedItem (
"te_btof1" , m_ngch, m_te_btof1 );
312 status = m_tuple1->addIndexedItem (
"tmu_btof1" , m_ngch, m_tmu_btof1 );
313 status = m_tuple1->addIndexedItem (
"tpi_btof1" , m_ngch, m_tpi_btof1 );
314 status = m_tuple1->addIndexedItem (
"tk_btof1" , m_ngch, m_tk_btof1 );
315 status = m_tuple1->addIndexedItem (
"tp_btof1" , m_ngch, m_tp_btof1 );
317 status = m_tuple1->addIndexedItem (
"qual_btof2", m_ngch, m_qual_btof2 );
318 status = m_tuple1->addIndexedItem (
"tof_btof2" , m_ngch, m_tof_btof2 );
319 status = m_tuple1->addIndexedItem (
"te_btof2" , m_ngch, m_te_btof2 );
320 status = m_tuple1->addIndexedItem (
"tmu_btof2" , m_ngch, m_tmu_btof2 );
321 status = m_tuple1->addIndexedItem (
"tpi_btof2" , m_ngch, m_tpi_btof2 );
322 status = m_tuple1->addIndexedItem (
"tk_btof2" , m_ngch, m_tk_btof2 );
323 status = m_tuple1->addIndexedItem (
"tp_btof2" , m_ngch, m_tp_btof2 );
324 status = m_tuple1->addIndexedItem (
"pidcode" , m_ngch, m_pidcode);
325 status = m_tuple1->addIndexedItem (
"pidprob" , m_ngch, m_pidprob);
326 status = m_tuple1->addIndexedItem (
"pidchiDedx" , m_ngch, m_pidchiDedx);
327 status = m_tuple1->addIndexedItem (
"pidchiTof1" , m_ngch, m_pidchiTof1);
328 status = m_tuple1->addIndexedItem (
"pidchiTof2" , m_ngch, m_pidchiTof2);
330 status = m_tuple1->addItem (
"px_cms_ep", m_px_cms_ep);
331 status = m_tuple1->addItem (
"py_cms_ep", m_py_cms_ep);
332 status = m_tuple1->addItem (
"pz_cms_ep", m_pz_cms_ep);
333 status = m_tuple1->addItem (
"e_cms_ep", m_e_cms_ep);
334 status = m_tuple1->addItem (
"cos_ep", m_cos_ep);
335 status = m_tuple1->addItem (
"px_cms_em", m_px_cms_em);
336 status = m_tuple1->addItem (
"py_cms_em", m_py_cms_em);
337 status = m_tuple1->addItem (
"pz_cms_em", m_pz_cms_em);
338 status = m_tuple1->addItem (
"e_cms_em", m_e_cms_em);
339 status = m_tuple1->addItem (
"cos_em", m_cos_em);
340 status = m_tuple1->addItem (
"mass_ee", m_mass_ee);
341 status = m_tuple1->addItem (
"emax", m_emax);
342 status = m_tuple1->addItem (
"esum", m_esum);
343 status = m_tuple1->addItem (
"npip", m_npip );
344 status = m_tuple1->addItem (
"npim", m_npim );
345 status = m_tuple1->addItem (
"nkp", m_nkp );
346 status = m_tuple1->addItem (
"nkm", m_nkm );
347 status = m_tuple1->addItem (
"np", m_np );
348 status = m_tuple1->addItem (
"npb", m_npb );
350 status = m_tuple1->addItem (
"nep", m_nep );
351 status = m_tuple1->addItem (
"nem", m_nem );
352 status = m_tuple1->addItem (
"nmup", m_nmup );
353 status = m_tuple1->addItem (
"nmum", m_nmum );
357 log << MSG::ERROR <<
" Cannot book N-tuple:" << long(m_tuple1) << endmsg;
358 return StatusCode::FAILURE;
366log << MSG::INFO <<
"successfully return from initialize()" <<endmsg;
367return StatusCode::SUCCESS;
376 setFilterPassed(
false);
377 const double beamEnergy = m_ecms/2.;
378 const HepLorentzVector
p_cms(m_ecms*
sin(m_beamangle*0.5),0.0,0.0,m_ecms);
379 const Hep3Vector
u_cms = -
p_cms.boostVector();
380 MsgStream log(
msgSvc(), name());
381 log << MSG::INFO <<
"in execute()" << endreq;
384 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
387 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
388 return StatusCode::SUCCESS;
391 m_run = eventHeader->runNumber();
392 m_rec = eventHeader->eventNumber();
400 log << MSG::FATAL <<
"Could not find EvtRecEvent" << endreq;
401 return StatusCode::SUCCESS;
403 log << MSG::INFO <<
"ncharg, nneu, tottks = "
404 << evtRecEvent->totalCharged() <<
" , "
405 << evtRecEvent->totalNeutral() <<
" , "
406 << evtRecEvent->totalTracks() <<endreq;
408 m_ncharg = evtRecEvent->totalCharged();
410 m_nneu = evtRecEvent->totalNeutral();
415 HepSymMatrix Evx(3, 0);
418 Gaudi::svcLocator()->service(
"VertexDbSvc", vtxsvc);
428 Evx[0][0]=vv[0]*vv[0];
429 Evx[0][1]=vv[0]*vv[1];
430 Evx[1][1]=vv[1]*vv[1];
431 Evx[1][2]=vv[1]*vv[2];
432 Evx[2][2]=vv[2]*vv[2];
439 log << MSG::FATAL <<
"Could not find EvtRecTrackCol" << endreq;
440 return StatusCode::SUCCESS;
447 for(
int i = 0; i < evtRecEvent->totalCharged(); i++){
449 if(!(*itTrk)->isMdcTrackValid())
continue;
450 if(!(*itTrk)->isMdcKalTrackValid())
continue;
453 double pch=mdcTrk->
p();
454 double x0=mdcTrk->
x();
455 double y0=mdcTrk->
y();
456 double z0=mdcTrk->
z();
457 double phi0=mdcTrk->
helix(1);
461 double Rxy=(x0-xv)*
cos(phi0)+(y0-yv)*
sin(phi0);
466 if(fabs(z0) >= m_vz0cut)
continue;
467 if(fabs(Rxy) >= m_vr0cut)
continue;
470 if(fabs(m_vz0) >= m_vz0cut)
continue;
471 if(m_vr0 >= m_vr0cut)
continue;
477 nCharge += mdcTrk->
charge();
488 int nGood = iGood.size();
490 log << MSG::DEBUG <<
"ngood, totcharge = " << nGood <<
" , " << nCharge << endreq;
492 if((nGood != 2)||(nCharge!=0)){
493 return StatusCode::SUCCESS;
501 Vint ipip, ipim, iep,iem,imup,imum;
511 for(
int i = 0; i < m_ngch; i++) {
531 HepLorentzVector
ptrk;
532 ptrk.setPx(mdcTrk->
px()) ;
533 ptrk.setPy(mdcTrk->
py()) ;
534 ptrk.setPz(mdcTrk->
pz()) ;
540 m_pidprob[i]=pid->
prob(1);
541 m_pidchiDedx[i]=pid->
chiDedx(1);
542 m_pidchiTof1[i]=pid->
chiTof1(1);
543 m_pidchiTof2[i]=pid->
chiTof2(1);
544 if(mdcTrk->
charge() > 0) {
545 imup.push_back(iGood[i]);
548 if (mdcTrk->
charge() < 0) {
549 imum.push_back(iGood[i]);
558 m_nmup = imup.size() ;
559 m_nmum = imum.size() ;
569 for(
int i = evtRecEvent->totalCharged(); i< evtRecEvent->totalTracks(); i++) {
570 if(i>=evtRecTrkCol->size())
break;
572 if(!(*itTrk)->isEmcShowerValid())
continue;
574 Hep3Vector emcpos(emcTrk->
x(), emcTrk->
y(), emcTrk->
z());
579 int module=emcTrk->
module();
580 double x = emcTrk->
x();
581 double y = emcTrk->
y();
582 double z = emcTrk->
z();
583 double dx = emcTrk->
dx();
584 double dy = emcTrk->
dy();
585 double dth = emcTrk->
dtheta();
586 double dph = emcTrk->
dphi();
587 double dz = emcTrk->
dz();
589 double dE = emcTrk->
dE();
590 double eSeed = emcTrk->
eSeed();
591 double e3x3 = emcTrk->
e3x3();
592 double e5x5 = emcTrk->
e5x5();
595 double getTime = emcTrk->
time();
596 double getEAll = emcTrk->
getEAll();
606 m_nemchits[iphoton]=
n;
607 m_npart[iphoton]=npart;
608 m_module[iphoton]=
module;
609 m_theta[iphoton]=EmcPos.theta();
610 m_phi[iphoton]=EmcPos.phi();
617 m_dtheta[iphoton]=dth;
621 m_eSeed[iphoton]=eSeed;
622 m_nSeed[iphoton]=nseed;
623 m_e3x3[iphoton]=e3x3;
624 m_e5x5[iphoton]=e5x5;
625 m_secondMoment[iphoton]=secondMoment;
626 m_latMoment[iphoton]=latMoment;
627 m_getTime[iphoton]=getTime;
628 m_getEAll[iphoton]=getEAll;
629 m_a20Moment[iphoton]=a20Moment;
630 m_a42Moment[iphoton]=a42Moment;
642 for(
int j = 0; j < nGood; j++) {
646 if (!(*jtTrk)->isMdcTrackValid())
continue;
648 double jtcharge = jtmdcTrk->
charge();
649 if(!(*jtTrk)->isExtTrackValid())
continue;
654 double angd = extpos.angle(emcpos);
655 double thed = extpos.theta() - emcpos.theta();
656 double phid = extpos.deltaPhi(emcpos);
657 thed = fmod(thed+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
658 phid = fmod(phid+CLHEP::twopi+CLHEP::twopi+
pi, CLHEP::twopi) - CLHEP::pi;
660 if(fabs(thed) < fabs(dthe)) dthe = thed;
661 if(fabs(phid) < fabs(dphi)) dphi = phid;
662 if(angd < dang) dang = angd;
672 dthe = dthe * 180 / (CLHEP::pi);
673 dphi = dphi * 180 / (CLHEP::pi);
674 dang = dang * 180 / (CLHEP::pi);
675 double eraw = emcTrk->
energy();
676 double phi = emcTrk->
phi();
677 double the = emcTrk->
theta();
679 m_delphi[iphoton]=dphi;
680 m_delthe[iphoton]=dthe;
681 m_delang[iphoton]=dang;
682 if(
energy < m_energyThreshold)
continue;
683 if(getTime>m_gammathCut||getTime<m_gammatlCut)
continue;
685 if(dang< m_gammaTrkCut)
continue;
688 if(iphoton>=40)
return StatusCode::SUCCESS;
691 int nGam = iGam.size();
703 for(
int i = 0; i < m_nGam; i++) {
705 if(!(*itTrk)->isEmcShowerValid())
continue;
707 double eraw = emcTrk->
energy();
708 double phi = emcTrk->
phi();
709 double the = emcTrk->
theta();
710 HepLorentzVector
ptrk;
711 ex_gam+=eraw*
sin(the)*
cos(phi);
712 ey_gam+=eraw*
sin(the)*
sin(phi);
713 ez_gam+=eraw*
cos(the);
714 et_gam+=eraw*
sin(the);
740 for(
int i = 0; i < m_ngch; i++ ){
744 if(!(*itTrk)->isMdcTrackValid())
continue;
745 if(!(*itTrk)->isMdcKalTrackValid())
continue;
752 m_charge[ii] = mdcTrk->
charge();
753 m_vx0[ii] = mdcTrk->
x();
754 m_vy0[ii] = mdcTrk->
y();
755 m_vz0[ii] = mdcTrk->
z();
758 m_px[ii] = mdcTrk->
px();
759 m_py[ii] = mdcTrk->
py();
760 m_pz[ii] = mdcTrk->
pz();
761 m_p[ii] = mdcTrk->
p();
769 m_kal_vx0[ii] = mdcKalTrk->
x();
770 m_kal_vy0[ii] = mdcKalTrk->
y();
771 m_kal_vz0[ii] = mdcKalTrk->
z();
774 m_kal_px[ii] = mdcKalTrk->
px();
775 m_kal_py[ii] = mdcKalTrk->
py();
776 m_kal_pz[ii] = mdcKalTrk->
pz();
778 t_pxy2 = m_kal_px[i]*m_kal_px[i] + m_kal_py[i]*m_kal_py[i];
779 m_kal_p[i] = sqrt(t_pxy2 + m_kal_pz[i]*m_kal_pz[i]);
780 double ptrk = m_kal_p[i];
784 pt_had+=sqrt(t_pxy2);
786 e_had+=sqrt(m_kal_p[i]*m_kal_p[i]+mdcKalTrk->
mass()*mdcKalTrk->
mass());
789 if((*itTrk)->isMdcDedxValid()) {
792 m_probPH[ii]= dedxTrk->
probPH();
793 m_normPH[ii]= dedxTrk->
normPH();
795 m_chie[ii] = dedxTrk->
chiE();
796 m_chimu[ii] = dedxTrk->
chiMu();
797 m_chipi[ii] = dedxTrk->
chiPi();
798 m_chik[ii] = dedxTrk->
chiK();
799 m_chip[ii] = dedxTrk->
chiP();
804 if((*itTrk)->isEmcShowerValid()) {
807 m_e_emc[ii] = emcTrk->
energy();
808 m_phi_emc[ii] = emcTrk->
phi();
809 m_theta_emc[ii] = emcTrk->
theta();
813 if((*itTrk)->isMucTrackValid()){
816 m_nhit_muc[ii] = mucTrk->
numHits() ;
826 if((*itTrk)->isTofTrackValid()) {
828 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
830 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
832 for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
834 status->
setStatus((*iter_tof)->status());
837 if( (status->
is_cluster()) ) m_t_etof[ii] = (*iter_tof)->tof();
838 if( !(status->
is_counter()) ){
if(status)
delete status;
continue;}
839 if( status->
layer()!=0 ) {
if(status)
delete status;
continue;}
840 double path=(*iter_tof)->path();
841 double tof = (*iter_tof)->tof();
842 double ph = (*iter_tof)->ph();
843 double rhit = (*iter_tof)->zrhit();
844 double qual = 0.0 + (*iter_tof)->quality();
845 double cntr = 0.0 + (*iter_tof)->tofID();
847 for(
int j = 0; j < 5; j++) {
849 double beta = gb/sqrt(1+gb*gb);
850 texp[j] = path /beta/
velc;
853 m_qual_etof[ii] = qual;
854 m_tof_etof[ii] = tof ;
857 if( (status->
is_cluster()) ) m_t_btof[ii] = (*iter_tof)->tof();
858 if( !(status->
is_counter()) ){
if(status)
delete status;
continue;}
859 if(status->
layer()==1){
860 double path=(*iter_tof)->path();
861 double tof = (*iter_tof)->tof();
862 double ph = (*iter_tof)->ph();
863 double rhit = (*iter_tof)->zrhit();
864 double qual = 0.0 + (*iter_tof)->quality();
865 double cntr = 0.0 + (*iter_tof)->tofID();
867 for(
int j = 0; j < 5; j++) {
869 double beta = gb/sqrt(1+gb*gb);
870 texp[j] = path /beta/
velc;
873 m_qual_btof1[ii] = qual;
874 m_tof_btof1[ii] = tof ;
877 if(status->
layer()==2){
878 double path=(*iter_tof)->path();
879 double tof = (*iter_tof)->tof();
880 double ph = (*iter_tof)->ph();
881 double rhit = (*iter_tof)->zrhit();
882 double qual = 0.0 + (*iter_tof)->quality();
883 double cntr = 0.0 + (*iter_tof)->tofID();
885 for(
int j = 0; j < 5; j++) {
887 double beta = gb/sqrt(1+gb*gb);
888 texp[j] = path /beta/
velc;
891 m_qual_btof2[ii] = qual;
892 m_tof_btof2[ii] = tof ;
895 if(status)
delete status;
907 if(m_ngch != 2 || nCharge != 0 )
return StatusCode::SUCCESS;
917 HepLorentzVector p41e,p42e,p4le;
918 Hep3Vector p31e,p32e,p3le;
919 HepLorentzVector p41m,p42m,p4lm;
920 Hep3Vector p31m,p32m,p3lm;
921 HepLorentzVector p41h,p42h,p4lh;
922 Hep3Vector p31h,p32h,p3lh;
927 for(
int i = 0; i < m_ngch; i++ ){
928 if(m_charge[i]>0)itTrk1= evtRecTrkCol->begin() + iGood[i];
929 if(m_charge[i]<0) itTrk2= evtRecTrkCol->begin() + iGood[i];
930 if(m_charge[i]>0) mdcKalTrk1 = (*itTrk1)->mdcKalTrack();
931 if(m_charge[i]<0) mdcKalTrk2 = (*itTrk2)->mdcKalTrack();
932 if(m_charge[i]>0)iip=i;
933 if(m_charge[i]<0)iim=i;
937 if(m_charge[i]<0) w2_ini=
WTrackParameter (
xmass[1],mdcKalTrk2 ->getZHelixMu(),mdcKalTrk2 ->getZErrorMu());
940 if(m_charge[i]>0) p41m =w1_ini.
p();
941 if(m_charge[i]<0) p42m =w2_ini.
p();
942 if(m_charge[i]>0) p41m.boost(
u_cms);
943 if(m_charge[i]<0) p42m.boost(
u_cms);
944 if(m_charge[i]>0) p31m = p41m.vect();
945 if(m_charge[i]<0) p32m = p42m.vect();
949 m_px_cms_ep=p41m.px();
950 m_py_cms_ep=p41m.py();
951 m_pz_cms_ep=p41m.pz();
955 m_px_cms_em=p42m.px();
956 m_py_cms_em=p42m.py();
957 m_pz_cms_em=p42m.pz();
964 double e01=(iip!=-1)?m_e_emc[iip]:0;
965 double e02=(iim!=-1)?m_e_emc[iim]:0;
966 int ilarge=( e01 > e02 ) ?iip:iim;
968 p4lm=( e01 > e02 ) ?p41m:p42m;
971 p3lm=( e01 > e02 ) ?p31m:p32m;
974 double acollm= 180.-p31m.angle(p32m)* 180.0 / CLHEP::pi;
975 double acoplm= 180.- (p31m.perpPart()).angle(p32m.perpPart ())* 180.0 / CLHEP::pi;
976 double poeb1m=p41m.rho()/beamEnergy;
977 double poeb2m=p42m.rho()/beamEnergy;
978 double poeblm=p4lm.rho()/beamEnergy;
980 double eemc1=m_e_emc[iip];
981 double eemc2=m_e_emc[iim];
984 double ex1=m_kal_vx0[iip];
985 double ey1=m_kal_vy0[iip];
986 double ez1=m_kal_vz0[iip];
987 double epx1=m_kal_px[iip];
988 double epy1=m_kal_py[iip];
989 double epz1=m_kal_pz[iip];
990 double epp1=m_kal_p[iip];
991 double ex2=m_kal_vx0[iim];
992 double ey2=m_kal_vy0[iim];
993 double ez2=m_kal_vz0[iim];
994 double epx2=m_kal_px[iim];
995 double epy2=m_kal_py[iim];
996 double epz2=m_kal_pz[iim];
997 double epp2=m_kal_p[iim];
999 double pidchidedx1=m_pidchiDedx[iip];
1000 double pidchitof11= m_pidchiTof1[iip];
1001 double pidchitof21= m_pidchiTof2[iip];
1002 double pidchidedx2=m_pidchiDedx[iim];
1003 double pidchitof12= m_pidchiTof1[iim];
1004 double pidchitof22= m_pidchiTof2[iim];
1006 double eoeb1=m_e_emc[iip]/beamEnergy;
1007 double eoeb2=m_e_emc[iim]/beamEnergy;
1011 if(p41m.rho()>0)eopm1=m_e_emc[iip]/p41m.rho();
1013 if(p42m.rho()>0)eopm2=m_e_emc[iim]/p42m.rho();
1016 double exoeb1= m_e_emc[iip]*
sin(m_theta_emc[iip])*
cos(m_phi_emc[iip])/beamEnergy;
1017 double eyoeb1= m_e_emc[iip]*
sin(m_theta_emc[iip])*
sin(m_phi_emc[iip])/beamEnergy;
1018 double ezoeb1=m_e_emc[iip]*
cos(m_theta_emc[iip])/beamEnergy;
1019 double etoeb1=m_e_emc[iip]*
sin(m_theta_emc[iip])/beamEnergy;
1021 double exoeb2= m_e_emc[iim]*
sin(m_theta_emc[iim])*
cos(m_phi_emc[iim])/beamEnergy;
1022 double eyoeb2= m_e_emc[iim]*
sin(m_theta_emc[iim])*
sin(m_phi_emc[iim])/beamEnergy;
1023 double ezoeb2=m_e_emc[iim]*
cos(m_theta_emc[iim])/beamEnergy;
1024 double etoeb2=m_e_emc[iim]*
sin(m_theta_emc[iim])/beamEnergy;
1026 double eoebl=m_e_emc[ilarge]/beamEnergy;
1029 if(p4lm.rho()>0)eopl=m_e_emc[ilarge]/p4lh.rho();
1031 double exoebl= m_e_emc[ilarge]*
sin(m_theta_emc[ilarge])*
cos(m_phi_emc[ilarge])/beamEnergy;
1032 double eyoebl= m_e_emc[ilarge]*
sin(m_theta_emc[ilarge])*
sin(m_phi_emc[ilarge])/beamEnergy;
1033 double ezoebl=m_e_emc[ilarge]*
cos(m_theta_emc[ilarge])/beamEnergy;
1034 double etoebl=m_e_emc[ilarge]*
sin(m_theta_emc[ilarge])/beamEnergy;
1036 int mucinfo1=(m_nhit_muc[iip]>=2&&m_nlay_muc[iip]>=2 ) ? 1 : 0;
1037 int mucinfo2=(m_nhit_muc[iim]>=2&&m_nlay_muc[iim]>=2) ? 1 : 0;
1038 int mucinfol=(m_nhit_muc[ilarge]>=2&&m_nlay_muc[ilarge]>=2) ? 1 : 0;
1039 int pidel=( e01 > e02 ) ? m_nep : m_nem;
1040 int pidmul=( e01 > e02 ) ? m_nmup : m_nmum;
1043 if(m_t_btof[iip]*m_t_btof[iim]!=0) deltatof+=fabs(m_t_btof[iip]-m_t_btof[iim]);
1044 if(m_t_etof[iip]*m_t_etof[iim]!=0) deltatof+=fabs(m_t_etof[iip]-m_t_etof[iim]);
1047 if(acollm<m_acoll_mu_cut)m_dimutag+=1;
1048 if (acoplm<m_acopl_mu_cut)m_dimutag+=10;
1049 if (fabs(m_ecms-
mpsi2s)<0.001){
1050 if((sqrt(((poeb1m-poeb2m)/0.35)*((poeb1m-poeb2m)/0.35)+((poeb1m+poeb2m-1.68)/0.125)*((poeb1m+poeb2m-1.68)/0.125))>m_tptotal_mu_cut)
1051 &&(((poeb1m>=m_tpoebh_mu_cut)&&(poeb2m>=m_tpoebl_mu_cut))
1052 ||((poeb2m>=m_tpoebh_mu_cut)&&(poeb1m>=m_tpoebl_mu_cut))))m_dimutag+=100;
1055 if((fabs(poeb1m-1)<m_poeb_mu_cut)&&(fabs(poeb2m-1)<m_poeb_mu_cut))m_dimutag+=100;
1057 if(!m_useTOF||(deltatof<m_dtof_mu_cut))m_dimutag+=1000;
1058 if(!m_useMUC||(mucinfo1==1&&mucinfo2==1))m_dimutag+=10000;
1059 if(etoeb1<m_eoeb_mu_cut&&eoeb2<m_eoeb_mu_cut)m_dimutag+=100000;
1060 if(etoeb1+etoeb2<m_etotal_mu_cut)m_dimutag+=1000000;
1061 if(!m_usePID||(m_nmup==1&&m_nmum==1))m_dimutag+=10000000;
1075 m_cos_ep=p41m.cosTheta ();
1076 m_cos_em=p42m.cosTheta ();
1077 m_mass_ee=(p41m+p42m).m();
1079 m_deltatof=deltatof;
1086 m_mucinfo1=mucinfo1;
1087 m_mucinfo2=mucinfo2;
1089 if(m_dimutag==11111111){
1096 (*itTrk1)->tagMuon();
1097 (*itTrk2)->tagMuon();
1105 (*itTrk1)->setQuality(0);
1106 (*itTrk2)->setQuality(0);
1110 setFilterPassed(
true);
1115 m_mumu_mass->Fill((p41m+p42m).m());
1116 m_mumu_acoll->Fill(acollm);
1117 m_mumu_eop_mup->Fill(eopm1);
1118 m_mumu_eop_mum->Fill(eopm2);
1119 m_mumu_costheta_mup->Fill(p41m.cosTheta ());
1120 m_mumu_costheta_mum->Fill(p42m.cosTheta ());
1121 m_mumu_phi_mup->Fill(p41m.phi ());
1122 m_mumu_phi_mum->Fill(p42m.phi ());
1123 m_mumu_nneu->Fill(m_nGam);
1124 m_mumu_nhit->Fill(m_nhit_muc[ilarge]);
1125 m_mumu_nlay->Fill(m_nlay_muc[ilarge]);
1128 m_mumu_eemc_mup->Fill(eemc1);
1129 m_mumu_eemc_mum->Fill(eemc2);
1131 m_mumu_x_mup->Fill(ex1);
1132 m_mumu_y_mup->Fill(ey1);
1133 m_mumu_z_mup->Fill(ez1);
1135 m_mumu_x_mum->Fill(ex2);
1136 m_mumu_y_mum->Fill(ey2);
1137 m_mumu_z_mum->Fill(ez2);
1140 m_mumu_px_mup->Fill(epx1);
1141 m_mumu_py_mup->Fill(epy1);
1142 m_mumu_pz_mup->Fill(epz1);
1143 m_mumu_p_mup->Fill(epp1);
1145 m_mumu_px_mum->Fill(epx2);
1146 m_mumu_py_mum->Fill(epy2);
1147 m_mumu_pz_mum->Fill(epz2);
1148 m_mumu_p_mum->Fill(epp2);
1150 m_mumu_deltatof->Fill(deltatof);
1152 m_mumu_pidchidedx_mup->Fill(pidchidedx1);
1153 m_mumu_pidchidedx_mum->Fill(pidchidedx2);
1154 m_mumu_pidchitof1_mup->Fill(pidchitof11);
1155 m_mumu_pidchitof1_mum->Fill(pidchitof12);
1156 m_mumu_pidchitof2_mup->Fill(pidchitof21);
1157 m_mumu_pidchitof2_mum->Fill(pidchitof22);
1159 if(m_writentuple)m_tuple1 -> write();
1169 return StatusCode::SUCCESS;