8 #include <hlt/softwaretrigger/calculations/SkimSampleCalculator.h>
9 #include <hlt/softwaretrigger/calculations/utilities.h>
10 #include <analysis/utility/PCmsLabTransform.h>
11 #include <analysis/ClusterUtility/ClusterUtils.h>
12 #include <analysis/dataobjects/Particle.h>
13 #include <mdst/dataobjects/KLMCluster.h>
14 #include <mdst/dataobjects/Track.h>
15 #include <analysis/utility/ReferenceFrame.h>
16 #include <mdst/dataobjects/TrackFitResult.h>
17 #include <mdst/dataobjects/HitPatternCDC.h>
18 #include <reconstruction/dataobjects/CDCDedxTrack.h>
19 #include <analysis/ContinuumSuppression/FoxWolfram.h>
21 #include <TDatabasePDG.h>
22 #include <analysis/variables/BelleVariables.h>
23 #include <analysis/variables/ECLVariables.h>
24 #include <mdst/dataobjects/PIDLikelihood.h>
25 #include <analysis/variables/AcceptanceVariables.h>
26 #include <analysis/variables/FlightInfoVariables.h>
27 #include <mdst/dataobjects/SoftwareTriggerResult.h>
30 using namespace SoftwareTrigger;
33 m_pionParticles(
"pi+:skim"), m_gammaParticles(
"gamma:skim"), m_pionHadParticles(
"pi+:hadb"), m_pionTauParticles(
"pi+:tau"),
34 m_KsParticles(
"K_S0:merged"), m_LambdaParticles(
"Lambda0:merged"), m_DstParticles(
"D*+:d0pi"), m_offIpParticles(
"pi+:offip"),
35 m_filterL1TrgNN(
"software_trigger_cut&filter&L1_trigger_nn_info"),
36 m_BpParticles(
"B+:BtoCharmForHLT"), m_BzParticles(
"B0:BtoCharmForHLT")
61 getRho(gammaWithMaximumRho));
64 getRho(trackWithMaximumRho));
67 const double& rhoOfECLClusterWithSecondMaximumRho = getRhoOfECLClusterWithMaximumRhoBelow(
m_pionParticles,
69 rhoOfECLClusterWithMaximumRho);
71 const double& rhoOfTrackWithMaximumRho = getRho(trackWithMaximumRho);
72 const double& rhoOfTrackWithSecondMaximumRho = getRho(trackWithSecondMaximumRho);
73 const double& rhoOfGammaWithMaximumRho = getRho(gammaWithMaximumRho);
74 const double& rhoOfGammaWithSecondMaximumRho = getRho(gammaWithSecondMaximumRho);
78 calculationResult[
"EC1CMSLE"] = rhoOfECLClusterWithMaximumRho;
81 calculationResult[
"EC2CMSLE"] = rhoOfECLClusterWithSecondMaximumRho;
84 calculationResult[
"EC12CMSLE"] = rhoOfECLClusterWithMaximumRho + rhoOfECLClusterWithSecondMaximumRho;
96 calculationResult[
"P1CMSBhabhaLE"] = rhoOfTrackWithMaximumRho;
99 calculationResult[
"P1OEbeamCMSBhabhaLE"] = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
102 calculationResult[
"P2CMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho;
105 calculationResult[
"P2OEbeamCMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
108 calculationResult[
"P12CMSBhabhaLE"] = rhoOfTrackWithMaximumRho + rhoOfTrackWithSecondMaximumRho;
111 calculationResult[
"G1CMSBhabhaLE"] = rhoOfGammaWithMaximumRho;
113 calculationResult[
"G1OEbeamCMSBhabhaLE"] = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
116 calculationResult[
"G2CMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho;
118 calculationResult[
"G2OEbeamCMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
121 calculationResult[
"G12CMSBhabhaLE"] = rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho;
123 calculationResult[
"G12OEbeamCMSBhabhaLE"] =
124 (rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho) / BeamEnergyCMS();
129 if (gammaWithMaximumRho) {
130 calculationResult[
"ENeutralLE"] = getRho(gammaWithMaximumRho);
132 calculationResult[
"ENeutralLE"] = -1;
138 return particle.getECLCluster() != nullptr;
140 calculationResult[
"nECLMatchTracksLE"] = numberOfTracksWithECLMatch;
143 double neclClusters = -1.;
144 double eneclClusters = 0.;
148 double EsumGamma = 0.;
150 const unsigned int numberOfECLClusters = std::count_if(eclClusters.
begin(), eclClusters.
end(),
152 return (eclcluster.hasHypothesis(
153 ECLCluster::EHypothesisBit::c_nPhotons)
154 and eclcluster.getEnergy(
155 ECLCluster::EHypothesisBit::c_nPhotons) > 0.1);
157 neclClusters = numberOfECLClusters;
159 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
163 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
166 EsumGamma += V4Gamma_CMS.E();
167 PzGamma += V4Gamma_CMS.Pz();
172 calculationResult[
"nECLClustersLE"] = neclClusters;
174 int nb2bcc_PhiHigh = 0;
175 int nb2bcc_PhiLow = 0;
178 for (
int i = 0; i < eclClusters.
getEntries() - 1; i++) {
182 double Eg1 = V4g1.E();
183 for (
int j = i + 1; j < eclClusters.
getEntries(); j++) {
187 double Eg2 = V4g2.E();
192 double deltphi = fabs(V3g1.DeltaPhi(V3g2) * 180. / 3.1415926);
193 double Tsum = Thetag1 + Thetag2;
194 if (deltphi > 170. && (Eg1 > 0.25 && Eg2 > 0.25)) nb2bcc_PhiHigh++;
195 if (deltphi > 170. && (Eg1 < 0.25 || Eg2 < 0.25)) nb2bcc_PhiLow++;
196 if (deltphi > 160. && (Tsum > 160. && Tsum < 200.)) nb2bcc_3D++;
200 calculationResult[
"nB2BCCPhiHighLE"] = nb2bcc_PhiHigh;
201 calculationResult[
"nB2BCCPhiLowLE"] = nb2bcc_PhiLow;
202 calculationResult[
"nB2BCC3DLE"] = nb2bcc_3D;
206 double angleGTLE = -10.;
207 if (gammaWithMaximumRho) {
208 const TLorentzVector& V4g1 = gammaWithMaximumRho->
get4Vector();
209 if (trackWithMaximumRho) {
210 const TLorentzVector& V4p1 = trackWithMaximumRho->
get4Vector();
211 const double theta1 = (V4g1.Vect()).Angle(V4p1.Vect());
212 if (angleGTLE < theta1) angleGTLE = theta1;
214 if (trackWithSecondMaximumRho) {
215 const TLorentzVector& V4p2 = trackWithSecondMaximumRho->
get4Vector();
216 const double theta2 = (V4g1.Vect()).Angle(V4p2.Vect());
217 if (angleGTLE < theta2) angleGTLE = theta2;
221 calculationResult[
"AngleGTLE"] = angleGTLE;
224 double angleG1G2CMSLE = -10.;
225 if (gammaWithMaximumRho) {
226 const TLorentzVector& V4p1 = gammaWithMaximumRho->
get4Vector();
227 if (gammaWithSecondMaximumRho) {
228 const TLorentzVector& V4p2 = gammaWithSecondMaximumRho->
get4Vector();
231 angleG1G2CMSLE = V3p1.Angle(V3p2);
235 calculationResult[
"AngleG1G2CMSLE"] = angleG1G2CMSLE;
238 double maxAngleTTLE = -10.;
241 const double jPsiMasswindow = 0.11;
243 for (
unsigned int i = 0; i <
m_pionParticles->getListSize() - 1; i++) {
245 for (
unsigned int j = i + 1; j <
m_pionParticles->getListSize(); j++) {
249 TLorentzVector V4pSum = V4p1 + V4p2;
251 const double mSum = V4pSum.M();
252 const double JpsidM = mSum - TDatabasePDG::Instance()->GetParticle(443)->Mass();
253 if (abs(JpsidM) < jPsiMasswindow && chSum == 0) nJpsi++;
256 const double temp = V3p1.Angle(V3p2);
257 if (maxAngleTTLE < temp) maxAngleTTLE = temp;
262 if (nJpsi != 0) Jpsi = 1;
264 calculationResult[
"maxAngleTTLE"] = maxAngleTTLE;
265 calculationResult[
"Jpsi"] = Jpsi;
268 double maxAngleGGLE = -10.;
278 const double temp = V3p1.Angle(V3p2);
279 if (maxAngleGGLE < temp) maxAngleGGLE = temp;
284 calculationResult[
"maxAngleGGLE"] = maxAngleGGLE;
289 const double& momentum = p.getMomentumMagnitude();
290 const double& r_rho = getRho(&p);
291 const ECLCluster* eclTrack = p.getECLCluster();
293 const double& energyOverMomentum = eclTrack->getEnergy(
294 ECLCluster::EHypothesisBit::c_nPhotons) / momentum;
295 double r_rhotoebeam = r_rho / BeamEnergyCMS();
296 return (r_rhotoebeam) > 0.35 && energyOverMomentum > 0.8;
301 calculationResult[
"nEidLE"] = nEidLE;
305 const double visibleEnergyTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
306 [](
const double & visibleEnergy,
const Particle & p) {
307 return visibleEnergy + p.getMomentumMagnitude();
310 const double visibleEnergyGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
311 [](
const double & visibleEnergy,
const Particle & p) {
312 return visibleEnergy + p.getMomentumMagnitude();
315 calculationResult[
"VisibleEnergyLE"] = visibleEnergyTracks + visibleEnergyGammas;
318 const double eTotTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
319 [](
const double & eTot,
const Particle & p) {
320 const ECLCluster* eclCluster = p.getECLCluster();
322 const double eclEnergy = eclCluster->getEnergy(
323 ECLCluster::EHypothesisBit::c_nPhotons);
324 if (eclEnergy > 0.1) {
325 return eTot + eclCluster->getEnergy(
326 ECLCluster::EHypothesisBit::c_nPhotons);
332 const double eTotGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
333 [](
const double & eTot,
const Particle & p) {
334 return eTot + p.getEnergy();
336 double Etot = eTotTracks + eTotGammas;
337 calculationResult[
"EtotLE"] = Etot;
341 double numMaxLayerKLM = -1.;
342 double numSecMaxLayerKLM = -1.;
345 for (
const auto& klmCluster : klmClusters) {
346 double klmClusterLayer = klmCluster.getLayers();
347 if (numMaxLayerKLM < klmClusterLayer) {
348 numSecMaxLayerKLM = numMaxLayerKLM;
349 numMaxLayerKLM = klmClusterLayer;
350 }
else if (numSecMaxLayerKLM < klmClusterLayer)
351 numSecMaxLayerKLM = klmClusterLayer;
354 calculationResult[
"N1KLMLayer"] = numMaxLayerKLM;
355 calculationResult[
"N2KLMLayer"] = numSecMaxLayerKLM;
359 if (trackWithMaximumRho) charget1 = trackWithMaximumRho->getCharge();
361 if (trackWithSecondMaximumRho) charget2 = trackWithSecondMaximumRho->getCharge();
363 double Bhabha2Trk = 0.;
364 int ntrk_bha = m_pionParticles->getListSize();
365 double rp1ob = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
366 double rp2ob = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
367 bool bhabha2trk_tag =
368 ntrk_bha >= 2 && maxAngleTTLE > 2.88 && nEidLE >= 1 && rp1ob > 0.35 && rp2ob > 0.35 && (Etot) > 4.0
369 && (abs(charget1) == 1 && abs(charget2) == 1 && (charget1 + charget2) == 0);
370 if (bhabha2trk_tag) Bhabha2Trk = 1;
371 calculationResult[
"Bhabha2Trk"] = Bhabha2Trk;
373 double Bhabha1Trk = 0.;
374 double rc1ob = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
375 double rc2ob = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
376 bool bhabha1trk_tag = ntrk_bha == 1 && rp1ob > 0.35 && rc1ob > 0.35 && angleGTLE > 2.618;
377 if (bhabha1trk_tag) Bhabha1Trk = 1;
378 calculationResult[
"Bhabha1Trk"] = Bhabha1Trk;
381 bool gg_tag = ntrk_bha <= 1 && nEidLE == 0 && rc1ob > 0.35 && rc2ob > 0.2 && Etot > 4.0 && maxAngleGGLE > 2.618;
382 if (gg_tag) ggSel = 1;
383 calculationResult[
"GG"] = ggSel;
386 double BhabhaECL = 0.;
388 for (
int i = 0; i < eclClusters.getEntries() - 1; i++) {
394 double Eg1ob = V4g1.E() / (2 * BeamEnergyCMS());
395 for (
int j = i + 1; j < eclClusters.getEntries(); j++) {
400 double Eg2ob = V4g2.E() / (2 * BeamEnergyCMS());
401 const TVector3 V3g1 = V4g1.Vect();
402 const TVector3 V3g2 = V4g2.Vect();
403 double Thetag1 = V4g1.Theta() * TMath::RadToDeg();
404 double Thetag2 = V4g2.Theta() * TMath::RadToDeg();
405 double deltphi = fabs(V3g1.DeltaPhi(V3g2) * TMath::RadToDeg());
406 double Tsum = Thetag1 + Thetag2;
407 if ((deltphi > 165. && deltphi < 178.5) && (Eg1ob > 0.4 && Eg2ob > 0.4 && (Eg1ob > 0.45 || Eg2ob > 0.45)) && (Tsum > 178.
408 && Tsum < 182.)) BhabhaECL = 1;
411 calculationResult[
"BhabhaECL"] = BhabhaECL;
415 const double lowdEdxEdge = 0.70, highdEdxEdge = 1.30;
416 const double lowEoPEdge = 0.70, highEoPEdge = 1.30;
418 if (m_pionParticles->getListSize() == 2) {
421 for (
unsigned int i = 0; i < m_pionParticles->getListSize() - 1; i++) {
423 Particle* part1 = m_pionParticles->getParticle(i);
424 if (!part1)
continue;
426 const auto chargep1 = part1->
getCharge();
427 if (abs(chargep1) != 1)
continue;
430 if (!eclTrack1)
continue;
435 if (energyOverMomentum1 <= lowEoPEdge || energyOverMomentum1 >= highEoPEdge)
continue;
438 if (!track1)
continue;
441 if (!trackFit1)
continue;
445 if (!dedxTrack1)
continue;
448 for (
unsigned int j = i + 1; j < m_pionParticles->getListSize(); j++) {
450 Particle* part2 = m_pionParticles->getParticle(j);
451 if (!part2)
continue;
453 const auto chargep2 = part2->
getCharge();
454 if (abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
457 if (!eclTrack2)
continue;
462 if (energyOverMomentum2 <= lowEoPEdge || energyOverMomentum2 >= highEoPEdge)
continue;
465 if (!track2)
continue;
468 if (!trackFit2)
continue;
472 if (!dedxTrack2)
continue;
477 if ((p1_dedxnosat > lowdEdxEdge && p1_dedxnosat < highdEdxEdge) || (p2_dedxnosat > lowdEdxEdge
478 && p2_dedxnosat < highdEdxEdge))radee = 1;
484 calculationResult[
"Radee"] = radee;
487 double mumutight = 0.;
488 double eMumuTotGammas = 0.;
491 int nGammas = m_gammaParticles->getListSize();
493 for (
int t = 0; t < nGammas; t++) {
494 const Particle* part = m_gammaParticles->getParticle(t);
496 eMumuTotGammas += frame.getMomentum(part).E();
500 nTracks = tracks.getEntries();
505 if (m_pionParticles->getListSize() == 2) {
508 for (
unsigned int k = 0; k < m_pionParticles->getListSize() - 1; k++) {
510 Particle* part1 = m_pionParticles->getParticle(k);
511 if (!part1)
continue;
513 const auto chargep1 = part1->
getCharge();
514 if (abs(chargep1) != 1)
continue;
517 if (!eclTrack1)
continue;
521 if (!track1)
continue;
524 if (!trackFit1)
continue;
529 const double p1MomLab = V4p1.P();
530 double highestP = p1MomLab;
534 if (p1Pid) p1hasKLMid = p1Pid->
isAvailable(Const::KLM);
535 const double p1isInCDC = Variable::inCDCAcceptance(part1);
536 const double p1clusPhi = Variable::eclClusterPhi(part1);
538 const double Pp1 = V3p1.Mag();
539 const double Thetap1 = (V3p1).Theta() * TMath::RadToDeg();
540 const double Phip1 = (V3p1).Phi() * TMath::RadToDeg();
544 const bool goodTrk1 = enECLTrack1 > 0 && enECLTrack1 < 0.5 && p1CDChits > 0
545 && ((p1hasKLMid == 0 && enECLTrack1 < 0.25 && p1MomLab < 2.0) || p1hasKLMid == 1) && p1isInCDC == 1;
548 for (
unsigned int l = k + 1; l < m_pionParticles->getListSize(); l++) {
550 Particle* part2 = m_pionParticles->getParticle(l);
551 if (!part2)
continue;
553 const auto chargep2 = part2->
getCharge();
554 if (abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
557 if (!eclTrack2)
continue;
561 if (!track2)
continue;
564 if (!trackFit2)
continue;
569 const double p2MomLab = V4p2.P();
570 double lowestP = p2MomLab;
574 if (p2Pid) p2hasKLMid = p2Pid->
isAvailable(Const::KLM);
575 const double p2isInCDC = Variable::inCDCAcceptance(part2);
576 const double p2clusPhi = Variable::eclClusterPhi(part2);
578 const double Pp2 = V3p2.Mag();
579 const double Thetap2 = (V3p2).Theta() * TMath::RadToDeg();
580 const double Phip2 = (V3p2).Phi() * TMath::RadToDeg();
582 const double acopPhi = fabs(180 - fabs(Phip1 - Phip2));
583 const double acopTheta = fabs(fabs(Thetap1 + Thetap2) - 180);
587 const bool goodTrk2 = enECLTrack2 > 0 && enECLTrack2 < 0.5 && p2CDChits > 0
588 && ((p2hasKLMid == 0 && enECLTrack2 < 0.25 && p2MomLab < 2.0) || p2hasKLMid == 1) && p2isInCDC == 1;
590 double eTotMumuTracks = enECLTrack1 + enECLTrack2;
591 double EMumutot = eTotMumuTracks + eMumuTotGammas;
593 bool mumutight_tag = enECLTrack1 < 0.5 && enECLTrack2 < 0.5 && EMumutot < 2 && acopPhi < 10 && acopTheta < 10 && nTracks == 2
594 && Pp1 > 0.5 && Pp2 > 0.5;
596 if (mumutight_tag) mumutight = 1;
598 if (p1MomLab < p2MomLab) {
603 double diffPhi = p1clusPhi - p2clusPhi;
604 if (fabs(diffPhi) > M_PI) {
605 if (diffPhi > M_PI) {
606 diffPhi = diffPhi - 2 * M_PI;
608 diffPhi = 2 * M_PI + diffPhi;
612 const double recoilP = fr.getMomentum(pIN - V4p1 - V4p2).P();
614 const bool radmumu_tag = nTracks < 4 && goodTrk1 == 1 && goodTrk2 == 1 && highestP > 1 && lowestP < 3 && (p1hasKLMid == 1
615 || p2hasKLMid == 1) && abs(diffPhi) >= 0.5 * M_PI && recoilP > 0.1 && (enECLTrack1 <= 0.25 || enECLTrack2 <= 0.25);
617 if (radmumu_tag) radmumu = 1;
623 calculationResult[
"MumuTight"] = mumutight;
624 calculationResult[
"Radmumu"] = radmumu;
627 double EsumPiHad = 0;
629 int nHadTracks = m_pionHadParticles->getListSize();
633 std::vector<TVector3> m_pionHadv3;
635 for (
int nPiHad = 0; nPiHad < nHadTracks; nPiHad++) {
636 Particle* parPiHad = m_pionHadParticles->getParticle(nPiHad);
639 EsumPiHad += V4PiHad.E();
640 PzPiHad += V4PiHad.Pz();
643 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (BeamEnergyCMS() * 2.0);
644 double EsumCMSnorm = eneclClusters / (BeamEnergyCMS() * 2.0);
645 double PzTotCMSnorm = (PzPiHad + PzGamma) / (BeamEnergyCMS() * 2.0);
647 bool hadronb_tag = nHadTracks >= 3 && visibleEnergyCMSnorm > 0.2 && abs(PzTotCMSnorm) < 0.5 && neclClusters > 1
648 && EsumCMSnorm > 0.1 && EsumCMSnorm < 0.8;
653 fw.calculateBasicMoments();
654 double R2 = fw.getR(2);
655 if (R2 < 0.4) hadronb1 = 1;
656 if (hadronb1 && nHadTracks >= 5) hadronb2 = 1;
659 calculationResult[
"HadronB"] = hadronb;
660 calculationResult[
"HadronB1"] = hadronb1;
661 calculationResult[
"HadronB2"] = hadronb2;
666 const double KsMassLow = 0.468;
667 const double KsMassHigh = 0.528;
669 if (m_KsParticles.isValid()) {
670 for (
unsigned int i = 0; i < m_KsParticles->getListSize(); i++) {
671 const Particle* mergeKsCand = m_KsParticles->getParticle(i);
672 const double isKsCandGood = Variable::goodBelleKshort(mergeKsCand);
673 const double KsCandMass = mergeKsCand->
getMass();
674 if (KsCandMass > KsMassLow && KsCandMass < KsMassHigh && isKsCandGood == 1.) nKshort++;
678 if (nKshort != 0) Kshort = 1;
680 calculationResult[
"Kshort"] = Kshort;
686 const double visibleEnergyCMS = visibleEnergyCMSnorm * BeamEnergyCMS() * 2.0;
687 const unsigned int n_particles = m_pionHadParticles->getListSize();
689 if (n_particles >= 2) {
690 for (
unsigned int i = 0; i < n_particles - 1; i++) {
691 Particle* par1 = m_pionHadParticles->getParticle(i);
692 for (
unsigned int j = i + 1; j < n_particles; j++) {
693 Particle* par2 = m_pionHadParticles->getParticle(j);
695 const TLorentzVector V4p1 = par1->
get4Vector();
696 const TLorentzVector V4p2 = par2->
get4Vector();
697 const double opAng = V4p1.Theta() - V4p2.Theta();
698 const TLorentzVector V4pSum = V4p1 + V4p2;
700 const double ptCMS = V4pSumCMS.Pt();
701 const double pzCMS = V4pSumCMS.Pz();
702 const double mSum = V4pSum.M();
704 const bool fourLepCand = chSum == 0 && (V4p1.P() > 0.4 && V4p2.P() > 0.4) && cos(opAng) > -0.997 && ptCMS < 0.15 && abs(pzCMS) < 2.5
707 if (fourLepCand) nFourLep++;
712 if (nFourLep != 0 && visibleEnergyCMS < 6) fourLep = 1;
714 calculationResult[
"FourLep"] = fourLep;
717 unsigned int nLambda = 0;
719 if (m_LambdaParticles.isValid()) {
720 for (
unsigned int i = 0; i < m_LambdaParticles->getListSize(); i++) {
721 const Particle* mergeLambdaCand = m_LambdaParticles->getParticle(i);
722 const double flightDist = Variable::flightDistance(mergeLambdaCand);
723 const double flightDistErr = Variable::flightDistanceErr(mergeLambdaCand);
724 const double flightSign = flightDist / flightDistErr;
727 const double protMom = protCand->
getMomentum().Mag();
728 const double pionMom = pionCand->
getMomentum().Mag();
729 const double asymPDaughters = (protMom - pionMom) / (protMom + pionMom);
730 if (flightSign > 10 && asymPDaughters > 0.41) nLambda++;
735 calculationResult[
"Lambda"] = 1;
737 calculationResult[
"Lambda"] = 0;
741 unsigned int nDstp1 = 0;
742 unsigned int nDstp2 = 0;
743 unsigned int nDstp3 = 0;
744 unsigned int nDstp4 = 0;
746 if (m_DstParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
747 for (
unsigned int i = 0; i < m_DstParticles->getListSize(); i++) {
748 const Particle* allDstCand = m_DstParticles->getParticle(i);
749 const double dstDecID = allDstCand->
getExtraInfo(
"decayModeID");
750 if (dstDecID == 1.) nDstp1++;
751 if (dstDecID == 2.) nDstp2++;
752 if (dstDecID == 3.) nDstp3++;
753 if (dstDecID == 4.) nDstp4++;
759 calculationResult[
"Dstp1"] = 1;
761 calculationResult[
"Dstp1"] = 0;
765 calculationResult[
"Dstp2"] = 1;
767 calculationResult[
"Dstp2"] = 0;
771 calculationResult[
"Dstp3"] = 1;
773 calculationResult[
"Dstp3"] = 0;
777 calculationResult[
"Dstp4"] = 1;
779 calculationResult[
"Dstp4"] = 0;
783 calculationResult[
"nTracksOffIP"] = m_offIpParticles->getListSize();
786 calculationResult[
"NeuroTRG"] = 0;
787 calculationResult[
"GammaGammaFilter"] = 0;
791 const std::map<std::string, int>& nonPrescaledResults = filter_result->getNonPrescaledResults();
792 if (nonPrescaledResults.find(m_filterL1TrgNN) != nonPrescaledResults.end()) {
794 if (hasNN) calculationResult[
"NeuroTRG"] = 1;
796 const bool ggEndcap = (filter_result->getNonPrescaledResult(
"software_trigger_cut&filter&ggEndcapLoose") ==
798 const bool ggBarrel = (filter_result->getNonPrescaledResult(
"software_trigger_cut&filter&ggBarrelLoose") ==
800 if (ggEndcap || ggBarrel) calculationResult[
"GammaGammaFilter"] = 1;
805 double mumuHighMass = 0.;
807 if (trackWithMaximumRho && trackWithSecondMaximumRho) {
809 double eclE1 = 0., eclE2 = 0.;
811 const auto charge1 = trackWithMaximumRho->getCharge();
812 const auto charge2 = trackWithSecondMaximumRho->getCharge();
813 const auto chSum = charge1 + charge2;
815 const ECLCluster* eclTrack1 = trackWithMaximumRho->getECLCluster();
821 const ECLCluster* eclTrack2 = trackWithSecondMaximumRho->getECLCluster();
829 const TLorentzVector V4pSum = V4p1 + V4p2;
830 const double mSum = V4pSum.M();
832 const double thetaSumCMS = (V4p1.Theta() + V4p2.Theta()) * TMath::RadToDeg();
833 const double phi1CMS = V4p1.Phi() * TMath::RadToDeg();
834 const double phi2CMS = V4p2.Phi() * TMath::RadToDeg();
836 double diffPhi = phi1CMS - phi2CMS;
837 if (fabs(diffPhi) > 180) {
839 diffPhi = diffPhi - 2 * 180;
841 diffPhi = 2 * 180 + diffPhi;
844 const double delThetaCMS = fabs(fabs(thetaSumCMS) - 180);
845 const double delPhiCMS = fabs(180 - fabs(diffPhi));
847 const bool mumuHighMassCand = chSum == 0 && (mSum > 8. && mSum < 12.) && hasClus > 0 && eclE1 <= 1
848 && eclE2 <= 1 && delThetaCMS < 10 && delPhiCMS < 10;
850 if (mumuHighMassCand) mumuHighMass = 1;
854 calculationResult[
"MumuHighM"] = mumuHighMass;
857 calculationResult[
"Bp"] = 0;
858 calculationResult[
"Bz"] = 0;
860 if (m_BpParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
861 calculationResult[
"Bp"] = m_BpParticles->getListSize() >= 1;
864 if (m_BzParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
865 calculationResult[
"Bz"] = m_BzParticles->getListSize() >= 1;
Debug output for CDCDedxPID module.
double getDedxNoSat() const
Get dE/dx truncated mean without the saturation correction for this track.
Class to provide momentum-related information from ECLClusters.
const TLorentzVector Get4MomentumFromCluster(const ECLCluster *cluster, ECLCluster::EHypothesisBit hypo)
Returns four momentum vector.
static const ChargedStable pion
charged pion particle
bool hasHypothesis(EHypothesisBit bitmask) const
Return if specific hypothesis bit is set.
double getEnergy(EHypothesisBit hypothesis) const
Return Energy (GeV).
@ c_nPhotons
CR is split into n photons (N1)
Class to calculate the Fox-Wolfram moments up to order 8.
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
bool isAvailable(Const::PIDDetectorSet set) const
Check whether PID information from a given set of detectors is available.
Class to store reconstructed particles.
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
float getExtraInfo(const std::string &name) const
Return given value if set.
float getMass() const
Returns invariant mass (= nominal for FS particles)
TVector3 getMomentum() const
Returns momentum vector.
const PIDLikelihood * getPIDLikelihood() const
Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to creat...
float getCharge(void) const
Returns particle charge.
TLorentzVector get4Vector() const
Returns Lorentz vector.
float getMomentumMagnitude() const
Returns momentum magnitude.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
static const ReferenceFrame & GetCurrent()
Get current rest frame.
StoreObjPtr< ParticleList > m_pionParticles
Internal storage of the tracks as particles.
StoreObjPtr< ParticleList > m_gammaParticles
Internal storage of the ECL clusters as particles.
StoreObjPtr< ParticleList > m_BzParticles
Internal storage of the B0's.
StoreObjPtr< ParticleList > m_LambdaParticles
Internal storage of the Lambda0's.
StoreObjPtr< ParticleList > m_pionHadParticles
Internal storage of the tracks as particles (definition for hadronb).
void requireStoreArrays() override
Require the particle list. We do not need more here.
void doCalculation(SoftwareTriggerObject &calculationResult) override
Actually write out the variables into the map.
SkimSampleCalculator()
Set the default names for the store object particle lists.
StoreObjPtr< ParticleList > m_KsParticles
Internal storage of the K_S0's.
StoreObjPtr< ParticleList > m_DstParticles
Internal storage of the D*'s.
StoreObjPtr< ParticleList > m_pionTauParticles
Internal storage of the tracks as particles (definition for tau skims).
StoreObjPtr< ParticleList > m_BpParticles
Internal storage of the B+'s.
StoreObjPtr< ParticleList > m_offIpParticles
Internal storage of the tracks for alignment calibration.
Accessor to arrays stored in the data store.
bool isValid() const
Check wether the array was registered.
int getEntries() const
Get the number of objects in the array.
iterator end()
Return iterator to last entry +1.
iterator begin()
Return iterator to first entry.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Values of the result of a track fit with a given particle hypothesis.
TLorentzVector get4Momentum() const
Getter for the 4Momentum at the closest approach of the track in the r/phi projection.
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
Class that bundles various TrackFitResults.
@ c_accept
Accept this event.
Abstract base class for different kinds of events.