362 if( tofDigiCol.size() <= 0 )
return;
363 TofDigiCol::iterator iter_digi = tofDigiCol.begin();
364 for( ; iter_digi!=tofDigiCol.end(); iter_digi++ ) {
365 unsigned int overflow = (*iter_digi)->getOverflow();
366 if( ( overflow & 0xfe000000 ) == 0xfe000000 ) {
374 digi_adc = 0x7fffffff;
375 digi_tdc = 0x7fffffff;
376 digi_qclock = 1000.0;
377 digi_tclock = 1000.0;
378 digi_overflow = overflow;
387 digi_crate = ( ( overflow &0x1000000 ) >> 24 );
388 digi_geo = ( ( overflow &0x0f80000 ) >> 19 );
389 digi_tdcnum = ( ( overflow &0x0078000 ) >> 15 );
390 digi_err = ( overflow &0x0007fff );
400 unsigned int adc = (*iter_digi)->getChargeChannel();
401 unsigned int tdc = (*iter_digi)->getTimeChannel();
405 digi_barrel = barrel_ec;
409 digi_adc = ( adc & 0x1fff );
410 if( adc == 0x7fffffff ) digi_adc = adc;
412 digi_qclock = ( ( adc & 0x7e000 ) >> 13 );
413 if( adc == 0x7fffffff ) digi_qclock = 1000.;
414 digi_tclock = ( ( tdc & 0x7e000 ) >> 13 );
415 if( tdc == 0x7fffffff ) digi_tclock = 1000.;
416 digi_overflow = overflow;
417 digi_noq = ( ( overflow & 0x20 ) >> 5 );
418 digi_not = ( ( overflow & 0x10 ) >> 4 );
419 digi_multiq = ( ( overflow & 0x08 ) >> 3 );
420 digi_multit = ( ( overflow & 0x04 ) >> 2 );
421 digi_overq = ( ( overflow & 0x02 ) >> 1 );
422 digi_overt = ( overflow & 0x01 );
424 digi_t0stat = t0stat;
542 ext_trackid = extTrack->
trackId();
544 int hitcase[5], tofId1[5], tofId2[5];
546 for(
unsigned int i=0; i<5; i++ ) {
550 ext_kalman[i] = mdcKalTrack->
getStat( 1, i );
555 if( tofId1[i]>=0 && tofId1[i]<=87 ) {
556 ext_tofid1[i] = tofId1[i];
559 else if( tofId1[i]>=176 && tofId1[i]<=223 ) {
560 ext_tofid1[i] = tofId1[i] - 176 + 48;
563 else if( tofId1[i]>=224 && tofId1[i]<=271 ) {
564 ext_tofid1[i] = tofId1[i] - 176 - 48;
568 if( tofId2[i]>=88 && tofId2[i]<=175 ) {
569 ext_tofid2[i] = tofId2[i];
570 if( hitcase[i] == 0 ) {
573 else if( hitcase[i] == 5 ) {
580 if( ( hitcase[i] == 0 ) || ( hitcase[i] == 2 ) ) {
581 ext_texp1[i] = extTrack->
tof1( i );
582 ext_path1[i] = extTrack->
tof1Path( i );
588 else if( ( hitcase[i] == 3 ) || ( hitcase[i] == 4 ) ) {
589 ext_texp1[i] = extTrack->
tof1( i );
590 ext_path1[i] = extTrack->
tof1Path( i );
597 if( ( hitcase[i] == 1 ) || ( hitcase[i] == 2 ) ) {
598 ext_texp2[i] = extTrack->
tof2( i );
599 ext_path2[i] = extTrack->
tof2Path( i );
606 if( hitcase[i] == 5 ) { ext_quality[i] = 3; }
607 else { ext_quality[i] = 0; }
609 ext_hitcase[i] = hitcase[i];
930 RecMdcKalTrackCol::iterator
iter = mdcKalTrackCol.begin();
931 for( ;
iter != mdcKalTrackCol.end();
iter++ ) {
932 if( (*iter)->trackId() == tof->
trackId() ) {
933 double kappa = 10000.0;
934 double tanl = -10000.0;
937 kappa = (*iter)->kappa();
938 tanl = (*iter)->tanl();
939 if( kappa>0 ) { tof_charge = 1; }
940 else { tof_charge = -1; }
941 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
942 tof_pt[0] = 1.0/kappa;
943 tof_p[0] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[0]);
946 kappa = (*iter)->kappa();
947 tanl = (*iter)->tanl();
948 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
949 tof_pt[1] = 1.0/kappa;
950 tof_p[1] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[1]);
953 kappa = (*iter)->kappa();
954 tanl = (*iter)->tanl();
955 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
956 tof_pt[2] = 1.0/kappa;
957 tof_p[2] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[2]);
960 kappa = (*iter)->kappa();
961 tanl = (*iter)->tanl();
962 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
963 tof_pt[3] = 1.0/kappa;
964 tof_p[3] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[3]);
967 kappa = (*iter)->kappa();
968 tanl = (*iter)->tanl();
969 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
970 tof_pt[4] = 1.0/kappa;
971 tof_p[4] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[4]);
976 tof_id1 = tof->
id1();
977 tof_id2 = tof->
id2();
978 tof_barrel = tof->
barrel();
980 tof_momentum = tof->
p();
981 tof_path1 = tof->
path1();
982 tof_path2 = tof->
path2();
983 tof_zrhit1 = tof->
zrhit1();
984 tof_zrhit2 = tof->
zrhit2();
985 tof_errzr1 = tof->
errzr1();
986 tof_errzr2 = tof->
errzr2();
987 for(
unsigned int i=0; i<5; i++ ) {
988 tof_kal[i] = tof->
kal(i);
989 tof_zr1[i] = tof->
zrhit1(i);
990 tof_zr2[i] = tof->
zrhit2(i);
992 tof_ztdc1 = tof->
ztdc1();
993 tof_ztdc2 = tof->
ztdc2();
994 tof_zadc1 = tof->
zadc1();
995 tof_zadc2 = tof->
zadc2();
1016 tof_size1 = tof->
size1();
1017 tof_size2 = tof->
size2();
1018 tof_size3 = tof->
size3();
1019 tof_size4 = tof->
size4();
1020 tof_theta1 = tof->
theta1();
1021 tof_theta2 = tof->
theta2();
1022 tof_phi1 = tof->
phi1();
1023 tof_phi2 = tof->
phi2();
1027 tof_tofid1 = tof->
tofId1();
1028 tof_tofid2 = tof->
tofId2();
1041 tof_ph11 = tof->
ph11();
1042 tof_ph12 = tof->
ph12();
1043 tof_ph21 = tof->
ph21();
1044 tof_ph22 = tof->
ph22();
1045 tof_ph1 = tof->
ph1();
1046 tof_ph2 = tof->
ph2();
1048 tof_tofe11 = tof->
tof11(0);
1049 tof_tofe12 = tof->
tof12(0);
1050 tof_tofe21 = tof->
tof21(0);
1051 tof_tofe22 = tof->
tof22(0);
1052 tof_tofe1 = tof->
tof1(0);
1053 tof_tofe2 = tof->
tof2(0);
1054 tof_tofe = tof->
tof(0);
1055 tof_tofmu11 = tof->
tof11(1);
1056 tof_tofmu12 = tof->
tof12(1);
1057 tof_tofmu21 = tof->
tof21(1);
1058 tof_tofmu22 = tof->
tof22(1);
1059 tof_tofmu1 = tof->
tof1(1);
1060 tof_tofmu2 = tof->
tof2(1);
1061 tof_tofmu = tof->
tof(1);
1062 tof_tofpi11 = tof->
tof11(2);
1063 tof_tofpi12 = tof->
tof12(2);
1064 tof_tofpi21 = tof->
tof21(2);
1065 tof_tofpi22 = tof->
tof22(2);
1066 tof_tofpi1 = tof->
tof1(2);
1067 tof_tofpi2 = tof->
tof2(2);
1068 tof_tofpi = tof->
tof(2);
1069 tof_tofk11 = tof->
tof11(3);
1070 tof_tofk12 = tof->
tof12(3);
1071 tof_tofk21 = tof->
tof21(3);
1072 tof_tofk22 = tof->
tof22(3);
1073 tof_tofk1 = tof->
tof1(3);
1074 tof_tofk2 = tof->
tof2(3);
1075 tof_tofk = tof->
tof(3);
1076 tof_tofp11 = tof->
tof11(4);
1077 tof_tofp12 = tof->
tof12(4);
1078 tof_tofp21 = tof->
tof21(4);
1079 tof_tofp22 = tof->
tof22(4);
1080 tof_tofp1 = tof->
tof1(4);
1081 tof_tofp2 = tof->
tof2(4);
1082 tof_tofp = tof->
tof(4);
1083 tof_qch1 = tof->
qch1();
1084 tof_qch2 = tof->
qch2();
1085 tof_qch3 = tof->
qch3();
1086 tof_qch4 = tof->
qch4();
1087 tof_adc1 = tof->
adc1();
1088 tof_adc2 = tof->
adc2();
1089 tof_adc3 = tof->
adc3();
1090 tof_adc4 = tof->
adc4();
1091 tof_tdc1 = tof->
tdc1();
1092 tof_tdc2 = tof->
tdc2();
1093 tof_tdc3 = tof->
tdc3();
1094 tof_tdc4 = tof->
tdc4();
1105 tof_texpe = tof->
texp(0);
1106 tof_texpmu = tof->
texp(1);
1107 tof_texppi = tof->
texp(2);
1108 tof_texpk = tof->
texp(3);
1109 tof_texpp = tof->
texp(4);
1110 tof_tdiff1 = tof->
tdiff1();
1111 tof_tdiff2 = tof->
tdiff2();
1112 tof_estime = estime;
1113 tof_t0stat = t0stat;
1126 RecMdcKalTrackCol::iterator
iter = mdcKalTrackCol.begin();
1127 for( ;
iter != mdcKalTrackCol.end();
iter++ ) {
1128 if( (*iter)->trackId() == tof->
trackId() ) {
1129 double kappa = 10000.0;
1130 double tanl = -10000.0;
1133 kappa = (*iter)->kappa();
1134 tanl = (*iter)->tanl();
1135 if( kappa>0 ) { tof_charge = 1; }
1136 else { tof_charge = -1; }
1137 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1138 tof_pt[0] = 1.0/kappa;
1139 tof_p[0] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[0]);
1142 kappa = (*iter)->kappa();
1143 tanl = (*iter)->tanl();
1144 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1145 tof_pt[1] = 1.0/kappa;
1146 tof_p[1] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[1]);
1149 kappa = (*iter)->kappa();
1150 tanl = (*iter)->tanl();
1151 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1152 tof_pt[2] = 1.0/kappa;
1153 tof_p[2] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[2]);
1156 kappa = (*iter)->kappa();
1157 tanl = (*iter)->tanl();
1158 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1159 tof_pt[3] = 1.0/kappa;
1160 tof_p[3] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[3]);
1163 kappa = (*iter)->kappa();
1164 tanl = (*iter)->tanl();
1165 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1166 tof_pt[4] = 1.0/kappa;
1167 tof_p[4] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[4]);
1172 tof_id1 = tof->
id1();
1173 tof_id2 = tof->
id2();
1174 tof_barrel = tof->
barrel();
1176 tof_momentum = tof->
p();
1177 tof_path1 = tof->
path1();
1178 tof_path2 = tof->
path2();
1179 tof_zrhit1 = tof->
zrhit1();
1180 tof_zrhit2 = tof->
zrhit2();
1181 tof_errzr1 = tof->
errzr1();
1182 tof_errzr2 = tof->
errzr2();
1183 for(
unsigned int i=0; i<5; i++ ) {
1184 tof_kal[i] = tof->
kal(i);
1185 tof_zr1[i] = tof->
zrhit1(i);
1186 tof_zr2[i] = tof->
zrhit2(i);
1188 tof_ztdc1 = tof->
ztdc1();
1189 tof_ztdc2 = tof->
ztdc2();
1190 tof_zadc1 = tof->
zadc1();
1191 tof_zadc2 = tof->
zadc2();
1212 tof_size1 = tof->
size1();
1213 tof_size2 = tof->
size2();
1214 tof_size3 = tof->
size3();
1215 tof_size4 = tof->
size4();
1216 tof_theta1 = tof->
theta1();
1217 tof_theta2 = tof->
theta2();
1218 tof_phi1 = tof->
phi1();
1219 tof_phi2 = tof->
phi2();
1223 tof_tofid1 = tof->
tofId1();
1224 tof_tofid2 = tof->
tofId2();
1237 tof_ph11 = tof->
ph11();
1238 tof_ph12 = tof->
ph12();
1239 tof_ph21 = tof->
ph21();
1240 tof_ph22 = tof->
ph22();
1241 tof_ph1 = tof->
ph1();
1242 tof_ph2 = tof->
ph2();
1244 tof_tofe11 = tof->
tof11(0);
1245 tof_tofe12 = tof->
tof12(0);
1246 tof_tofe21 = tof->
tof21(0);
1247 tof_tofe22 = tof->
tof22(0);
1248 tof_tofe1 = tof->
tof1(0);
1249 tof_tofe2 = tof->
tof2(0);
1250 tof_tofe = tof->
tof(0);
1251 tof_tofmu11 = tof->
tof11(1);
1252 tof_tofmu12 = tof->
tof12(1);
1253 tof_tofmu21 = tof->
tof21(1);
1254 tof_tofmu22 = tof->
tof22(1);
1255 tof_tofmu1 = tof->
tof1(1);
1256 tof_tofmu2 = tof->
tof2(1);
1257 tof_tofmu = tof->
tof(1);
1258 tof_tofpi11 = tof->
tof11(2);
1259 tof_tofpi12 = tof->
tof12(2);
1260 tof_tofpi21 = tof->
tof21(2);
1261 tof_tofpi22 = tof->
tof22(2);
1262 tof_tofpi1 = tof->
tof1(2);
1263 tof_tofpi2 = tof->
tof2(2);
1264 tof_tofpi = tof->
tof(2);
1265 tof_tofk11 = tof->
tof11(3);
1266 tof_tofk12 = tof->
tof12(3);
1267 tof_tofk21 = tof->
tof21(3);
1268 tof_tofk22 = tof->
tof22(3);
1269 tof_tofk1 = tof->
tof1(3);
1270 tof_tofk2 = tof->
tof2(3);
1271 tof_tofk = tof->
tof(3);
1272 tof_tofp11 = tof->
tof11(4);
1273 tof_tofp12 = tof->
tof12(4);
1274 tof_tofp21 = tof->
tof21(4);
1275 tof_tofp22 = tof->
tof22(4);
1276 tof_tofp1 = tof->
tof1(4);
1277 tof_tofp2 = tof->
tof2(4);
1278 tof_tofp = tof->
tof(4);
1279 tof_qch1 = tof->
qch1();
1280 tof_qch2 = tof->
qch2();
1281 tof_qch3 = tof->
qch3();
1282 tof_qch4 = tof->
qch4();
1283 tof_adc1 = tof->
adc1();
1284 tof_adc2 = tof->
adc2();
1285 tof_adc3 = tof->
adc3();
1286 tof_adc4 = tof->
adc4();
1287 tof_tdc1 = tof->
tdc1();
1288 tof_tdc2 = tof->
tdc2();
1289 tof_tdc3 = tof->
tdc3();
1290 tof_tdc4 = tof->
tdc4();
1301 tof_texpe = tof->
texp(0);
1302 tof_texpmu = tof->
texp(1);
1303 tof_texppi = tof->
texp(2);
1304 tof_texpk = tof->
texp(3);
1305 tof_texpp = tof->
texp(4);
1306 tof_tdiff1 = tof->
tdiff1();
1307 tof_tdiff2 = tof->
tdiff2();
1308 tof_estime = estime;
1309 tof_t0stat = t0stat;
1312 if( calibData ==
"Bhabha" ) { particleId = 11; }
1313 else if( calibData ==
"Dimu" ) { particleId = 13; }
1314 else if( calibData ==
"pion" ) { particleId = 211; }
1315 else if( calibData ==
"kaon" ) { particleId = 321; }
1316 else if( calibData ==
"proton" ) { particleId = 2212; }
1318 cout <<
"Reconstruction::TofRec::TofCheckDigi::Fill_TofTrack: For MC, Wrong Input Particle ID!" << endl;
1322 tof_mctofp = -100.0;
1323 tof_mctrkid = -100.0;
1324 tof_mcpath = -100.0;
1325 tof_mctexp = -100.0;
1326 tof_mczrhit = -1000.0;
1328 McParticleCol::iterator iter_mc = mcParticleCol.begin();
1329 for( ; iter_mc != mcParticleCol.end(); iter_mc++ ) {
1330 int pid = (*iter_mc)->particleProperty();
1331 if(
abs(pid) != particleId )
continue;
1332 if( ( particleId==11 || particleId==13 ) && ( ( pid>0 && tof_charge>0 ) || ( pid<0 && tof_charge<0 ) ) )
continue;
1333 if( ( particleId!=11 && particleId!=13 ) && ( ( pid>0 && tof_charge<0 ) || ( pid<0 && tof_charge>0 ) ) )
continue;
1335 int trkIndex = (*iter_mc)->trackIndex();
1336 tof_mcp = (*iter_mc)->initialFourMomentum().rho();
1338 TofMcHitCol::iterator iter_mc_tof = tofMcCol.begin();
1339 for( ; iter_mc_tof != tofMcCol.end(); iter_mc_tof++ ) {
1340 if( trkIndex != (*iter_mc_tof)->getTrackIndex() )
continue;
1341 double mcposx = (*iter_mc_tof)->getPositionX();
1342 double mcposy = (*iter_mc_tof)->getPositionY();
1343 double mcposr = 0.1*sqrt(mcposx*mcposx+mcposy*mcposy);
1344 double mcposz = 0.1*(*iter_mc_tof)->getPositionZ();
1345 double mcpx = (*iter_mc_tof)->getPx();
1346 double mcpy = (*iter_mc_tof)->getPy();
1347 double mcpz = (*iter_mc_tof)->getPz();
1348 double mctofp = 0.001*sqrt(mcpx*mcpx+mcpy*mcpy+mcpz*mcpz);
1349 tof_mctofp = mctofp;
1350 tof_mctrkid = (*iter_mc_tof)->getTrackIndex();
1351 tof_mcpath = 0.1*(*iter_mc_tof)->getTrackLength();
1352 tof_mctexp = (*iter_mc_tof)->getFlightTime();
1354 tof_mczrhit = mcposz;
1357 tof_mczrhit = mcposr;
1387 bb_trksize = extTrackCol.size();
1388 bb_mdcsize = mdcTrackCol.size();
1389 bb_emcsize = emcShowerCol.size();
1391 RecMdcTrackCol::iterator iter_mdc1 = mdcTrackCol.begin();
1392 RecMdcTrackCol::iterator iter_mdc2 = mdcTrackCol.begin() + 1;
1394 Hep3Vector p1 = (*iter_mdc1)->p3();
1395 Hep3Vector p2 = (*iter_mdc2)->p3();
1397 bb_trk1 = (*iter_mdc1)->trackId();
1398 bb_pmdc1 = (*iter_mdc1)->p();
1399 bb_ptmdc1 = (*iter_mdc1)->pxy();
1400 bb_theta1 = (*iter_mdc1)->theta();
1401 bb_phi1 = (*iter_mdc1)->phi();
1402 bb_x1 = (*iter_mdc1)->x();
1403 bb_y1 = (*iter_mdc1)->y();
1404 bb_z1 = (*iter_mdc1)->z();
1405 bb_r1 = (*iter_mdc1)->r();
1406 bb_charge1 = (*iter_mdc1)->charge();
1407 bb_chi1 = (*iter_mdc1)->chi2();
1408 bb_ndof1 = (*iter_mdc1)->ndof();
1409 bb_layer1 = (*iter_mdc1)->lastLayer();
1410 bb_trk2 = (*iter_mdc2)->trackId();
1411 bb_pmdc2 = (*iter_mdc2)->p();
1412 bb_ptmdc2 = (*iter_mdc2)->pxy();
1413 bb_theta2 = (*iter_mdc2)->theta();
1414 bb_phi2 = (*iter_mdc2)->phi();
1415 bb_x2 = (*iter_mdc2)->x();
1416 bb_y2 = (*iter_mdc2)->y();
1417 bb_z2 = (*iter_mdc2)->z();
1418 bb_r2 = (*iter_mdc2)->r();
1419 bb_charge2 = (*iter_mdc2)->charge();
1420 bb_chi2 = (*iter_mdc2)->chi2();
1421 bb_ndof2 = (*iter_mdc2)->ndof();
1422 bb_layer2 = (*iter_mdc2)->lastLayer();
1424 bb_dang = 180.0 - p1.angle( p2.unit() )*180.0/
pi;
1425 bb_dphi =
abs( (*iter_mdc1)->phi() - (*iter_mdc2)->phi() )*180.0/
pi;
1427 RecMdcKalTrackCol::iterator iter_kal1 = mdcKalTrackCol.begin();
1428 RecMdcKalTrackCol::iterator iter_kal2 = mdcKalTrackCol.begin() + 1;
1430 if( ( (*iter_kal1)->trackId() == (*iter_mdc2)->trackId() ) && ( (*iter_kal2)->trackId() == (*iter_mdc1)->trackId() ) ) {
1431 RecMdcKalTrackCol::iterator iter_tmp = iter_kal1;
1432 iter_kal1 = iter_kal2;
1433 iter_kal2 = iter_tmp;
1439 double tanl1 = (*iter_kal1)->tanl();
1440 double kappa1 = (*iter_kal1)->kappa();
1441 double tanl2 = (*iter_kal2)->tanl();
1442 double kappa2 = (*iter_kal2)->kappa();
1443 bb_pe1 = sqrt(1.0+tanl1*tanl1)/kappa1;
1444 bb_pte1 = 1.0/kappa1;
1445 bb_pe2 = sqrt(1.0+tanl2*tanl2)/kappa2;
1446 bb_pte2 = 1.0/kappa2;
1450 tanl1 = (*iter_kal1)->tanl();
1451 kappa1 = (*iter_kal1)->kappa();
1452 tanl2 = (*iter_kal2)->tanl();
1453 kappa2 = (*iter_kal2)->kappa();
1454 bb_pmu1 = sqrt(1.0+tanl1*tanl1)/kappa1;
1455 bb_ptmu1 = 1.0/kappa1;
1456 bb_pmu2 = sqrt(1.0+tanl2*tanl2)/kappa2;
1457 bb_ptmu2 = 1.0/kappa2;
1459 RecExtTrackCol::iterator iter_ext1 = extTrackCol.begin();
1460 RecExtTrackCol::iterator iter_ext2 = extTrackCol.begin() + 1;
1462 Hep3Vector extPos1 = (*iter_ext1)->emcPosition();
1463 Hep3Vector extPos2 = (*iter_ext2)->emcPosition();
1465 bb_extx1 = extPos1.x();
1466 bb_exty1 = extPos1.y();
1467 bb_extz1 = extPos1.z();
1468 bb_extx2 = extPos2.x();
1469 bb_exty2 = extPos2.y();
1470 bb_extz2 = extPos2.z();
1472 RecEmcShowerCol::iterator iter_emc1 = emcShowerCol.begin();
1473 RecEmcShowerCol::iterator iter_emc2 = emcShowerCol.begin() + 1;
1475 Hep3Vector emcPos1((*iter_emc1)->x(),(*iter_emc1)->y(),(*iter_emc1)->z());
1476 Hep3Vector emcPos2((*iter_emc2)->x(),(*iter_emc2)->y(),(*iter_emc2)->z());
1481 Hep3Vector dis1 = extPos1 - emcPos1;
1482 Hep3Vector dis2 = extPos2 - emcPos1;
1486 if( dis1.r() > dis2.r() ) {
1487 RecEmcShowerCol::iterator iter_tmp = iter_emc1;
1488 iter_emc1 = iter_emc2;
1489 iter_emc2 = iter_tmp;
1490 Hep3Vector emc_tmp = emcPos1;
1494 dis1 = extPos1 - emcPos1;
1495 dis2 = extPos2 - emcPos2;
1497 bb_emctrk1 = (*iter_emc1)->trackId();
1498 bb_emcx1 = (*iter_emc1)->x();
1499 bb_emcy1 = (*iter_emc1)->y();
1500 bb_emcz1 = (*iter_emc1)->z();
1501 bb_e1 = (*iter_emc1)->energy();
1502 bb_th1 = (*iter_emc1)->theta();
1503 bb_ph1 = (*iter_emc1)->phi();
1504 bb_emctrk2 = (*iter_emc2)->trackId();
1505 bb_emcx2 = (*iter_emc2)->x();
1506 bb_emcy2 = (*iter_emc2)->y();
1507 bb_emcz2 = (*iter_emc2)->z();
1508 bb_e2 = (*iter_emc2)->energy();
1509 bb_th2 = (*iter_emc2)->theta();
1510 bb_ph2 = (*iter_emc2)->phi();
1512 bb_drxy1 = dis1.rho();
1515 bb_drxy2 = dis2.rho();
1519 RecEmcShowerCol::iterator iter_emc = emcShowerCol.begin();
1520 for( ; iter_emc != emcShowerCol.end(); iter_emc++ ) {
1521 etot += (*iter_emc)->energy();