Skip to content

Commit 98d4e8b

Browse files
rutuparnarathRutuparna Rath
authored andcommitted
[NuclBaTask]AntiDeuteron pT-shift Correction in MC (AliceO2Group#3426)
Co-authored-by: Rutuparna Rath <rutuparnarath@RUTUPARNAS-MBP.station>
1 parent e270e7e commit 98d4e8b

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

PWGLF/Tasks/LFNucleiBATask.cxx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ struct LFNucleiBATask {
8989
Configurable<bool> enablePtShift{"enablePtShift", false, "Flag to enable Pt shift (for He only)"};
9090
Configurable<std::vector<float>> parShiftPt{"parShiftPt", {0.0f, 0.1f, 0.1f, 0.1f, 0.1f}, "Parameters for Pt shift (if enabled)."};
9191

92+
Configurable<bool> enablePtShiftAntiD{"enablePtShiftAntiD", true, "Flag to enable Pt shift (for antiDeuteron only)"};
93+
Configurable<std::vector<float>> parShiftPtAntiD{"parShiftPtAntiD", {-0.0955412, 0.798164, -0.536111, 0.0887876, -1.11022e-13}, "Parameters for Pt shift (if enabled)."};
94+
9295
Configurable<bool> makeDCABeforeCutPlots{"makeDCABeforeCutPlots", false, "Flag to enable plots of DCA before cuts"};
9396
Configurable<bool> makeDCAAfterCutPlots{"makeDCAAfterCutPlots", false, "Flag to enable plots of DCA after cuts"};
9497
Configurable<bool> enableDCACustomCut{"enableDCACustomCut", false, "Flag to enable DCA custom cuts - unflag to use standard isGlobalCut DCA cut"};
@@ -109,6 +112,7 @@ struct LFNucleiBATask {
109112
Configurable<int> massTOFConfig{"massTOFConfig", 0, "Estimate massTOF using beta with (0) TPC momentum (1) TOF expected momentum"};
110113
Configurable<int> tritonSelConfig{"tritonSelConfig", 0, "Select tritons using (0) 3Sigma TPC triton (1) additional 3sigma TPC pi,K,p veto cut"};
111114
Configurable<int> helium3Pt{"helium3Pt", 0, "Select use default pT (0) or use instead 2*pT (1) for helium-3"};
115+
Configurable<int> antiDeuteronPt{"antiDeuteronPt", 0, "Select use default pT (0) or use instead pT shift (1) for antideuteron"};
112116

113117
Configurable<int> nITSLayer{"nITSLayer", 0, "ITS Layer (0-6)"};
114118
Configurable<bool> usenITSLayer{"usenITSLayer", false, "Flag to enable ITS layer hit"};
@@ -127,6 +131,7 @@ struct LFNucleiBATask {
127131
static constexpr float fMassAlpha = 3.72738f;
128132

129133
TF1* fShift = 0;
134+
TF1* fShiftAntiD = 0;
130135

131136
void init(o2::framework::InitContext&)
132137
{
@@ -1169,6 +1174,9 @@ struct LFNucleiBATask {
11691174
histos.add("spectraGen/deuteron/histGenPtDPrim", "generated particles", HistType::kTH1F, {ptAxis});
11701175
histos.add("spectraGen/deuteron/histGenPtDSec", "generated particles", HistType::kTH1F, {ptAxis});
11711176
histos.add("spectraGen/deuteron/histSecTransportPtD", "generated particles", HistType::kTH1F, {ptAxis});
1177+
histos.add("tracks/deuteron/histAntiDPtShiftRec", "histAntiDPtShiftRec", HistType::kTH1F, {ptAxis});
1178+
histos.add("tracks/deuteron/histAntiDPtRec", "histAntiDPtRec", HistType::kTH1F, {ptAxis});
1179+
histos.add("spectraGen/histPtShiftCorrection", "histPtShiftCorrection", HistType::kTH2F, {{800, 0.f, 8.f}, {400, -4.f, 4.f}});
11721180

11731181
histos.add("spectraGen/deuteron/histGenPtantiD", "generated particles", HistType::kTH1F, {ptAxis});
11741182
histos.add("spectraGen/deuteron/histGenPtantiDPrim", "generated particles", HistType::kTH1F, {ptAxis});
@@ -1230,7 +1238,7 @@ struct LFNucleiBATask {
12301238
if (event.posZ() < cfgLowCutVertex || event.posZ() > cfgHighCutVertex)
12311239
return;
12321240

1233-
float gamma = 0., massTOF = 0., hePt = 0.f;
1241+
float gamma = 0., massTOF = 0., hePt = 0.f, antiDPt = 0.f;
12341242
bool isTriton = kFALSE;
12351243
bool deRapCut = kFALSE;
12361244
bool heRapCut = kFALSE;
@@ -1274,6 +1282,21 @@ struct LFNucleiBATask {
12741282
fShift->SetParameters(par[0], par[1], par[2], par[3], par[4]);
12751283
}
12761284

1285+
if (enablePtShiftAntiD && !fShiftAntiD) {
1286+
fShiftAntiD = new TF1("fShiftAntiD", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x", 0.f, 8.f);
1287+
auto par = (std::vector<float>)parShiftPtAntiD;
1288+
fShiftAntiD->SetParameters(par[0], par[1], par[2], par[3], par[4]);
1289+
}
1290+
1291+
switch (antiDeuteronPt) {
1292+
case 0:
1293+
if (enablePtShiftAntiD && fShiftAntiD) {
1294+
auto shiftAntiD = fShiftAntiD->Eval(track.pt());
1295+
antiDPt = track.pt() - shiftAntiD;
1296+
}
1297+
break;
1298+
}
1299+
12771300
switch (helium3Pt) {
12781301
case 0:
12791302
hePt = track.pt();
@@ -1441,6 +1464,14 @@ struct LFNucleiBATask {
14411464
if (isPhysPrim) {
14421465
histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteronTruePrim"), track.pt(), track.dcaXY());
14431466
histos.fill(HIST("tracks/deuteron/dca/before/hDCAzVsPtantiDeuteronTruePrim"), track.pt(), track.dcaZ());
1467+
if constexpr (!IsFilteredData) {
1468+
histos.fill(HIST("spectraGen/histPtShift"), track.pt(), track.pt() - track.mcParticle().pt());
1469+
histos.fill(HIST("spectraGen/histPtShiftVsEta"), track.eta(), track.pt() - track.mcParticle().pt());
1470+
histos.fill(HIST("spectraGen/histPShift"), track.p(), track.p() - track.mcParticle().p());
1471+
histos.fill(HIST("tracks/deuteron/histAntiDPtShiftRec"), antiDPt);
1472+
histos.fill(HIST("tracks/deuteron/histAntiDPtRec"), track.pt());
1473+
histos.fill(HIST("spectraGen/histPtShiftCorrection"), antiDPt, antiDPt - track.mcParticle().pt());
1474+
}
14441475
}
14451476
if (!isPhysPrim && isProdByGen) {
14461477
histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteronTrueSec"), track.pt(), track.dcaXY());

0 commit comments

Comments
 (0)