Skip to content

Commit 5fe3706

Browse files
JStaaalibuild
andauthored
[PWGCF] Added efficiency correction and improved the FakeV0Filter (#8465)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 9676e8d commit 5fe3706

File tree

1 file changed

+85
-44
lines changed

1 file changed

+85
-44
lines changed

PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx

Lines changed: 85 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
#include <algorithm>
13+
1214
#include "Framework/runDataProcessing.h"
1315
#include "Framework/AnalysisTask.h"
16+
#include "CCDB/BasicCCDBManager.h"
1417
#include "Common/DataModel/Centrality.h"
1518
#include "Common/DataModel/PIDResponse.h"
1619
#include "PWGLF/DataModel/LFStrangenessTables.h"
1720

1821
#include "TPDGCode.h"
19-
#include "TLorentzVector.h"
22+
#include "RecoDecay.h"
2023

2124
using namespace o2;
2225
using namespace o2::framework;
2326
using namespace o2::framework::expressions;
2427

2528
struct ThreePartCorr {
29+
Service<o2::ccdb::BasicCCDBManager> CCDB;
2630

2731
// Histogram registry
2832
HistogramRegistry MECorrRegistry{"MECorrRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
@@ -79,6 +83,11 @@ struct ThreePartCorr {
7983
Double_t massLambda = o2::constants::physics::MassLambda0;
8084
Double_t DGaussSigma = 0.0021;
8185

86+
// Efficiency histograms
87+
TH1D** hEffPions = new TH1D*[2];
88+
TH1D** hEffKaons = new TH1D*[2];
89+
TH1D** hEffProtons = new TH1D*[2];
90+
8291
// Correlation variables
8392
Int_t T_Sign;
8493
Double_t CandMass;
@@ -146,6 +155,16 @@ struct ThreePartCorr {
146155
MECorrRegistry.add("hMixLambdaKaon_SB", "Mixed-event #Lambda - K correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
147156
MECorrRegistry.add("hMixLambdaProton_SGNL", "Mixed-event #Lambda - p correlator (SGNL region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
148157
MECorrRegistry.add("hMixLambdaProton_SB", "Mixed-event #Lambda - p correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
158+
159+
CCDB->setURL("http://alice-ccdb.cern.ch");
160+
CCDB->setCaching(true);
161+
TList* EfficiencyList = CCDB->getForTimeStamp<TList>("Users/j/jstaa/Efficiency/ChargedParticles", 1);
162+
hEffPions[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionP"));
163+
hEffPions[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionN"));
164+
hEffKaons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonP"));
165+
hEffKaons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonN"));
166+
hEffProtons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonP"));
167+
hEffProtons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonN"));
149168
}
150169

151170
//================================================================================================================================================================================================================
@@ -205,19 +224,19 @@ struct ThreePartCorr {
205224

206225
if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
207226
if (A_PID[0] == 0.0) { // Pions
208-
SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
227+
SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt()));
209228
} else if (A_PID[0] == 1.0) { // Kaons
210-
SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
229+
SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt()));
211230
} else if (A_PID[0] == 2.0) { // Protons
212-
SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
231+
SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt()));
213232
}
214233
} else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
215234
if (A_PID[0] == 0.0) { // Pions
216-
SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
235+
SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt()));
217236
} else if (A_PID[0] == 1.0) { // Kaons
218-
SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
237+
SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt()));
219238
} else if (A_PID[0] == 2.0) { // Protons
220-
SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
239+
SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt()));
221240
}
222241
}
223242
}
@@ -250,19 +269,19 @@ struct ThreePartCorr {
250269

251270
if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
252271
if (A_PID[0] == 0.0) { // Pions
253-
MECorrRegistry.fill(HIST("hMixLambdaPion_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
272+
MECorrRegistry.fill(HIST("hMixLambdaPion_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt()));
254273
} else if (A_PID[0] == 1.0) { // Kaons
255-
MECorrRegistry.fill(HIST("hMixLambdaKaon_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
274+
MECorrRegistry.fill(HIST("hMixLambdaKaon_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt()));
256275
} else if (A_PID[0] == 2.0) { // Protons
257-
MECorrRegistry.fill(HIST("hMixLambdaProton_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
276+
MECorrRegistry.fill(HIST("hMixLambdaProton_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt()));
258277
}
259278
} else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
260279
if (A_PID[0] == 0.0) { // Pions
261-
MECorrRegistry.fill(HIST("hMixLambdaPion_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
280+
MECorrRegistry.fill(HIST("hMixLambdaPion_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt()));
262281
} else if (A_PID[0] == 1.0) { // Kaons
263-
MECorrRegistry.fill(HIST("hMixLambdaKaon_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
282+
MECorrRegistry.fill(HIST("hMixLambdaKaon_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt()));
264283
} else if (A_PID[0] == 2.0) { // Protons
265-
MECorrRegistry.fill(HIST("hMixLambdaProton_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign());
284+
MECorrRegistry.fill(HIST("hMixLambdaProton_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt()));
266285
}
267286
}
268287
}
@@ -352,6 +371,32 @@ struct ThreePartCorr {
352371
return dPhi;
353372
}
354373

374+
Double_t TrackEff(TH1D** Efficiencies, Int_t Sign, Double_t pT)
375+
{
376+
377+
Int_t Index = -999;
378+
if (Sign > 0) {
379+
Index = 0;
380+
} else if (Sign < 0) {
381+
Index = 1;
382+
}
383+
384+
return Efficiencies[Index]->GetBinContent(Efficiencies[Index]->FindBin(pT));
385+
}
386+
387+
template <class V0Cand>
388+
Int_t V0Sign(const V0Cand& V0)
389+
{
390+
391+
if (TMath::Abs(V0.mLambda() - massLambda) <= TMath::Abs(V0.mAntiLambda() - massLambda)) {
392+
return 1;
393+
} else if (TMath::Abs(V0.mLambda() - massLambda) > TMath::Abs(V0.mAntiLambda() - massLambda)) {
394+
return -1;
395+
}
396+
397+
return 0;
398+
}
399+
355400
template <class TrackCand>
356401
Double_t* TrackPID(const TrackCand& Track)
357402
{
@@ -387,19 +432,6 @@ struct ThreePartCorr {
387432
return ID;
388433
}
389434

390-
template <class V0Cand>
391-
Int_t V0Sign(const V0Cand& V0)
392-
{
393-
394-
if (TMath::Abs(V0.mLambda() - massLambda) <= TMath::Abs(V0.mAntiLambda() - massLambda)) {
395-
return 1;
396-
} else if (TMath::Abs(V0.mLambda() - massLambda) > TMath::Abs(V0.mAntiLambda() - massLambda)) {
397-
return -1;
398-
}
399-
400-
return 0;
401-
}
402-
403435
template <class V0Cand>
404436
Bool_t V0Filters(const V0Cand& V0)
405437
{
@@ -439,28 +471,37 @@ struct ThreePartCorr {
439471

440472
if (ConfFilterSwitch) {
441473

442-
TLorentzVector Daughter, Associate;
443474
if (TrackPID(Track)[0] == 1.0) { // Kaons
444475
return kTRUE;
445-
} else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 0.0 && Track.sign() == -1) { // Lambda - Pi_min
446-
const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>();
447-
Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton);
448-
Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged);
449-
} else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 0.0 && Track.sign() == 1) { // Antilambda - Pi_plus
450-
const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>();
451-
Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton);
452-
Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged);
453-
} else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 2.0 && Track.sign() == 1) { // Lambda - Proton
454-
const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>();
455-
Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged);
456-
Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton);
457-
} else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 2.0 && Track.sign() == -1) { // Antilambda - Antiproton
458-
const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>();
459-
Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged);
460-
Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton);
461476
}
462477

463-
if ((Daughter + Associate).M() >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M() <= massLambda + 4 * DGaussSigma) {
478+
std::array<float, 2> MassArray;
479+
std::array<float, 3> DMomArray;
480+
std::array<float, 3> AMomArray = Track.pVector();
481+
if (TrackPID(Track)[0] == 0.0) {
482+
MassArray = {o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged};
483+
484+
if (V0Sign(V0) == 1 && Track.sign() == -1) { // Lambda - Pi_min
485+
const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>();
486+
DMomArray = dTrack.pVector();
487+
} else if (V0Sign(V0) == -1 && Track.sign() == 1) { // Antilambda - Pi_plus
488+
const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>();
489+
DMomArray = dTrack.pVector();
490+
}
491+
} else if (TrackPID(Track)[0] == 2.0) {
492+
MassArray = {o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton};
493+
494+
if (V0Sign(V0) == 1 && Track.sign() == 1) { // Lambda - Proton
495+
const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>();
496+
DMomArray = dTrack.pVector();
497+
} else if (V0Sign(V0) == -1 && Track.sign() == -1) { // Antilambda - Antiproton
498+
const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>();
499+
DMomArray = dTrack.pVector();
500+
}
501+
}
502+
503+
Double_t M = RecoDecay::m(std::array{DMomArray, AMomArray}, MassArray);
504+
if (M >= massLambda - 4 * DGaussSigma && M <= massLambda + 4 * DGaussSigma) {
464505
return kFALSE;
465506
}
466507
}

0 commit comments

Comments
 (0)