Skip to content

Commit 01222e3

Browse files
authored
[PWGLF] Add ITS PID signals to Antineutron CEX task and extend LFAntinCexTables (#13901)
1 parent c453238 commit 01222e3

File tree

2 files changed

+90
-17
lines changed

2 files changed

+90
-17
lines changed

PWGLF/DataModel/LFAntinCexTables.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ DECLARE_SOA_COLUMN(PLayersOk, pLayersOk, int8_t);
103103
DECLARE_SOA_COLUMN(APLayersOk, apLayersOk, int8_t);
104104

105105
DECLARE_SOA_COLUMN(PVtxZ, pVtxZ, float);
106+
107+
// Proton ITS PID
108+
DECLARE_SOA_COLUMN(PTrkItsNSigmaPr, pTrkItsNSigmaPr, float);
109+
DECLARE_SOA_COLUMN(PTrkItsPidValid, pTrkItsPidValid, int8_t);
110+
DECLARE_SOA_COLUMN(PTrkTgl, pTrkTgl, float);
111+
112+
// Antiproton ITS PID
113+
DECLARE_SOA_COLUMN(AntipTrkItsNSigmaPr, antipTrkItsNSigmaPr, float);
114+
DECLARE_SOA_COLUMN(AntipTrkItsPidValid, antipTrkItsPidValid, int8_t);
115+
DECLARE_SOA_COLUMN(AntipTrkTgl, antipTrkTgl, float);
106116
} // namespace antin_cex
107117

108118
// Table
@@ -123,7 +133,9 @@ DECLARE_SOA_TABLE(AntinCexPairs, "AOD", "ANTINCEX",
123133
antin_cex::DPairP, antin_cex::DPairPt, antin_cex::DPairPz, antin_cex::DOpenAngle,
124134
antin_cex::SVNearestLayerId, antin_cex::SVDeltaRToLayer,
125135
antin_cex::PTrkItsHitMap, antin_cex::APTrkItsHitMap, antin_cex::PLayersOk, antin_cex::APLayersOk,
126-
antin_cex::PVtxZ);
136+
antin_cex::PVtxZ,
137+
antin_cex::PTrkItsNSigmaPr, antin_cex::PTrkItsPidValid, antin_cex::PTrkTgl,
138+
antin_cex::AntipTrkItsNSigmaPr, antin_cex::AntipTrkItsPidValid, antin_cex::AntipTrkTgl);
127139

128140
} // namespace o2::aod
129141

PWGLF/TableProducer/Nuspex/nucleiAntineutronCex.cxx

Lines changed: 77 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@
1515
/// \author Fabiola Lugo
1616
///
1717

18-
#include "PWGLF/DataModel/LFAntinCexTables.h"
19-
20-
#include "CommonConstants/MathConstants.h"
21-
#include "DCAFitter/DCAFitterN.h"
22-
#include "DetectorsBase/Propagator.h"
23-
#include "Framework/AnalysisDataModel.h"
24-
#include "Framework/AnalysisTask.h"
25-
#include "Framework/Logger.h"
26-
#include "Framework/runDataProcessing.h"
27-
#include "ReconstructionDataFormats/TrackParametrization.h"
28-
29-
#include "TMCProcess.h"
30-
#include "TMath.h"
31-
#include "TPDGCode.h"
32-
#include "TVector3.h"
18+
#include <PWGLF/DataModel/LFAntinCexTables.h>
19+
20+
#include <Common/DataModel/PIDResponseITS.h>
21+
22+
#include <CommonConstants/MathConstants.h>
23+
#include <DCAFitter/DCAFitterN.h>
24+
#include <DetectorsBase/Propagator.h>
25+
#include <Framework/AnalysisDataModel.h>
26+
#include <Framework/AnalysisTask.h>
27+
#include <Framework/Logger.h>
28+
#include <Framework/runDataProcessing.h>
29+
#include <ReconstructionDataFormats/TrackParametrization.h>
30+
31+
#include <TMCProcess.h>
32+
#include <TMath.h>
33+
#include <TPDGCode.h>
34+
#include <TVector3.h>
3335

