Skip to content

Commit 23e63d0

Browse files
authored
PWGUD: new PID for central barrel J/psi (#6682)
1 parent da5d4ea commit 23e63d0

1 file changed

Lines changed: 96 additions & 51 deletions

File tree

PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx

Lines changed: 96 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ struct UpcJpsiCentralBarrel {
6060
Configurable<bool> TOFOneProton{"TOFOneProton", false, "one candidate proton has TOF hits"};
6161
Configurable<bool> TPCNsigmaCut{"TPCNsigmaCut", false, "cut on nSigma"};
6262
Configurable<bool> TPCPIDOnly{"TPCPIDOnly", false, "Only TPC PID"};
63+
Configurable<bool> smallestPID{"smallestPID", false, "Use smallest PID hypo."};
64+
Configurable<bool> DCAcut{"DCAcut", false, "DCA cut from run2."};
6365
Configurable<float> TPCNSigmaMu{"TPCNSigmaMu", 3, "PID for TPC Mu track"};
6466
Configurable<float> EtaCut{"EtaCut", 0.9f, "acceptance cut per track"};
6567
Configurable<float> RapCut{"RapCut", 0.8f, "choose event in midrapidity"};
6668
Configurable<float> dcaZCut{"dcaZCut", 2, "cut on the impact parameter in z of the track to the PV"};
6769
Configurable<float> dcaXYCut{"dcaXYCut", 1e10, "cut on the impact parameter in xy of the track to the PV"};
68-
Configurable<int> ITSNClsCut{"ITSNClsCut", 1, "minimal number of ITS clusters"};
70+
Configurable<int> ITSNClsCut{"ITSNClsCut", 4, "minimal number of ITS clusters"};
6971
Configurable<int> ITSChi2NClsCut{"ITSChi2NClsCut", 36, "minimal Chi2/cluster for the ITS track"};
7072
Configurable<int> TPCNClsCrossedRowsCut{"TPCNClsCrossedRowsCut", 70, "minimal number of crossed TPC rows"};
7173
Configurable<int> TPCChi2NCls{"TPCChi2NCls", 4, "minimal Chi2/cluster for the TPC track"};
@@ -215,6 +217,8 @@ struct UpcJpsiCentralBarrel {
215217
TG.add("TG/TPC/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma});
216218
TG.add("TG/TPC/hNsigmaEl", "hNsigmaEl", HistType::kTH1F, {axisSigma});
217219
TG.add("TG/TPC/hNsigmaPr", "hNsigmaPr", HistType::kTH1F, {axisSigma});
220+
TG.add("TG/TPC/TPCPosSignal", "TPCPosSignal", HistType::kTH1F, {axisTPC});
221+
TG.add("TG/TPC/TPCNegSignal", "TPCNegSignal", HistType::kTH1F, {axisTPC});
218222
TG.add("TG/TOF/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma});
219223
TG.add("TG/TOF/hNsigmaEl", "hNsigmaEl", HistType::kTH1F, {axisSigma});
220224
TG.add("TG/TOF/hNsigmaPr", "hNsigmaPr", HistType::kTH1F, {axisSigma});
@@ -521,8 +525,15 @@ struct UpcJpsiCentralBarrel {
521525
if (track.dcaZ() > dcaZCut) {
522526
return false;
523527
}
524-
if (track.dcaXY() > dcaXYCut) {
525-
return false;
528+
if (DCAcut) {
529+
float dcaXYCut = 0.0105f + 0.0350f / pow(track.pt(), 1.1f);
530+
if (abs(track.dcaXY()) > dcaXYCut) {
531+
return false;
532+
}
533+
} else {
534+
if (track.dcaXY() > dcaXYCut) {
535+
return false;
536+
}
526537
}
527538
// ITS
528539
if (!track.hasITS()) {
@@ -636,24 +647,36 @@ struct UpcJpsiCentralBarrel {
636647
continue;
637648
}
638649
countGT++;
639-
int hypoID;
640-
if (TPCPIDOnly) {
641-
hypoID = testPIDhypoTPC(track);
642-
} else {
643-
hypoID = testPIDhypo(track);
644-
}
645-
if (hypoID == P_ELECTRON || hypoID == P_MUON || hypoID == P_PROTON) {
646-
countGTselected++;
647-
trkIdx.push_back(track.index());
648-
if (hypoID == P_ELECTRON) {
649-
countGTel++;
650-
}
651-
if (hypoID == P_MUON) {
652-
countGTmu++;
650+
trkIdx.push_back(track.index());
651+
if (smallestPID) {
652+
int hypoID;
653+
if (TPCPIDOnly) {
654+
hypoID = testPIDhypoTPC(track);
655+
} else {
656+
hypoID = testPIDhypo(track);
653657
}
654-
if (hypoID == P_PROTON) {
655-
countGTp++;
658+
if (hypoID == P_ELECTRON || hypoID == P_MUON || hypoID == P_PROTON) {
659+
countGTselected++;
660+
trkIdx.push_back(track.index());
661+
if (hypoID == P_ELECTRON) {
662+
countGTel++;
663+
}
664+
if (hypoID == P_MUON) {
665+
countGTmu++;
666+
}
667+
if (hypoID == P_PROTON) {
668+
countGTp++;
669+
}
656670
}
671+
672+
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(3., countGTselected);
673+
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(4., countGTel);
674+
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(5., countGTmu);
675+
676+
Statistics.get<TH1>(HIST("Statistics/hNumberGTselected"))->Fill(countGTselected);
677+
Statistics.get<TH1>(HIST("Statistics/hNumberGTel"))->Fill(countGTel);
678+
Statistics.get<TH1>(HIST("Statistics/hNumberGTmu"))->Fill(countGTmu);
679+
Statistics.get<TH1>(HIST("Statistics/hNumberGTp"))->Fill(countGTp);
657680
}
658681
if (std::abs(track.tpcNSigmaMu()) < 3) {
659682
countGTMuSigma++;
@@ -670,14 +693,7 @@ struct UpcJpsiCentralBarrel {
670693
}
671694

672695
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(2., countGT);
673-
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(3., countGTselected);
674-
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(4., countGTel);
675-
Statistics.get<TH1>(HIST("Statistics/hNumberOfTracks"))->Fill(5., countGTmu);
676696
Statistics.get<TH1>(HIST("Statistics/hNumberGT"))->Fill(countGT);
677-
Statistics.get<TH1>(HIST("Statistics/hNumberGTselected"))->Fill(countGTselected);
678-
Statistics.get<TH1>(HIST("Statistics/hNumberGTel"))->Fill(countGTel);
679-
Statistics.get<TH1>(HIST("Statistics/hNumberGTmu"))->Fill(countGTmu);
680-
Statistics.get<TH1>(HIST("Statistics/hNumberGTp"))->Fill(countGTp);
681697
Statistics.get<TH1>(HIST("Statistics/hNumberGTelSigma"))->Fill(countGTElSigma);
682698
Statistics.get<TH1>(HIST("Statistics/hNumberGTmuSigma"))->Fill(countGTMuSigma);
683699
Statistics.get<TH1>(HIST("Statistics/hNumberGTpSigma"))->Fill(countGTPSigma);
@@ -689,22 +705,24 @@ struct UpcJpsiCentralBarrel {
689705

690706
if (countGT == 2) {
691707
TLorentzVector mom, daughter[2];
708+
692709
auto trkDaughter1 = tracks.iteratorAt(trkIdx[0]);
693710
auto trkDaughter2 = tracks.iteratorAt(trkIdx[1]);
711+
694712
if ((trkDaughter1.sign() * trkDaughter2.sign()) > 0) {
695713
return;
696714
}
697715

698-
auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massEl);
716+
/*auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massEl);
699717
auto ene2 = RecoDecay::e(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), massEl);
700718
daughter[0].SetPxPyPzE(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), ene1);
701719
daughter[1].SetPxPyPzE(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), ene2);
702-
mom = daughter[0] + daughter[1];
720+
mom = daughter[0] + daughter[1];*/
703721

704722
std::array<double, 3> daughter1 = {trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()};
705723
std::array<double, 3> daughter2 = {trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()};
706724

707-
std::array<double, 3> mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()};
725+
// std::array<double, 3> mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()};
708726

709727
TG.get<TH1>(HIST("TG/hTrackPt1"))->Fill(trkDaughter1.pt());
710728
TG.get<TH1>(HIST("TG/hTrackPt2"))->Fill(trkDaughter2.pt());
@@ -721,6 +739,11 @@ struct UpcJpsiCentralBarrel {
721739
TG.get<TH1>(HIST("TG/TPC/hNsigmaMu"))->Fill(trkDaughter1.tpcNSigmaMu());
722740
TG.get<TH1>(HIST("TG/TPC/hNsigmaEl"))->Fill(trkDaughter1.tpcNSigmaEl());
723741
TG.get<TH1>(HIST("TG/TPC/hNsigmaPr"))->Fill(trkDaughter1.tpcNSigmaPr());
742+
if (trkDaughter1.sign() > 0) {
743+
TG.get<TH1>(HIST("TG/TPC/TPCPosSignal"))->Fill(trkDaughter1.tpcSignal());
744+
} else {
745+
TG.get<TH1>(HIST("TG/TPC/TPCNegSignal"))->Fill(trkDaughter1.tpcSignal());
746+
}
724747
}
725748
if (trkDaughter2.hasTPC()) {
726749
TG.get<TH2>(HIST("TG/PID/hTPCVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tpcSignal());
@@ -730,6 +753,11 @@ struct UpcJpsiCentralBarrel {
730753
TG.get<TH1>(HIST("TG/TPC/hNsigmaMu"))->Fill(trkDaughter2.tpcNSigmaMu());
731754
TG.get<TH1>(HIST("TG/TPC/hNsigmaEl"))->Fill(trkDaughter2.tpcNSigmaEl());
732755
TG.get<TH1>(HIST("TG/TPC/hNsigmaPr"))->Fill(trkDaughter2.tpcNSigmaPr());
756+
if (trkDaughter2.sign() > 0) {
757+
TG.get<TH1>(HIST("TG/TPC/TPCPosSignal"))->Fill(trkDaughter2.tpcSignal());
758+
} else {
759+
TG.get<TH1>(HIST("TG/TPC/TPCNegSignal"))->Fill(trkDaughter2.tpcSignal());
760+
}
733761
}
734762
if (trkDaughter1.hasTOF()) {
735763
TG.get<TH2>(HIST("TG/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal());
@@ -751,10 +779,16 @@ struct UpcJpsiCentralBarrel {
751779
TG.get<TH1>(HIST("TG/TOF/hNsigmaPr"))->Fill(trkDaughter2.tofNSigmaPr());
752780
}
753781

754-
if (countGTel == 2) {
755-
if (!(RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu()) > RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl()))) {
756-
return;
757-
}
782+
if (RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu()) > RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl())) {
783+
784+
auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massEl);
785+
auto ene2 = RecoDecay::e(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), massEl);
786+
daughter[0].SetPxPyPzE(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), ene1);
787+
daughter[1].SetPxPyPzE(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), ene2);
788+
mom = daughter[0] + daughter[1];
789+
790+
std::array<double, 3> mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()};
791+
758792
if (TOFBothTracks) {
759793
if (!trkDaughter1.hasTOF() || !trkDaughter2.hasTOF())
760794
return;
@@ -912,7 +946,7 @@ struct UpcJpsiCentralBarrel {
912946
Asymmetry.get<TH1>(HIST("Asymmetry/Electron/Coherent/DeltaPhi"))->Fill(dp);
913947

914948
delete[] q;
915-
}
949+
} // end coherent electrons
916950
if (RecoDecay::pt(mother) > 0.2f) {
917951
// fill track histos
918952
JPsiToEl.get<TH1>(HIST("JPsiToEl/Incoherent/hPt1"))->Fill(trkDaughter1.pt());
@@ -966,15 +1000,18 @@ struct UpcJpsiCentralBarrel {
9661000
Asymmetry.get<TH1>(HIST("Asymmetry/Electron/Incoherent/DeltaPhi"))->Fill(dp);
9671001

9681002
delete[] q;
969-
}
970-
}
971-
} // end electrons
972-
if (countGTmu == 2) {
973-
974-
if (!(RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl()) > RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu()))) {
975-
return;
976-
}
977-
1003+
} // end incoherent electrons
1004+
} // end mass cut
1005+
} // end electrons
1006+
if (RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl()) > RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu())) {
1007+
1008+
auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massMu);
1009+
auto ene2 = RecoDecay::e(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), massMu);
1010+
daughter[0].SetPxPyPzE(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), ene1);
1011+
daughter[1].SetPxPyPzE(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), ene2);
1012+
mom = daughter[0] + daughter[1];
1013+
1014+
std::array<double, 3> mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()};
9781015
if (TOFBothTracks) {
9791016
if (!trkDaughter1.hasTOF() || !trkDaughter2.hasTOF())
9801017
return;
@@ -1189,7 +1226,15 @@ struct UpcJpsiCentralBarrel {
11891226
}
11901227
}
11911228
} // end muons
1192-
if (countGTp == 2) {
1229+
if (RecoDecay::sumOfSquares((trkDaughter1.hasTOF() ? trkDaughter1.tofNSigmaPr() : trkDaughter1.tpcNSigmaPr()), (trkDaughter2.hasTOF() ? trkDaughter2.tofNSigmaPr() : trkDaughter2.tpcNSigmaPr()) < 4)) {
1230+
1231+
auto ene1 = RecoDecay::e(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), massPr);
1232+
auto ene2 = RecoDecay::e(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), massPr);
1233+
daughter[0].SetPxPyPzE(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz(), ene1);
1234+
daughter[1].SetPxPyPzE(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz(), ene2);
1235+
mom = daughter[0] + daughter[1];
1236+
1237+
std::array<double, 3> mother = {trkDaughter1.px() + trkDaughter2.px(), trkDaughter1.py() + trkDaughter2.py(), trkDaughter1.pz() + trkDaughter2.pz()};
11931238

