Skip to content

Commit 5ac67c1

Browse files
authored
Update nucleitpcpbpb.cxx
1 parent e3854c6 commit 5ac67c1

File tree

1 file changed

+33
-63
lines changed

1 file changed

+33
-63
lines changed

PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

Lines changed: 33 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ struct NucleitpcPbPb {
150150
Configurable<bool> cfgmaxGetMeanItsClsSizeRequire{"cfgmaxGetMeanItsClsSizeRequire", true, "Require maxGetMeanItsClsSize Cut"};
151151
Configurable<bool> cfgDCAwithptRequire{"cfgDCAwithptRequire", true, "Require DCA cuts with pt dependance"};
152152
Configurable<bool> cfgRequirebetaplot{"cfgRequirebetaplot", true, "Require beta plot"};
153-
Configurable<bool> cfgIncludeMaterialInEfficiency{"cfgIncludeMaterialInEfficiency", false, "Require from material in efficiency"};
153+
Configurable<bool> cfgIncludeMaterialInEfficiency{"cfgIncludeMaterialInEfficiency", true, "Require from material in efficiency"};
154154

155155
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], nParticles, nBetheParams, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"};
156156
Configurable<LabeledArray<double>> cfgTrackPIDsettings{"cfgTrackPIDsettings", {kTrackPIDSettings[0], nParticles, nTrkSettings, particleNames, trackPIDsettingsNames}, "track selection and PID criteria"};
@@ -465,8 +465,8 @@ struct NucleitpcPbPb {
465465
continue;
466466

467467
int pdgCode = mcParticle.pdgCode();
468-
bool isHe3 = (std::abs(pdgCode) == 1000020030);
469-
bool isHe4 = (std::abs(pdgCode) == 1000020040);
468+
bool isHe3 = (std::abs(pdgCode) == particlePdgCodes.at(4));
469+
bool isHe4 = (std::abs(pdgCode) == particlePdgCodes.at(5));
470470

471471
if (std::abs(mcParticle.eta()) > cfgCutEta)
472472
continue;
@@ -493,19 +493,19 @@ struct NucleitpcPbPb {
493493
if (isMaterialSecondary) {
494494
float centrality = mcCollInfos[idx].passedEvSel ? mcCollInfos[idx].centrality : -1.0f;
495495

496-
if (pdgCode == 1000020030) {
496+
if (pdgCode == particlePdgCodes.at(4)) {
497497
histomc.fill(HIST("histSecondaryMaterialHe3"), mcParticle.pt(), centrality);
498-
} else if (pdgCode == -1000020030) {
498+
} else if (pdgCode == -particlePdgCodes.at(4)) {
499499
histomc.fill(HIST("histSecondaryMaterialAntiHe3"), mcParticle.pt(), centrality);
500-
} else if (pdgCode == 1000020040) {
500+
} else if (pdgCode == particlePdgCodes.at(5)) {
501501
histomc.fill(HIST("histSecondaryMaterialHe4"), mcParticle.pt(), centrality);
502-
} else if (pdgCode == -1000020040) {
502+
} else if (pdgCode == -particlePdgCodes.at(5)) {
503503
histomc.fill(HIST("histSecondaryMaterialAntiHe4"), mcParticle.pt(), centrality);
504504
}
505505
int type = 0;
506-
if (std::abs(pdgCode) == 1000020030)
506+
if (std::abs(pdgCode) == particlePdgCodes.at(4))
507507
type = (pdgCode > 0) ? 1 : 2;
508-
else if (std::abs(pdgCode) == 1000020040)
508+
else if (std::abs(pdgCode) == particlePdgCodes.at(5))
509509
type = (pdgCode > 0) ? 3 : 4;
510510
histomc.fill(HIST("histAllMaterialSecondariesGen"), mcParticle.pt(), mcParticle.y(), type);
511511
}
@@ -514,8 +514,6 @@ struct NucleitpcPbPb {
514514
continue;
515515

516516
uint16_t flags = 0;
517-
int motherPdgCode = 0;
518-
float motherDecRadius = -1;
519517
int decayType = 0;
520518
int particleAnti = (pdgCode > 0) ? 0 : 1;
521519

@@ -528,21 +526,13 @@ struct NucleitpcPbPb {
528526
std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
529527
flags |= kIsSecondaryFromWeakDecay;
530528
decayType = 1;
531-
motherPdgCode = motherparticle.pdgCode();
532-
motherDecRadius = std::hypot(mcParticle.vx() - motherparticle.vx(),
533-
mcParticle.vy() - motherparticle.vy());
534529
break;
535530
}
536531
}
537532
}
538533
} else if (mcParticle.has_mothers()) {
539534
flags |= kIsSecondaryFromWeakDecay;
540535
decayType = 1;
541-
for (auto& motherparticle : mcParticle.mothers_as<aod::McParticles>()) {
542-
motherPdgCode = motherparticle.pdgCode();
543-
motherDecRadius = std::hypot(mcParticle.vx() - motherparticle.vx(),
544-
mcParticle.vy() - motherparticle.vy());
545-
}
546536
} else {
547537
flags |= kIsSecondaryFromMaterial;
548538
decayType = 2;
@@ -554,9 +544,9 @@ struct NucleitpcPbPb {
554544
continue;
555545

556546
int particleType = -1;
557-
if (std::abs(pdgCode) == 1000020030)
547+
if (std::abs(pdgCode) == particlePdgCodes.at(4))
558548
particleType = he3;
559-
else if (std::abs(pdgCode) == 1000020040)
549+
else if (std::abs(pdgCode) == particlePdgCodes.at(5))
560550
particleType = he4;
561551

562552
if (particleType >= 0) {
@@ -570,23 +560,23 @@ struct NucleitpcPbPb {
570560

571561
if (isFromWeakDecay) {
572562
float centrality = mcCollInfos[idx].passedEvSel ? mcCollInfos[idx].centrality : -1.0f;
573-
if (pdgCode == 1000020030) {
563+
if (pdgCode == particlePdgCodes.at(4)) {
574564
histomc.fill(HIST("histWeakDecayPtHe3"), mcParticle.pt(), centrality);
575-
} else if (pdgCode == -1000020030) {
565+
} else if (pdgCode == -particlePdgCodes.at(4)) {
576566
histomc.fill(HIST("histWeakDecayPtAntiHe3"), mcParticle.pt(), centrality);
577-
} else if (pdgCode == 1000020040) {
567+
} else if (pdgCode == particlePdgCodes.at(5)) {
578568
histomc.fill(HIST("histWeakDecayPtHe4"), mcParticle.pt(), centrality);
579-
} else if (pdgCode == -1000020040) {
569+
} else if (pdgCode == -particlePdgCodes.at(5)) {
580570
histomc.fill(HIST("histWeakDecayPtAntiHe4"), mcParticle.pt(), centrality);
581571
}
582572
}
583-
if (pdgCode == 1000020030) {
573+
if (pdgCode == particlePdgCodes.at(4)) {
584574
histomc.fill(HIST("histPtgenHe3"), mcParticle.pt());
585-
} else if (pdgCode == -1000020030) {
575+
} else if (pdgCode == -particlePdgCodes.at(4)) {
586576
histomc.fill(HIST("histPtgenAntiHe3"), mcParticle.pt());
587-
} else if (pdgCode == 1000020040) {
577+
} else if (pdgCode == particlePdgCodes.at(5)) {
588578
histomc.fill(HIST("histPtgenHe4"), mcParticle.pt());
589-
} else if (pdgCode == -1000020040) {
579+
} else if (pdgCode == -particlePdgCodes.at(5)) {
590580
histomc.fill(HIST("histPtgenAntiHe4"), mcParticle.pt());
591581
}
592582
}
@@ -609,8 +599,8 @@ struct NucleitpcPbPb {
609599
continue;
610600

611601
int pdgCode = mcParticle.pdgCode();
612-
bool isHe3 = (std::abs(pdgCode) == 1000020030);
613-
bool isHe4 = (std::abs(pdgCode) == 1000020040);
602+
bool isHe3 = (std::abs(pdgCode) == particlePdgCodes.at(4));
603+
bool isHe4 = (std::abs(pdgCode) == particlePdgCodes.at(5));
614604

615605
if (!isHe3 && !isHe4)
616606
continue;
@@ -620,8 +610,6 @@ struct NucleitpcPbPb {
620610
continue;
621611

622612
uint16_t flags = 0;
623-
int motherPdgCode = 0;
624-
float motherDecRadius = -1;
625613
int decayType = 0;
626614
int particleAnti = (pdgCode > 0) ? 0 : 1;
627615

@@ -634,21 +622,13 @@ struct NucleitpcPbPb {
634622
std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
635623
flags |= kIsSecondaryFromWeakDecay;
636624
decayType = 1;
637-
motherPdgCode = motherparticle.pdgCode();
638-
motherDecRadius = std::hypot(mcParticle.vx() - motherparticle.vx(),
639-
mcParticle.vy() - motherparticle.vy());
640625
break;
641626
}
642627
}
643628
}
644629
} else if (mcParticle.has_mothers()) {
645630
flags |= kIsSecondaryFromWeakDecay;
646631
decayType = 1;
647-
for (auto& motherparticle : mcParticle.mothers_as<aod::McParticles>()) {
648-
motherPdgCode = motherparticle.pdgCode();
649-
motherDecRadius = std::hypot(mcParticle.vx() - motherparticle.vx(),
650-
mcParticle.vy() - motherparticle.vy());
651-
}
652632
} else {
653633
flags |= kIsSecondaryFromMaterial;
654634
decayType = 2;
@@ -660,9 +640,9 @@ struct NucleitpcPbPb {
660640
continue;
661641

662642
int particleType = -1;
663-
if (std::abs(pdgCode) == 1000020030)
643+
if (std::abs(pdgCode) == particlePdgCodes.at(4))
664644
particleType = he3;
665-
else if (std::abs(pdgCode) == 1000020040)
645+
else if (std::abs(pdgCode) == particlePdgCodes.at(5))
666646
particleType = he4;
667647

668648
if (particleType >= 0) {
@@ -713,8 +693,8 @@ struct NucleitpcPbPb {
713693
auto const& matchedMCParticle = particlesMC.iteratorAt(label);
714694

715695
int pdg = matchedMCParticle.pdgCode();
716-
bool isHe3 = (std::abs(pdg) == 1000020030);
717-
bool isHe4 = (std::abs(pdg) == 1000020040);
696+
bool isHe3 = (std::abs(pdg) == particlePdgCodes.at(4));
697+
bool isHe4 = (std::abs(pdg) == particlePdgCodes.at(5));
718698

719699
bool isMaterialSecondary = false;
720700
if ((isHe3 || isHe4) && !matchedMCParticle.isPhysicalPrimary()) {
@@ -727,20 +707,20 @@ struct NucleitpcPbPb {
727707
}
728708

729709
if (isMaterialSecondary) {
730-
if (pdg == 1000020030) {
710+
if (pdg == particlePdgCodes.at(4)) {
731711
histomc.fill(HIST("histRecoSecondaryMaterialHe3"), track.pt(), collision.centFT0C());
732-
} else if (pdg == -1000020030) {
712+
} else if (pdg == -particlePdgCodes.at(4)) {
733713
histomc.fill(HIST("histRecoSecondaryMaterialAntiHe3"), track.pt(), collision.centFT0C());
734-
} else if (pdg == 1000020040) {
714+
} else if (pdg == particlePdgCodes.at(5)) {
735715
histomc.fill(HIST("histRecoSecondaryMaterialHe4"), track.pt(), collision.centFT0C());
736-
} else if (pdg == -1000020040) {
716+
} else if (pdg == -particlePdgCodes.at(5)) {
737717
histomc.fill(HIST("histRecoSecondaryMaterialAntiHe4"), track.pt(), collision.centFT0C());
738718
}
739719

740720
int type = 0;
741-
if (std::abs(pdg) == 1000020030)
721+
if (std::abs(pdg) == particlePdgCodes.at(4))
742722
type = (pdg > 0) ? 1 : 2;
743-
else if (std::abs(pdg) == 1000020040)
723+
else if (std::abs(pdg) == particlePdgCodes.at(5))
744724
type = (pdg > 0) ? 3 : 4;
745725
histomc.fill(HIST("histAllMaterialSecondariesReco"), track.pt(), getRapidity(track, he3), type);
746726

@@ -749,8 +729,6 @@ struct NucleitpcPbPb {
749729
}
750730
}
751731
uint16_t flags = 0;
752-
int motherPdgCode = 0;
753-
float motherDecRadius = -1;
754732
int decayType = 0;
755733
bool isFromWeakDecay = false;
756734

@@ -764,9 +742,6 @@ struct NucleitpcPbPb {
764742
flags |= kIsSecondaryFromWeakDecay;
765743
isFromWeakDecay = true;
766744
decayType = 1;
767-
motherPdgCode = motherparticle.pdgCode();
768-
motherDecRadius = std::hypot(matchedMCParticle.vx() - motherparticle.vx(),
769-
matchedMCParticle.vy() - motherparticle.vy());
770745
break;
771746
}
772747
}
@@ -775,11 +750,6 @@ struct NucleitpcPbPb {
775750
flags |= kIsSecondaryFromWeakDecay;
776751
isFromWeakDecay = true;
777752
decayType = 1;
778-
for (auto& motherparticle : matchedMCParticle.mothers_as<aod::McParticles>()) {
779-
motherPdgCode = motherparticle.pdgCode();
780-
motherDecRadius = std::hypot(matchedMCParticle.vx() - motherparticle.vx(),
781-
matchedMCParticle.vy() - motherparticle.vy());
782-
}
783753
} else {
784754
flags |= kIsSecondaryFromMaterial;
785755
decayType = 2;
@@ -858,9 +828,9 @@ struct NucleitpcPbPb {
858828
histomc.fill(HIST("hNumerEffAcc"), i, matchedMCParticle.pt(), matchedMCParticle.y(), collision.centFT0C(), particleAnti, decayType);
859829
}
860830
if (isFromWeakDecay) {
861-
if (std::abs(pdg) == 1000020030) {
831+
if (std::abs(pdg) == particlePdgCodes.at(4)) {
862832
histomc.fill(HIST("histRecoWeakDecayPtHe3"), ptReco, collision.centFT0C());
863-
} else if (std::abs(pdg) == 1000020040) {
833+
} else if (std::abs(pdg) == particlePdgCodes.at(5)) {
864834
histomc.fill(HIST("histRecoWeakDecayPtHe4"), ptReco, collision.centFT0C());
865835
}
866836
}

0 commit comments

Comments
 (0)