Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion PWGLF/DataModel/LFAntinCexTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,25 @@
DECLARE_SOA_COLUMN(DPairPz, dPairPz, float);
DECLARE_SOA_COLUMN(DOpenAngle, dOpenAngle, float);

DECLARE_SOA_COLUMN(SVNearestLayerId, svNearestLayerId, int16_t);

Check failure on line 97 in PWGLF/DataModel/LFAntinCexTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(SVDeltaRToLayer, svDeltaRToLayer, float);

Check failure on line 98 in PWGLF/DataModel/LFAntinCexTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(PTrkItsHitMap, pTrkItsHitMap, uint16_t);
DECLARE_SOA_COLUMN(APTrkItsHitMap, apTrkItsHitMap, uint16_t);

Check failure on line 101 in PWGLF/DataModel/LFAntinCexTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PLayersOk, pLayersOk, int8_t);
DECLARE_SOA_COLUMN(APLayersOk, apLayersOk, int8_t);

Check failure on line 103 in PWGLF/DataModel/LFAntinCexTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(PVtxZ, pVtxZ, float);

// Proton ITS PID
DECLARE_SOA_COLUMN(PTrkItsNSigmaPr, pTrkItsNSigmaPr, float);
DECLARE_SOA_COLUMN(PTrkItsPidValid, pTrkItsPidValid, int8_t);
DECLARE_SOA_COLUMN(PTrkTgl, pTrkTgl, float);

// Antiproton ITS PID
DECLARE_SOA_COLUMN(AntipTrkItsNSigmaPr, antipTrkItsNSigmaPr, float);
DECLARE_SOA_COLUMN(AntipTrkItsPidValid, antipTrkItsPidValid, int8_t);
DECLARE_SOA_COLUMN(AntipTrkTgl, antipTrkTgl, float);
} // namespace antin_cex

// Table
Expand All @@ -123,7 +133,9 @@
antin_cex::DPairP, antin_cex::DPairPt, antin_cex::DPairPz, antin_cex::DOpenAngle,
antin_cex::SVNearestLayerId, antin_cex::SVDeltaRToLayer,
antin_cex::PTrkItsHitMap, antin_cex::APTrkItsHitMap, antin_cex::PLayersOk, antin_cex::APLayersOk,
antin_cex::PVtxZ);
antin_cex::PVtxZ,
antin_cex::PTrkItsNSigmaPr, antin_cex::PTrkItsPidValid, antin_cex::PTrkTgl,
antin_cex::AntipTrkItsNSigmaPr, antin_cex::AntipTrkItsPidValid, antin_cex::AntipTrkTgl);

} // namespace o2::aod

Expand Down
93 changes: 77 additions & 16 deletions PWGLF/TableProducer/Nuspex/nucleiAntineutronCex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@
/// \author Fabiola Lugo
///

#include "PWGLF/DataModel/LFAntinCexTables.h"

#include "CommonConstants/MathConstants.h"
#include "DCAFitter/DCAFitterN.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/Logger.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/TrackParametrization.h"

#include "TMCProcess.h"
#include "TMath.h"
#include "TPDGCode.h"
#include "TVector3.h"
#include <PWGLF/DataModel/LFAntinCexTables.h>

#include <Common/DataModel/PIDResponseITS.h>

#include <CommonConstants/MathConstants.h>
#include <DCAFitter/DCAFitterN.h>
#include <DetectorsBase/Propagator.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Logger.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/TrackParametrization.h>

#include <TMCProcess.h>
#include <TMath.h>
#include <TPDGCode.h>
#include <TVector3.h>