3436
#include <algorithm>
3537
#include <array>
@@ -157,6 +159,20 @@ struct NucleiAntineutronCex {
157159
histos.add("vtxfit_mc_dY", "SV residual Y (fit - MC);#Delta Y (cm);Entries", kTH1F, {{400, -20., 20.}});
158160
histos.add("vtxfit_mc_dZ", "SV residual Z (fit - MC);#Delta Z (cm);Entries", kTH1F, {{400, -20., 20.}});
159161
histos.add("vtxfit_mc_d3D", "SV distance |fit - MC|;#Delta r (cm);Entries", kTH1F, {{300, 0., 30.}});
162+
163+
// ITS PID (protons / antiprotons, reconstructed tracks)
164+
histos.add("pItsNsigmaPr", "ITS n#sigma (p hyp., proton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
165+
histos.add("apItsNsigmaPr", "ITS n#sigma (p hyp., antiproton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
166+
histos.add("pItsPidValid", "ITS PID valid flag (proton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
167+
histos.add("apItsPidValid", "ITS PID valid flag (antiproton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
168+
histos.add("pTgl", "tgl (proton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
169+
histos.add("apTgl", "tgl (antiproton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
170+
histos.add("pItsNsigmaPr_bg", "ITS n#sigma (p hyp., proton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
171+
histos.add("apItsNsigmaPr_bg", "ITS n#sigma (p hyp., antiproton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
172+
histos.add("pItsPidValid_bg", "ITS PID valid flag (proton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
173+
histos.add("apItsPidValid_bg", "ITS PID valid flag (antiproton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
174+
histos.add("pTgl_bg", "tgl (proton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
175+
histos.add("apTgl_bg", "tgl (antiproton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
160176
}
161177

162178
static o2::track::TrackParCov makeTPCovFromAOD(const TracksWCovMc::iterator& tr)
@@ -495,6 +511,9 @@ struct NucleiAntineutronCex {
495511
// int antip_trk_nClsTPC = 0;
496512
int antipTrkNClsIts = 0;
497513
uint16_t apItsMap = 0;
514+
float pTrkItsNSigmaPr = -999.f;
515+
int8_t pTrkItsPidValid = 0;
516+
float pTrkTgl = 0.f;
498517

499518
bool pLayers = false;
500519
bool pHasTrack = false;
@@ -507,6 +526,11 @@ struct NucleiAntineutronCex {
507526
// int p_trk_nClsTPC = 0;
508527
int pTrkNClsIts = 0;
509528
uint16_t pItsMap = 0;
529+
float antipTrkItsNSigmaPr = -999.f;
530+
int8_t antipTrkItsPidValid = 0;
531+
float antipTrkTgl = 0.f;
532+
533+
o2::aod::ITSResponse itsResponse;
510534

511535
for (const auto& track : tracks) {
512536
if (!track.has_mcParticle())
@@ -542,11 +566,25 @@ struct NucleiAntineutronCex {
542566
antipTrkTpcSignal = track.tpcSignal();
543567
// antip_trk_nClsTPC = track.tpcNCls();
544568
antipTrkNClsIts = track.itsNCls();
569+
antipTrkTgl = track.tgl();
570+
const auto nsigmaITSantip = itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
571+
antipTrkItsNSigmaPr = static_cast<float>(nsigmaITSantip);
572+
antipTrkItsPidValid = std::isfinite(nsigmaITSantip) ? 1 : 0;
545573
antipHasTrack = true;
546574
apItsMap = static_cast<uint16_t>(track.itsClusterMap());
547575
antipLayers = (apItsMap != 0);
548576
if (layerCondition)
549577
antipLayers = true;
578+
if (motherPdg == -kNeutron) {
579+
histos.fill(HIST("apItsNsigmaPr"), antipTrkItsNSigmaPr);
580+
histos.fill(HIST("apItsPidValid"), antipTrkItsPidValid);
581+
histos.fill(HIST("apTgl"), antipTrkTgl);
582+
}
583+
if (motherPdg != -kNeutron) {
584+
histos.fill(HIST("apItsNsigmaPr_bg"), antipTrkItsNSigmaPr);
585+
histos.fill(HIST("apItsPidValid_bg"), antipTrkItsPidValid);
586+
histos.fill(HIST("apTgl_bg"), antipTrkTgl);
587+
}
550588
} else if (mc.globalIndex() == pId) {
551589
pTrkP = track.p();
552590
pTrkPx = track.px();
@@ -556,11 +594,26 @@ struct NucleiAntineutronCex {
556594
pTrkTpcSignal = track.tpcSignal();
557595
// p_trk_nClsTPC = track.tpcNCls();
558596
pTrkNClsIts = track.itsNCls();
597+
pTrkTgl = track.tgl();
598+
const auto nsigmaITSp =
599+
itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
600+
pTrkItsNSigmaPr = static_cast<float>(nsigmaITSp);
601+
pTrkItsPidValid = std::isfinite(nsigmaITSp) ? 1 : 0;
559602
pHasTrack = true;
560603
pItsMap = static_cast<uint16_t>(track.itsClusterMap());
561604
pLayers = (pItsMap != 0);
562605
if (layerCondition)
563606
pLayers = true;
607+
if (motherPdg == -kNeutron) {
608+
histos.fill(HIST("pItsNsigmaPr"), pTrkItsNSigmaPr);
609+
histos.fill(HIST("pItsPidValid"), pTrkItsPidValid);
610+
histos.fill(HIST("pTgl"), pTrkTgl);
611+
}
612+
if (motherPdg == -kNeutron) {
613+
histos.fill(HIST("pItsNsigmaPr_bg"), pTrkItsNSigmaPr);
614+
histos.fill(HIST("pItsPidValid_bg"), pTrkItsPidValid);
615+
histos.fill(HIST("pTgl_bg"), pTrkTgl);
616+
}
564617
}
565618
}
566619
if (!(pHasTrack && antipHasTrack))
@@ -782,7 +835,15 @@ struct NucleiAntineutronCex {
782835
static_cast<int8_t>(pLayers ? 1 : 0),
783836
static_cast<int8_t>(antipLayers ? 1 : 0),
784837

785-
pvtxZ);
838+
pvtxZ,
839+
840+
pTrkItsNSigmaPr,
841+
pTrkItsPidValid,
842+
pTrkTgl,
843+
844+
antipTrkItsNSigmaPr,
845+
antipTrkItsPidValid,
846+
antipTrkTgl);
786847
}
787848
}
788849
// ==== end DCAFitter2 ====

0 commit comments

Comments
 (0)