Skip to content

Commit ae6f153

Browse files
committed
PWGCF: Added efficiency correction and improved the FakeV0Filter
1 parent 0ac4c85 commit ae6f153

File tree

1 file changed

+85
-46
lines changed

1 file changed

+85
-46
lines changed

PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx

Lines changed: 85 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@
1111

1212
#include "Framework/runDataProcessing.h"
1313
#include "Framework/AnalysisTask.h"
14+
#include "CCDB/BasicCCDBManager.h"
1415
#include "Common/DataModel/Centrality.h"
1516
#include "Common/DataModel/PIDResponse.h"
1617
#include "PWGLF/DataModel/LFStrangenessTables.h"
1718

1819
#include "TPDGCode.h"
19-
#include "TLorentzVector.h"
20+
#include "RecoDecay.h"
2021

2122
using namespace o2;
2223
using namespace o2::framework;
2324
using namespace o2::framework::expressions;
2425

2526
struct ThreePartCorr {
26-
27+
Service<o2::ccdb::BasicCCDBManager> CCDB;
28+
2729
// Histogram registry
2830
HistogramRegistry MECorrRegistry{"MECorrRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
2931
HistogramRegistry SECorrRegistry{"SECorrRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
@@ -79,6 +81,11 @@ struct ThreePartCorr {
7981
Double_t massLambda = o2::constants::physics::MassLambda0;
8082
Double_t DGaussSigma = 0.0021;
8183

84+
// Efficiency histograms
85+
TH1D** hEffPions = new TH1D*[2];
86+
TH1D** hEffKaons = new TH1D*[2];
87+
TH1D** hEffProtons = new TH1D*[2];
88+
8289
// Correlation variables
8390
Int_t T_Sign;
8491
Double_t CandMass;
@@ -90,7 +97,7 @@ struct ThreePartCorr {
9097

9198
void init(InitContext const&)
9299
{
93-
100+
94101
const AxisSpec CentralityAxis{ConfCentBins};
95102
const AxisSpec ZvtxAxis{ConfZvtxBins};
96103
const AxisSpec PhiAxis{36, (-1. / 2) * M_PI, (3. / 2) * M_PI};
@@ -146,6 +153,16 @@ struct ThreePartCorr {
146153
MECorrRegistry.add("hMixLambdaKaon_SB", "Mixed-event #Lambda - K correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
147154
MECorrRegistry.add("hMixLambdaProton_SGNL", "Mixed-event #Lambda - p correlator (SGNL region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
148155
MECorrRegistry.add("hMixLambdaProton_SB", "Mixed-event #Lambda - p correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}});
156+
157+
CCDB->setURL("http://alice-ccdb.cern.ch");
158+
CCDB->setCaching(true);
159+
TList* EfficiencyList = CCDB->getForTimeStamp<TList>("Users/j/jstaa/Efficiency/ChargedParticles", 1);
160+
hEffPions[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionP"));
161+
hEffPions[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionN"));
162+
hEffKaons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonP"));
163+
hEffKaons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonN"));
164+
hEffProtons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonP"));
165+
hEffProtons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonN"));
149166
}
150167

151168
//================================================================================================================================================================================================================
@@ -205,19 +222,19 @@ struct ThreePartCorr {
205222

206223
if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
207224
if (A_PID[0] == 0.0) { // Pions
208-
SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
225+
SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffPions, associate.sign(), associate.pt()));
209226
} else if (A_PID[0] == 1.0) { // Kaons
210-
SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
227+
SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffKaons, associate.sign(), associate.pt()));
211228
} else if (A_PID[0] == 2.0) { // Protons
212-
SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
229+
SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffProtons, associate.sign(), associate.pt()));
213230
}
214231
} else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
215232
if (A_PID[0] == 0.0) { // Pions
216-
SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
233+
SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffPions, associate.sign(), associate.pt()));
217234
} else if (A_PID[0] == 1.0) { // Kaons
218-
SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
235+
SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffKaons, associate.sign(), associate.pt()));
219236
} else if (A_PID[0] == 2.0) { // Protons
220-
SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign());
237+
SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffProtons, associate.sign(), associate.pt()));
221238
}
222239
}
223240
}
@@ -250,19 +267,19 @@ struct ThreePartCorr {
250267

251268
if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
252269
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());
270+
MECorrRegistry.fill(HIST("hMixLambdaPion_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffPions, associate.sign(), associate.pt()));
254271
} 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());
272+
MECorrRegistry.fill(HIST("hMixLambdaKaon_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffKaons, associate.sign(), associate.pt()));
256273
} 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());
274+
MECorrRegistry.fill(HIST("hMixLambdaProton_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffProtons, associate.sign(), associate.pt()));
258275
}
259276
} else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
260277
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());
278+
MECorrRegistry.fill(HIST("hMixLambdaPion_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffPions, associate.sign(), associate.pt()));
262279
} 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());
280+
MECorrRegistry.fill(HIST("hMixLambdaKaon_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffKaons, associate.sign(), associate.pt()));
264281
} 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());
282+
MECorrRegistry.fill(HIST("hMixLambdaProton_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1./TrackEff(hEffProtons, associate.sign(), associate.pt()));
266283
}
267284
}
268285
}
@@ -352,6 +369,32 @@ struct ThreePartCorr {
352369
return dPhi;
353370
}
354371

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

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-
403433
template <class V0Cand>
404434
Bool_t V0Filters(const V0Cand& V0)
405435
{
@@ -439,28 +469,37 @@ struct ThreePartCorr {
439469

440470
if (ConfFilterSwitch) {
441471

442-
TLorentzVector Daughter, Associate;
443472
if (TrackPID(Track)[0] == 1.0) { // Kaons
444473
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);
461474
}
462475

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

0 commit comments

Comments
 (0)