75 getRho(gammaWithMaximumRho));
78 getRho(trackWithMaximumRho));
81 const double& rhoOfECLClusterWithSecondMaximumRho = getRhoOfECLClusterWithMaximumRhoBelow(
m_pionParticles,
83 rhoOfECLClusterWithMaximumRho);
85 const double& rhoOfTrackWithMaximumRho = getRho(trackWithMaximumRho);
86 const double& rhoOfTrackWithSecondMaximumRho = getRho(trackWithSecondMaximumRho);
87 const double& rhoOfGammaWithMaximumRho = getRho(gammaWithMaximumRho);
88 const double& rhoOfGammaWithSecondMaximumRho = getRho(gammaWithSecondMaximumRho);
92 calculationResult[
"EC1CMSLE"] = rhoOfECLClusterWithMaximumRho;
95 calculationResult[
"EC2CMSLE"] = rhoOfECLClusterWithSecondMaximumRho;
98 calculationResult[
"EC12CMSLE"] = rhoOfECLClusterWithMaximumRho + rhoOfECLClusterWithSecondMaximumRho;
110 calculationResult[
"P1CMSBhabhaLE"] = rhoOfTrackWithMaximumRho;
113 calculationResult[
"P1OEbeamCMSBhabhaLE"] = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
116 calculationResult[
"P2CMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho;
119 calculationResult[
"P2OEbeamCMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
122 calculationResult[
"P12CMSBhabhaLE"] = rhoOfTrackWithMaximumRho + rhoOfTrackWithSecondMaximumRho;
125 calculationResult[
"G1CMSBhabhaLE"] = rhoOfGammaWithMaximumRho;
127 calculationResult[
"G1OEbeamCMSBhabhaLE"] = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
130 calculationResult[
"G2CMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho;
132 calculationResult[
"G2OEbeamCMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
135 calculationResult[
"G12CMSBhabhaLE"] = rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho;
137 calculationResult[
"G12OEbeamCMSBhabhaLE"] =
138 (rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho) / BeamEnergyCMS();
143 if (gammaWithMaximumRho) {
144 calculationResult[
"ENeutralLE"] = getRho(gammaWithMaximumRho);
146 calculationResult[
"ENeutralLE"] = -1;
152 return particle.getECLCluster() != nullptr;
154 calculationResult[
"nECLMatchTracksLE"] = numberOfTracksWithECLMatch;
157 double neclClusters = -1.;
158 double eneclClusters = 0.;
162 double EsumGamma = 0.;
164 const unsigned int numberOfECLClusters = std::count_if(eclClusters.
begin(), eclClusters.
end(),
166 return (eclcluster.hasHypothesis(
167 ECLCluster::EHypothesisBit::c_nPhotons)
168 and eclcluster.getEnergy(
169 ECLCluster::EHypothesisBit::c_nPhotons) > 0.1);
171 neclClusters = numberOfECLClusters;
173 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
177 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
180 EsumGamma += V4Gamma_CMS.E();
181 PzGamma += V4Gamma_CMS.Pz();
186 calculationResult[
"nECLClustersLE"] = neclClusters;
188 int nb2bcc_PhiHigh = 0;
189 int nb2bcc_PhiLow = 0;
192 for (
int i = 0; i < eclClusters.
getEntries() - 1; i++) {
196 double Eg1 = V4g1.E();
197 for (
int j = i + 1; j < eclClusters.
getEntries(); j++) {
201 double Eg2 = V4g2.E();
204 double Thetag1 = V4g1CMS.Theta() * TMath::RadToDeg();
205 double Thetag2 = V4g2CMS.Theta() * TMath::RadToDeg();
206 double deltphi = std::abs(ROOT::Math::VectorUtil::DeltaPhi(V4g1CMS, V4g2CMS) * TMath::RadToDeg());
207 double Tsum = Thetag1 + Thetag2;
208 if (deltphi > 170. && (Eg1 > 0.25 && Eg2 > 0.25)) nb2bcc_PhiHigh++;
209 if (deltphi > 170. && (Eg1 < 0.25 || Eg2 < 0.25)) nb2bcc_PhiLow++;
210 if (deltphi > 160. && (Tsum > 160. && Tsum < 200.)) nb2bcc_3D++;
214 calculationResult[
"nB2BCCPhiHighLE"] = nb2bcc_PhiHigh;
215 calculationResult[
"nB2BCCPhiLowLE"] = nb2bcc_PhiLow;
216 calculationResult[
"nB2BCC3DLE"] = nb2bcc_3D;
220 double angleGTLE = -10.;
221 if (gammaWithMaximumRho) {
222 const ROOT::Math::XYZVector& V3g1 = gammaWithMaximumRho->
getMomentum();
223 if (trackWithMaximumRho) {
224 const ROOT::Math::XYZVector& V3p1 = trackWithMaximumRho->
getMomentum();
225 const double theta1 = ROOT::Math::VectorUtil::Angle(V3g1, V3p1);
226 if (angleGTLE < theta1) angleGTLE = theta1;
228 if (trackWithSecondMaximumRho) {
229 const ROOT::Math::XYZVector& V3p2 = trackWithSecondMaximumRho->
getMomentum();
230 const double theta2 = ROOT::Math::VectorUtil::Angle(V3g1, V3p2);
231 if (angleGTLE < theta2) angleGTLE = theta2;
235 calculationResult[
"AngleGTLE"] = angleGTLE;
238 double angleG1G2CMSLE = -10.;
239 if (gammaWithMaximumRho) {
241 if (gammaWithSecondMaximumRho) {
243 angleG1G2CMSLE = ROOT::Math::VectorUtil::Angle(V4p1, V4p2);
247 calculationResult[
"AngleG1G2CMSLE"] = angleG1G2CMSLE;
250 double maxAngleTTLE = -10.;
253 const double jPsiMasswindow = 0.11;
255 for (
unsigned int i = 0; i <
m_pionParticles->getListSize() - 1; i++) {
257 for (
unsigned int j = i + 1; j <
m_pionParticles->getListSize(); j++) {
259 ROOT::Math::PxPyPzEVector V4p1 = par1->
get4Vector();
260 ROOT::Math::PxPyPzEVector V4p2 = par2->
get4Vector();
261 ROOT::Math::PxPyPzEVector V4pSum = V4p1 + V4p2;
263 const double mSum = V4pSum.M();
264 const double JpsidM = mSum - TDatabasePDG::Instance()->GetParticle(443)->Mass();
265 if (std::abs(JpsidM) < jPsiMasswindow && chSum == 0) nJpsi++;
268 const double temp = ROOT::Math::VectorUtil::Angle(V4p1CMS, V4p2CMS);
269 if (maxAngleTTLE < temp) maxAngleTTLE = temp;
274 if (nJpsi != 0) Jpsi = 1;
276 calculationResult[
"maxAngleTTLE"] = maxAngleTTLE;
277 calculationResult[
"Jpsi"] = Jpsi;
280 double maxAngleGGLE = -10.;
288 const double temp = ROOT::Math::VectorUtil::Angle(V4p1, V4p2);
289 if (maxAngleGGLE < temp) maxAngleGGLE = temp;
294 calculationResult[
"maxAngleGGLE"] = maxAngleGGLE;
299 const double& momentum = p.getMomentumMagnitude();
300 const double& r_rho = getRho(&p);
301 const ECLCluster* eclTrack = p.getECLCluster();
303 const double& energyOverMomentum = eclTrack->getEnergy(
304 ECLCluster::EHypothesisBit::c_nPhotons) / momentum;
305 double r_rhotoebeam = r_rho / BeamEnergyCMS();
306 return (r_rhotoebeam) > 0.35 && energyOverMomentum > 0.8;
311 calculationResult[
"nEidLE"] = nEidLE;
315 const double visibleEnergyTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
316 [](
const double & visibleEnergy,
const Particle & p) {
317 return visibleEnergy + p.getMomentumMagnitude();
320 const double visibleEnergyGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
321 [](
const double & visibleEnergy,
const Particle & p) {
322 return visibleEnergy + p.getMomentumMagnitude();
325 calculationResult[
"VisibleEnergyLE"] = visibleEnergyTracks + visibleEnergyGammas;
328 const double eTotTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
329 [](
const double & eTot,
const Particle & p) {
330 const ECLCluster* eclCluster = p.getECLCluster();
332 const double eclEnergy = eclCluster->getEnergy(
333 ECLCluster::EHypothesisBit::c_nPhotons);
334 if (eclEnergy > 0.1) {
335 return eTot + eclCluster->getEnergy(
336 ECLCluster::EHypothesisBit::c_nPhotons);
342 const double eTotGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
343 [](
const double & eTot,
const Particle & p) {
344 return eTot + p.getEnergy();
346 double Etot = eTotTracks + eTotGammas;
347 calculationResult[
"EtotLE"] = Etot;
351 double numMaxLayerKLM = -1.;
352 double numSecMaxLayerKLM = -1.;
355 for (
const auto& klmCluster : klmClusters) {
356 double klmClusterLayer = klmCluster.getLayers();
357 if (numMaxLayerKLM < klmClusterLayer) {
358 numSecMaxLayerKLM = numMaxLayerKLM;
359 numMaxLayerKLM = klmClusterLayer;
360 }
else if (numSecMaxLayerKLM < klmClusterLayer)
361 numSecMaxLayerKLM = klmClusterLayer;
364 calculationResult[
"N1KLMLayer"] = numMaxLayerKLM;
365 calculationResult[
"N2KLMLayer"] = numSecMaxLayerKLM;
369 if (trackWithMaximumRho) charget1 = trackWithMaximumRho->getCharge();
371 if (trackWithSecondMaximumRho) charget2 = trackWithSecondMaximumRho->getCharge();
373 double Bhabha2Trk = 0.;
374 int ntrk_bha = m_pionParticles->getListSize();
375 double rp1ob = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
376 double rp2ob = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
377 bool bhabha2trk_tag =
378 ntrk_bha >= 2 && maxAngleTTLE > 2.88 && nEidLE >= 1 && rp1ob > 0.35 && rp2ob > 0.35 && (Etot) > 4.0
379 && (std::abs(charget1) == 1 && std::abs(charget2) == 1 && (charget1 + charget2) == 0);
380 if (bhabha2trk_tag) Bhabha2Trk = 1;
381 calculationResult[
"Bhabha2Trk"] = Bhabha2Trk;
383 double Bhabha1Trk = 0.;
384 double rc1ob = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
385 double rc2ob = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
386 bool bhabha1trk_tag = ntrk_bha == 1 && rp1ob > 0.35 && rc1ob > 0.35 && angleGTLE > 2.618;
387 if (bhabha1trk_tag) Bhabha1Trk = 1;
388 calculationResult[
"Bhabha1Trk"] = Bhabha1Trk;
391 bool gg_tag = ntrk_bha <= 1 && nEidLE == 0 && rc1ob > 0.35 && rc2ob > 0.2 && Etot > 4.0 && maxAngleGGLE > 2.618;
392 if (gg_tag) ggSel = 1;
393 calculationResult[
"GG"] = ggSel;
396 double BhabhaECL = 0.;
398 for (
int i = 0; i < eclClusters.getEntries() - 1; i++) {
404 double Eg1ob = V4g1.E() / (2 * BeamEnergyCMS());
405 for (
int j = i + 1; j < eclClusters.getEntries(); j++) {
410 double Eg2ob = V4g2.E() / (2 * BeamEnergyCMS());
411 double Thetag1 = V4g1.Theta() * TMath::RadToDeg();
412 double Thetag2 = V4g2.Theta() * TMath::RadToDeg();
413 double deltphi = std::abs(ROOT::Math::VectorUtil::DeltaPhi(V4g1, V4g2) * TMath::RadToDeg());
414 double Tsum = Thetag1 + Thetag2;
415 if ((deltphi > 165. && deltphi < 178.5) && (Eg1ob > 0.4 && Eg2ob > 0.4 && (Eg1ob > 0.45 || Eg2ob > 0.45)) && (Tsum > 178.
416 && Tsum < 182.)) BhabhaECL = 1;
419 calculationResult[
"BhabhaECL"] = BhabhaECL;
422 double BhabhaCDC = 0.;
425 const double lowdEdxEdge = 0.70, highdEdxEdge = 1.30;
426 const double lowEoPEdge = 0.70, highEoPEdge = 1.30;
428 if (m_pionParticles->getListSize() == 2) {
431 for (
unsigned int i = 0; i < m_pionParticles->getListSize() - 1; i++) {
433 Particle* part1 = m_pionParticles->getParticle(i);
434 if (!part1)
continue;
436 const auto chargep1 = part1->
getCharge();
437 if (std::abs(chargep1) != 1)
continue;
440 if (!eclTrack1)
continue;
445 if (energyOverMomentum1 <= lowEoPEdge || energyOverMomentum1 >= highEoPEdge)
continue;
447 const Track* track1 = part1->
getTrack();
448 if (!track1)
continue;
450 const TrackFitResult* trackFit1 = track1->getTrackFitResultWithClosestMass(
Const::pion);
451 if (!trackFit1)
continue;
455 for (
unsigned int j = i + 1; j < m_pionParticles->getListSize(); j++) {
457 Particle* part2 = m_pionParticles->getParticle(j);
458 if (!part2)
continue;
460 const auto chargep2 = part2->
getCharge();
461 if (std::abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
464 if (!eclTrack2)
continue;
469 if (energyOverMomentum2 <= lowEoPEdge || energyOverMomentum2 >= highEoPEdge)
continue;
471 const Track* track2 = part2->
getTrack();
472 if (!track2)
continue;
474 const TrackFitResult* trackFit2 = track2->getTrackFitResultWithClosestMass(
Const::pion);
475 if (!trackFit2)
continue;
480 const CDCDedxTrack* dedxTrack1 = track1->getRelatedTo<CDCDedxTrack>();
481 if (!dedxTrack1)
continue;
483 const CDCDedxTrack* dedxTrack2 = track2->getRelatedTo<CDCDedxTrack>();
484 if (!dedxTrack2)
continue;
489 if ((p1_dedxnosat > lowdEdxEdge && p1_dedxnosat < highdEdxEdge) || (p2_dedxnosat > lowdEdxEdge
490 && p2_dedxnosat < highdEdxEdge)) radee = 1;
496 calculationResult[
"BhabhaCDC"] = BhabhaCDC;
497 calculationResult[
"Radee"] = radee;
500 double mumutight = 0.;
501 double eMumuTotGammas = 0.;
504 int nGammas = m_gammaParticles->getListSize();
506 for (
int t = 0; t < nGammas; t++) {
507 const Particle* part = m_gammaParticles->getParticle(t);
509 eMumuTotGammas += frame.getMomentum(part).E();
512 StoreArray<Track> tracks;
513 nTracks = tracks.getEntries();
518 if (m_pionParticles->getListSize() == 2) {
521 for (
unsigned int k = 0; k < m_pionParticles->getListSize() - 1; k++) {
523 Particle* part1 = m_pionParticles->getParticle(k);
524 if (!part1)
continue;
526 const auto chargep1 = part1->
getCharge();
527 if (std::abs(chargep1) != 1)
continue;
530 if (!eclTrack1)
continue;
533 const Track* track1 = part1->
getTrack();
534 if (!track1)
continue;
536 const TrackFitResult* trackFit1 = track1->getTrackFitResultWithClosestMass(
Const::pion);
537 if (!trackFit1)
continue;
539 const ROOT::Math::PxPyPzEVector V4p1 = trackFit1->
get4Momentum();
542 const double p1MomLab = V4p1.P();
543 double highestP = p1MomLab;
547 if (p1Pid) p1hasKLMid = p1Pid->
isAvailable(Const::KLM);
548 const double p1isInCDC = Variable::inCDCAcceptance(part1);
549 const double p1clusPhi = Variable::eclClusterPhi(part1);
551 const double Pp1 = V4p1CMS.R();
552 const double Thetap1 = V4p1CMS.Theta() * TMath::RadToDeg();
553 const double Phip1 = V4p1CMS.Phi() * TMath::RadToDeg();
557 const bool goodTrk1 = enECLTrack1 > 0 && enECLTrack1 < 0.5 && p1CDChits > 0
558 && ((p1hasKLMid == 0 && enECLTrack1 < 0.25 && p1MomLab < 2.0) || p1hasKLMid == 1) && p1isInCDC == 1;
561 for (
unsigned int l = k + 1; l < m_pionParticles->getListSize(); l++) {
563 Particle* part2 = m_pionParticles->getParticle(l);
564 if (!part2)
continue;
566 const auto chargep2 = part2->
getCharge();
567 if (std::abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
570 if (!eclTrack2)
continue;
573 const Track* track2 = part2->
getTrack();
574 if (!track2)
continue;
576 const TrackFitResult* trackFit2 = track2->getTrackFitResultWithClosestMass(
Const::pion);
577 if (!trackFit2)
continue;
579 const ROOT::Math::PxPyPzEVector V4p2 = trackFit2->
get4Momentum();
582 const double p2MomLab = V4p2.P();
583 double lowestP = p2MomLab;
587 if (p2Pid) p2hasKLMid = p2Pid->
isAvailable(Const::KLM);
588 const double p2isInCDC = Variable::inCDCAcceptance(part2);
589 const double p2clusPhi = Variable::eclClusterPhi(part2);
591 const double Pp2 = V4p2CMS.R();
592 const double Thetap2 = V4p2CMS.Theta() * TMath::RadToDeg();
593 const double Phip2 = V4p2CMS.Phi() * TMath::RadToDeg();
595 const double acopPhi = std::abs(180 - std::abs(Phip1 - Phip2));
596 const double acopTheta = std::abs(std::abs(Thetap1 + Thetap2) - 180);
600 const bool goodTrk2 = enECLTrack2 > 0 && enECLTrack2 < 0.5 && p2CDChits > 0
601 && ((p2hasKLMid == 0 && enECLTrack2 < 0.25 && p2MomLab < 2.0) || p2hasKLMid == 1) && p2isInCDC == 1;
603 double eTotMumuTracks = enECLTrack1 + enECLTrack2;
604 double EMumutot = eTotMumuTracks + eMumuTotGammas;
606 bool mumutight_tag = enECLTrack1 < 0.5 && enECLTrack2 < 0.5 && EMumutot < 2 && acopPhi < 10 && acopTheta < 10 && nTracks == 2
607 && Pp1 > 0.5 && Pp2 > 0.5;
609 if (mumutight_tag) mumutight = 1;
611 if (p1MomLab < p2MomLab) {
616 double diffPhi = p1clusPhi - p2clusPhi;
617 if (std::abs(diffPhi) > M_PI) {
618 if (diffPhi > M_PI) {
619 diffPhi = diffPhi - 2 * M_PI;
621 diffPhi = 2 * M_PI + diffPhi;
625 const double recoilP = fr.getMomentum(pIN - V4p1 - V4p2).P();
627 const bool radmumu_tag = nTracks < 4 && goodTrk1 == 1 && goodTrk2 == 1 && highestP > 1 && lowestP < 3
628 && (p1hasKLMid == 1 || p2hasKLMid == 1) && std::abs(diffPhi) >= 0.5 * M_PI && recoilP > 0.1
629 && (enECLTrack1 <= 0.25 || enECLTrack2 <= 0.25);
631 if (radmumu_tag) radmumu = 1;
637 calculationResult[
"MumuTight"] = mumutight;
638 calculationResult[
"Radmumu"] = radmumu;
641 double EsumPiHad = 0;
643 int nHadTracks = m_pionHadParticles->getListSize();
647 std::vector<ROOT::Math::PxPyPzEVector> m_pionHad;
649 for (
int nPiHad = 0; nPiHad < nHadTracks; nPiHad++) {
650 Particle* parPiHad = m_pionHadParticles->getParticle(nPiHad);
652 m_pionHad.push_back(V4PiHad);
653 EsumPiHad += V4PiHad.E();
654 PzPiHad += V4PiHad.Pz();
657 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (BeamEnergyCMS() * 2.0);
658 double EsumCMSnorm = eneclClusters / (BeamEnergyCMS() * 2.0);
659 double PzTotCMSnorm = (PzPiHad + PzGamma) / (BeamEnergyCMS() * 2.0);
661 bool hadronb_tag = nHadTracks >= 3 && visibleEnergyCMSnorm > 0.2 && std::abs(PzTotCMSnorm) < 0.5 && neclClusters > 1
662 && EsumCMSnorm > 0.1 && EsumCMSnorm < 0.8;
666 FoxWolfram fw(m_pionHad);
667 fw.calculateBasicMoments();
668 double R2 = fw.getR(2);
669 if (R2 < 0.4) hadronb1 = 1;
670 if (hadronb1 && nHadTracks >= 5) hadronb2 = 1;
673 calculationResult[
"HadronB"] = hadronb;
674 calculationResult[
"HadronB1"] = hadronb1;
675 calculationResult[
"HadronB2"] = hadronb2;
680 const double KsMassLow = 0.468;
681 const double KsMassHigh = 0.528;
683 if (m_KsParticles.isValid()) {
684 for (
unsigned int i = 0; i < m_KsParticles->getListSize(); i++) {
685 const Particle* mergeKsCand = m_KsParticles->getParticle(i);
686 const double isKsCandGood = Variable::goodBelleKshort(mergeKsCand);
687 const double KsCandMass = mergeKsCand->
getMass();
688 if (KsCandMass > KsMassLow && KsCandMass < KsMassHigh && isKsCandGood == 1.) nKshort++;
692 if (nKshort != 0) Kshort = 1;
694 calculationResult[
"Kshort"] = Kshort;
700 const double visibleEnergyCMS = visibleEnergyCMSnorm * BeamEnergyCMS() * 2.0;
701 const unsigned int n_particles = m_pionHadParticles->getListSize();
703 if (n_particles >= 2) {
704 for (
unsigned int i = 0; i < n_particles - 1; i++) {
705 Particle* par1 = m_pionHadParticles->getParticle(i);
706 for (
unsigned int j = i + 1; j < n_particles; j++) {
707 Particle* par2 = m_pionHadParticles->getParticle(j);
709 const ROOT::Math::PxPyPzEVector V4p1 = par1->
get4Vector();
710 const ROOT::Math::PxPyPzEVector V4p2 = par2->
get4Vector();
711 const double opAng = V4p1.Theta() + V4p2.Theta();
712 const ROOT::Math::PxPyPzEVector V4pSum = V4p1 + V4p2;
714 const double ptCMS = V4pSumCMS.Pt();
715 const double pzCMS = V4pSumCMS.Pz();
716 const double mSum = V4pSum.M();
718 const bool fourLepCand = chSum == 0 && (V4p1.P() > 0.4 && V4p2.P() > 0.4) && cos(opAng) > -0.997 && ptCMS < 0.15
719 && std::abs(pzCMS) < 2.5
722 if (fourLepCand) nFourLep++;
727 if (nFourLep != 0 && visibleEnergyCMS < 6) fourLep = 1;
729 calculationResult[
"FourLep"] = fourLep;
732 unsigned int nLambda = 0;
734 if (m_LambdaParticles.isValid()) {
735 for (
unsigned int i = 0; i < m_LambdaParticles->getListSize(); i++) {
736 const Particle* mergeLambdaCand = m_LambdaParticles->getParticle(i);
737 const double flightDist = Variable::flightDistance(mergeLambdaCand);
738 const double flightDistErr = Variable::flightDistanceErr(mergeLambdaCand);
739 const double flightSign = flightDist / flightDistErr;
740 const Particle* protCand = mergeLambdaCand->
getDaughter(0);
741 const Particle* pionCand = mergeLambdaCand->
getDaughter(1);
742 const double protMom = protCand->
getP();
743 const double pionMom = pionCand->
getP();
744 const double asymPDaughters = (protMom - pionMom) / (protMom + pionMom);
745 if (flightSign > 10 && asymPDaughters > 0.41) nLambda++;
750 calculationResult[
"Lambda"] = 1;
752 calculationResult[
"Lambda"] = 0;
756 unsigned int nDstp1 = 0;
757 unsigned int nDstp2 = 0;
758 unsigned int nDstp3 = 0;
759 unsigned int nDstp4 = 0;
761 if (m_DstParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
762 for (
unsigned int i = 0; i < m_DstParticles->getListSize(); i++) {
763 const Particle* allDstCand = m_DstParticles->getParticle(i);
764 const double dstDecID = allDstCand->
getExtraInfo(
"decayModeID");
765 if (dstDecID == 1.) nDstp1++;
766 if (dstDecID == 2.) nDstp2++;
767 if (dstDecID == 3.) nDstp3++;
768 if (dstDecID == 4.) nDstp4++;
774 calculationResult[
"Dstp1"] = 1;
776 calculationResult[
"Dstp1"] = 0;
780 calculationResult[
"Dstp2"] = 1;
782 calculationResult[
"Dstp2"] = 0;
786 calculationResult[
"Dstp3"] = 1;
788 calculationResult[
"Dstp3"] = 0;
792 calculationResult[
"Dstp4"] = 1;
794 calculationResult[
"Dstp4"] = 0;
798 calculationResult[
"nTracksOffIP"] = m_offIpParticles->getListSize();
801 calculationResult[
"NeuroTRG"] = 0;
802 calculationResult[
"GammaGammaFilter"] = 0;
804 StoreObjPtr<SoftwareTriggerResult> filter_result;
806 const std::map<std::string, int>& nonPrescaledResults = filter_result->getNonPrescaledResults();
807 if (nonPrescaledResults.find(m_filterL1TrgNN) != nonPrescaledResults.end()) {
809 if (hasNN) calculationResult[
"NeuroTRG"] = 1;
811 const bool ggEndcap = (filter_result->getNonPrescaledResult(
"software_trigger_cut&filter&ggEndcapLoose") ==
813 const bool ggBarrel = (filter_result->getNonPrescaledResult(
"software_trigger_cut&filter&ggBarrelLoose") ==
815 if (ggEndcap || ggBarrel) calculationResult[
"GammaGammaFilter"] = 1;
820 double mumuHighMass = 0.;
822 if (trackWithMaximumRho && trackWithSecondMaximumRho) {
824 double eclE1 = 0., eclE2 = 0.;
826 const auto charge1 = trackWithMaximumRho->getCharge();
827 const auto charge2 = trackWithSecondMaximumRho->getCharge();
828 const auto chSum = charge1 + charge2;
830 const ECLCluster* eclTrack1 = trackWithMaximumRho->getECLCluster();
836 const ECLCluster* eclTrack2 = trackWithSecondMaximumRho->getECLCluster();
844 const ROOT::Math::PxPyPzEVector V4pSum = V4p1 + V4p2;
845 const double mSum = V4pSum.M();
847 const double thetaSumCMS = (V4p1.Theta() + V4p2.Theta()) * TMath::RadToDeg();
848 const double phi1CMS = V4p1.Phi() * TMath::RadToDeg();
849 const double phi2CMS = V4p2.Phi() * TMath::RadToDeg();
851 double diffPhi = phi1CMS - phi2CMS;
852 if (std::abs(diffPhi) > 180) {
854 diffPhi = diffPhi - 2 * 180;
856 diffPhi = 2 * 180 + diffPhi;
859 const double delThetaCMS = std::abs(std::abs(thetaSumCMS) - 180);
860 const double delPhiCMS = std::abs(180 - std::abs(diffPhi));
862 const bool mumuHighMassCand = chSum == 0 && (mSum > 8. && mSum < 12.) && hasClus > 0 && eclE1 <= 1
863 && eclE2 <= 1 && delThetaCMS < 10 && delPhiCMS < 10;
865 if (mumuHighMassCand) mumuHighMass = 1;
869 calculationResult[
"MumuHighM"] = mumuHighMass;
872 calculationResult[
"Bp"] = 0;
873 calculationResult[
"Bz"] = 0;
875 if (m_BpParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
876 calculationResult[
"Bp"] = m_BpParticles->getListSize() >= 1;
879 if (m_BzParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
880 calculationResult[
"Bz"] = m_BzParticles->getListSize() >= 1;