459 double DmesonMass = -99.0;
460 const float Dmeson_reference = 1864.83;
461 const float Dmeson_upper = 2200.0;
462 const float Dmeson_lower = 1000.0;
463 TLorentzVector secondaryVtx_4momentum_Dmeson;
466 if(secondaryVtx_track_number == 3 && abs(secondaryVtx_charge) == 1){
467 std::vector<TLorentzVector>::const_iterator secondaryVtx_4momentum_Iter = secondaryVtx_4momentum_vector.begin();
468 for (std::vector<float>::const_iterator secondaryVtx_charge_Iter = secondaryVtx_charge_vector.begin();
469 secondaryVtx_charge_Iter != secondaryVtx_charge_vector.end();
470 ++secondaryVtx_charge_Iter) {
471 TLorentzVector track_fourVector_new;
472 if((secondaryVtx_charge==1 && (*secondaryVtx_charge_Iter)==-1) || (secondaryVtx_charge==-1 && (*secondaryVtx_charge_Iter)==1)){
473 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_kaon);
475 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_mass);
477 secondaryVtx_4momentum_Dmeson += track_fourVector_new;
478 ++secondaryVtx_4momentum_Iter;
480 if(secondaryVtx_4momentum_Dmeson.M()>Dmeson_lower && secondaryVtx_4momentum_Dmeson.M()<Dmeson_upper){
481 DmesonMass = secondaryVtx_4momentum_Dmeson.M();
483 }
else if(secondaryVtx_track_number == 2 && secondaryVtx_charge == 0){
484 std::vector<TLorentzVector>::const_iterator secondaryVtx_4momentum_Iter = secondaryVtx_4momentum_vector.begin();
485 for (std::vector<float>::const_iterator secondaryVtx_charge_Iter = secondaryVtx_charge_vector.begin();
486 secondaryVtx_charge_Iter != secondaryVtx_charge_vector.end();
487 ++secondaryVtx_charge_Iter) {
488 TLorentzVector track_fourVector_new;
489 if((*secondaryVtx_charge_Iter)==-1){
490 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_kaon);
492 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_mass);
494 secondaryVtx_4momentum_Dmeson += track_fourVector_new;
495 ++secondaryVtx_4momentum_Iter;
497 if(secondaryVtx_4momentum_Dmeson.M()>Dmeson_lower && secondaryVtx_4momentum_Dmeson.M()<Dmeson_upper){
498 DmesonMass = secondaryVtx_4momentum_Dmeson.M();
500 }
else if(secondaryVtx_track_number == 4 && secondaryVtx_charge == 0){
501 std::vector<TLorentzVector>::const_iterator secondaryVtx_4momentum_Iter = secondaryVtx_4momentum_vector.begin();
502 bool KaonFlag =
false;
503 for (std::vector<float>::const_iterator secondaryVtx_charge_Iter = secondaryVtx_charge_vector.begin();
504 secondaryVtx_charge_Iter != secondaryVtx_charge_vector.end();
505 ++secondaryVtx_charge_Iter) {
506 TLorentzVector track_fourVector_new;
507 if((*secondaryVtx_charge_Iter)==-1 && KaonFlag ==
false){
508 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_kaon);
511 track_fourVector_new.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_mass);
513 secondaryVtx_4momentum_Dmeson += track_fourVector_new;
514 ++secondaryVtx_4momentum_Iter;
516 double mDmeson_1 = secondaryVtx_4momentum_Dmeson.M();
517 secondaryVtx_4momentum_Iter = secondaryVtx_4momentum_vector.begin();
519 TLorentzVector secondaryVtx_4momentum_Dmeson_new;
520 for(std::vector<float>::const_iterator secondaryVtx_charge_Iter = secondaryVtx_charge_vector.begin();
521 secondaryVtx_charge_Iter != secondaryVtx_charge_vector.end();
522 ++secondaryVtx_charge_Iter) {
523 TLorentzVector track_fourVector_new2;
524 if((*secondaryVtx_charge_Iter)==-1 && KaonFlag ==
false){
526 }
else if ((*secondaryVtx_charge_Iter)==-1 && KaonFlag ==
true){
527 track_fourVector_new2.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_kaon);
529 track_fourVector_new2.SetVectM((*secondaryVtx_4momentum_Iter).Vect(), track_mass);
531 secondaryVtx_4momentum_Dmeson_new += track_fourVector_new2;
532 ++secondaryVtx_4momentum_Iter;
534 double mDmeson_2 = secondaryVtx_4momentum_Dmeson_new.M();
535 if (std::abs(mDmeson_1 - Dmeson_reference)<=std::abs(mDmeson_2 - Dmeson_reference) && mDmeson_1>Dmeson_lower && mDmeson_1<Dmeson_upper){
536 DmesonMass=mDmeson_1;
538 else if(std::abs(mDmeson_2 - Dmeson_reference)<=std::abs(mDmeson_1 - Dmeson_reference) && mDmeson_2>Dmeson_lower && mDmeson_2<Dmeson_upper){
539 DmesonMass=mDmeson_2;