Skip to content

Commit d5caac8

Browse files
[PWGLF] added efficiency for syst variations (#10535)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 472afe5 commit d5caac8

File tree

1 file changed

+142
-6
lines changed

1 file changed

+142
-6
lines changed

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 142 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,6 @@ struct AntinucleiInJets {
196196
// helium-3
197197
registryData.add("helium3_jet_tpc", "helium3_jet_tpc", HistType::kTH2F, {{nbins, min * 3, max * 3, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}});
198198
registryData.add("helium3_ue_tpc", "helium3_ue_tpc", HistType::kTH2F, {{nbins, min * 3, max * 3, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}});
199-
200-
// systematic variations
201-
registryData.add("antiproton_tpc_syst", "antiproton_tpc_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
202-
registryData.add("antiproton_tof_syst", "antiproton_tof_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
203-
registryData.add("antideuteron_tpc_syst", "antideuteron_tpc_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
204-
registryData.add("antideuteron_tof_syst", "antideuteron_tof_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
205199
}
206200

207201
// monte carlo histograms
@@ -257,6 +251,24 @@ struct AntinucleiInJets {
257251
// detector response matrix
258252
registryMC.add("detectorResponseMatrix", "detectorResponseMatrix", HistType::kTH2F, {{1000, 0.0, 100.0, "#it{p}_{T}^{gen} (GeV/#it{c})"}, {2000, -20.0, 20.0, "#it{p}_{T}^{gen} - #it{p}_{T}^{rec} (GeV/#it{c})"}});
259253
}
254+
255+
// systematic uncertainties
256+
if (doprocessSystematicsData) {
257+
registryData.add("antiproton_tpc_syst", "antiproton_tpc_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
258+
registryData.add("antiproton_tof_syst", "antiproton_tof_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
259+
registryData.add("antideuteron_tpc_syst", "antideuteron_tpc_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
260+
registryData.add("antideuteron_tof_syst", "antideuteron_tof_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
261+
}
262+
263+
if (doprocessSystematicsEfficiency) {
264+
registryMC.add("antiproton_incl_gen_syst", "antiproton_incl_gen_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {10, 0, 10, "systematic uncertainty"}});
265+
registryMC.add("antideuteron_incl_gen_syst", "antideuteron_incl_gen_syst", HistType::kTHnSparseF, {{nbins, min * 2, max * 2, "#it{p}_{T} (GeV/#it{c})"}, {10, 0, 10, "systematic uncertainty"}});
266+
registryMC.add("antiproton_incl_prim_syst", "antiproton_incl_prim_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {10, 0, 10, "systematic uncertainty"}});
267+
registryMC.add("antiproton_incl_rec_tpc_syst", "antiproton_incl_rec_tpc_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
268+
registryMC.add("antiproton_incl_rec_tof_syst", "antiproton_incl_rec_tof_syst", HistType::kTHnSparseF, {{nbins, min, max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
269+
registryMC.add("antideuteron_incl_rec_tpc_syst", "antideuteron_incl_rec_tpc_syst", HistType::kTHnSparseF, {{nbins, 2 * min, 2 * max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TPC}"}, {10, 0, 10, "systematic uncertainty"}});
270+
registryMC.add("antideuteron_incl_rec_tof_syst", "antideuteron_incl_rec_tof_syst", HistType::kTHnSparseF, {{nbins, 2 * min, 2 * max, "#it{p}_{T} (GeV/#it{c})"}, {400, -20.0, 20.0, "n#sigma_{TOF}"}, {10, 0, 10, "systematic uncertainty"}});
271+
}
260272
}
261273

262274
void getPerpendicularAxis(TVector3 p, TVector3& u, double sign)
@@ -1312,6 +1324,130 @@ struct AntinucleiInJets {
13121324
}
13131325
}
13141326
PROCESS_SWITCH(AntinucleiInJets, processSystematicsData, "Process Systematics", false);
1327+
1328+
void processSystematicsEfficiency(SimCollisions const& collisions, MCTracks const& mcTracks, aod::McParticles const& mcParticles)
1329+
{
1330+
const int nSystematics = 10;
1331+
int itsNclustersSyst[nSystematics] = {5, 6, 5, 4, 5, 3, 5, 6, 3, 4};
1332+
float tpcNcrossedRowsSyst[nSystematics] = {100, 85, 80, 110, 95, 90, 105, 95, 100, 105};
1333+
float dcaxySyst[nSystematics] = {0.05, 0.07, 0.10, 0.03, 0.06, 0.15, 0.08, 0.04, 0.09, 0.10};
1334+
float dcazSyst[nSystematics] = {0.1, 0.15, 0.3, 0.075, 0.12, 0.18, 0.2, 0.1, 0.15, 0.2};
1335+
1336+
for (const auto& collision : collisions) {
1337+
1338+
if (!collision.sel8() || std::fabs(collision.posZ()) > zVtx)
1339+
continue;
1340+
1341+
// generated
1342+
for (const auto& particle : mcParticles) {
1343+
1344+
if (!particle.isPhysicalPrimary())
1345+
continue;
1346+
1347+
if (particle.eta() < minEta || particle.eta() > maxEta)
1348+
continue;
1349+
1350+
switch (particle.pdgCode()) {
1351+
case kProtonBar:
1352+
registryMC.fill(HIST("antiproton_incl_gen_syst"), particle.pt());
1353+
break;
1354+
case -o2::constants::physics::Pdg::kDeuteron:
1355+
registryMC.fill(HIST("antideuteron_incl_gen_syst"), particle.pt());
1356+
break;
1357+
}
1358+
}
1359+
1360+
// ITS pid using cluster size
1361+
o2::aod::ITSResponse itsResponse;
1362+
1363+
// Reconstructed Tracks
1364+
for (auto const& track : mcTracks) {
1365+
1366+
// Get MC Particle
1367+
if (!track.has_mcParticle())
1368+
continue;
1369+
const auto particle = track.mcParticle();
1370+
1371+
// Variables
1372+
double nsigmaTPCPr = track.tpcNSigmaPr();
1373+
double nsigmaTOFPr = track.tofNSigmaPr();
1374+
double nsigmaTPCDe = track.tpcNSigmaDe();
1375+
double nsigmaTOFDe = track.tofNSigmaDe();
1376+
double dcaxy = track.dcaXY();
1377+
double dcaz = track.dcaZ();
1378+
1379+
for (int i = 0; i < nSystematics; i++) {
1380+
1381+
// Track Selection
1382+
if (requirePvContributor && !(track.isPVContributor()))
1383+
continue;
1384+
if (!track.hasITS())
1385+
continue;
1386+
if (track.itsNCls() < itsNclustersSyst[i])
1387+
continue;
1388+
if (!track.hasTPC())
1389+
continue;
1390+
if (track.tpcNClsCrossedRows() < tpcNcrossedRowsSyst[i])
1391+
continue;
1392+
if ((static_cast<double>(track.tpcNClsCrossedRows()) / static_cast<double>(track.tpcNClsFindable())) < minTpcNcrossedRowsOverFindable)
1393+
continue;
1394+
if (track.tpcChi2NCl() > maxChiSquareTpc)
1395+
continue;
1396+
if (track.itsChi2NCl() > maxChiSquareIts)
1397+
continue;
1398+
if (track.eta() < minEta || track.eta() > maxEta)
1399+
continue;
1400+
if (track.pt() < minPt)
1401+
continue;
1402+
if (std::fabs(dcaxy) > dcaxySyst[i])
1403+
continue;
1404+
if (std::fabs(dcaz) > dcazSyst[i])
1405+
continue;
1406+
1407+
// particle identification using the ITS cluster size
1408+
bool passedItsPidProt(false), passedItsPidDeut(false);
1409+
if (itsResponse.nSigmaITS<o2::track::PID::Proton>(track) > nSigmaItsMin && itsResponse.nSigmaITS<o2::track::PID::Proton>(track) < nSigmaItsMax) {
1410+
passedItsPidProt = true;
1411+
}
1412+
if (itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track) > nSigmaItsMin && itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track) < nSigmaItsMax) {
1413+
passedItsPidDeut = true;
1414+
}
1415+
if (!applyItsPid) {
1416+
passedItsPidProt = true;
1417+
passedItsPidDeut = true;
1418+
}
1419+
if (track.pt() > ptMaxItsPidProt)
1420+
passedItsPidProt = true;
1421+
if (track.pt() > ptMaxItsPidDeut)
1422+
passedItsPidDeut = true;
1423+
if (!particle.isPhysicalPrimary())
1424+
continue;
1425+
1426+
if (particle.pdgCode() == kProtonBar)
1427+
registryMC.fill(HIST("antiproton_incl_prim_syst"), track.pt(), i);
1428+
1429+
// antiprotons
1430+
if (particle.pdgCode() == kProtonBar && passedItsPidProt) {
1431+
if (nsigmaTPCPr > minNsigmaTpc && nsigmaTPCPr < maxNsigmaTpc) {
1432+
registryMC.fill(HIST("antiproton_incl_rec_tpc_syst"), track.pt(), i);
1433+
if (track.hasTOF() && nsigmaTOFPr > minNsigmaTof && nsigmaTOFPr < maxNsigmaTof)
1434+
registryMC.fill(HIST("antiproton_incl_rec_tof_syst"), track.pt(), i);
1435+
}
1436+
}
1437+
1438+
// antideuterons
1439+
if (particle.pdgCode() == -o2::constants::physics::Pdg::kDeuteron && passedItsPidDeut) {
1440+
if (nsigmaTPCDe > minNsigmaTpc && nsigmaTPCDe < maxNsigmaTpc) {
1441+
registryMC.fill(HIST("antideuteron_incl_rec_tpc_syst"), track.pt(), i);
1442+
if (track.hasTOF() && nsigmaTOFDe > minNsigmaTof && nsigmaTOFDe < maxNsigmaTof)
1443+
registryMC.fill(HIST("antideuteron_incl_rec_tof_syst"), track.pt(), i);
1444+
}
1445+
}
1446+
}
1447+
}
1448+
}
1449+
}
1450+
PROCESS_SWITCH(AntinucleiInJets, processSystematicsEfficiency, "process efficiency for systematics", false);
13151451
};
13161452

13171453
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)