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")
58 getRho(gammaWithMaximumRho));
61 getRho(trackWithMaximumRho));
64 const double& rhoOfECLClusterWithSecondMaximumRho = getRhoOfECLClusterWithMaximumRhoBelow(
m_pionParticles,
66 rhoOfECLClusterWithMaximumRho);
68 const double& rhoOfTrackWithMaximumRho = getRho(trackWithMaximumRho);
69 const double& rhoOfTrackWithSecondMaximumRho = getRho(trackWithSecondMaximumRho);
70 const double& rhoOfGammaWithMaximumRho = getRho(gammaWithMaximumRho);
71 const double& rhoOfGammaWithSecondMaximumRho = getRho(gammaWithSecondMaximumRho);
75 calculationResult[
"EC1CMSLE"] = rhoOfECLClusterWithMaximumRho;
78 calculationResult[
"EC2CMSLE"] = rhoOfECLClusterWithSecondMaximumRho;
81 calculationResult[
"EC12CMSLE"] = rhoOfECLClusterWithMaximumRho + rhoOfECLClusterWithSecondMaximumRho;
93 calculationResult[
"P1CMSBhabhaLE"] = rhoOfTrackWithMaximumRho;
96 calculationResult[
"P1OEbeamCMSBhabhaLE"] = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
99 calculationResult[
"P2CMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho;
102 calculationResult[
"P2OEbeamCMSBhabhaLE"] = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
105 calculationResult[
"P12CMSBhabhaLE"] = rhoOfTrackWithMaximumRho + rhoOfTrackWithSecondMaximumRho;
108 calculationResult[
"G1CMSBhabhaLE"] = rhoOfGammaWithMaximumRho;
110 calculationResult[
"G1OEbeamCMSBhabhaLE"] = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
113 calculationResult[
"G2CMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho;
115 calculationResult[
"G2OEbeamCMSBhabhaLE"] = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
118 calculationResult[
"G12CMSBhabhaLE"] = rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho;
120 calculationResult[
"G12OEbeamCMSBhabhaLE"] =
121 (rhoOfGammaWithMaximumRho + rhoOfGammaWithSecondMaximumRho) / BeamEnergyCMS();
126 if (gammaWithMaximumRho) {
127 calculationResult[
"ENeutralLE"] = getRho(gammaWithMaximumRho);
129 calculationResult[
"ENeutralLE"] = -1;
135 return particle.getECLCluster() != nullptr;
137 calculationResult[
"nECLMatchTracksLE"] = numberOfTracksWithECLMatch;
140 double neclClusters = -1.;
141 double eneclClusters = 0.;
145 double EsumGamma = 0.;
147 const unsigned int numberOfECLClusters = std::count_if(eclClusters.
begin(), eclClusters.
end(),
149 return (eclcluster.hasHypothesis(
150 ECLCluster::EHypothesisBit::c_nPhotons)
151 and eclcluster.getEnergy(
152 ECLCluster::EHypothesisBit::c_nPhotons) > 0.1);
154 neclClusters = numberOfECLClusters;
156 for (
int ncl = 0; ncl < eclClusters.
getEntries(); ncl++) {
160 if (!eclClusters[ncl]->getRelatedFrom<Track>()) {
163 EsumGamma += V4Gamma_CMS.E();
164 PzGamma += V4Gamma_CMS.Pz();
169 calculationResult[
"nECLClustersLE"] = neclClusters;
171 int nb2bcc_PhiHigh = 0;
172 int nb2bcc_PhiLow = 0;
175 for (
int i = 0; i < eclClusters.
getEntries() - 1; i++) {
179 double Eg1 = V4g1.E();
180 for (
int j = i + 1; j < eclClusters.
getEntries(); j++) {
184 double Eg2 = V4g2.E();
189 double deltphi = fabs(V3g1.DeltaPhi(V3g2) * 180. / 3.1415926);
190 double Tsum = Thetag1 + Thetag2;
191 if (deltphi > 170. && (Eg1 > 0.25 && Eg2 > 0.25)) nb2bcc_PhiHigh++;
192 if (deltphi > 170. && (Eg1 < 0.25 || Eg2 < 0.25)) nb2bcc_PhiLow++;
193 if (deltphi > 160. && (Tsum > 160. && Tsum < 200.)) nb2bcc_3D++;
197 calculationResult[
"nB2BCCPhiHighLE"] = nb2bcc_PhiHigh;
198 calculationResult[
"nB2BCCPhiLowLE"] = nb2bcc_PhiLow;
199 calculationResult[
"nB2BCC3DLE"] = nb2bcc_3D;
203 double angleGTLE = -10.;
204 if (gammaWithMaximumRho) {
205 const TLorentzVector& V4g1 = gammaWithMaximumRho->
get4Vector();
206 if (trackWithMaximumRho) {
207 const TLorentzVector& V4p1 = trackWithMaximumRho->
get4Vector();
208 const double theta1 = (V4g1.Vect()).Angle(V4p1.Vect());
209 if (angleGTLE < theta1) angleGTLE = theta1;
211 if (trackWithSecondMaximumRho) {
212 const TLorentzVector& V4p2 = trackWithSecondMaximumRho->
get4Vector();
213 const double theta2 = (V4g1.Vect()).Angle(V4p2.Vect());
214 if (angleGTLE < theta2) angleGTLE = theta2;
218 calculationResult[
"AngleGTLE"] = angleGTLE;
221 double angleG1G2CMSLE = -10.;
222 if (gammaWithMaximumRho) {
223 const TLorentzVector& V4p1 = gammaWithMaximumRho->
get4Vector();
224 if (gammaWithSecondMaximumRho) {
225 const TLorentzVector& V4p2 = gammaWithSecondMaximumRho->
get4Vector();
228 angleG1G2CMSLE = V3p1.Angle(V3p2);
232 calculationResult[
"AngleG1G2CMSLE"] = angleG1G2CMSLE;
235 double maxAngleTTLE = -10.;
238 const double jPsiMasswindow = 0.11;
240 for (
unsigned int i = 0; i <
m_pionParticles->getListSize() - 1; i++) {
242 for (
unsigned int j = i + 1; j <
m_pionParticles->getListSize(); j++) {
246 TLorentzVector V4pSum = V4p1 + V4p2;
248 const double mSum = V4pSum.M();
249 const double JpsidM = mSum - TDatabasePDG::Instance()->GetParticle(443)->Mass();
250 if (abs(JpsidM) < jPsiMasswindow && chSum == 0) nJpsi++;
253 const double temp = V3p1.Angle(V3p2);
254 if (maxAngleTTLE < temp) maxAngleTTLE = temp;
259 if (nJpsi != 0) Jpsi = 1;
261 calculationResult[
"maxAngleTTLE"] = maxAngleTTLE;
262 calculationResult[
"Jpsi"] = Jpsi;
265 double maxAngleGGLE = -10.;
275 const double temp = V3p1.Angle(V3p2);
276 if (maxAngleGGLE < temp) maxAngleGGLE = temp;
281 calculationResult[
"maxAngleGGLE"] = maxAngleGGLE;
286 const double& momentum = p.getMomentumMagnitude();
287 const double& r_rho = getRho(&p);
288 const ECLCluster* eclTrack = p.getECLCluster();
290 const double& energyOverMomentum = eclTrack->getEnergy(
291 ECLCluster::EHypothesisBit::c_nPhotons) / momentum;
292 double r_rhotoebeam = r_rho / BeamEnergyCMS();
293 return (r_rhotoebeam) > 0.35 && energyOverMomentum > 0.8;
298 calculationResult[
"nEidLE"] = nEidLE;
302 const double visibleEnergyTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
303 [](
const double & visibleEnergy,
const Particle & p) {
304 return visibleEnergy + p.getMomentumMagnitude();
307 const double visibleEnergyGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
308 [](
const double & visibleEnergy,
const Particle & p) {
309 return visibleEnergy + p.getMomentumMagnitude();
312 calculationResult[
"VisibleEnergyLE"] = visibleEnergyTracks + visibleEnergyGammas;
315 const double eTotTracks = std::accumulate(m_pionParticles->begin(), m_pionParticles->end(), 0.0,
316 [](
const double & eTot,
const Particle & p) {
317 const ECLCluster* eclCluster = p.getECLCluster();
319 const double eclEnergy = eclCluster->getEnergy(
320 ECLCluster::EHypothesisBit::c_nPhotons);
321 if (eclEnergy > 0.1) {
322 return eTot + eclCluster->getEnergy(
323 ECLCluster::EHypothesisBit::c_nPhotons);
329 const double eTotGammas = std::accumulate(m_gammaParticles->begin(), m_gammaParticles->end(), 0.0,
330 [](
const double & eTot,
const Particle & p) {
331 return eTot + p.getEnergy();
333 double Etot = eTotTracks + eTotGammas;
334 calculationResult[
"EtotLE"] = Etot;
338 double numMaxLayerKLM = -1.;
339 double numSecMaxLayerKLM = -1.;
342 for (
const auto& klmCluster : klmClusters) {
343 double klmClusterLayer = klmCluster.getLayers();
344 if (numMaxLayerKLM < klmClusterLayer) {
345 numSecMaxLayerKLM = numMaxLayerKLM;
346 numMaxLayerKLM = klmClusterLayer;
347 }
else if (numSecMaxLayerKLM < klmClusterLayer)
348 numSecMaxLayerKLM = klmClusterLayer;
351 calculationResult[
"N1KLMLayer"] = numMaxLayerKLM;
352 calculationResult[
"N2KLMLayer"] = numSecMaxLayerKLM;
356 if (trackWithMaximumRho) charget1 = trackWithMaximumRho->getCharge();
358 if (trackWithSecondMaximumRho) charget2 = trackWithSecondMaximumRho->getCharge();
360 double Bhabha2Trk = 0.;
361 int ntrk_bha = m_pionParticles->getListSize();
362 double rp1ob = rhoOfTrackWithMaximumRho / BeamEnergyCMS();
363 double rp2ob = rhoOfTrackWithSecondMaximumRho / BeamEnergyCMS();
364 bool bhabha2trk_tag =
365 ntrk_bha >= 2 && maxAngleTTLE > 2.88 && nEidLE >= 1 && rp1ob > 0.35 && rp2ob > 0.35 && (Etot) > 4.0
366 && (abs(charget1) == 1 && abs(charget2) == 1 && (charget1 + charget2) == 0);
367 if (bhabha2trk_tag) Bhabha2Trk = 1;
368 calculationResult[
"Bhabha2Trk"] = Bhabha2Trk;
370 double Bhabha1Trk = 0.;
371 double rc1ob = rhoOfGammaWithMaximumRho / BeamEnergyCMS();
372 double rc2ob = rhoOfGammaWithSecondMaximumRho / BeamEnergyCMS();
373 bool bhabha1trk_tag = ntrk_bha == 1 && rp1ob > 0.35 && rc1ob > 0.35 && angleGTLE > 2.618;
374 if (bhabha1trk_tag) Bhabha1Trk = 1;
375 calculationResult[
"Bhabha1Trk"] = Bhabha1Trk;
378 bool gg_tag = ntrk_bha <= 1 && nEidLE == 0 && rc1ob > 0.35 && rc2ob > 0.2 && Etot > 4.0 && maxAngleGGLE > 2.618;
379 if (gg_tag) ggSel = 1;
380 calculationResult[
"GG"] = ggSel;
383 double BhabhaECL = 0.;
385 for (
int i = 0; i < eclClusters.getEntries() - 1; i++) {
391 double Eg1ob = V4g1.E() / (2 * BeamEnergyCMS());
392 for (
int j = i + 1; j < eclClusters.getEntries(); j++) {
397 double Eg2ob = V4g2.E() / (2 * BeamEnergyCMS());
398 const TVector3 V3g1 = V4g1.Vect();
399 const TVector3 V3g2 = V4g2.Vect();
400 double Thetag1 = V4g1.Theta() * TMath::RadToDeg();
401 double Thetag2 = V4g2.Theta() * TMath::RadToDeg();
402 double deltphi = fabs(V3g1.DeltaPhi(V3g2) * TMath::RadToDeg());
403 double Tsum = Thetag1 + Thetag2;
404 if ((deltphi > 165. && deltphi < 178.5) && (Eg1ob > 0.4 && Eg2ob > 0.4 && (Eg1ob > 0.45 || Eg2ob > 0.45)) && (Tsum > 178.
405 && Tsum < 182.)) BhabhaECL = 1;
408 calculationResult[
"BhabhaECL"] = BhabhaECL;
412 const double lowdEdxEdge = 0.70, highdEdxEdge = 1.30;
413 const double lowEoPEdge = 0.70, highEoPEdge = 1.30;
415 if (m_pionParticles->getListSize() == 2) {
418 for (
unsigned int i = 0; i < m_pionParticles->getListSize() - 1; i++) {
420 Particle* part1 = m_pionParticles->getParticle(i);
421 if (!part1)
continue;
423 const auto chargep1 = part1->
getCharge();
424 if (abs(chargep1) != 1)
continue;
427 if (!eclTrack1)
continue;
432 if (energyOverMomentum1 <= lowEoPEdge || energyOverMomentum1 >= highEoPEdge)
continue;
435 if (!track1)
continue;
438 if (!trackFit1)
continue;
442 if (!dedxTrack1)
continue;
445 for (
unsigned int j = i + 1; j < m_pionParticles->getListSize(); j++) {
447 Particle* part2 = m_pionParticles->getParticle(j);
448 if (!part2)
continue;
450 const auto chargep2 = part2->
getCharge();
451 if (abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
454 if (!eclTrack2)
continue;
459 if (energyOverMomentum2 <= lowEoPEdge || energyOverMomentum2 >= highEoPEdge)
continue;
462 if (!track2)
continue;
465 if (!trackFit2)
continue;
469 if (!dedxTrack2)
continue;
474 if ((p1_dedxnosat > lowdEdxEdge && p1_dedxnosat < highdEdxEdge) || (p2_dedxnosat > lowdEdxEdge
475 && p2_dedxnosat < highdEdxEdge))radee = 1;
481 calculationResult[
"Radee"] = radee;
484 double mumutight = 0.;
485 double eMumuTotGammas = 0.;
488 int nGammas = m_gammaParticles->getListSize();
490 for (
int t = 0; t < nGammas; t++) {
491 const Particle* part = m_gammaParticles->getParticle(t);
493 eMumuTotGammas += frame.getMomentum(part).E();
497 nTracks = tracks.getEntries();
502 if (m_pionParticles->getListSize() == 2) {
505 for (
unsigned int k = 0; k < m_pionParticles->getListSize() - 1; k++) {
507 Particle* part1 = m_pionParticles->getParticle(k);
508 if (!part1)
continue;
510 const auto chargep1 = part1->
getCharge();
511 if (abs(chargep1) != 1)
continue;
514 if (!eclTrack1)
continue;
518 if (!track1)
continue;
521 if (!trackFit1)
continue;
526 const double p1MomLab = V4p1.P();
527 double highestP = p1MomLab;
531 if (p1Pid) p1hasKLMid = p1Pid->
isAvailable(Const::KLM);
532 const double p1isInCDC = Variable::inCDCAcceptance(part1);
533 const double p1clusPhi = Variable::eclClusterPhi(part1);
535 const double Pp1 = V3p1.Mag();
536 const double Thetap1 = (V3p1).Theta() * TMath::RadToDeg();
537 const double Phip1 = (V3p1).Phi() * TMath::RadToDeg();
541 const bool goodTrk1 = enECLTrack1 > 0 && enECLTrack1 < 0.5 && p1CDChits > 0
542 && ((p1hasKLMid == 0 && enECLTrack1 < 0.25 && p1MomLab < 2.0) || p1hasKLMid == 1) && p1isInCDC == 1;
545 for (
unsigned int l = k + 1; l < m_pionParticles->getListSize(); l++) {
547 Particle* part2 = m_pionParticles->getParticle(l);
548 if (!part2)
continue;
550 const auto chargep2 = part2->
getCharge();
551 if (abs(chargep2) != 1 || (chargep1 + chargep2 != 0))
continue;
554 if (!eclTrack2)
continue;
558 if (!track2)
continue;
561 if (!trackFit2)
continue;
566 const double p2MomLab = V4p2.P();
567 double lowestP = p2MomLab;
571 if (p2Pid) p2hasKLMid = p2Pid->
isAvailable(Const::KLM);
572 const double p2isInCDC = Variable::inCDCAcceptance(part2);
573 const double p2clusPhi = Variable::eclClusterPhi(part2);
575 const double Pp2 = V3p2.Mag();
576 const double Thetap2 = (V3p2).Theta() * TMath::RadToDeg();
577 const double Phip2 = (V3p2).Phi() * TMath::RadToDeg();
579 const double acopPhi = fabs(180 - fabs(Phip1 - Phip2));
580 const double acopTheta = fabs(fabs(Thetap1 + Thetap2) - 180);
584 const bool goodTrk2 = enECLTrack2 > 0 && enECLTrack2 < 0.5 && p2CDChits > 0
585 && ((p2hasKLMid == 0 && enECLTrack2 < 0.25 && p2MomLab < 2.0) || p2hasKLMid == 1) && p2isInCDC == 1;
587 double eTotMumuTracks = enECLTrack1 + enECLTrack2;
588 double EMumutot = eTotMumuTracks + eMumuTotGammas;
590 bool mumutight_tag = enECLTrack1 < 0.5 && enECLTrack2 < 0.5 && EMumutot < 2 && acopPhi < 10 && acopTheta < 10 && nTracks == 2
591 && Pp1 > 0.5 && Pp2 > 0.5;
593 if (mumutight_tag) mumutight = 1;
595 if (p1MomLab < p2MomLab) {
600 double diffPhi = p1clusPhi - p2clusPhi;
601 if (fabs(diffPhi) > M_PI) {
602 if (diffPhi > M_PI) {
603 diffPhi = diffPhi - 2 * M_PI;
605 diffPhi = 2 * M_PI + diffPhi;
609 const double recoilP = fr.getMomentum(pIN - V4p1 - V4p2).P();
611 const bool radmumu_tag = nTracks < 4 && goodTrk1 == 1 && goodTrk2 == 1 && highestP > 1 && lowestP < 3 && (p1hasKLMid == 1
612 || p2hasKLMid == 1) && abs(diffPhi) >= 0.5 * M_PI && recoilP > 0.1 && (enECLTrack1 <= 0.25 || enECLTrack2 <= 0.25);
614 if (radmumu_tag) radmumu = 1;
620 calculationResult[
"MumuTight"] = mumutight;
621 calculationResult[
"Radmumu"] = radmumu;
624 double EsumPiHad = 0;
626 int nHadTracks = m_pionHadParticles->getListSize();
630 std::vector<TVector3> m_pionHadv3;
632 for (
int nPiHad = 0; nPiHad < nHadTracks; nPiHad++) {
633 Particle* parPiHad = m_pionHadParticles->getParticle(nPiHad);
636 EsumPiHad += V4PiHad.E();
637 PzPiHad += V4PiHad.Pz();
640 double visibleEnergyCMSnorm = (EsumPiHad + EsumGamma) / (BeamEnergyCMS() * 2.0);
641 double EsumCMSnorm = eneclClusters / (BeamEnergyCMS() * 2.0);
642 double PzTotCMSnorm = (PzPiHad + PzGamma) / (BeamEnergyCMS() * 2.0);
644 bool hadronb_tag = nHadTracks >= 3 && visibleEnergyCMSnorm > 0.2 && abs(PzTotCMSnorm) < 0.5 && neclClusters > 1
645 && EsumCMSnorm > 0.1 && EsumCMSnorm < 0.8;
650 fw.calculateBasicMoments();
651 double R2 = fw.getR(2);
652 if (R2 < 0.4) hadronb1 = 1;
653 if (hadronb1 && nHadTracks >= 5) hadronb2 = 1;
656 calculationResult[
"HadronB"] = hadronb;
657 calculationResult[
"HadronB1"] = hadronb1;
658 calculationResult[
"HadronB2"] = hadronb2;
663 const double KsMassLow = 0.468;
664 const double KsMassHigh = 0.528;
666 if (m_KsParticles.isValid()) {
667 for (
unsigned int i = 0; i < m_KsParticles->getListSize(); i++) {
668 const Particle* mergeKsCand = m_KsParticles->getParticle(i);
669 const double isKsCandGood = Variable::goodBelleKshort(mergeKsCand);
670 const double KsCandMass = mergeKsCand->
getMass();
671 if (KsCandMass > KsMassLow && KsCandMass < KsMassHigh && isKsCandGood == 1.) nKshort++;
675 if (nKshort != 0) Kshort = 1;
677 calculationResult[
"Kshort"] = Kshort;
683 const double visibleEnergyCMS = visibleEnergyCMSnorm * BeamEnergyCMS() * 2.0;
684 const unsigned int n_particles = m_pionHadParticles->getListSize();
686 if (n_particles >= 2) {
687 for (
unsigned int i = 0; i < n_particles - 1; i++) {
688 Particle* par1 = m_pionHadParticles->getParticle(i);
689 for (
unsigned int j = i + 1; j < n_particles; j++) {
690 Particle* par2 = m_pionHadParticles->getParticle(j);
692 const TLorentzVector V4p1 = par1->
get4Vector();
693 const TLorentzVector V4p2 = par2->
get4Vector();
694 const double opAng = V4p1.Theta() - V4p2.Theta();
695 const TLorentzVector V4pSum = V4p1 + V4p2;
697 const double ptCMS = V4pSumCMS.Pt();
698 const double pzCMS = V4pSumCMS.Pz();
699 const double mSum = V4pSum.M();
701 const bool fourLepCand = chSum == 0 && (V4p1.P() > 0.4 && V4p2.P() > 0.4) && cos(opAng) > -0.997 && ptCMS < 0.15 && abs(pzCMS) < 2.5
704 if (fourLepCand) nFourLep++;
709 if (nFourLep != 0 && visibleEnergyCMS < 6) fourLep = 1;
711 calculationResult[
"FourLep"] = fourLep;
714 unsigned int nLambda = 0;
716 if (m_LambdaParticles.isValid()) {
717 for (
unsigned int i = 0; i < m_LambdaParticles->getListSize(); i++) {
718 const Particle* mergeLambdaCand = m_LambdaParticles->getParticle(i);
719 const double flightDist = Variable::flightDistance(mergeLambdaCand);
720 const double flightDistErr = Variable::flightDistanceErr(mergeLambdaCand);
721 const double flightSign = flightDist / flightDistErr;
724 const double protMom = protCand->
getMomentum().Mag();
725 const double pionMom = pionCand->
getMomentum().Mag();
726 const double asymPDaughters = (protMom - pionMom) / (protMom + pionMom);
727 if (flightSign > 10 && asymPDaughters > 0.41) nLambda++;
732 calculationResult[
"Lambda"] = 1;
734 calculationResult[
"Lambda"] = 0;
738 unsigned int nDstp1 = 0;
739 unsigned int nDstp2 = 0;
740 unsigned int nDstp3 = 0;
741 unsigned int nDstp4 = 0;
743 if (m_DstParticles.isValid() && (ntrk_bha >= 3 && Bhabha2Trk == 0)) {
744 for (
unsigned int i = 0; i < m_DstParticles->getListSize(); i++) {
745 const Particle* allDstCand = m_DstParticles->getParticle(i);
746 const double dstDecID = allDstCand->
getExtraInfo(
"decayModeID");
747 if (dstDecID == 1.) nDstp1++;
748 if (dstDecID == 2.) nDstp2++;
749 if (dstDecID == 3.) nDstp3++;
750 if (dstDecID == 4.) nDstp4++;
756 calculationResult[
"Dstp1"] = 1;
758 calculationResult[
"Dstp1"] = 0;
762 calculationResult[
"Dstp2"] = 1;
764 calculationResult[
"Dstp2"] = 0;
768 calculationResult[
"Dstp3"] = 1;
770 calculationResult[
"Dstp3"] = 0;
774 calculationResult[
"Dstp4"] = 1;
776 calculationResult[
"Dstp4"] = 0;
780 calculationResult[
"nTracksOffIP"] = m_offIpParticles->getListSize();
783 calculationResult[
"NeuroTRG"] = 0;
787 const std::map<std::string, int>& nonPrescaledResults = filter_result->getNonPrescaledResults();
788 if (nonPrescaledResults.find(m_filterL1TrgNN) != nonPrescaledResults.end()) {
790 if (hasNN) calculationResult[
"NeuroTRG"] = 1;
796 double mumuHighMass = 0.;
798 if (trackWithMaximumRho && trackWithSecondMaximumRho) {
800 double eclE1 = 0., eclE2 = 0.;
802 const auto charge1 = trackWithMaximumRho->getCharge();
803 const auto charge2 = trackWithSecondMaximumRho->getCharge();
804 const auto chSum = charge1 + charge2;
806 const ECLCluster* eclTrack1 = trackWithMaximumRho->getECLCluster();
812 const ECLCluster* eclTrack2 = trackWithSecondMaximumRho->getECLCluster();
820 const TLorentzVector V4pSum = V4p1 + V4p2;
821 const double mSum = V4pSum.M();
823 const double thetaSumCMS = (V4p1.Theta() + V4p2.Theta()) * TMath::RadToDeg();
824 const double phi1CMS = V4p1.Phi() * TMath::RadToDeg();
825 const double phi2CMS = V4p2.Phi() * TMath::RadToDeg();
827 double diffPhi = phi1CMS - phi2CMS;
828 if (fabs(diffPhi) > 180) {
830 diffPhi = diffPhi - 2 * 180;
832 diffPhi = 2 * 180 + diffPhi;
835 const double delThetaCMS = fabs(fabs(thetaSumCMS) - 180);
836 const double delPhiCMS = fabs(180 - fabs(diffPhi));
838 const bool mumuHighMassCand = chSum == 0 && (mSum > 8. && mSum < 12.) && hasClus > 0 && eclE1 <= 1
839 && eclE2 <= 1 && delThetaCMS < 10 && delPhiCMS < 10;
841 if (mumuHighMassCand) mumuHighMass = 1;
845 calculationResult[
"MumuHighM"] = mumuHighMass;
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_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_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.