428 if( tofDigiCol.size() <= 0 )
return;
429 TofDigiCol::iterator iter_digi = tofDigiCol.begin();
430 for( ; iter_digi!=tofDigiCol.end(); iter_digi++ ) {
431 unsigned int overflow = (*iter_digi)->getOverflow();
432 if( ( overflow & 0xfe000000 ) == 0xfe000000 ) {
442 digi_adc = 0x7fffffff;
443 digi_tdc = 0x7fffffff;
444 digi_qclock = 1000.0;
445 digi_tclock = 1000.0;
446 digi_overflow = overflow;
455 digi_crate = ( ( overflow &0x1000000 ) >> 24 );
456 digi_geo = ( ( overflow &0x0f80000 ) >> 19 );
457 digi_tdcnum = ( ( overflow &0x0078000 ) >> 15 );
458 digi_err = ( overflow &0x0007fff );
464 unsigned int adc = (*iter_digi)->getChargeChannel();
465 unsigned int tdc = (*iter_digi)->getTimeChannel();
476 digi_adc = ( adc & 0x1fff );
479 digi_tofId = TofID::module(iden);
482 if( adc == 0x7fffffff ) digi_adc = adc;
484 digi_qclock = ( ( adc & 0x7e000 ) >> 13 );
485 if( adc == 0x7fffffff ) digi_qclock = 1000.;
486 digi_tclock = ( ( tdc & 0x7e000 ) >> 13 );
487 if( tdc == 0x7fffffff ) digi_tclock = 1000.;
488 digi_overflow = overflow;
489 digi_noq = ( ( overflow & 0x20 ) >> 5 );
490 digi_not = ( ( overflow & 0x10 ) >> 4 );
491 digi_multiq = ( ( overflow & 0x08 ) >> 3 );
492 digi_multit = ( ( overflow & 0x04 ) >> 2 );
493 digi_overq = ( ( overflow & 0x02 ) >> 1 );
494 digi_overt = ( overflow & 0x01 );
496 digi_t0stat = t0stat;
660 ext_trackid = extTrack->
trackId();
661 ext_p = mdcTrack->
p();
662 ext_costheta=
cos( mdcTrack->
theta() );
664 int hitcase1[5], hitcase2[5], hitcase[5];
665 int tofId1[5], tofId2[5];
667 for(
unsigned int i=0; i<5; i++ ) {
673 ext_zrhit1[i] = -99.;
674 ext_zrhit2[i] = -99.;
686 ext_kalman[i] = mdcKalTrack->
getStat( 1, i );
697 if( tofId1[i]>=0 && tofId1[i]<=87 ) {
698 ext_tofid1[i] = tofId1[i];
701 else if( tofId1[i]>=176 && tofId1[i]<=223 ) {
702 ext_tofid1[i] = tofId1[i] - 176 + 48;
705 else if( tofId1[i]>=224 && tofId1[i]<=271 ) {
706 ext_tofid1[i] = tofId1[i] - 176 - 48;
709 else if( tofId1[i]>=272 && tofId1[i]<=1135 ) {
710 int module = tofId1[i] - 176 - 96;
711 ext_strip1[i] =
module%12;
712 ext_tofid1[i] =
module/12;
713 if( tofId1[i]>=272 && tofId1[i]<=703 ) {
716 else if( tofId1[i]>=704 && tofId1[i]<=1135 ) {
721 if( tofId2[i]>=88 && tofId2[i]<=175 ) {
722 ext_tofid2[i] = tofId2[i];
725 else if( tofId2[i]>=272 && tofId2[i]<=1135 ) {
726 int module = tofId2[i] - 176 - 96;
727 ext_strip2[i] =
module%12;
728 ext_tofid2[i] =
module/12;
729 if( tofId2[i]>=272 && tofId2[i]<=703 ) {
732 else if( tofId2[i]>=704 && tofId2[i]<=1135 ) {
744 if( ( hitcase1[i] == 0 ) || ( hitcase1[i] == 2 ) ) {
745 ext_texp1[i] = extTrack->
tof1( i );
746 ext_path1[i] = extTrack->
tof1Path( i );
752 else if( ( hitcase1[i] == 3 ) || ( hitcase1[i] == 4 ) ) {
753 ext_texp1[i] = extTrack->
tof1( i );
754 ext_path1[i] = extTrack->
tof1Path( i );
760 else if( ( hitcase1[i] == 5 ) || ( hitcase1[i] == 6 ) ) {
761 ext_texp1[i] = extTrack->
tof1( i );
762 ext_path1[i] = extTrack->
tof1Path( i );
769 if( ( hitcase2[i] == 5 ) || ( hitcase2[i] == 6 ) ) {
770 ext_texp2[i] = extTrack->
tof2( i );
771 ext_path2[i] = extTrack->
tof2Path( i );
777 else if( hitcase2[i] == 1 ) {
778 ext_texp2[i] = extTrack->
tof2( i );
779 ext_path2[i] = extTrack->
tof2Path( i );
786 if( ( hitcase1[i] == 7 ) && ( hitcase2[i] == 7 ) ) { ext_quality[i] = 3; }
787 else { ext_quality[i] = 0; }
789 if( hitcase1[i] == 0 ) {
790 if( hitcase2[i] == 1 ) { hitcase[i] = 2; }
791 else if( hitcase2[i] == 7 ) { hitcase[i] = 0; }
793 else if( ( hitcase1[i] == 3 ) || ( hitcase1[i] == 4 ) ) {
794 if( hitcase2[i] == 7 ) { hitcase[i] == hitcase1[i]; }
796 else if( ( hitcase1[i] == 5 ) || ( hitcase1[i] == 6 ) ) {
797 if( hitcase2[i] == 7 ) { hitcase[i] == hitcase1[i]; }
800 if( hitcase2[i] == 1 ) {
801 if( hitcase1[i] == 7 ) { hitcase[i] = 1; }
803 else if( ( hitcase2[i] == 5 ) || ( hitcase2[i] == 6 ) ) {
804 if( hitcase1[i] == 7 ) { hitcase[i] == hitcase2[i]; }
805 else if( hitcase1[i] == hitcase2[i] ) { hitcase[i] == hitcase2[i]; }
808 ext_hitcase1[i] = hitcase1[i];
809 ext_hitcase2[i] = hitcase2[i];
810 ext_hitcase[i] = hitcase[i];
1153 RecMdcKalTrackCol::iterator
iter = mdcKalTrackCol.begin();
1154 for( ;
iter != mdcKalTrackCol.end();
iter++ ) {
1155 if( (*iter)->trackId() == tof->
trackId() ) {
1156 double kappa = 10000.0;
1157 double tanl = -10000.0;
1160 kappa = (*iter)->kappa();
1161 tanl = (*iter)->tanl();
1162 if( kappa>0 ) { tof_charge = 1; }
1163 else { tof_charge = -1; }
1164 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1165 tof_pt[0] = 1.0/kappa;
1166 tof_p[0] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[0]);
1169 kappa = (*iter)->kappa();
1170 tanl = (*iter)->tanl();
1171 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1172 tof_pt[1] = 1.0/kappa;
1173 tof_p[1] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[1]);
1176 kappa = (*iter)->kappa();
1177 tanl = (*iter)->tanl();
1178 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1179 tof_pt[2] = 1.0/kappa;
1180 tof_p[2] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[2]);
1183 kappa = (*iter)->kappa();
1184 tanl = (*iter)->tanl();
1185 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1186 tof_pt[3] = 1.0/kappa;
1187 tof_p[3] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[3]);
1190 kappa = (*iter)->kappa();
1191 tanl = (*iter)->tanl();
1192 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1193 tof_pt[4] = 1.0/kappa;
1194 tof_p[4] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[4]);
1199 tof_id1 = tof->
id1();
1200 tof_id2 = tof->
id2();
1205 tof_barrel = tof->
barrel();
1207 tof_momentum = tof->
p();
1208 tof_path1 = tof->
path1();
1209 tof_path2 = tof->
path2();
1210 tof_zrhit1 = tof->
zrhit1();
1211 tof_zrhit2 = tof->
zrhit2();
1214 tof_xhit1 = tof->
xhit1();
1215 tof_yhit1 = tof->
yhit1();
1216 tof_xhit2 = tof->
xhit2();
1217 tof_yhit2 = tof->
yhit2();
1218 for(
unsigned int i=0; i<5; i++ ) {
1219 tof_kal[i] = tof->
kal(i);
1220 tof_zr1[i] = tof->
zr1(i);
1221 tof_zr2[i] = tof->
zr2(i);
1223 tof_ztdc1 = tof->
ztdc1();
1224 tof_ztdc2 = tof->
ztdc2();
1225 tof_zadc1 = tof->
zadc1();
1226 tof_zadc2 = tof->
zadc2();
1247 tof_size1 = tof->
size1();
1248 tof_size2 = tof->
size2();
1249 tof_size3 = tof->
size3();
1250 tof_size4 = tof->
size4();
1251 tof_theta1 = tof->
theta1();
1252 tof_theta2 = tof->
theta2();
1253 tof_phi1 = tof->
phi1();
1254 tof_phi2 = tof->
phi2();
1258 tof_tofid1 = tof->
tofId1();
1259 tof_tofid2 = tof->
tofId2();
1260 tof_strip1 = tof->
strip1();
1261 tof_strip2 = tof->
strip2();
1274 tof_ph11 = tof->
ph11();
1275 tof_ph12 = tof->
ph12();
1276 tof_ph21 = tof->
ph21();
1277 tof_ph22 = tof->
ph22();
1278 tof_ph1 = tof->
ph1();
1279 tof_ph2 = tof->
ph2();
1281 tof_tofe11 = tof->
tof11(0);
1282 tof_tofe12 = tof->
tof12(0);
1283 tof_tofe21 = tof->
tof21(0);
1284 tof_tofe22 = tof->
tof22(0);
1285 tof_tofe1 = tof->
tof1(0);
1286 tof_tofe2 = tof->
tof2(0);
1287 tof_tofe = tof->
tof(0);
1288 tof_tofmu11 = tof->
tof11(1);
1289 tof_tofmu12 = tof->
tof12(1);
1290 tof_tofmu21 = tof->
tof21(1);
1291 tof_tofmu22 = tof->
tof22(1);
1292 tof_tofmu1 = tof->
tof1(1);
1293 tof_tofmu2 = tof->
tof2(1);
1294 tof_tofmu = tof->
tof(1);
1295 tof_tofpi11 = tof->
tof11(2);
1296 tof_tofpi12 = tof->
tof12(2);
1297 tof_tofpi21 = tof->
tof21(2);
1298 tof_tofpi22 = tof->
tof22(2);
1299 tof_tofpi1 = tof->
tof1(2);
1300 tof_tofpi2 = tof->
tof2(2);
1301 tof_tofpi = tof->
tof(2);
1302 tof_tofk11 = tof->
tof11(3);
1303 tof_tofk12 = tof->
tof12(3);
1304 tof_tofk21 = tof->
tof21(3);
1305 tof_tofk22 = tof->
tof22(3);
1306 tof_tofk1 = tof->
tof1(3);
1307 tof_tofk2 = tof->
tof2(3);
1308 tof_tofk = tof->
tof(3);
1309 tof_tofp11 = tof->
tof11(4);
1310 tof_tofp12 = tof->
tof12(4);
1311 tof_tofp21 = tof->
tof21(4);
1312 tof_tofp22 = tof->
tof22(4);
1313 tof_tofp1 = tof->
tof1(4);
1314 tof_tofp2 = tof->
tof2(4);
1315 tof_tofp = tof->
tof(4);
1316 tof_qch1 = tof->
qch1();
1317 tof_qch2 = tof->
qch2();
1318 tof_qch3 = tof->
qch3();
1319 tof_qch4 = tof->
qch4();
1320 tof_adc1 = tof->
adc1();
1321 tof_adc2 = tof->
adc2();
1322 tof_adc3 = tof->
adc3();
1323 tof_adc4 = tof->
adc4();
1324 tof_tdc1 = tof->
tdc1();
1325 tof_tdc2 = tof->
tdc2();
1326 tof_tdc3 = tof->
tdc3();
1327 tof_tdc4 = tof->
tdc4();
1338 tof_texpe = tof->
texp(0);
1339 tof_texpmu = tof->
texp(1);
1340 tof_texppi = tof->
texp(2);
1341 tof_texpk = tof->
texp(3);
1342 tof_texpp = tof->
texp(4);
1343 tof_tdiff1 = tof->
tdiff1();
1344 tof_tdiff2 = tof->
tdiff2();
1345 tof_estime = estime;
1346 tof_t0stat = t0stat;
1359 RecMdcKalTrackCol::iterator
iter = mdcKalTrackCol.begin();
1360 for( ;
iter != mdcKalTrackCol.end();
iter++ ) {
1361 if( (*iter)->trackId() == tof->
trackId() ) {
1362 double kappa = 10000.0;
1363 double tanl = -10000.0;
1366 kappa = (*iter)->kappa();
1367 tanl = (*iter)->tanl();
1368 if( kappa>0 ) { tof_charge = 1; }
1369 else { tof_charge = -1; }
1370 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1371 tof_pt[0] = 1.0/kappa;
1372 tof_p[0] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[0]);
1375 kappa = (*iter)->kappa();
1376 tanl = (*iter)->tanl();
1377 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1378 tof_pt[1] = 1.0/kappa;
1379 tof_p[1] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[1]);
1382 kappa = (*iter)->kappa();
1383 tanl = (*iter)->tanl();
1384 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1385 tof_pt[2] = 1.0/kappa;
1386 tof_p[2] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[2]);
1389 kappa = (*iter)->kappa();
1390 tanl = (*iter)->tanl();
1391 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1392 tof_pt[3] = 1.0/kappa;
1393 tof_p[3] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[3]);
1396 kappa = (*iter)->kappa();
1397 tanl = (*iter)->tanl();
1398 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
1399 tof_pt[4] = 1.0/kappa;
1400 tof_p[4] =
abs(sqrt(1.0+tanl*tanl)*tof_pt[4]);
1405 tof_id1 = tof->
id1();
1406 tof_id2 = tof->
id2();
1409 tof_barrel = tof->
barrel();
1411 tof_momentum = tof->
p();
1412 tof_path1 = tof->
path1();
1413 tof_path2 = tof->
path2();
1414 tof_zrhit1 = tof->
zrhit1();
1415 tof_zrhit2 = tof->
zrhit2();
1418 tof_xhit1 = tof->
xhit1();
1419 tof_yhit1 = tof->
yhit1();
1420 tof_xhit2 = tof->
xhit2();
1421 tof_yhit2 = tof->
yhit2();
1422 for(
unsigned int i=0; i<5; i++ ) {
1423 tof_kal[i] = tof->
kal(i);
1424 tof_zr1[i] = tof->
zr1(i);
1425 tof_zr2[i] = tof->
zr2(i);
1427 tof_ztdc1 = tof->
ztdc1();
1428 tof_ztdc2 = tof->
ztdc2();
1429 tof_zadc1 = tof->
zadc1();
1430 tof_zadc2 = tof->
zadc2();
1451 tof_size1 = tof->
size1();
1452 tof_size2 = tof->
size2();
1453 tof_size3 = tof->
size3();
1454 tof_size4 = tof->
size4();
1455 tof_theta1 = tof->
theta1();
1456 tof_theta2 = tof->
theta2();
1457 tof_phi1 = tof->
phi1();
1458 tof_phi2 = tof->
phi2();
1462 tof_tofid1 = tof->
tofId1();
1463 tof_tofid2 = tof->
tofId2();
1464 tof_strip1 = tof->
strip1();
1465 tof_strip2 = tof->
strip2();
1478 tof_ph11 = tof->
ph11();
1479 tof_ph12 = tof->
ph12();
1480 tof_ph21 = tof->
ph21();
1481 tof_ph22 = tof->
ph22();
1482 tof_ph1 = tof->
ph1();
1483 tof_ph2 = tof->
ph2();
1485 tof_tofe11 = tof->
tof11(0);
1486 tof_tofe12 = tof->
tof12(0);
1487 tof_tofe21 = tof->
tof21(0);
1488 tof_tofe22 = tof->
tof22(0);
1489 tof_tofe1 = tof->
tof1(0);
1490 tof_tofe2 = tof->
tof2(0);
1491 tof_tofe = tof->
tof(0);
1492 tof_tofmu11 = tof->
tof11(1);
1493 tof_tofmu12 = tof->
tof12(1);
1494 tof_tofmu21 = tof->
tof21(1);
1495 tof_tofmu22 = tof->
tof22(1);
1496 tof_tofmu1 = tof->
tof1(1);
1497 tof_tofmu2 = tof->
tof2(1);
1498 tof_tofmu = tof->
tof(1);
1499 tof_tofpi11 = tof->
tof11(2);
1500 tof_tofpi12 = tof->
tof12(2);
1501 tof_tofpi21 = tof->
tof21(2);
1502 tof_tofpi22 = tof->
tof22(2);
1503 tof_tofpi1 = tof->
tof1(2);
1504 tof_tofpi2 = tof->
tof2(2);
1505 tof_tofpi = tof->
tof(2);
1506 tof_tofk11 = tof->
tof11(3);
1507 tof_tofk12 = tof->
tof12(3);
1508 tof_tofk21 = tof->
tof21(3);
1509 tof_tofk22 = tof->
tof22(3);
1510 tof_tofk1 = tof->
tof1(3);
1511 tof_tofk2 = tof->
tof2(3);
1512 tof_tofk = tof->
tof(3);
1513 tof_tofp11 = tof->
tof11(4);
1514 tof_tofp12 = tof->
tof12(4);
1515 tof_tofp21 = tof->
tof21(4);
1516 tof_tofp22 = tof->
tof22(4);
1517 tof_tofp1 = tof->
tof1(4);
1518 tof_tofp2 = tof->
tof2(4);
1519 tof_tofp = tof->
tof(4);
1520 tof_qch1 = tof->
qch1();
1521 tof_qch2 = tof->
qch2();
1522 tof_qch3 = tof->
qch3();
1523 tof_qch4 = tof->
qch4();
1524 tof_adc1 = tof->
adc1();
1525 tof_adc2 = tof->
adc2();
1526 tof_adc3 = tof->
adc3();
1527 tof_adc4 = tof->
adc4();
1528 tof_tdc1 = tof->
tdc1();
1529 tof_tdc2 = tof->
tdc2();
1530 tof_tdc3 = tof->
tdc3();
1531 tof_tdc4 = tof->
tdc4();
1542 tof_texpe = tof->
texp(0);
1543 tof_texpmu = tof->
texp(1);
1544 tof_texppi = tof->
texp(2);
1545 tof_texpk = tof->
texp(3);
1546 tof_texpp = tof->
texp(4);
1547 tof_tdiff1 = tof->
tdiff1();
1548 tof_tdiff2 = tof->
tdiff2();
1549 tof_estime = estime;
1550 tof_t0stat = t0stat;
1553 if( calibData ==
"Bhabha" ) { particleId = 11; }
1554 else if( calibData ==
"Dimu" ) { particleId = 13; }
1555 else if( calibData ==
"pion" ) { particleId = 211; }
1556 else if( calibData ==
"kaon" ) { particleId = 321; }
1557 else if( calibData ==
"proton" ) { particleId = 2212; }
1559 cout <<
"Reconstruction::TofRec::TofCheckDigi::Fill_TofTrack: For MC, Wrong Input Particle ID!" << endl;
1563 tof_mctofp = -100.0;
1564 tof_mctrkid = -100.0;
1565 tof_mcpath = -100.0;
1566 tof_mctexp = -100.0;
1567 tof_mczrhit = -1000.0;
1569 McParticleCol::iterator iter_mc = mcParticleCol.begin();
1570 for( ; iter_mc != mcParticleCol.end(); iter_mc++ ) {
1571 int pid = (*iter_mc)->particleProperty();
1572 if(
abs(pid) != particleId )
continue;
1573 if( ( particleId==11 || particleId==13 ) && ( ( pid>0 && tof_charge>0 ) || ( pid<0 && tof_charge<0 ) ) )
continue;
1574 if( ( particleId!=11 && particleId!=13 ) && ( ( pid>0 && tof_charge<0 ) || ( pid<0 && tof_charge>0 ) ) )
continue;
1576 int trkIndex = (*iter_mc)->trackIndex();
1577 tof_mcp = (*iter_mc)->initialFourMomentum().rho();
1579 TofMcHitCol::iterator iter_mc_tof = tofMcCol.begin();
1580 for( ; iter_mc_tof != tofMcCol.end(); iter_mc_tof++ ) {
1581 if( trkIndex != (*iter_mc_tof)->getTrackIndex() )
continue;
1582 double mcposx = (*iter_mc_tof)->getPositionX();
1583 double mcposy = (*iter_mc_tof)->getPositionY();
1584 double mcposr = 0.1*sqrt(mcposx*mcposx+mcposy*mcposy);
1585 double mcposz = 0.1*(*iter_mc_tof)->getPositionZ();
1586 double mcpx = (*iter_mc_tof)->getPx();
1587 double mcpy = (*iter_mc_tof)->getPy();
1588 double mcpz = (*iter_mc_tof)->getPz();
1589 double mctofp = 0.001*sqrt(mcpx*mcpx+mcpy*mcpy+mcpz*mcpz);
1590 tof_mctofp = mctofp;
1591 tof_mctrkid = (*iter_mc_tof)->getTrackIndex();
1592 tof_mcpath = 0.1*(*iter_mc_tof)->getTrackLength();
1593 tof_mctexp = (*iter_mc_tof)->getFlightTime();
1595 tof_mczrhit = mcposz;
1598 tof_mczrhit = mcposr;
1632 bb_trksize = extTrackCol.size();
1633 bb_mdcsize = mdcTrackCol.size();
1634 bb_emcsize = emcShowerCol.size();
1636 RecMdcTrackCol::iterator iter_mdc1 = mdcTrackCol.begin();
1637 RecMdcTrackCol::iterator iter_mdc2 = mdcTrackCol.begin() + 1;
1639 Hep3Vector
p1 = (*iter_mdc1)->p3();
1640 Hep3Vector
p2 = (*iter_mdc2)->p3();
1642 bb_trk1 = (*iter_mdc1)->trackId();
1643 bb_pmdc1 = (*iter_mdc1)->p();
1644 bb_ptmdc1 = (*iter_mdc1)->pxy();
1645 bb_theta1 = (*iter_mdc1)->theta();
1646 bb_phi1 = (*iter_mdc1)->phi();
1647 bb_x1 = (*iter_mdc1)->x();
1648 bb_y1 = (*iter_mdc1)->y();
1649 bb_z1 = (*iter_mdc1)->z();
1650 bb_r1 = (*iter_mdc1)->r();
1651 bb_charge1 = (*iter_mdc1)->charge();
1652 bb_chi1 = (*iter_mdc1)->chi2();
1653 bb_ndof1 = (*iter_mdc1)->ndof();
1654 bb_layer1 = (*iter_mdc1)->lastLayer();
1655 bb_trk2 = (*iter_mdc2)->trackId();
1656 bb_pmdc2 = (*iter_mdc2)->p();
1657 bb_ptmdc2 = (*iter_mdc2)->pxy();
1658 bb_theta2 = (*iter_mdc2)->theta();
1659 bb_phi2 = (*iter_mdc2)->phi();
1660 bb_x2 = (*iter_mdc2)->x();
1661 bb_y2 = (*iter_mdc2)->y();
1662 bb_z2 = (*iter_mdc2)->z();
1663 bb_r2 = (*iter_mdc2)->r();
1664 bb_charge2 = (*iter_mdc2)->charge();
1665 bb_chi2 = (*iter_mdc2)->chi2();
1666 bb_ndof2 = (*iter_mdc2)->ndof();
1667 bb_layer2 = (*iter_mdc2)->lastLayer();
1669 bb_dang = 180.0 -
p1.angle(
p2.unit() )*180.0/
pi;
1670 bb_dphi =
abs( (*iter_mdc1)->phi() - (*iter_mdc2)->phi() )*180.0/
pi;
1672 RecMdcKalTrackCol::iterator iter_kal1 = mdcKalTrackCol.begin();
1673 RecMdcKalTrackCol::iterator iter_kal2 = mdcKalTrackCol.begin() + 1;
1675 if( ( (*iter_kal1)->trackId() == (*iter_mdc2)->trackId() ) && ( (*iter_kal2)->trackId() == (*iter_mdc1)->trackId() ) ) {
1676 RecMdcKalTrackCol::iterator iter_tmp = iter_kal1;
1677 iter_kal1 = iter_kal2;
1678 iter_kal2 = iter_tmp;
1684 double tanl1 = (*iter_kal1)->tanl();
1685 double kappa1 = (*iter_kal1)->kappa();
1686 double tanl2 = (*iter_kal2)->tanl();
1687 double kappa2 = (*iter_kal2)->kappa();
1688 bb_pe1 = sqrt(1.0+tanl1*tanl1)/kappa1;
1689 bb_pte1 = 1.0/kappa1;
1690 bb_pe2 = sqrt(1.0+tanl2*tanl2)/kappa2;
1691 bb_pte2 = 1.0/kappa2;
1695 tanl1 = (*iter_kal1)->tanl();
1696 kappa1 = (*iter_kal1)->kappa();
1697 tanl2 = (*iter_kal2)->tanl();
1698 kappa2 = (*iter_kal2)->kappa();
1699 bb_pmu1 = sqrt(1.0+tanl1*tanl1)/kappa1;
1700 bb_ptmu1 = 1.0/kappa1;
1701 bb_pmu2 = sqrt(1.0+tanl2*tanl2)/kappa2;
1702 bb_ptmu2 = 1.0/kappa2;
1704 RecExtTrackCol::iterator iter_ext1 = extTrackCol.begin();
1705 RecExtTrackCol::iterator iter_ext2 = extTrackCol.begin() + 1;
1707 Hep3Vector extPos1 = (*iter_ext1)->emcPosition();
1708 Hep3Vector extPos2 = (*iter_ext2)->emcPosition();
1710 bb_extx1 = extPos1.x();
1711 bb_exty1 = extPos1.y();
1712 bb_extz1 = extPos1.z();
1713 bb_extx2 = extPos2.x();
1714 bb_exty2 = extPos2.y();
1715 bb_extz2 = extPos2.z();
1717 RecEmcShowerCol::iterator iter_emc1 = emcShowerCol.begin();
1718 RecEmcShowerCol::iterator iter_emc2 = emcShowerCol.begin() + 1;
1720 Hep3Vector emcPos1((*iter_emc1)->x(),(*iter_emc1)->y(),(*iter_emc1)->z());
1721 Hep3Vector emcPos2((*iter_emc2)->x(),(*iter_emc2)->y(),(*iter_emc2)->z());
1726 Hep3Vector dis1 = extPos1 - emcPos1;
1727 Hep3Vector dis2 = extPos2 - emcPos1;
1731 if( dis1.r() > dis2.r() ) {
1732 RecEmcShowerCol::iterator iter_tmp = iter_emc1;
1733 iter_emc1 = iter_emc2;
1734 iter_emc2 = iter_tmp;
1735 Hep3Vector emc_tmp = emcPos1;
1739 dis1 = extPos1 - emcPos1;
1740 dis2 = extPos2 - emcPos2;
1742 bb_emctrk1 = (*iter_emc1)->trackId();
1743 bb_emcx1 = (*iter_emc1)->x();
1744 bb_emcy1 = (*iter_emc1)->y();
1745 bb_emcz1 = (*iter_emc1)->z();
1746 bb_ep1 = (*iter_emc1)->energy()/(*iter_mdc1)->p();;
1747 bb_th1 = (*iter_emc1)->theta();
1748 bb_ph1 = (*iter_emc1)->phi();
1749 bb_emctrk2 = (*iter_emc2)->trackId();
1750 bb_emcx2 = (*iter_emc2)->x();
1751 bb_emcy2 = (*iter_emc2)->y();
1752 bb_emcz2 = (*iter_emc2)->z();
1753 bb_ep2 = (*iter_emc2)->energy()/(*iter_mdc2)->p();;
1754 bb_th2 = (*iter_emc2)->theta();
1755 bb_ph2 = (*iter_emc2)->phi();
1757 bb_drxy1 = dis1.rho();
1760 bb_drxy2 = dis2.rho();
1764 RecEmcShowerCol::iterator iter_emc = emcShowerCol.begin();
1765 for( ; iter_emc != emcShowerCol.end(); iter_emc++ ) {
1766 etot += (*iter_emc)->energy();
1768 bb_etot =
etot - (*iter_emc1)->energy() - (*iter_emc2)->energy();