1013{
1014 MsgStream log(
msgSvc(), name());
1015 log << MSG::INFO <<" In findD0Decay " << endmsg ;
1016
1017 vector<double> d0_info(7);
1018 for(int i=0; i< 7; i++) d0_info[i]=0;
1019 double decay_mode = 9;
1020 double r2D0 = -1;
1021 double deltaD0 = -1;
1022
1024 for(
int i=0; i< 26; i++)
num[i]=0;
1025
1026 int kPiPlus = 0;
1027 int kPiMinus = 1;
1028 int kPi0 = 2;
1029 int kEta = 3;
1030 int kEtaPrime = 4;
1031 int kNeutralScalar = 5;
1032 int kUFVPlus = 6;
1033 int kUFVMinus = 7;
1034 int kRho0 = 8;
1035 int kOmega = 9;
1036 int kPhi = 10;
1037 int kKPlus = 11;
1038 int kKMinus = 12;
1039 int kK0S = 13;
1040 int kK0L = 14;
1041 int kFVPlus = 15;
1042 int kFVMinus = 16;
1043 int kKStar0 = 17;
1044 int kKStar0Bar = 18;
1045 int kK10 = 19;
1046 int kK10Bar = 20;
1047 int kLeptonPlus = 21;
1048 int kLeptonMinus = 22;
1049 int kNeutrino = 23;
1050 int kGamma = 24;
1051 int kUnknown = 25;
1052
1053
1054
1056 int d0_pdg = charm == 1 ? kD0ID : kD0BarID;
1057
1058 HepLorentzVector piPlus, piMinus, k0;
1059
1060 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
1061 {
1062 int pdg_code = (*it)->particleProperty();
1063 if ((*it)->primaryParticle()) continue;
1065 int mother_pdg = 0;
1066
1067
1069
1070
1071 if (pdg_code == kKStar0ID || pdg_code == kKStar0BarID || pdg_code == kK0ID || pdg_code == kK0BarID
1072 || pdg_code == kK10ID || pdg_code == kK10BarID
1073 || pdg_code == kK0Star0ID || pdg_code == kK0Star0BarID || pdg_code == kK0StarPlusID || pdg_code == kK0BarID ) continue;
1074
1075 if (mother_pdg == kK0ID || mother_pdg == kK0BarID) {
1078
1079 if (mother_pdg == kKStar0ID || mother_pdg == kKStar0BarID) {
1080
1081
1082 if (pdg_code == kPiPlusID || pdg_code == kPiMinusID) continue;
1083 if (mother_pdg == kKStar0ID && pdg_code == kKPlusID) pdg_code = kKStar0ID;
1084 if (mother_pdg == kKStar0BarID && pdg_code == kKMinusID) pdg_code = kKStar0BarID;
1087 }
1088
1089 if ( mother_pdg == kK0Star0ID || mother_pdg == kK0Star0BarID ) {
1092 }
1093
1094 if (mother_pdg == kK10ID || mother_pdg == kK10BarID) {
1097 }
1098
1099
1100
1101
1102 if (mother_pdg == d0_pdg)
1103 {
1104 if (pdg_code == kPiPlusID || pdg_code == kA0PlusID )
num[0]++;
1105 else if (pdg_code == kPiMinusID || pdg_code == kA0MinusID )
num[1]++;
1106 else if (pdg_code == kPi0ID )
num[2]++;
1107 else if (pdg_code == kEtaID )
num[3]++;
1108 else if (pdg_code == kEtaPrimeID )
num[4]++;
1109 else if (pdg_code == kF0ID || pdg_code == kA00ID
1110 || pdg_code == kFPrime0ID|| pdg_code == kF0m1500ID
1111 || pdg_code == kF2ID)
num[5]++;
1112 else if (pdg_code == kRhoPlusID || pdg_code == kRho2SPlusID
1113 || pdg_code == kA1PlusID )
num[6]++;
1114 else if (pdg_code == kRhoMinusID || pdg_code == kRho2SMinusID
1115 || pdg_code == kA1MinusID)
num[7]++;
1116 else if (pdg_code == kRho0ID || pdg_code == kRho2S0ID)
num[8]++;
1117 else if (pdg_code == kOmegaID )
num[9]++;
1118 else if (pdg_code == kPhiID )
num[10]++;
1119 else if (pdg_code == kKPlusID )
num[11]++;
1120 else if (pdg_code == kKMinusID )
num[12]++;
1121 else if (pdg_code == kK0SID )
num[13]++;
1122 else if (pdg_code == kK0LID )
num[14]++;
1123 else if (pdg_code == kKStarPlusID || pdg_code == kK1PlusID
1124 || pdg_code == kK2StarPlusID || pdg_code == kK1PrimePlusID
1125 || pdg_code == kK0StarPlusID)
num[15]++;
1126 else if (pdg_code == kKStarMinusID || pdg_code == kK1MinusID
1127 || pdg_code == kK2StarMinusID || pdg_code == kK1PrimeMinusID
1128 || pdg_code == kK0StarMinusID )
num[16]++;
1129 else if (pdg_code == kKStar0ID )
num[17]++;
1130 else if (pdg_code == kKStar0BarID )
num[18]++;
1131 else if (pdg_code == kK10ID || pdg_code == kK1Prime0ID)
num[19]++;
1132 else if (pdg_code == kK10BarID || pdg_code == kK1Prime0BarID)
num[20]++;
1133 else if (pdg_code == kEPlusID || pdg_code == kMuPlusID )
num[21]++;
1134 else if (pdg_code == kEMinusID || pdg_code == kMuMinusID )
num[22]++;
1135 else if (pdg_code == kNuEID || pdg_code == kNuEBarID
1136 || pdg_code == kNuMuID || pdg_code == kNuMuBarID )
num[23]++;
1137 else if (pdg_code == kGammaID )
num[24]++;
1138 else if (pdg_code == kGammaFSRID ) continue;
1139 else {
1141 cout <<"Unknown particle: "<< pdg_code << endl;
1142 }
1143
1144
1145
1146
1147
1148 if (pdg_code == kPiPlusID) piPlus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1149 if (pdg_code == kPiMinusID) piMinus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1150 if (pdg_code == kK0SID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1151 if (pdg_code == kK0LID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1152 }
1153 }
1154
1155
1156 int nDaughters = 0 ;
1157 for( int i = 0 ; i < 26 ; i++ )
1158 {
1159 nDaughters +=
num[ i ] ;
1160 }
1161
1162 int nUFP0 =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] ;
1163 int nUFV0 =
num[ kRho0 ] +
num[ kPhi ] +
num[ kOmega ] +
num[ kGamma ] ;
1164 int nFV0 =
num[ kKStar0 ] +
num[ kK10 ] ;
1165 int nFV0Bar =
num[ kKStar0Bar ] +
num[ kK10Bar ] ;
1166 int nStrange =
num[ kKMinus ] +
num[ kFVMinus ] + nFV0Bar ;
1167 int nAntiStrange =
num[ kKPlus ] +
num[ kFVPlus ] + nFV0 ;
1168 int nCPPlusEig =
num[ kNeutralScalar ] +
num[ kRho0 ] +
num[ kOmega ] +
num[ kPhi ] +
num[ kK0S ] +
num[ kGamma ] ;
1169 int nCPMinusEig =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] +
num[ kK0L ] ;
1170 int nCPEig = nCPPlusEig + nCPMinusEig ;
1171 int nChargedPiK =
num[ kPiPlus ] +
num[ kPiMinus ] +
num[ kKPlus ] +
num[ kKMinus ] ;
1172 int nK0 =
num[ kK0S ] +
num[ kK0L ] ;
1173
1174
1175
1176 double mnm_gen = 0. ;
1177 double mpn_gen = 0. ;
1178 double mpm_gen = 0. ;
1179 bool isKsPiPi =
false ;
1180
1181 if( nK0 == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] && nDaughters == 3 )
1182 {
1183 decay_mode = kDalitz ;
1184 k0.boost(-0.011, 0, 0);
1185 piMinus.boost(-0.011, 0, 0);
1186 piPlus.boost(-0.011, 0, 0);
1187 mnm_gen = (k0 + piMinus).m2();
1188 mpn_gen = (k0 + piPlus).m2();
1189 mpm_gen = (piPlus + piMinus).m2();
1190 if(
num[ kK0S ] == 1) isKsPiPi =
true ;
1191 }
1192
1193
1194 if( decay_mode == kDalitz )
1195 {
1196 ++m_nDalitz ;
1197
1200 if (m_dalitzModel == 0) {
1201 D0 =
t.CLEO_Amplitude( mpn_gen, mnm_gen, mpm_gen ) ;
1202 D0bar =
t.CLEO_Amplitude( mnm_gen, mpn_gen, mpm_gen ) ;}
1203 if (m_dalitzModel == 1) {
1204 D0 =
t.Babar_Amplitude( mpn_gen, mnm_gen, mpm_gen ) ;
1205 D0bar =
t.Babar_Amplitude( mnm_gen, mpn_gen, mpm_gen ) ;}
1206 if (m_dalitzModel == 2) {
1207 D0 =
t.Amplitude( mpn_gen, mnm_gen, mpm_gen ) ;
1208 D0bar =
t.Amplitude( mnm_gen, mpn_gen, mpm_gen ) ;}
1209
1210 if( charm == 1){
1211 r2D0 = norm( D0bar ) / norm( D0 ) ;
1212 deltaD0 =
arg( D0 *
conj( D0bar ) ) + ( isKsPiPi ?
PI : 0. );
1213
1214 double cosd =
cos( deltaD0 ) ;
1215 double sind =
sin( deltaD0 ) ;
1216 if( mpn_gen - mnm_gen > 0. )
1217 {
1218 m_dalitzNumer1 += -2. * sqrt( r2D0 ) * cosd ;
1219 m_dalitzNumer2 += 2. * r2D0 * cosd * sind * m_x ;
1220 m_dalitzDenom += -2. * r2D0 * cosd * cosd ;
1221 }
1222 }
1223 else {
1224 r2D0 = norm( D0 ) / norm( D0bar ) ;
1225 deltaD0 =
arg( D0bar *
conj( D0 ) ) + ( isKsPiPi ?
PI : 0. ) ;
1226
1227 double cosd =
cos( deltaD0 ) ;
1228 double sind =
sin( deltaD0 ) ;
1229 if( mpn_gen - mnm_gen < 0. )
1230 {
1231 m_dalitzNumer1 += -2. * sqrt( r2D0 ) * cosd ;
1232 m_dalitzNumer2 += 2. * r2D0 * cosd * sind * m_x ;
1233 m_dalitzDenom += -2. * r2D0 * cosd * cosd ;
1234 }
1235 }
1236 }
1237 else if(
num[ kLeptonPlus ] == 1 )
1238 {
1239 decay_mode = kSLPlus ;
1240 ++m_nSL ;
1241
1242 r2D0 = 0. ;
1243 deltaD0 = 0. ;
1244 }
1245 else if(
num[ kLeptonMinus ] == 1 )
1246 {
1247 decay_mode = kSLMinus ;
1248 ++m_nSL ;
1249
1250 r2D0 = 0. ;
1251 deltaD0 = 0. ;
1252 }
1253
1254 else if(
1255 ( nDaughters == 2 &&
1256 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 ) ||
1257 nUFP0 == 2 ||
1258 num[ kNeutralScalar ] == 2 ||
1259 ( nUFP0 == 1 && nUFV0 == 1 ) ||
1260 (
num[ kNeutralScalar ] == 1 && nUFV0 == 1 ) ||
1261 (
num[ kKPlus ] == 1 &&
num[ kKMinus ] == 1 ) ||
1264 (
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
1265 (
num[ kK0S ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
1266 (
num[ kK0L ] == 1 && nUFV0 == 1 ) ) ) ||
1267 ( nDaughters == 3 &&
1268 ( ( nCPPlusEig == 1 &&
num[ kPi0 ] == 2 ) ||
1269 (
num[ kK0S ] == 3 ) ) ) ||
1270 ( nDaughters == 4 &&
1271 num[ kK0L ] == 1 &&
num[ kPi0 ] == 3 )
1272 )
1273 {
1274 decay_mode = kCPPlus ;
1275 ++m_nCPPlus ;
1276
1277 r2D0 = 1. ;
1279 }
1280
1281 else if(
1282 ( nDaughters == 2 &&
1283 ( (
num[ kK0S ] == 1 && nUFP0 == 1 ) ||
1284 (
num[ kK0L ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
1285 (
num[ kK0S ] == 1 && nUFV0 == 1 ) ||
1286 ( nUFP0 == 1 &&
num[ kNeutralScalar ] == 1 ) ) ) ||
1287 ( nDaughters == 3 &&
1288 ( ( nCPMinusEig == 3 &&
num[ kPi0 ] == 2 ) ||
1289 (
num[ kPi0 ] == 3 ) ||
1290 (
num[ kK0L ] == 3 ) ) ) ||
1291 ( nDaughters == 4 &&
1292 num[ kK0S ] == 1 &&
num[ kPi0 ] == 3 )
1293 )
1294 {
1295 decay_mode = kCPMinus ;
1296 ++m_nCPMinus ;
1297
1298 r2D0 = 1. ;
1299 deltaD0 = 0. ;
1300 }
1301 else if( nStrange == nAntiStrange + 1 )
1302 {
1303 decay_mode = kFlavoredCF ;
1304
1305 if( charm == 1 )
1306 {
1307 ++m_nFlavoredCFD0 ;
1308 r2D0 = pow(m_rCF,2) ;
1309 deltaD0 = m_deltaCF ;
1310 }
1311 else
1312 {
1313 ++m_nFlavoredDCSD0 ;
1314 r2D0 = 1. / pow( m_rCF,2 ) ;
1315 deltaD0 = -m_deltaCF ;
1316 }
1317 }
1318 else if( nAntiStrange == nStrange + 1 )
1319 {
1320 decay_mode = kFlavoredCFBar ;
1321
1322 if( charm == -1 )
1323 {
1324 ++m_nFlavoredCFD0 ;
1325 r2D0 = pow( m_rCF, 2) ;
1326 deltaD0 = m_deltaCF ;
1327 }
1328 else
1329 {
1330 ++m_nFlavoredDCSD0 ;
1331 r2D0 = 1. / pow( m_rCF, 2) ;
1332 deltaD0 = -m_deltaCF ;
1333 }
1334 }
1335 else if( nStrange == nAntiStrange )
1336 {
1337 if( (
num[ kKPlus ] > 0 &&
1338 (
num[ kKPlus ] ==
num[ kFVMinus ] ||
1339 num[ kKPlus ] == nFV0Bar ) ) ||
1340 ( nK0 > 0 &&
1341 nFV0 != nFV0Bar &&
1342 nK0 == nFV0Bar ) ||
1343 (
num[ kPiPlus ] > 0 &&
1344 num[ kPiPlus ] ==
num[ kUFVMinus ] ) )
1345 {
1346 decay_mode = kFlavoredCS ;
1347 ++m_nFlavoredCSD0 ;
1348
1349 if( charm == 1 )
1350 {
1351 r2D0 = pow( m_rCS, 2 ) ;
1352 deltaD0 = m_deltaCS ;
1353 }
1354 else
1355 {
1356 r2D0 = 1. / pow( m_rCS, 2 ) ;
1357 deltaD0 = -m_deltaCS ;
1358 }
1359 }
1360 else if( (
num[ kKMinus ] > 0 && (
num[ kKMinus ] ==
num[ kFVPlus ] ||
num[ kKMinus ] == nFV0 ) ) ||
1361 ( nK0 > 0 && nFV0 != nFV0Bar && nK0 == nFV0 ) ||
1362 (
num[ kPiMinus ] > 0 &&
num[ kPiMinus ] ==
num[ kUFVPlus ] ) )
1363 {
1364 decay_mode = kFlavoredCSBar ;
1365 ++m_nFlavoredCSD0 ;
1366
1367 if( charm == -1 )
1368 {
1369 r2D0 = pow( m_rCS, 2 ) ;
1370 deltaD0 = m_deltaCS ;
1371 }
1372 else
1373 {
1374 r2D0 = 1. / pow( m_rCS, 2 ) ;
1375 deltaD0 = -m_deltaCS ;
1376 }
1377 }
1378
1379
1380
1381
1382 else if( ( nDaughters >= 3 &&
num[ kPiPlus ] ==
num[ kPiMinus ] &&
1383 num[ kKPlus ] ==
num[ kKMinus ] && nChargedPiK + nCPEig == nDaughters ) ||
1384 nUFV0 == nDaughters ||
1385 (
num[ kKStar0 ] > 0 &&
num[ kKStar0 ] ==
num[ kKStar0Bar ] ) ||
1386 (
num[ kK10 ] > 0 &&
num[ kK10 ] ==
num[ kK10Bar ] ) ||
1387 (
num[ kUFVPlus ] == 1 &&
num[ kUFVMinus ] == 1 )
1388
1389 )
1390 {
1391 log << MSG::DEBUG <<" [ Self-conjugate mixed-CP ]" << endmsg ;
1392
1393 if( RandFlat::shoot() > 0.5 )
1394 {
1395 if( RandFlat::shoot() > 0.5 )
1396 {
1397 decay_mode = kCPPlus ;
1398 ++m_nCPPlus ;
1399
1400 r2D0 = 1. ;
1402 }
1403 else
1404 {
1405 decay_mode = kCPMinus ;
1406 ++m_nCPMinus ;
1407
1408 r2D0 = 1. ;
1409 deltaD0 = 0. ;
1410 }
1411 }
1412 else
1413 {
1414
1415 if( nK0 % 2 )
1416 {
1417
1418 double cutoff = m_rwsCF / ( 1. + m_rwsCF ) ;
1419
1420 if( charm == -1 )
1421 {
1422 cutoff = 1. - cutoff ;
1423 }
1424
1425 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
1426
1427 decay_mode = ( RandFlat::shoot() > cutoff ) ? kFlavoredCF : kFlavoredCFBar ;
1428
1429 if( ( decay_mode == kFlavoredCF && charm == 1 ) ||
1430 ( decay_mode == kFlavoredCFBar && charm == -1 ) )
1431 {
1432 ++m_nFlavoredCFD0 ;
1433
1434 r2D0 = sqrt( m_rCF ) ;
1435 deltaD0 = m_deltaCF ;
1436 }
1437 else
1438 {
1439 ++m_nFlavoredDCSD0 ;
1440
1441 r2D0 = 1. / sqrt( m_rCF ) ;
1442 deltaD0 = -m_deltaCF ;
1443 }
1444 }
1445 else
1446 {
1447
1448 double cutoff = m_rwsCS / ( 1. + m_rwsCS ) ;
1449
1450 if( charm == -1 )
1451 {
1452 cutoff = 1. - cutoff ;
1453 }
1454
1455 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
1456
1457 decay_mode = ( RandFlat::shoot() > cutoff ) ?
1458 kFlavoredCS : kFlavoredCSBar ;
1459 ++m_nFlavoredCSD0 ;
1460
1461 if( ( decay_mode == kFlavoredCS && charm == 1 ) ||
1462 ( decay_mode == kFlavoredCSBar && charm == -1 ) )
1463 {
1464 r2D0 = sqrt( m_rCS ) ;
1465 deltaD0 = m_deltaCS ;
1466 }
1467 else
1468 {
1469 r2D0 = 1. / sqrt( m_rCS ) ;
1470 deltaD0 = -m_deltaCS ;
1471 }
1472 }
1473 }
1474 }
1475 }
1476
1477 if (
num[kUnknown] >= 1)
1478 {
1479 cout << "decay mode " << decay_mode << endl ;
1480 cout << "D #" << charm << endl ;
1481 cout <<
"pi+: " <<
num[ kPiPlus ] << endl ;
1482 cout <<
"pi-: " <<
num[ kPiMinus ] << endl ;
1483 cout <<
"pi0: " <<
num[ kPi0 ] << endl ;
1484 cout <<
"eta: " <<
num[ kEta ] << endl ;
1485 cout <<
"eta': " <<
num[ kEtaPrime ] << endl ;
1486 cout <<
"f0/a0: " <<
num[ kNeutralScalar ] << endl ;
1487 cout <<
"UFV+: " <<
num[ kUFVPlus ] << endl ;
1488 cout <<
"UFV-: " <<
num[ kUFVMinus ] << endl ;
1489 cout <<
"rho0: " <<
num[ kRho0 ] << endl ;
1490 cout <<
"omega: " <<
num[ kOmega ] << endl ;
1491 cout <<
"phi: " <<
num[ kPhi ] << endl ;
1492 cout <<
"K+: " <<
num[ kKPlus ] << endl ;
1493 cout <<
"K-: " <<
num[ kKMinus ] << endl ;
1494 cout <<
"K0S: " <<
num[ kK0S ] << endl ;
1495 cout <<
"K0L: " <<
num[ kK0L ] << endl ;
1496 cout <<
"FV+: " <<
num[ kFVPlus ] << endl ;
1497 cout <<
"FV-: " <<
num[ kFVMinus ] << endl ;
1498 cout <<
"K*0: " <<
num[ kKStar0 ] << endl ;
1499 cout <<
"K*0b: " <<
num[ kKStar0Bar ] << endl ;
1500 cout <<
"K10: " <<
num[ kK10 ] << endl ;
1501 cout <<
"K10b: " <<
num[ kK10Bar ] << endl ;
1502 cout <<
"l+: " <<
num[ kLeptonPlus ] << endl ;
1503 cout <<
"l-: " <<
num[ kLeptonMinus ] << endl ;
1504 cout <<
"nu: " <<
num[ kNeutrino ] << endl ;
1505 cout <<
"gamma: " <<
num[ kGamma ] << endl ;
1506 cout <<
"Unknown: " <<
num[ 25 ] << endl ;
1507 }
1508
1509
1510 d0_info[0]=decay_mode;
1511 d0_info[1]=r2D0;
1512 d0_info[2]=deltaD0;
1513 d0_info[3]=mnm_gen;
1514 d0_info[4]=mpn_gen;
1515 d0_info[5]= double (isKsPiPi);
1516 d0_info[6]=mpm_gen;
1517 return d0_info;
1518}
Evt3Rank3C conj(const Evt3Rank3C &t2)
double arg(const EvtComplex &c)