BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Single.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/AlgFactory.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5#include "GaudiKernel/IDataProviderSvc.h"
6#include "GaudiKernel/PropertyMgr.h"
8#include "GaudiKernel/Bootstrap.h"
9#include "GaudiKernel/ISvcLocator.h"
10
12#include "EventModel/Event.h"
13
19#include "McTruth/McParticle.h"
20
21#include "TMath.h"
22#include "GaudiKernel/INTupleSvc.h"
23#include "GaudiKernel/NTuple.h"
24#include "GaudiKernel/Bootstrap.h"
25#include "GaudiKernel/IHistogramSvc.h"
26#include "CLHEP/Vector/ThreeVector.h"
27#include "CLHEP/Vector/LorentzVector.h"
28#include "CLHEP/Vector/TwoVector.h"
29using CLHEP::Hep3Vector;
30using CLHEP::Hep2Vector;
31using CLHEP::HepLorentzVector;
32#include "CLHEP/Geometry/Point3D.h"
33#ifndef ENABLE_BACKWARDS_COMPATIBILITY
35#endif
36#include "SingleAlg/Single.h"
37
39#include "VertexFit/VertexFit.h"
40#include "VertexFit/Helix.h"
42
43#include <vector>
44
45typedef std::vector<int> Vint;
46typedef std::vector<HepLorentzVector> Vp4;
47
49
50
51/////////////////////////////////////////////////////////////////////////////
52DECLARE_COMPONENT(Single)
53Single::Single(const std::string& name, ISvcLocator* pSvcLocator) :
54 Algorithm(name, pSvcLocator) {
55 //Declare the properties
56 declareProperty("Vxy0cut", m_vxy0cut=2.0);
57 declareProperty("Vz0cut", m_vz0cut=20.0);
58 declareProperty("angdcut", m_angdcut=30.0);
59 declareProperty("CheckDedx", m_checkDedx = 1);
60 declareProperty("CheckTof", m_checkTof = 1);
61 declareProperty("CheckExt", m_checkExt = 1);
62 declareProperty("CheckEmc", m_checkEmc = 1);
63 declareProperty("CheckMuc", m_checkMuc = 1);
64 declareProperty("ParticleID", m_particleID = -211);
65 declareProperty("Itrack", m_itrack = 0);
66 declareProperty("PID_mode", m_pid_mode = 0);//0:Combine 1:Only Dedx 2:Only Tof
67
68}
69
70
71// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
72StatusCode Single::initialize(){
73 MsgStream log(msgSvc(), name());
74
75 log << MSG::INFO << "in initialize()" << endmsg;
76
77 StatusCode status;
78 NTuplePtr nt1(ntupleSvc(), "FILE1/mdctrack");
79 if ( nt1 ) m_tuple1 = nt1;
80 else {
81 m_tuple1 = ntupleSvc()->book ("FILE1/mdctrack", CLID_ColumnWiseTuple, "ks N-Tuple example");
82 if ( m_tuple1 ) {
83 status = m_tuple1->addItem ("mdc_vx0", m_vx0);
84 status = m_tuple1->addItem ("mdc_vy0", m_vy0);
85 status = m_tuple1->addItem ("mdc_vz0", m_vz0);
86 status = m_tuple1->addItem ("mdc_pch", m_pch);
87 status = m_tuple1->addItem ("mdc_trackid", m_trackid);
88 status = m_tuple1->addItem ("mdc_charge", m_charge);
89 status = m_tuple1->addItem ("mdc_pxy0", m_pxy0);
90 status = m_tuple1->addItem ("mdc_px0", m_px0);
91 status = m_tuple1->addItem ("mdc_py0", m_py0);
92 status = m_tuple1->addItem ("mdc_pz0", m_pz0);
93 status = m_tuple1->addItem ("mdc_r0", m_r0);
94 status = m_tuple1->addItem ("mdc_phi", m_phi);
95 status = m_tuple1->addItem ("mdc_theta", m_theta);
96 status = m_tuple1->addItem ("mdc_ndof", m_ndof);
97 status = m_tuple1->addItem ("mdc_nster", m_nster);
98 status = m_tuple1->addItem ("mdc_stat", m_stat);
99 status = m_tuple1->addItem ("mdc_angd", m_angd);
100 status = m_tuple1->addItem ("mdc_rvxy0", m_rvxy0);
101 status = m_tuple1->addItem ("mdc_rvz0", m_rvz0);
102 status = m_tuple1->addItem ("mdc_d0", m_d0);
103 status = m_tuple1->addItem ("mdc_phi0", m_phi0);
104 status = m_tuple1->addItem ("mdc_kappa", m_kappa);
105 status = m_tuple1->addItem ("mdc_dz", m_dzhelix);
106 status = m_tuple1->addItem ("mdc_tanlamda", m_tanlamda);
107 status = m_tuple1->addItem ("mdc_err11", m_err11);
108 status = m_tuple1->addItem ("mdc_err21", m_err21);
109 status = m_tuple1->addItem ("mdc_err22", m_err22);
110 status = m_tuple1->addItem ("mdc_err31", m_err31);
111 status = m_tuple1->addItem ("mdc_err32", m_err32);
112 status = m_tuple1->addItem ("mdc_err33", m_err33);
113 status = m_tuple1->addItem ("mdc_err41", m_err41);
114 status = m_tuple1->addItem ("mdc_err42", m_err42);
115 status = m_tuple1->addItem ("mdc_err43", m_err43);
116 status = m_tuple1->addItem ("mdc_err44", m_err44);
117 status = m_tuple1->addItem ("mdc_err51", m_err51);
118 status = m_tuple1->addItem ("mdc_err52", m_err52);
119 status = m_tuple1->addItem ("mdc_err53", m_err53);
120 status = m_tuple1->addItem ("mdc_err54", m_err54);
121 status = m_tuple1->addItem ("mdc_err55", m_err55);
122
123 status = m_tuple1->addItem ("mdc_kal_px", m_mdc_kal_px);
124 status = m_tuple1->addItem ("mdc_kal_py", m_mdc_kal_py);
125 status = m_tuple1->addItem ("mdc_kal_pz", m_mdc_kal_pz);
126 status = m_tuple1->addItem ("mdc_kal_p", m_mdc_kal_p);
127 status = m_tuple1->addItem ("mdc_kal_pxy", m_mdc_kal_pxy);
128 status = m_tuple1->addItem ("mdc_kal_costheta", m_mdc_kal_costheta);
129
130 status = m_tuple1->addItem ("NGch", m_ngch);
131 }
132 else {
133 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
134 return StatusCode::FAILURE;
135 }
136 }
137
138 // check mdctrack
139
140
141 if(m_checkDedx==1){
142 NTuplePtr nt2(ntupleSvc(), "FILE1/dedx");
143 if ( nt2 ) m_tuple2 = nt2;
144 else {
145 m_tuple2 = ntupleSvc()->book ("FILE1/dedx", CLID_ColumnWiseTuple, "ks N-Tuple example");
146 if ( m_tuple2 ) {
147 status = m_tuple2->addItem ("dedx_ptrk", m_ptrk);
148 status = m_tuple2->addItem ("dedx_chie", m_chie);
149 status = m_tuple2->addItem ("dedx_chimu", m_chimu);
150 status = m_tuple2->addItem ("dedx_chipi", m_chipi);
151 status = m_tuple2->addItem ("dedx_chik", m_chik);
152 status = m_tuple2->addItem ("dedx_chip", m_chip);
153 status = m_tuple2->addItem ("dedx_probPH", m_probPH);
154 status = m_tuple2->addItem ("dedx_normPH", m_normPH);
155 status = m_tuple2->addItem ("dedx_ghit", m_ghit);
156 status = m_tuple2->addItem ("dedx_thit", m_thit);
157 }
158 else {
159 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple2) << endmsg;
160 return StatusCode::FAILURE;
161 }
162 }
163 }
164 // check dE/dx
165
166
167 if(m_checkExt==1){
168 NTuplePtr nt3(ntupleSvc(), "FILE1/ext");
169 if ( nt3 ) m_tuple3 = nt3;
170 else {
171 m_tuple3 = ntupleSvc()->book ("FILE1/ext",CLID_ColumnWiseTuple, "ks N-Tuple example");
172 if ( m_tuple3 ) {
173
174 status = m_tuple3->addItem ("ext_tof1", m_tof1);
175 status = m_tuple3->addItem ("ext_tof1path", m_tof1path);
176 status = m_tuple3->addItem ("ext_tof1z", m_tof1z);
177 status = m_tuple3->addItem ("ext_tof1t", m_tof1t);
178 status = m_tuple3->addItem ("ext_tof1x", m_tof1x);
179 status = m_tuple3->addItem ("ext_tof1y", m_tof1y);
180
181 status = m_tuple3->addItem ("ext_tof2", m_tof2);
182 status = m_tuple3->addItem ("ext_tof2path", m_tof2path);
183 status = m_tuple3->addItem ("ext_tof2z", m_tof2z);
184 status = m_tuple3->addItem ("ext_tof2t", m_tof2t);
185 status = m_tuple3->addItem ("ext_tof2x", m_tof2x);
186 status = m_tuple3->addItem ("ext_tof2y", m_tof2y);
187
188 status = m_tuple3->addItem ("ext_emctheta", m_emctheta);
189 status = m_tuple3->addItem ("ext_emcphi", m_emcphi);
190 status = m_tuple3->addItem ("ext_emcpath", m_emcpath);
191
192 status = m_tuple3->addItem ("ext_mucz", m_mucz);
193 status = m_tuple3->addItem ("ext_muct", m_muct);
194 status = m_tuple3->addItem ("ext_mucx", m_mucx);
195 status = m_tuple3->addItem ("ext_mucy", m_mucy);
196
197
198 }
199 else {
200 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple3) << endmsg;
201 return StatusCode::FAILURE;
202 }
203 }
204 }
205 //check exttrack
206
207
208
209
210 if(m_checkTof==1){
211 NTuplePtr nt4(ntupleSvc(), "FILE1/tof");
212 if ( nt4 ) m_tuple4 = nt4;
213 else {
214 m_tuple4 = ntupleSvc()->book ("FILE1/tof", CLID_ColumnWiseTuple, "ks N-Tuple example");
215 if ( m_tuple2 ) {
216 status = m_tuple4->addItem ("tof_path", m_path);
217 status = m_tuple4->addItem ("tof_zrhit", m_zrhit);
218 status = m_tuple4->addItem ("tof_ph", m_ph);
219 status = m_tuple4->addItem ("tof_tof", m_tof);
220 status = m_tuple4->addItem ("tof_errtof", m_errtof);
221 status = m_tuple4->addItem ("tof_beta", m_beta);
222 status = m_tuple4->addItem ("tof_texpe", m_texpe);
223 status = m_tuple4->addItem ("tof_texpmu", m_texpmu);
224 status = m_tuple4->addItem ("tof_texppi", m_texppi);
225 status = m_tuple4->addItem ("tof_texpka", m_texpka);
226 status = m_tuple4->addItem ("tof_texppro", m_texppro);
227 status = m_tuple4->addItem ("tof_toffsete", m_toffsete);
228 status = m_tuple4->addItem ("tof_toffsetmu", m_toffsetmu);
229 status = m_tuple4->addItem ("tof_toffsetpi", m_toffsetpi);
230 status = m_tuple4->addItem ("tof_toffsetka", m_toffsetka);
231 status = m_tuple4->addItem ("tof_toffsetpro", m_toffsetpro);
232 status = m_tuple4->addItem ("tof_toffsetatpr", m_toffsetatpr);
233 status = m_tuple4->addItem ("tof_sigmae", m_sigmae);
234 status = m_tuple4->addItem ("tof_sigmamu", m_sigmamu);
235 status = m_tuple4->addItem ("tof_sigmapi", m_sigmapi);
236 status = m_tuple4->addItem ("tof_sigmaka", m_sigmaka);
237 status = m_tuple4->addItem ("tof_sigmapro", m_sigmapro);
238 status = m_tuple4->addItem ("tof_sigmaatpr", m_sigmaatpr);
239 status = m_tuple4->addItem ("tof_quality", m_quality);
240 status = m_tuple4->addItem ("tof_t0", m_t0);
241 status = m_tuple4->addItem ("tof_errt0", m_errt0);
242 status = m_tuple4->addItem ("tof_errz", m_errz);
243 status = m_tuple4->addItem ("tof_phi", m_phitof);
244 status = m_tuple4->addItem ("tof_errphi", m_errphi);
245 status = m_tuple4->addItem ("tof_energy", m_energy);
246 status = m_tuple4->addItem ("tof_errenergy", m_errenergy);
247 }
248 else {
249 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple4) << endmsg;
250 return StatusCode::FAILURE;
251 }
252 }
253 }
254 //check tof
255
256
257
258 if(m_checkEmc==1){
259 NTuplePtr nt5(ntupleSvc(), "FILE1/emc");
260 if ( nt5 ) m_tuple5 = nt5;
261 else {
262 m_tuple5 = ntupleSvc()->book ("FILE1/emc",CLID_ColumnWiseTuple, "ks N-Tuple example");
263 if ( m_tuple5 ) {
264
265 status = m_tuple5->addItem ("emc_x", m_x);
266 status = m_tuple5->addItem ("emc_y", m_y);
267 status = m_tuple5->addItem ("emc_z", m_z);
268 status = m_tuple5->addItem ("emc_theta", m_thetaemc);
269 status = m_tuple5->addItem ("emc_phi", m_phiemc);
270 status = m_tuple5->addItem ("emc_dx", m_dx);
271 status = m_tuple5->addItem ("emc_dy", m_dy);
272 status = m_tuple5->addItem ("emc_dz", m_dz);
273 status = m_tuple5->addItem ("emc_dtheta", m_dtheta);
274 status = m_tuple5->addItem ("emc_dphi", m_dphi);
275 status = m_tuple5->addItem ("emc_energy", m_energyemc);
276 status = m_tuple5->addItem ("emc_dE", m_de);
277 status = m_tuple5->addItem ("emc_eseed", m_eseed);
278 status = m_tuple5->addItem ("emc_e3x3", m_e3x3);
279 status = m_tuple5->addItem ("emc_e5x5", m_e5x5);
280 status = m_tuple5->addItem ("emc_secp", m_secp);
281 status = m_tuple5->addItem ("emc_latp", m_latp);
282 }
283 else {
284 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple5) << endmsg;
285 return StatusCode::FAILURE;
286 }
287 }
288 }
289 //check emc
290
291 if(m_checkMuc==1){
292 NTuplePtr nt6(ntupleSvc(), "FILE1/muc");
293 if ( nt6 ) m_tuple6 = nt6;
294 else {
295 m_tuple6 = ntupleSvc()->book ("FILE1/muc",CLID_ColumnWiseTuple, "ks N-Tuple example");
296 if ( m_tuple6 ) {
297
298 status = m_tuple6->addItem ("muc_depth", m_depth);
299 status = m_tuple6->addItem ("muc_chi2", m_chi2);
300 status = m_tuple6->addItem ("muc_rms", m_rms);
301 status = m_tuple6->addItem ("muc_xpos", m_xpos);
302 status = m_tuple6->addItem ("muc_ypos", m_ypos);
303 status = m_tuple6->addItem ("muc_zpos", m_zpos);
304 status = m_tuple6->addItem ("muc_xsigma", m_xpossigma);
305 status = m_tuple6->addItem ("muc_ysigma", m_ypossigma);
306 status = m_tuple6->addItem ("muc_zsigma", m_zpossigma);
307 status = m_tuple6->addItem ("muc_px", m_px);
308 status = m_tuple6->addItem ("muc_py", m_py);
309 status = m_tuple6->addItem ("muc_pz", m_pz);
310 status = m_tuple6->addItem ("muc_distance", m_distance);
311 status = m_tuple6->addItem ("muc_deltaphi", m_deltaphi);
312 }
313 else {
314 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple6) << endmsg;
315 return StatusCode::FAILURE;
316 }
317 }
318 }
319 //check muc
320
321
322
323 NTuplePtr nt7(ntupleSvc(), "FILE1/runinfo");
324 if ( nt7 ) m_tuple7 = nt7;
325 else {
326 m_tuple7 = ntupleSvc()->book ("FILE1/runinfo",CLID_ColumnWiseTuple, "ks N-Tuple example");
327 if ( m_tuple7 ) {
328
329 status = m_tuple7->addItem ("runinfo_runNo", m_runNo);
330 status = m_tuple7->addItem ("runinfo_event", m_event);
331 status = m_tuple7->addItem ("runinfo_totcharged", m_totcharged);
332 status = m_tuple7->addItem ("runinfo_totneutral", m_totneutral);
333 status = m_tuple7->addItem ("runinfo_tottracks", m_tottracks);
334 status = m_tuple7->addItem ("runinfo_ngood", m_ngood);
335 status = m_tuple7->addItem ("runinfo_ncharge", m_ncharge);
336 status = m_tuple7->addItem ("kal_n", m_kaln);
337 status = m_tuple7->addItem ("costheta_n", m_costhetan);
338 status = m_tuple7->addItem ("p_n", m_pn);
339 status = m_tuple7->addItem ("charge", m_mat_charge);
340 status = m_tuple7->addItem ("diff_pxy", m_diff_pxy);
341 status = m_tuple7->addItem ("diff_p", m_diff_pch);
342 status = m_tuple7->addItem ("diff_costheta", m_diff_costheta);
343 }
344 else {
345 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple7) << endmsg;
346 return StatusCode::FAILURE;
347 }
348 }
349 //check runinfo
350
351
352
353 NTuplePtr nt8(ntupleSvc(), "FILE1/mcpart");
354 if ( nt8 ) m_tuple8 = nt8;
355 else {
356 m_tuple8 = ntupleSvc()->book ("FILE1/mcpart",CLID_ColumnWiseTuple, "ks N-Tuple example");
357 if ( m_tuple8 ) {
358 status = m_tuple8->addItem ("mcpart_vx", m_vx);
359 status = m_tuple8->addItem ("mcpart_vy", m_vy);
360 status = m_tuple8->addItem ("mcpart_vz", m_vz);
361 status = m_tuple8->addItem ("mcpart_vr0", m_vr0);
362 status = m_tuple8->addItem ("mcpart_px", m_pxmc);
363 status = m_tuple8->addItem ("mcpart_py", m_pymc);
364 status = m_tuple8->addItem ("mcpart_pz", m_pzmc);
365 status = m_tuple8->addItem ("mcpart_e", m_e);
366 status = m_tuple8->addItem ("mcpart_p", m_p);
367 status = m_tuple8->addItem ("mcpart_pxy", m_pxymc);
368 status = m_tuple8->addItem ("mcpart_theta", m_thetamc);
369 status = m_tuple8->addItem ("mcpart_costheta", m_costhetamc);
370
371 status = m_tuple8->addItem ("mcpart_phi", m_phimc);
372 status = m_tuple8->addItem ("mcpart_m", m_m);
373 status = m_tuple8->addItem ("mcpart_pro", m_pro);
374 status = m_tuple8->addItem ("mcpart_index", m_index);
375 status = m_tuple8->addItem ("totalcharged", m_mctotcharged);
376
377
378 }
379 else {
380 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple8) << endmsg;
381 return StatusCode::FAILURE;
382 }
383 }
384 //check mctruth
385
386
387 NTuplePtr nt9(ntupleSvc(), "FILE1/pid_kal");
388 if ( nt9 ) m_tuple9 = nt9;
389 else {
390 m_tuple9 = ntupleSvc()->book ("FILE1/pid_kal", CLID_ColumnWiseTuple, "ks N-Tuple example");
391 if ( m_tuple9 ) {
392 status = m_tuple9->addItem ("pid_ptrk", m_ptrk_pid);
393 status = m_tuple9->addItem ("pid_cost", m_cost_pid);
394 status = m_tuple9->addItem ("pid_dedx", m_dedx_pid);
395 status = m_tuple9->addItem ("pid_tof1", m_tof1_pid);
396 status = m_tuple9->addItem ("pid_tof2", m_tof2_pid);
397 status = m_tuple9->addItem ("prob_pion", m_prob_pid_pion);
398 status = m_tuple9->addItem ("prob_kaon", m_prob_pid_kaon);
399 status = m_tuple9->addItem ("prob_proton", m_prob_pid_proton);
400
401 status = m_tuple9->addItem ("kal_px", m_kalpx);
402 status = m_tuple9->addItem ("kal_py", m_kalpy);
403 status = m_tuple9->addItem ("kal_pz", m_kalpz);
404 status = m_tuple9->addItem ("kal_p", m_kalp);
405 status = m_tuple9->addItem ("kal_pxy", m_kalpxy);
406
407 status = m_tuple9->addItem ("kal_costheta", m_kalcostheta);
408
409 status = m_tuple9->addItem ("kal_d0", m_d0kal);
410 status = m_tuple9->addItem ("kal_phi0", m_phi0kal);
411 status = m_tuple9->addItem ("kal_kappa", m_kappakal);
412 status = m_tuple9->addItem ("kal_dz", m_dzhelixkal);
413 status = m_tuple9->addItem ("kal_tanlamda", m_tanlamdakal);
414 status = m_tuple9->addItem ("kal_err11", m_err11kal);
415 status = m_tuple9->addItem ("kal_err21", m_err21kal);
416 status = m_tuple9->addItem ("kal_err22", m_err22kal);
417 status = m_tuple9->addItem ("kal_err31", m_err31kal);
418 status = m_tuple9->addItem ("kal_err32", m_err32kal);
419 status = m_tuple9->addItem ("kal_err33", m_err33kal);
420 status = m_tuple9->addItem ("kal_err41", m_err41kal);
421 status = m_tuple9->addItem ("kal_err42", m_err42kal);
422 status = m_tuple9->addItem ("kal_err43", m_err43kal);
423 status = m_tuple9->addItem ("kal_err44", m_err44kal);
424 status = m_tuple9->addItem ("kal_err51", m_err51kal);
425 status = m_tuple9->addItem ("kal_err52", m_err52kal);
426 status = m_tuple9->addItem ("kal_err53", m_err53kal);
427 status = m_tuple9->addItem ("kal_err54", m_err54kal);
428 status = m_tuple9->addItem ("kal_err55", m_err55kal);
429 status = m_tuple9->addItem ("kal_nn", m_kalnn);
430 status = m_tuple9->addItem ("costheta_nn", m_costhetann);
431 status = m_tuple9->addItem ("p_nn", m_pnn);
432
433 status = m_tuple9->addItem ("comp_costheta", m_comp_costheta);
434
435
436 }
437 else {
438 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple9) << endmsg;
439 return StatusCode::FAILURE;
440 }
441 }
442 //check pid and kaltrack
443
444
445 //
446 //--------End of book--------
447 //
448
449 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
450 return StatusCode::SUCCESS;
451
452}
453
454// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
455StatusCode Single::execute() {
456 setFilterPassed(false);
457 //std::cout << "execute()" << std::endl;
458
459 MsgStream log(msgSvc(), name());
460 log << MSG::INFO << "in execute()" << endreq;
461
462
463 // runinfo
464 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
465 int runNo=eventHeader->runNumber();
466 int event=eventHeader->eventNumber();
467 log << MSG::DEBUG <<"run, evtnum = "
468 << runNo << " , "
469 << event <<endreq;
470
471
472 //cout<<"event "<<event<<endl;
473 Ncut0++;
474
475 m_runNo=runNo;
476 m_event=event;
477
478
479
480 SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
481 // log << MSG::INFO << "get event tag OK" << endreq;
482 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
483 << evtRecEvent->totalCharged() << " , "
484 << evtRecEvent->totalNeutral() << " , "
485 << evtRecEvent->totalTracks() <<endreq;
486
487 SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
488
489 Vint iGood;
490 iGood.clear();
491
492 int nCharge = 0;
493
494 Hep3Vector xorigin(0,0,0);
495 IVertexDbSvc* vtxsvc;
496 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
497 if(vtxsvc->isVertexValid()){
498 double* dbv = vtxsvc->PrimaryVertex();
499 double* vv = vtxsvc->SigmaPrimaryVertex();
500
501 xorigin.setX(dbv[0]);
502 xorigin.setY(dbv[1]);
503 xorigin.setZ(dbv[2]);
504 }
505
506 //
507 // check McParticle infomation
508 //
509
510 SmartDataPtr<Event::McParticleCol> mcParticleCol(eventSvc(),"/Event/MC/McParticleCol");
511 if(!mcParticleCol){
512 std::cout<<"could not retrieve McParticleCol"<<std::endl;
513 return StatusCode::FAILURE;
514 }
515
516 double costhetamc=-9.;
517 Event::McParticleCol::iterator iter_mc=mcParticleCol->begin();
518 HepLorentzVector initialFourMomentum;
519 for(;iter_mc!=mcParticleCol->end();iter_mc++){
520 if(abs((*iter_mc)->particleProperty())!=abs(m_particleID))continue;
521 HepLorentzVector initialPosition=(*iter_mc)->initialPosition();
522 m_vx=initialPosition.x();
523 m_vy=initialPosition.y();
524 m_vz=initialPosition.z();
525 m_vr0=sqrt(m_vx*m_vx+m_vy*m_vy);
526
527 initialFourMomentum=(*iter_mc)->initialFourMomentum();
528 m_pxmc=initialFourMomentum.px();
529 m_pymc=initialFourMomentum.py();
530 m_pzmc=initialFourMomentum.pz();
531 m_e=initialFourMomentum.e();
532 m_p=sqrt(m_pxmc*m_pxmc+m_pymc*m_pymc+m_pzmc*m_pzmc);
533 m_pxymc=sqrt(m_pxmc*m_pxmc+m_pymc*m_pymc);
534 m_thetamc=initialFourMomentum.theta()*180/(CLHEP::pi);
535 m_phimc=initialFourMomentum.phi()*180/(CLHEP::pi);
536 m_m=initialFourMomentum.m();
537 m_costhetamc=initialFourMomentum.cosTheta();
538
539 costhetamc=m_costhetamc;
540
541 m_pro=(*iter_mc)->particleProperty();
542 m_index=(*iter_mc)->trackIndex();
543
544 }
545 m_mctotcharged=evtRecEvent->totalCharged();
546
547 int mm=0;
548 if(m_costhetamc>-0.7&&m_costhetamc<0.7&&m_pxymc>0.2&&m_pxymc<0.3) mm=1;
549
550 double pxymc=m_pxymc;
551 double pmc=m_p;
552 //if(m_mctotcharged==0&&m_costhetamc>-0.7&&m_costhetamc<-0.6&&m_pxymc>0.25&&m_pxymc<0.3) cout<<"runNo="<<runNo<<" event"<<event<<endl;
553 // if(m_mctotcharged==0&&m_costhetamc>-0.7&&m_costhetamc<-0.6&&m_pxymc>0.35&&m_pxymc<0.4) cout<<"runNo1="<<runNo<<" event1"<<event<<endl;
554 m_tuple8->write();
555
556
557
558 //
559 // check MdcTrack infomation
560 //
561
562
563 int itrack=0;
564
565
566 double Rz_comp=30.;
567 double Rxy_comp=10.;
568 double Rang_comp=50.;
569
570 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
571 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
572 if(!(*itTrk)->isMdcTrackValid()) continue;
573 if(!(*itTrk)->isMdcKalTrackValid()) continue;
574 RecMdcTrack *mdcTrk = (*itTrk)->mdcTrack();
575 RecMdcTrack *mdcKalTrk = (*itTrk)->mdcTrack();
576 double pch=mdcTrk->p();
577 double x0=mdcTrk->x();
578 double y0=mdcTrk->y();
579 double z0=mdcTrk->z();
580 int trackid=mdcTrk->trackId();
581 int charge=mdcTrk->charge();
582 double pxy0=mdcTrk->pxy();
583 double px0=mdcTrk->px();
584 double py0=mdcTrk->py();
585 double pz0=mdcTrk->pz();
586 double r0 = mdcTrk->r();
587 double phi=mdcTrk->phi()*180/(CLHEP::pi);
588 double theta=mdcTrk->theta()*180/(CLHEP::pi);
589 int ndof=mdcTrk->ndof();
590 int nster=mdcTrk->nster();
591 int stat= mdcTrk->stat();
592
593 double phi0=mdcTrk->helix(1);
594 double xv=xorigin.x();
595 double yv=xorigin.y();
596 double Rxy=(x0-xv)*cos(phi0)+(y0-yv)*sin(phi0);
597
598 m_vx0 = x0;
599 m_vy0 = y0;
600 m_vz0 = z0;
601 m_pch = pch;
602 m_trackid = trackid;
603 m_charge = charge;
604 m_pxy0=pxy0;
605 m_px0=px0;
606 m_py0=py0;
607 m_pz0=pz0;
608 m_r0=r0;
609 m_phi=phi;
610 m_theta=theta;
611 m_ndof=ndof;
612 m_nster=nster;
613 m_stat=stat;
614 m_vr0 = Rxy;
615
616 HepVector a = mdcTrk->helix();
617 m_d0=a[0];
618 m_phi0=a[1];
619 m_kappa=a[2];
620 m_dzhelix=a[3];
621 m_tanlamda=a[4];
622
623 HepSymMatrix Ea = mdcTrk->err();
624
625 m_err11=Ea[0][0];
626 m_err21=Ea[1][0];
627 m_err22=Ea[1][1];
628 m_err31=Ea[2][0];
629 m_err32=Ea[2][1];
630 m_err33=Ea[2][2];
631 m_err41=Ea[3][0];
632 m_err42=Ea[3][1];
633 m_err43=Ea[3][2];
634 m_err44=Ea[3][3];
635 m_err51=Ea[4][0];
636 m_err52=Ea[4][1];
637 m_err53=Ea[4][2];
638 m_err54=Ea[4][3];
639 m_err55=Ea[4][4];
640
641
642 HepPoint3D point0(0.,0.,0.); // the initial point for MDC recosntruction
643 HepPoint3D IP(xorigin[0],xorigin[1],xorigin[2]);
644 VFHelix helixip(point0,a,Ea);
645 helixip.pivot(IP);
646 HepVector vecipa = helixip.a();
647 double Rvxy0=fabs(vecipa[0]); //the nearest distance to IP in xy plane
648 double Rvz0=vecipa[3]; //the nearest distance to IP in z direction
649 double Rvphi0=vecipa[1];
650 m_rvxy0=Rvxy0;
651 m_rvz0=Rvz0;
652 // m_rvphi0=Rvphi0;
653
654 HepLorentzVector mdcpos(m_px0,m_py0,m_pz0,m_e);
655 m_angd=initialFourMomentum.angle(mdcpos)*180/(CLHEP::pi);
656
657 if(fabs(Rvz0) >= m_vz0cut) continue;
658 if(fabs(Rvxy0) >= m_vxy0cut) continue;
659 //if(m_angd>m_angdcut) continue;
660
661 if(m_angd<Rang_comp){
662 //if(Rvz0<Rz_comp||Rvxy0<Rxy_comp||m_angd<Rang_comp){
663 Rz_comp=Rvz0;
664 Rxy_comp=Rvxy0;
665 Rang_comp=m_angd;
666 itrack=i;
667 }
668 // nCharge += mdcTrk->charge();
669//if(nCharge!=-1) continue;
670 //m_tuple1->write();
671 iGood.push_back(i);
672 nCharge += mdcTrk->charge();
673 }
674
675//if(nCharge!=-1) return StatusCode::SUCCESS;
676
677
678 //
679 // Finish MdcTrack and Good Charged Track Selection
680 //
681
682
683 int nGood = iGood.size();
684 log << MSG::DEBUG << "nGood, totcharge = " << nGood << " , " << nCharge << endreq;
685 //cout << "nGood, totcharge = " << nGood << " , " << nCharge << endl;
686 if(mm==1&&nGood==0) setFilterPassed(true);
687
688 m_ngch=nGood;
689 m_ncharge=nCharge;
690 for(int i = 0; i < nGood; i++) {
691 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGood[i];
692
693 RecMdcKalTrack* mdcKalTrk = (*itTrk)->mdcKalTrack();
694 if(abs(m_particleID)==211) RecMdcKalTrack::setPidType (RecMdcKalTrack::pion);
695 if(abs(m_particleID)==321) RecMdcKalTrack::setPidType (RecMdcKalTrack::kaon);
696 if(abs(m_particleID)==2212) RecMdcKalTrack::setPidType (RecMdcKalTrack::proton);
699
700 m_mdc_kal_px=mdcKalTrk->px();
701 m_mdc_kal_py=mdcKalTrk->py();
702 m_mdc_kal_pz=mdcKalTrk->pz();
703 m_mdc_kal_p=sqrt(m_mdc_kal_px*m_mdc_kal_px+m_mdc_kal_py*m_mdc_kal_py+m_mdc_kal_pz*m_mdc_kal_pz);
704 m_mdc_kal_pxy=sqrt(m_mdc_kal_px*m_mdc_kal_px+m_mdc_kal_py*m_mdc_kal_py);
705
706 m_mdc_kal_costheta=cos(mdcKalTrk->theta());
707
708
709 }
710
711
712 double mdc_pxy0=m_pxy0;
713 double mdc_pch=m_pch;
714 double mdc_costheta=cos(m_theta);
715
716
717 m_tuple1->write();
718 //if(nGood!=1) return StatusCode::SUCCESS;
719 //if(fabs(costhetamc)>0.93) return StatusCode::SUCCESS;
720
721 Ncut1++;
722
723 m_totcharged=evtRecEvent->totalCharged();
724 m_totneutral=evtRecEvent->totalNeutral();
725 m_tottracks =evtRecEvent->totalTracks();
726 m_ngood = nGood;
727
728 // if(m_totneutral>0) return StatusCode::SUCCESS;
729
730 //m_kaln=-9;
731 //m_costhetan=-9;
732
733 //for(int i = 0; i < nGood; i++) {
734 //if (i != itrack) continue;
735 m_kaln=pxymc;
736 m_costhetan=costhetamc;
737 m_pn=pmc;
738 //}
739 m_mat_charge=-2;
740 m_diff_pxy=-2;
741 m_diff_pch=-2;
742 m_diff_costheta=-2;
743
744 for(int i = 0; i < nGood; i++) {
745 if (i != itrack) continue;
746 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGood[i];
747 RecMdcTrack *mdcTrk = (*itTrk)->mdcTrack();
748 m_mat_charge=mdcTrk->charge();
749 m_diff_pxy=fabs(m_kaln-mdc_pxy0);
750 m_diff_pch=fabs(m_pn-mdc_pch);
751 m_diff_costheta=fabs(m_costhetan-mdc_costheta);
752 }
753
754
755
756 m_tuple7->write();
757
758 //Finish runinfo check
759
760
761
762
763
764 //
765 //
766 // check dedx infomation
767 //
768 //
769 if(m_checkDedx==1){
770 for(int i = 0; i < nGood; i++){
771 if (m_itrack==1&&i != itrack) continue;
772 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
773 if(!(*itTrk)->isMdcTrackValid()) continue;
774 if(!(*itTrk)->isMdcDedxValid())continue;
775 RecMdcTrack* mdcTrk = (*itTrk)->mdcTrack();
776 RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
777 m_ptrk = mdcTrk->p();
778
779 m_chie = dedxTrk->chiE();
780 m_chimu = dedxTrk->chiMu();
781 m_chipi = dedxTrk->chiPi();
782 m_chik = dedxTrk->chiK();
783 m_chip = dedxTrk->chiP();
784 m_ghit = dedxTrk->numGoodHits();
785 m_thit = dedxTrk->numTotalHits();
786 m_probPH = dedxTrk->probPH();
787 m_normPH = dedxTrk->normPH();
788 m_tuple2->write();
789 }
790 }
791
792
793 //
794 //
795 // check ExtTrack infomation
796 //
797 //
798 if(m_checkExt==1){
799 for(int i = 0; i <nGood; i++){
800 if (m_itrack==1&&i != itrack) continue;
801 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
802 if(!(*itTrk)->isExtTrackValid())continue;
803 RecExtTrack* extTrk = (*itTrk)->extTrack();
804
805 m_tof1 =extTrk->tof1();
806 m_tof1path=extTrk->tof1Path();
807 m_tof1z=extTrk->tof1PosSigmaAlongZ();
808 m_tof1t=extTrk->tof1PosSigmaAlongT();
809 m_tof1x=extTrk->tof1PosSigmaAlongX();
810 m_tof1y=extTrk->tof1PosSigmaAlongY();
811
812 m_tof2 =extTrk->tof2();
813 m_tof2path=extTrk->tof2Path();
814 m_tof2z=extTrk->tof2PosSigmaAlongZ();
815 m_tof2t=extTrk->tof2PosSigmaAlongT();
816 m_tof2x=extTrk->tof2PosSigmaAlongX();
817 m_tof2y=extTrk->tof2PosSigmaAlongY();
818
819 m_emctheta=extTrk->emcPosSigmaAlongTheta()*180/(CLHEP::pi);
820 m_emcphi=extTrk->emcPosSigmaAlongPhi()*180/(CLHEP::pi);
821 m_emcpath=extTrk->emcPath();
822
823 m_mucz=extTrk->mucPosSigmaAlongZ();
824 m_muct=extTrk->mucPosSigmaAlongT();
825 m_mucx=extTrk->mucPosSigmaAlongX();
826 m_mucy=extTrk->mucPosSigmaAlongY();
827
828 m_tuple3->write();
829 }
830 }
831
832 //
833 //
834 // check TOF infomation
835 //
836 //
837 if(m_checkTof==1){
838 for(int i = 0; i < nGood; i++){
839 if (m_itrack==1&&i != itrack) continue;
840 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
841 if(!(*itTrk)->isTofTrackValid())continue;
842
843 SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
844 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
845
846 m_path=(*iter_tof)->path();
847 m_zrhit=(*iter_tof)->zrhit();
848 m_ph=(*iter_tof)->ph();
849 m_tof=(*iter_tof)->tof();
850 m_errtof=(*iter_tof)->errtof();
851 m_beta=(*iter_tof)->beta();
852 m_texpe=(*iter_tof)->texpElectron();
853 m_texpmu=(*iter_tof)->texpMuon();
854 m_texppi=(*iter_tof)->texpPion();
855 m_texpka=(*iter_tof)->texpKaon();
856 m_texppro=(*iter_tof)->texpProton();
857 m_toffsete=(*iter_tof)->toffsetElectron();
858 m_toffsetmu=(*iter_tof)->toffsetMuon();
859 m_toffsetpi=(*iter_tof)->toffsetPion();
860 m_toffsetka=(*iter_tof)->toffsetKaon();
861 m_toffsetpro=(*iter_tof)->toffsetProton();
862 m_toffsetatpr=(*iter_tof)->toffsetAntiProton();
863 m_sigmae=(*iter_tof)->sigmaElectron();
864 m_sigmamu=(*iter_tof)->sigmaMuon();
865 m_sigmapi=(*iter_tof)->sigmaPion();
866 m_sigmaka=(*iter_tof)->sigmaKaon();
867 m_sigmapro=(*iter_tof)->sigmaProton();
868 m_sigmaatpr=(*iter_tof)->sigmaAntiProton();
869 m_quality=(*iter_tof)->quality();
870 m_t0=(*iter_tof)->t0();
871 m_errt0=(*iter_tof)->errt0();
872 m_errz=(*iter_tof)->errz();
873 m_phitof=(*iter_tof)->phi()*180/(CLHEP::pi);
874 m_errphi=(*iter_tof)->errphi()*180/(CLHEP::pi);
875 m_energy=(*iter_tof)->energy();
876 m_errenergy=(*iter_tof)->errenergy();
877
878 m_tuple4->write();
879 }
880 }
881
882 //
883 //
884 // check EmcTrack infomation
885 //
886 //
887 if(m_checkEmc==1){
888 for(int i = 0; i < nGood; i++){
889 if (m_itrack==1&&i != itrack) continue;
890 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
891 if(!(*itTrk)->isEmcShowerValid())continue;
892 RecEmcShower* emcTrk = (*itTrk)->emcShower();
893
894 m_x=emcTrk->x();
895 m_y=emcTrk->y();
896 m_z=emcTrk->z();
897 m_thetaemc=emcTrk->theta()*180/(CLHEP::pi);
898 m_phiemc=emcTrk->phi()*180/(CLHEP::pi);
899 m_dx=emcTrk->dx();
900 m_dy=emcTrk->dy();
901 m_dz=emcTrk->dz();
902 m_dtheta=emcTrk->dtheta()*180/(CLHEP::pi);
903 m_dphi=emcTrk->dphi()*180/(CLHEP::pi);
904 m_energyemc=emcTrk->energy();
905 m_de=emcTrk->dE();
906 m_eseed=emcTrk->eSeed();
907 m_e3x3=emcTrk->e3x3();
908 m_e5x5=emcTrk->e5x5();
909 m_secp=emcTrk->secondMoment();
910 m_latp=emcTrk->latMoment();
911
912 m_tuple5->write();
913 }
914 }
915
916
917
918
919
920 //
921 // Assign 4-momentum to each charged track
922 //
924 for(int i = 0; i < nGood; i++) {
925 if(nGood!=1) continue;
926 if (m_itrack==1&&i != itrack) continue;
927 EvtRecTrackIterator itTrk = evtRecTrkCol->begin() + iGood[i];
928 // if(pid) delete pid;
929
930 pid->init();
931 pid->setMethod(pid->methodProbability());
932 // pid->setMethod(pid->methodLikelihood()); //for Likelihood Method
933
934 pid->setChiMinCut(4);
935 pid->setRecTrack(*itTrk);
936 if(m_pid_mode == 0) pid->usePidSys(pid->useDedx() | pid->useTof1() | pid->useTof2() |pid->useTofE());
937 if(m_pid_mode == 1) pid->usePidSys(pid->useDedx() );
938 if(m_pid_mode == 2) pid->usePidSys(pid->useTof1() | pid->useTof2() |pid->useTofE());
939
940 // pid->identify(pid->onlyPion() | pid->onlyKaon()); // seperater Pion/Kaon
941 // pid->identify(pid->onlyPion());
942 pid->identify(pid->onlyPionKaonProton());
943 pid->calculate();
944
945 //if(!(pid->IsPidInfoValid())&&costhetamc>-0.7&&costhetamc<-0.6&&pxymc>0.25&&pxymc<0.3) cout<<"pidrunNo="<<runNo<<" pidevent"<<event<<endl;
946 //if(!(pid->IsPidInfoValid())&&costhetamc>-0.7&&costhetamc<-0.6&&pxymc>0.35&&pxymc<0.4) cout<<"pidrunNo1="<<runNo<<" pidevent1"<<event<<endl;
947 if(!(pid->IsPidInfoValid())) continue;
948 RecMdcTrack* mdcTrk = (*itTrk)->mdcTrack();
949 m_ptrk_pid = mdcTrk->p();
950 m_cost_pid = cos(mdcTrk->theta());
951 m_dedx_pid = pid->chiDedx(2);
952 m_tof1_pid = pid->chiTof1(2);
953 m_tof2_pid = pid->chiTof2(2);
954 m_prob_pid_pion = pid->probPion();
955 m_prob_pid_kaon = pid->probKaon();
956 m_prob_pid_proton = pid->probProton();
957
958
959 //
960 // check KalTrack infomation
961 //
962
963
964 // if(!(*itTrk)->isMdcKalTrackValid()) {cout<<"kal"<<endl; continue;}
965
966
967 RecMdcKalTrack* mdcKalTrk = (*itTrk)->mdcKalTrack();
968 if(abs(m_particleID)==211) RecMdcKalTrack::setPidType (RecMdcKalTrack::pion);
969 if(abs(m_particleID)==321) RecMdcKalTrack::setPidType (RecMdcKalTrack::kaon);
970 if(abs(m_particleID)==2212) RecMdcKalTrack::setPidType (RecMdcKalTrack::proton);
973
974 m_kalpx=mdcKalTrk->px();
975 m_kalpy=mdcKalTrk->py();
976 m_kalpz=mdcKalTrk->pz();
977 m_kalp=sqrt(m_kalpx*m_kalpx+m_kalpy*m_kalpy+m_kalpz*m_kalpz);
978 m_kalpxy=sqrt(m_kalpx*m_kalpx+m_kalpy*m_kalpy);
979
980 HepLorentzVector ptr;
981
982 ptr=mdcKalTrk->p4(0.000511*0.000511);
983 m_kalcostheta=ptr.cosTheta();
984
985 double kalcostheta=m_kalcostheta;
986 m_comp_costheta=costhetamc-kalcostheta;
987 //cout<<" kalcostheta="<<m_kalcostheta<<endl;
988 HepVector k= mdcKalTrk->helix();
989 HepSymMatrix Ek = mdcKalTrk->err();
990
991 m_d0kal=k[0];
992 m_phi0kal=k[1];
993 m_kappakal=k[2];
994 m_dzhelixkal=k[3];
995 m_tanlamdakal=k[4];
996
997
998 m_err11kal=Ek[0][0];
999 m_err21kal=Ek[1][0];
1000 m_err22kal=Ek[1][1];
1001
1002 m_err31kal=Ek[2][0];
1003 m_err32kal=Ek[2][1];
1004 m_err33kal=Ek[2][2];
1005 m_err41kal=Ek[3][0];
1006 m_err42kal=Ek[3][1];
1007 m_err43kal=Ek[3][2];
1008 m_err44kal=Ek[3][3];
1009 m_err51kal=Ek[4][0];
1010 m_err52kal=Ek[4][1];
1011 m_err53kal=Ek[4][2];
1012 m_err54kal=Ek[4][3];
1013 m_err55kal=Ek[4][4];
1014
1015
1016 m_kalnn=pxymc;
1017 m_costhetann=costhetamc;
1018 m_pnn=pmc;
1019 //cout<<"pxy="<<pxymc<<'\t'<<'\t'<<m_kalpxy<<endl;
1020 //cout<<"costheta="<<costhetamc<<'\t'<<m_kalcostheta<<endl<<endl;
1021
1022 m_tuple9->write();
1023 }
1024
1025
1026 //
1027 //
1028 // check MucTrack infomation
1029 //
1030 //
1031 if(m_checkMuc==1){
1032 for(int i = 0; i < nGood; i++){
1033 if (m_itrack==1&&i != itrack) continue;
1034 EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
1035 if(!(*itTrk)->isMucTrackValid())continue;
1036 RecMucTrack* mucTrk = (*itTrk)->mucTrack();
1037
1038 m_depth=mucTrk->depth();
1039 m_chi2=mucTrk->chi2();
1040 m_rms=mucTrk->rms();
1041 m_xpos=mucTrk->xPos();
1042 m_ypos=mucTrk->yPos();
1043 m_zpos=mucTrk->zPos();
1044 m_xpossigma=mucTrk->xPosSigma();
1045 m_ypossigma=mucTrk->yPosSigma();
1046 m_zpossigma=mucTrk->zPosSigma();
1047 m_px=mucTrk->px();
1048 m_py=mucTrk->py();
1049 m_pz=mucTrk->pz();
1050 m_distance=mucTrk->distance();
1051 m_deltaphi=mucTrk->deltaPhi()*180/(CLHEP::pi);
1052
1053 m_tuple6->write();
1054 }
1055 }
1056
1057
1058
1059 return StatusCode::SUCCESS;
1060
1061}
1062
1063// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1064StatusCode Single::finalize() {
1065 cout<<"mdc"<<endl;
1066 cout<<"total number: "<<Ncut0<<endl;
1067 cout<<"nGood: "<<Ncut1<<endl;
1068 MsgStream log(msgSvc(), name());
1069 log << MSG::INFO << "in finalize()" << endmsg;
1070 return StatusCode::SUCCESS;
1071}
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
int runNo
Definition DQA_TO_DB.cxx:12
EvtRecTrackCol::iterator EvtRecTrackIterator
std::vector< int > Vint
Definition Gam4pikp.cxx:52
int Ncut1
Definition Ppjrhopi.cxx:53
int Ncut0
Definition Ppjrhopi.cxx:53
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
int Ncut2
Definition Single.cxx:48
HepGeom::Point3D< double > HepPoint3D
Definition Single.cxx:34
int Ncut1
Definition Single.cxx:48
std::vector< HepLorentzVector > Vp4
Definition Single.cxx:46
int Ncut0
Definition Single.cxx:48
int Ncut3
Definition Single.cxx:48
std::vector< int > Vint
Definition Single.cxx:45
int Ncut4
Definition Single.cxx:48
double dy() const
double latMoment() const
double eSeed() const
double dphi() const
double theta() const
double e3x3() const
double dz() const
double phi() const
double dx() const
double secondMoment() const
double x() const
double e5x5() const
double z() const
double energy() const
double dE() const
double dtheta() const
double y() const
const double tof1Path() const
Definition DstExtTrack.h:68
const double mucPosSigmaAlongZ() const
const double emcPosSigmaAlongTheta() const
const double emcPosSigmaAlongPhi() const
const double tof2PosSigmaAlongY() const
const double mucPosSigmaAlongX() const
const double tof1() const
Definition DstExtTrack.h:66
const double tof2() const
const double tof2PosSigmaAlongZ() const
const double tof1PosSigmaAlongX() const
Definition DstExtTrack.h:74
const double tof2Path() const
const double tof2PosSigmaAlongT() const
const double mucPosSigmaAlongY() const
const double tof1PosSigmaAlongY() const
Definition DstExtTrack.h:76
const double emcPath() const
const double tof1PosSigmaAlongT() const
Definition DstExtTrack.h:72
const double mucPosSigmaAlongT() const
const double tof2PosSigmaAlongX() const
const double tof1PosSigmaAlongZ() const
Definition DstExtTrack.h:70
double probPH() const
Definition DstMdcDedx.h:66
double chiE() const
Definition DstMdcDedx.h:59
int numTotalHits() const
Definition DstMdcDedx.h:65
int numGoodHits() const
Definition DstMdcDedx.h:64
double normPH() const
Definition DstMdcDedx.h:67
double chiPi() const
Definition DstMdcDedx.h:61
double chiK() const
Definition DstMdcDedx.h:62
double chiMu() const
Definition DstMdcDedx.h:60
double chiP() const
Definition DstMdcDedx.h:63
const HepVector & helix() const
const double theta() const
const double px() const
static void setPidType(PidType pidType)
const double pz() const
const double py() const
const HepSymMatrix & err() const
const HepLorentzVector p4() const
const double theta() const
Definition DstMdcTrack.h:59
const double r() const
Definition DstMdcTrack.h:64
const double py() const
Definition DstMdcTrack.h:56
const HepSymMatrix err() const
const int charge() const
Definition DstMdcTrack.h:53
const int trackId() const
Definition DstMdcTrack.h:52
const double px() const
Definition DstMdcTrack.h:55
const double phi() const
Definition DstMdcTrack.h:60
const double pz() const
Definition DstMdcTrack.h:57
const double pxy() const
Definition DstMdcTrack.h:54
const int ndof() const
Definition DstMdcTrack.h:67
const int stat() const
Definition DstMdcTrack.h:65
const HepVector helix() const
......
const double z() const
Definition DstMdcTrack.h:63
const double p() const
Definition DstMdcTrack.h:58
const int nster() const
Definition DstMdcTrack.h:68
const double y() const
Definition DstMdcTrack.h:62
const double x() const
Definition DstMdcTrack.h:61
double zPos() const
Definition DstMucTrack.h:52
double pz() const
Definition DstMucTrack.h:60
double py() const
Definition DstMucTrack.h:59
double deltaPhi() const
Definition DstMucTrack.h:63
double zPosSigma() const
Definition DstMucTrack.h:56
double xPos() const
Definition DstMucTrack.h:50
double xPosSigma() const
Definition DstMucTrack.h:54
double px() const
Definition DstMucTrack.h:58
double yPosSigma() const
Definition DstMucTrack.h:55
double yPos() const
Definition DstMucTrack.h:51
double distance() const
Definition DstMucTrack.h:62
double rms() const
Definition DstMucTrack.h:48
double depth() const
Definition DstMucTrack.h:45
double chi2() const
Definition DstMucTrack.h:46
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
int useTof2() const
int useTofE() const
int methodProbability() const
int useDedx() const
int onlyPionKaonProton() const
int useTof1() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
double probKaon() const
Definition ParticleID.h:124
void setMethod(const int method)
Definition ParticleID.h:94
double chiTof2(int n) const
void identify(const int pidcase)
Definition ParticleID.h:103
void usePidSys(const int pidsys)
Definition ParticleID.h:97
static ParticleID * instance()
bool IsPidInfoValid() const
double probPion() const
Definition ParticleID.h:123
double chiTof1(int n) const
void calculate()
void init()
double probProton() const
Definition ParticleID.h:125
double chiDedx(int n) const
StatusCode initialize()
Definition Single.cxx:72
StatusCode execute()
Definition Single.cxx:455
StatusCode finalize()
Definition Single.cxx:1064
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.
_EXTERN_ std::string EvtRecEvent
Definition EventModel.h:116
_EXTERN_ std::string EvtRecTrackCol
Definition EventModel.h:117
float charge