Skip to content

Commit cb9e3e9

Browse files
RafRaf11alibuild
andauthored
[PWGLF] Update NucleiHistTask.cxx (AliceO2Group#9339)
Co-authored-by: ALICE Action Bot <[email protected]>
1 parent 907597d commit cb9e3e9

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

PWGLF/Tasks/Nuspex/NucleiHistTask.cxx

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,30 @@ struct NucleiHistTask {
504504
Configurable<bool> requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Remove TF border"};
505505
Configurable<bool> removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove TF border"};
506506

507+
TF1* Particle_Tpc_nSigma_shift = 0;
508+
Configurable<bool> enable_pT_shift_tpc_nSigma{"enable_pT_shift_tpc_nSigma", false, "Enable Data TPC nSigma recentering by TF1"};
509+
Configurable<std::vector<float>> parShiftPt{"parShiftPt", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for pT shift."};
510+
511+
TF1* Pion_Tpc_nSigma_shift = 0;
512+
TF1* Proton_Tpc_nSigma_shift = 0;
513+
TF1* Deuteron_Tpc_nSigma_shift = 0;
514+
TF1* Triton_Tpc_nSigma_shift = 0;
515+
TF1* He3_Tpc_nSigma_shift = 0;
516+
TF1* He4_Tpc_nSigma_shift = 0;
517+
518+
Configurable<bool> enable_pT_shift_pion_tpc_nSigma{"enable_pT_shift_pion_tpc_nSigma", false, "Enable MC Pi plus TPC nSigma recentering by TF1"};
519+
Configurable<bool> enable_pT_shift_proton_tpc_nSigma{"enable_pT_shift_proton_tpc_nSigma", false, "Enable MC Proton TPC nSigma recentering by TF1"};
520+
Configurable<bool> enable_pT_shift_deuteron_tpc_nSigma{"enable_pT_shift_deuteron_tpc_nSigma", false, "Enable MC Deuteron TPC nSigma recentering by TF1"};
521+
Configurable<bool> enable_pT_shift_triton_tpc_nSigma{"enable_pT_shift_triton_tpc_nSigma", false, "Enable MC Triton TPC nSigma recentering by TF1"};
522+
Configurable<bool> enable_pT_shift_He3_tpc_nSigma{"enable_pT_shift_He3_tpc_nSigma", false, "Enable MC Helium-3 TPC nSigma recentering by TF1"};
523+
Configurable<bool> enable_pT_shift_He4_tpc_nSigma{"enable_pT_shift_He4_tpc_nSigma", false, "Enable MC Helium-4 TPC nSigma recentering by TF1"};
524+
Configurable<std::vector<float>> parShiftPtPion{"parShiftPtPion", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Pi plus pT shift."};
525+
Configurable<std::vector<float>> parShiftPtProton{"parShiftPtProton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Proton pT shift."};
526+
Configurable<std::vector<float>> parShiftPtDeuteron{"parShiftPtDeuteron", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Deuteron pT shift."};
527+
Configurable<std::vector<float>> parShiftPtTriton{"parShiftPtTriton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Triton pT shift."};
528+
Configurable<std::vector<float>> parShiftPtHe3{"parShiftPtHe3", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Helium-3 pT shift."};
529+
Configurable<std::vector<float>> parShiftPtHe4{"parShiftPtHe4", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "MC Parameters for Alpha pT shift."};
530+
507531
//***********************************************************************************
508532

509533
template <typename CollisionType>
@@ -612,6 +636,12 @@ struct NucleiHistTask {
612636

613637
if (!isEventSelected(event))
614638
return;
639+
640+
if (enable_pT_shift_tpc_nSigma) {
641+
Particle_Tpc_nSigma_shift = new TF1("Particle_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
642+
auto par = (std::vector<float>)parShiftPt;
643+
Particle_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
644+
}
615645
for (auto track : tracks) {
616646

617647
float TPCnSigma_particle = -100;
@@ -675,6 +705,11 @@ struct NucleiHistTask {
675705
break;
676706
}
677707

708+
if (enable_pT_shift_tpc_nSigma) {
709+
float nSigma_shift = Particle_Tpc_nSigma_shift->Eval(momentum);
710+
TPCnSigma_particle -= nSigma_shift;
711+
}
712+
678713
histTrackcuts_data_particle->AddBinContent(1);
679714
if (event_selection_sel8 && !event.sel8())
680715
continue;
@@ -804,6 +839,13 @@ struct NucleiHistTask {
804839
{
805840
if (!isEventSelected(event))
806841
return;
842+
843+
if (enable_pT_shift_tpc_nSigma) {
844+
Particle_Tpc_nSigma_shift = new TF1("Particle_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
845+
auto par = (std::vector<float>)parShiftPt;
846+
Particle_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
847+
}
848+
807849
if (event_selection_sel8 && event.sel8())
808850
spectra_reg.fill(HIST("histCentrality"), event.centFT0C());
809851
if (!event_selection_sel8)
@@ -874,6 +916,11 @@ struct NucleiHistTask {
874916
break;
875917
}
876918

919+
if (enable_pT_shift_tpc_nSigma) {
920+
float nSigma_shift = Particle_Tpc_nSigma_shift->Eval(momentum);
921+
TPCnSigma_particle -= nSigma_shift;
922+
}
923+
877924
spectra_reg.fill(HIST("histEtaWithOverFlow"), track.eta());
878925
spectra_reg.fill(HIST("histEta_cent"), event.centFT0C(), track.eta());
879926

@@ -1128,6 +1175,37 @@ struct NucleiHistTask {
11281175
if (!isEventSelected(collisions))
11291176
return;
11301177

1178+
if (enable_pT_shift_pion_tpc_nSigma) {
1179+
Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1180+
auto par = (std::vector<float>)parShiftPtPion;
1181+
Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1182+
}
1183+
if (enable_pT_shift_proton_tpc_nSigma) {
1184+
Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1185+
auto par = (std::vector<float>)parShiftPtProton;
1186+
Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1187+
}
1188+
if (enable_pT_shift_deuteron_tpc_nSigma) {
1189+
Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1190+
auto par = (std::vector<float>)parShiftPtDeuteron;
1191+
Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1192+
}
1193+
if (enable_pT_shift_triton_tpc_nSigma) {
1194+
Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1195+
auto par = (std::vector<float>)parShiftPtTriton;
1196+
Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1197+
}
1198+
if (enable_pT_shift_He3_tpc_nSigma) {
1199+
He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1200+
auto par = (std::vector<float>)parShiftPtHe3;
1201+
He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1202+
}
1203+
if (enable_pT_shift_He4_tpc_nSigma) {
1204+
He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f);
1205+
auto par = (std::vector<float>)parShiftPtHe4;
1206+
He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
1207+
}
1208+
11311209
for (auto& track : tracks) {
11321210
histTrackcuts_MC->AddBinContent(1);
11331211
const auto particle = track.mcParticle();
@@ -1352,6 +1430,31 @@ struct NucleiHistTask {
13521430
float nSigmaHe3 = track.tpcNSigmaHe();
13531431
float nSigmaHe4 = track.tpcNSigmaAl();
13541432

1433+
if (enable_pT_shift_pion_tpc_nSigma) {
1434+
float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(track.pt());
1435+
nSigmaPion -= nSigmaPion_shift;
1436+
}
1437+
if (enable_pT_shift_proton_tpc_nSigma) {
1438+
float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(track.pt());
1439+
nSigmaProton -= nSigmaProton_shift;
1440+
}
1441+
if (enable_pT_shift_deuteron_tpc_nSigma) {
1442+
float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(track.pt());
1443+
nSigmaDeuteron -= nSigmaDeuteron_shift;
1444+
}
1445+
if (enable_pT_shift_triton_tpc_nSigma) {
1446+
float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(track.pt());
1447+
nSigmaTriton -= nSigmaTriton_shift;
1448+
}
1449+
if (enable_pT_shift_He3_tpc_nSigma) {
1450+
float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(track.pt() * 2.0);
1451+
nSigmaHe3 -= nSigmaHe3_shift;
1452+
}
1453+
if (enable_pT_shift_He4_tpc_nSigma) {
1454+
float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(track.pt() * 2.0);
1455+
nSigmaHe4 -= nSigmaHe4_shift;
1456+
}
1457+
13551458
if (track.sign() > 0) {
13561459
MC_recon_reg.fill(HIST("histTpcNsigmaDataPi"), track.pt(), nSigmaPion);
13571460
MC_recon_reg.fill(HIST("histTpcNsigmaDataPr"), track.pt(), nSigmaProton);

0 commit comments

Comments
 (0)