11941239
if (TOFBothProtons) {
11951240
if (!trkDaughter1.hasTOF() || !trkDaughter2.hasTOF())
@@ -1334,7 +1379,7 @@ struct UpcJpsiCentralBarrel {
13341379
JPsiToP.get<TH1>(HIST("JPsiToP/Coherent/hEta"))->Fill(RecoDecay::eta(mother));
13351380
JPsiToP.get<TH1>(HIST("JPsiToP/Coherent/hPhi"))->Fill(RecoDecay::phi(mother));
13361381
JPsiToP.get<TH1>(HIST("JPsiToP/Coherent/hRap"))->Fill(rapJpsi);
1337-
}
1382+
} // end coherent
13381383
if (RecoDecay::pt(mother) > 0.2f) {
13391384
// fill track histos
13401385
JPsiToP.get<TH1>(HIST("JPsiToP/Incoherent/hPt1"))->Fill(trkDaughter1.pt());
@@ -1374,12 +1419,12 @@ struct UpcJpsiCentralBarrel {
13741419
JPsiToP.get<TH1>(HIST("JPsiToP/Incoherent/hEta"))->Fill(RecoDecay::eta(mother));
13751420
JPsiToP.get<TH1>(HIST("JPsiToP/Incoherent/hPhi"))->Fill(RecoDecay::phi(mother));
13761421
JPsiToP.get<TH1>(HIST("JPsiToP/Incoherent/hRap"))->Fill(rapJpsi);
1377-
}
1378-
}
1379-
} // end protons
1380-
} // end two tracks
1381-
} // end process
1382-
}; // end struct
1422+
} // end incoherent
1423+
} // end mass cut
1424+
} // end protons
1425+
} // end two tracks
1426+
} // end process
1427+
}; // end struct
13831428

13841429
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
13851430
{

0 commit comments

Comments
 (0)