#include <algorithm>
#include <array>
Expand Down Expand Up @@ -157,6 +159,20 @@ struct NucleiAntineutronCex {
histos.add("vtxfit_mc_dY", "SV residual Y (fit - MC);#Delta Y (cm);Entries", kTH1F, {{400, -20., 20.}});
histos.add("vtxfit_mc_dZ", "SV residual Z (fit - MC);#Delta Z (cm);Entries", kTH1F, {{400, -20., 20.}});
histos.add("vtxfit_mc_d3D", "SV distance |fit - MC|;#Delta r (cm);Entries", kTH1F, {{300, 0., 30.}});

// ITS PID (protons / antiprotons, reconstructed tracks)
histos.add("pItsNsigmaPr", "ITS n#sigma (p hyp., proton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
histos.add("apItsNsigmaPr", "ITS n#sigma (p hyp., antiproton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
histos.add("pItsPidValid", "ITS PID valid flag (proton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
histos.add("apItsPidValid", "ITS PID valid flag (antiproton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
histos.add("pTgl", "tgl (proton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
histos.add("apTgl", "tgl (antiproton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
histos.add("pItsNsigmaPr_bg", "ITS n#sigma (p hyp., proton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
histos.add("apItsNsigmaPr_bg", "ITS n#sigma (p hyp., antiproton);n#sigma_{ITS}(p);Entries", kTH1F, {{100, -10., 10.}});
histos.add("pItsPidValid_bg", "ITS PID valid flag (proton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
histos.add("apItsPidValid_bg", "ITS PID valid flag (antiproton);PidValid;Entries", kTH1F, {{2, 0., 2.}});
histos.add("pTgl_bg", "tgl (proton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
histos.add("apTgl_bg", "tgl (antiproton track);tgl;Entries", kTH1F, {{100, -2., 2.}});
}

static o2::track::TrackParCov makeTPCovFromAOD(const TracksWCovMc::iterator& tr)
Expand Down Expand Up @@ -495,6 +511,9 @@ struct NucleiAntineutronCex {
// int antip_trk_nClsTPC = 0;
int antipTrkNClsIts = 0;
uint16_t apItsMap = 0;
float pTrkItsNSigmaPr = -999.f;
int8_t pTrkItsPidValid = 0;
float pTrkTgl = 0.f;

bool pLayers = false;
bool pHasTrack = false;
Expand All @@ -507,6 +526,11 @@ struct NucleiAntineutronCex {
// int p_trk_nClsTPC = 0;
int pTrkNClsIts = 0;
uint16_t pItsMap = 0;
float antipTrkItsNSigmaPr = -999.f;
int8_t antipTrkItsPidValid = 0;
float antipTrkTgl = 0.f;

o2::aod::ITSResponse itsResponse;

for (const auto& track : tracks) {
if (!track.has_mcParticle())
Expand Down Expand Up @@ -542,11 +566,25 @@ struct NucleiAntineutronCex {
antipTrkTpcSignal = track.tpcSignal();
// antip_trk_nClsTPC = track.tpcNCls();
antipTrkNClsIts = track.itsNCls();
antipTrkTgl = track.tgl();
const auto nsigmaITSantip = itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
antipTrkItsNSigmaPr = static_cast<float>(nsigmaITSantip);
antipTrkItsPidValid = std::isfinite(nsigmaITSantip) ? 1 : 0;
antipHasTrack = true;
apItsMap = static_cast<uint16_t>(track.itsClusterMap());
antipLayers = (apItsMap != 0);
if (layerCondition)
antipLayers = true;
if (motherPdg == -kNeutron) {
histos.fill(HIST("apItsNsigmaPr"), antipTrkItsNSigmaPr);
histos.fill(HIST("apItsPidValid"), antipTrkItsPidValid);
histos.fill(HIST("apTgl"), antipTrkTgl);
}
if (motherPdg != -kNeutron) {
histos.fill(HIST("apItsNsigmaPr_bg"), antipTrkItsNSigmaPr);
histos.fill(HIST("apItsPidValid_bg"), antipTrkItsPidValid);
histos.fill(HIST("apTgl_bg"), antipTrkTgl);
}
} else if (mc.globalIndex() == pId) {
pTrkP = track.p();
pTrkPx = track.px();
Expand All @@ -556,11 +594,26 @@ struct NucleiAntineutronCex {
pTrkTpcSignal = track.tpcSignal();
// p_trk_nClsTPC = track.tpcNCls();
pTrkNClsIts = track.itsNCls();
pTrkTgl = track.tgl();
const auto nsigmaITSp =
itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
pTrkItsNSigmaPr = static_cast<float>(nsigmaITSp);
pTrkItsPidValid = std::isfinite(nsigmaITSp) ? 1 : 0;
pHasTrack = true;
pItsMap = static_cast<uint16_t>(track.itsClusterMap());
pLayers = (pItsMap != 0);
if (layerCondition)
pLayers = true;
if (motherPdg == -kNeutron) {
histos.fill(HIST("pItsNsigmaPr"), pTrkItsNSigmaPr);
histos.fill(HIST("pItsPidValid"), pTrkItsPidValid);
histos.fill(HIST("pTgl"), pTrkTgl);
}
if (motherPdg == -kNeutron) {
histos.fill(HIST("pItsNsigmaPr_bg"), pTrkItsNSigmaPr);
histos.fill(HIST("pItsPidValid_bg"), pTrkItsPidValid);
histos.fill(HIST("pTgl_bg"), pTrkTgl);
}
}
}
if (!(pHasTrack && antipHasTrack))
Expand Down Expand Up @@ -782,7 +835,15 @@ struct NucleiAntineutronCex {
static_cast<int8_t>(pLayers ? 1 : 0),
static_cast<int8_t>(antipLayers ? 1 : 0),

pvtxZ);
pvtxZ,

pTrkItsNSigmaPr,
pTrkItsPidValid,
pTrkTgl,

antipTrkItsNSigmaPr,
antipTrkItsPidValid,
antipTrkTgl);
}
}
// ==== end DCAFitter2 ====
Expand Down
Loading