-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PWGHF] Add variables and selections to pid studies task #8807
Open
fchinu
wants to merge
3
commits into
AliceO2Group:master
Choose a base branch
from
fchinu:add_selections_vars
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+108
−35
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file pidStudies.cxx | ||
/// \file taskPidStudies.cxx | ||
/// \brief task for studies of PID performance | ||
/// | ||
/// \author Fabrizio Chinu <[email protected]>, Università and INFN Torino | ||
|
@@ -49,8 +49,12 @@ DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass | |
DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) | ||
DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) | ||
DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) | ||
DECLARE_SOA_COLUMN(TpcInnerParPos, tpcInnerParPos, float); //! Momentum of positive track at inner wall of TPC (GeV/c) | ||
DECLARE_SOA_COLUMN(TpcInnerParNeg, tpcInnerParNeg, float); //! Momentum of negative track at inner wall of TPC (GeV/c) | ||
DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius | ||
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle | ||
DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters | ||
DECLARE_SOA_COLUMN(DcaV0ToPv, dcaV0ToPv, float); //! DCA V0 to PV | ||
DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis | ||
DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis | ||
DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis | ||
|
@@ -66,10 +70,12 @@ DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt | |
DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass | ||
DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass | ||
DECLARE_SOA_COLUMN(BachPt, bachPt, float); //! Transverse momentum of the bachelor (GeV/c) | ||
DECLARE_SOA_COLUMN(TpcInnerParBach, tpcInnerParBach, float); //! Transverse momentum of the bachelor (GeV/c) | ||
DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) | ||
DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA | ||
DECLARE_SOA_COLUMN(CascCosPA, casccosPA, float); //! Cascade CPA | ||
DECLARE_SOA_COLUMN(DCAV0daughters, dcaV0daughters, float); //! DCA of V0 daughters | ||
DECLARE_SOA_COLUMN(DCAv0topv, dcav0topv, float); //! V0 DCA to PV | ||
DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA | ||
DECLARE_SOA_COLUMN(DcaV0daughters, dcaV0daughters, float); //! DCA of V0 daughters | ||
DECLARE_SOA_COLUMN(Dcav0topv, dcav0topv, float); //! V0 DCA to PV | ||
DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis | ||
DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis | ||
|
||
|
@@ -88,8 +94,12 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information | |
pid_studies::Pt, | ||
pid_studies::PtPos, | ||
pid_studies::PtNeg, | ||
pid_studies::TpcInnerParPos, | ||
pid_studies::TpcInnerParNeg, | ||
pid_studies::Radius, | ||
pid_studies::Cpa, | ||
pid_studies::DcaV0Daughters, | ||
pid_studies::DcaV0ToPv, | ||
pid_studies::NSigmaTpcPosPi, | ||
pid_studies::NSigmaTpcNegPi, | ||
pid_studies::NSigmaTpcPosPr, | ||
|
@@ -110,11 +120,13 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat | |
pid_studies::MassOmega, | ||
pid_studies::Pt, | ||
pid_studies::BachPt, | ||
pid_studies::TpcInnerParBach, | ||
pid_studies::MLambda, | ||
pid_studies::V0cosPA, | ||
pid_studies::MassXi, | ||
pid_studies::CascCosPA, | ||
pid_studies::DCAV0daughters, | ||
pid_studies::DCAv0topv, | ||
pid_studies::CascCosPa, | ||
pid_studies::DcaV0daughters, | ||
pid_studies::Dcav0topv, | ||
pid_studies::NSigmaTpcBachKa, | ||
pid_studies::NSigmaTofBachKa, | ||
pid_studies::OccupancyFt0c, | ||
|
@@ -124,7 +136,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat | |
pid_studies::CandFlag); | ||
} // namespace o2::aod | ||
|
||
struct HfPidStudies { | ||
struct HfTaskPidStudies { | ||
Produces<o2::aod::PidV0s> pidV0; | ||
Produces<o2::aod::PidCascades> pidCascade; | ||
|
||
|
@@ -134,6 +146,8 @@ struct HfPidStudies { | |
Configurable<float> massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; | ||
Configurable<float> massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; | ||
Configurable<float> massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; | ||
Configurable<float> qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; | ||
Configurable<float> qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; | ||
Configurable<float> downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; | ||
Configurable<float> ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; | ||
|
||
|
@@ -144,6 +158,13 @@ struct HfPidStudies { | |
using V0sMcRec = soa::Join<aod::V0Datas, aod::V0CoreMCLabels>; | ||
using CascsMcRec = soa::Join<aod::CascDatas, aod::CascCoreMCLabels>; | ||
|
||
void init(InitContext&) | ||
{ | ||
if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) { | ||
LOGP(fatal, "Both data and MC process functions were enabled! Please check your configuration!"); | ||
} | ||
} | ||
|
||
template <bool isV0, typename Cand> | ||
void fillTree(Cand const& candidate, const int flag) | ||
{ | ||
|
@@ -163,8 +184,12 @@ struct HfPidStudies { | |
candidate.pt(), | ||
posTrack.pt(), | ||
negTrack.pt(), | ||
posTrack.tpcInnerParam(), | ||
negTrack.tpcInnerParam(), | ||
candidate.v0radius(), | ||
candidate.v0cosPA(), | ||
candidate.dcaV0daughters(), | ||
candidate.dcav0topv(), | ||
posTrack.tofNSigmaPi(), | ||
negTrack.tofNSigmaPi(), | ||
posTrack.tofNSigmaPr(), | ||
|
@@ -186,6 +211,8 @@ struct HfPidStudies { | |
candidate.mOmega(), | ||
candidate.pt(), | ||
candidate.bachelorpt(), | ||
bachTrack.tpcInnerParam(), | ||
candidate.mLambda(), | ||
candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), | ||
candidate.mXi(), | ||
candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), | ||
|
@@ -242,53 +269,101 @@ struct HfPidStudies { | |
return aod::pid_studies::Particle::NotMatched; | ||
} | ||
|
||
void processMc(V0sMcRec const& V0s, | ||
aod::V0MCCores const&, | ||
CascsMcRec const& cascades, | ||
aod::CascMCCores const&, | ||
CollSels const&, | ||
PidTracks const&) | ||
template <typename V0Cand> | ||
bool isSelectedV0AsK0s(const V0Cand& v0) | ||
{ | ||
if (v0.mK0Short() < massK0Min || v0.mK0Short() > massK0Max) { | ||
return false; | ||
} | ||
if (v0.qtarm() < qtArmenterosMinForK0) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
template <typename V0Cand> | ||
bool isSelectedV0AsLambda(const V0Cand& v0) | ||
{ | ||
if ((v0.mLambda() < massLambdaMin || v0.mLambda() > massLambdaMax) && | ||
(v0.mAntiLambda() < massLambdaMin || v0.mAntiLambda() > massLambdaMax)) { | ||
return false; | ||
} | ||
if (v0.qtarm() > qtArmenterosMaxForLambda) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
template <typename CascCand> | ||
bool isSelectedCascAsOmega(const CascCand& casc) | ||
{ | ||
if (casc.mOmega() < massOmegaMin || casc.mOmega() > massOmegaMax) { | ||
return false; | ||
} | ||
if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
void processV0Mc(V0sMcRec const& V0s, | ||
aod::V0MCCores const&, | ||
CollSels const&, | ||
PidTracks const&) | ||
{ | ||
for (const auto& v0 : V0s) { | ||
if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || | ||
(v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || | ||
(v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { | ||
if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { | ||
int matched = isMatched(v0); | ||
if (matched != aod::pid_studies::Particle::NotMatched) { | ||
fillTree<true>(v0, matched); | ||
} | ||
} | ||
} | ||
} | ||
PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); | ||
|
||
void processV0Data(aod::V0Datas const& V0s, | ||
CollSels const&, | ||
PidTracks const&) | ||
{ | ||
for (const auto& v0 : V0s) { | ||
if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { | ||
fillTree<true>(v0, aod::pid_studies::Particle::NotMatched); | ||
} | ||
} | ||
} | ||
PROCESS_SWITCH(HfTaskPidStudies, processV0Data, "Process data", false); | ||
|
||
void processCascMc(CascsMcRec const& cascades, | ||
aod::CascMCCores const&, | ||
CollSels const&, | ||
PidTracks const&) | ||
{ | ||
for (const auto& casc : cascades) { | ||
if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { | ||
if (isSelectedCascAsOmega(casc)) { | ||
int matched = isMatched(casc); | ||
if (matched != aod::pid_studies::Particle::NotMatched) { | ||
fillTree<false>(casc, matched); | ||
} | ||
} | ||
} | ||
} | ||
PROCESS_SWITCH(HfPidStudies, processMc, "Process MC", true); | ||
PROCESS_SWITCH(HfTaskPidStudies, processCascMc, "Process MC", true); | ||
|
||
void processData(aod::V0Datas const& V0s, aod::CascDatas const& cascades, CollSels const&, PidTracks const&) | ||
void processCascData(aod::CascDatas const& cascades, | ||
CollSels const&, | ||
PidTracks const&) | ||
{ | ||
for (const auto& v0 : V0s) { | ||
if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || | ||
(v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || | ||
(v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { | ||
fillTree<true>(v0, aod::pid_studies::Particle::NotMatched); | ||
} | ||
} | ||
for (const auto& casc : cascades) { | ||
if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { | ||
if (isSelectedCascAsOmega(casc)) { | ||
fillTree<false>(casc, aod::pid_studies::Particle::NotMatched); | ||
} | ||
} | ||
} | ||
PROCESS_SWITCH(HfPidStudies, processData, "Process data", false); | ||
PROCESS_SWITCH(HfTaskPidStudies, processCascData, "Process data", false); | ||
}; | ||
|
||
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) | ||
{ | ||
return WorkflowSpec{adaptAnalysisTask<HfPidStudies>(cfgc)}; | ||
return WorkflowSpec{adaptAnalysisTask<HfTaskPidStudies>(cfgc)}; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem to be incorrectly named duplicates of
DcaV0Daughters
, andDcaV0ToPv
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thanks!