Skip to content

Commit c5b7107

Browse files
rolavickalibuild
andauthored
[PWGUD] Improving my personal analyzer (#6687)
* improving selection of psi2s * Please consider the following formatting changes * megalinter fixes * Please consider the following formatting changes --------- Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 70885f5 commit c5b7107

1 file changed

Lines changed: 79 additions & 17 deletions

File tree

PWGUD/Tasks/upcTauCentralBarrelRL.cxx

Lines changed: 79 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,23 @@ struct UpcTauCentralBarrelRL {
646646
histos.add("EventFourTracks/MuonsPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap});
647647
histos.add("EventFourTracks/MuonsPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt});
648648

649-
histos.add("EventFourTracks/Psi2S/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass});
650-
histos.add("EventFourTracks/Psi2S/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide});
651-
histos.add("EventFourTracks/Psi2S/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom});
652-
histos.add("EventFourTracks/Psi2S/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide});
653-
histos.add("EventFourTracks/Psi2S/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt});
654-
histos.add("EventFourTracks/Psi2S/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi});
655-
histos.add("EventFourTracks/Psi2S/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap});
656-
histos.add("EventFourTracks/Psi2S/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt});
649+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass});
650+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide});
651+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom});
652+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide});
653+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt});
654+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi});
655+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap});
656+
histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt});
657+
658+
histos.add("EventFourTracks/Psi2StoElElPiPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass});
659+
histos.add("EventFourTracks/Psi2StoElElPiPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide});
660+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom});
661+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide});
662+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt});
663+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi});
664+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap});
665+
histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt});
657666
}
658667
}
659668

@@ -862,6 +871,47 @@ struct UpcTauCentralBarrelRL {
862871
return true;
863872
}
864873

874+
template <typename T>
875+
int whatPsi2Schannel(T const& trkDaug1, T const& trkDaug2, T const& trkDaug3, T const& trkDaug4, std::vector<int>& vecPIDidx)
876+
{
877+
TLorentzVector jpsi, daug[4];
878+
daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));
879+
daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz()));
880+
daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz()));
881+
daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz()));
882+
// Find index of the two largest values
883+
std::vector<std::pair<double, double>> vecPts;
884+
for (int i = 0; i < 4; i++) {
885+
vecPts.push_back(std::make_pair(static_cast<double>(daug[i].Pt()), i));
886+
}
887+
sort(vecPts.begin(), vecPts.end());
888+
int idx1L = vecPts[vecPts.size() - 1].second;
889+
int idx2L = vecPts[vecPts.size() - 2].second;
890+
int idx3L = vecPts[vecPts.size() - 3].second;
891+
int idx4L = vecPts[vecPts.size() - 4].second;
892+
// Create the jpsi
893+
jpsi = daug[idx1L] + daug[idx2L];
894+
// The two smallest-pT tracks should be pions
895+
if ((vecPIDidx[idx3L] == P_MUON || vecPIDidx[idx3L] == P_PION) && (vecPIDidx[idx4L] == P_MUON || vecPIDidx[idx4L] == P_PION)) {
896+
// Branch into Jpsi to mumu and Jpsi to elel
897+
if ((vecPIDidx[idx1L] == P_MUON || vecPIDidx[idx1L] == P_PION) && (vecPIDidx[idx2L] == P_MUON || vecPIDidx[idx2L] == P_PION)) {
898+
// Is jpsi mass?
899+
if (jpsi.M() < 2.9 || jpsi.M() > 3.3)
900+
return 0; // Not Psi2S
901+
return 1;
902+
} else if (vecPIDidx[idx1L] == P_ELECTRON && vecPIDidx[idx2L] == P_ELECTRON) {
903+
// Is jpsi mass?
904+
if (jpsi.M() < 2.75 || jpsi.M() > 3.3)
905+
return 0; // Not Psi2S
906+
return 2;
907+
} else {
908+
return 0; // Not Psi2S
909+
}
910+
} else {
911+
return 0; // Not Psi2S
912+
}
913+
}
914+
865915
template <typename C, typename Ts>
866916
void fillHistograms(C reconstructedCollision, Ts reconstructedBarrelTracks)
867917
{
@@ -935,6 +985,7 @@ struct UpcTauCentralBarrelRL {
935985
int countTPCxRws70 = 0;
936986
int countTPCxRws100 = 0;
937987
std::vector<int> vecPVidx;
988+
std::vector<int> vecPIDidx;
938989
// Loop over tracks with selections
939990
for (auto& track : reconstructedBarrelTracks) {
940991
if (track.isPVContributor() != 1)
@@ -998,6 +1049,7 @@ struct UpcTauCentralBarrelRL {
9981049
if (track.tpcNClsCrossedRows() > 100)
9991050
countTPCxRws100++;
10001051
int hypothesisID = testPIDhypothesis(track);
1052+
vecPIDidx.push_back(hypothesisID);
10011053
if (hypothesisID == P_ELECTRON || hypothesisID == P_MUON || hypothesisID == P_PION) {
10021054
countPVGTselected++;
10031055
vecPVidx.push_back(track.index());
@@ -1883,15 +1935,25 @@ struct UpcTauCentralBarrelRL {
18831935
histos.get<TH2>(HIST("EventFourTracks/MuonsPions/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt());
18841936
}
18851937
// Hunting down psi2s: ideal case
1886-
if (countPVGTpionsSelection == 2 && countPVGTmuonsSelection == 2) {
1887-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hInvariantMass"))->Fill(mother.M());
1888-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hInvariantMassWide"))->Fill(mother.M());
1889-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hMotherP"))->Fill(mother.P());
1890-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hMotherPwide"))->Fill(mother.P());
1891-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hMotherPt"))->Fill(mother.Pt());
1892-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hMotherPhi"))->Fill(mother.Phi());
1893-
histos.get<TH1>(HIST("EventFourTracks/Psi2S/hMotherRapidity"))->Fill(mother.Rapidity());
1894-
histos.get<TH2>(HIST("EventFourTracks/Psi2S/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt());
1938+
if (whatPsi2Schannel(trkDaug1, trkDaug2, trkDaug3, trkDaug4, vecPIDidx) == 1) {
1939+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMass"))->Fill(mother.M());
1940+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMassWide"))->Fill(mother.M());
1941+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherP"))->Fill(mother.P());
1942+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPwide"))->Fill(mother.P());
1943+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPt"))->Fill(mother.Pt());
1944+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPhi"))->Fill(mother.Phi());
1945+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherRapidity"))->Fill(mother.Rapidity());
1946+
histos.get<TH2>(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt());
1947+
}
1948+
if (whatPsi2Schannel(trkDaug1, trkDaug2, trkDaug3, trkDaug4, vecPIDidx) == 2) {
1949+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hInvariantMass"))->Fill(mother.M());
1950+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hInvariantMassWide"))->Fill(mother.M());
1951+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherP"))->Fill(mother.P());
1952+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPwide"))->Fill(mother.P());
1953+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPt"))->Fill(mother.Pt());
1954+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPhi"))->Fill(mother.Phi());
1955+
histos.get<TH1>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherRapidity"))->Fill(mother.Rapidity());
1956+
histos.get<TH2>(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt());
18951957
}
18961958
}
18971959
} else if (countPVGTselected == 6 && doSixTracks) {

0 commit comments

Comments
 (0)