Skip to content
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

PWGLF: Improved PID selection and DCA fitter #7098

Merged
merged 98 commits into from
Jul 31, 2024
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
abad8c7
improve event mix
skundu692 Mar 16, 2024
f2d8aa3
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Mar 19, 2024
6293c14
Add time frame cut in pp phi
skundu692 Mar 19, 2024
65e86d3
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Mar 24, 2024
131ee59
fix momentum cut
skundu692 Mar 24, 2024
111f9d9
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Mar 26, 2024
8e6ad80
Add new thnsparse
skundu692 Mar 26, 2024
4ca23b0
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Mar 27, 2024
b4259bf
Fix histogram name
skundu692 Mar 27, 2024
534a7fd
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Mar 28, 2024
13c964d
Add rapidity bin in THnsparse
skundu692 Mar 28, 2024
b8a36f8
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 3, 2024
ddcf983
Q vector bining
skundu692 Apr 3, 2024
b1e3337
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 4, 2024
82c135b
Add shift correction
skundu692 Apr 4, 2024
68bea89
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 9, 2024
1c1b5bb
Add acceptance cut for generated
skundu692 Apr 9, 2024
dc11405
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 12, 2024
ed10ee3
Fix costheta range
skundu692 Apr 12, 2024
ee0b567
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 13, 2024
e654cd4
Preliminary task highmass lambda
skundu692 Apr 13, 2024
e958ce3
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 16, 2024
ba7742a
Fix lorentz vector
skundu692 Apr 16, 2024
d7dc343
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 22, 2024
e229fa2
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 22, 2024
62bb977
Add decay length
skundu692 Apr 22, 2024
9143fce
add rotational background
skundu692 Apr 22, 2024
5f78d14
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 23, 2024
c80f58d
Add Q vector amplitude information
skundu692 Apr 23, 2024
9ac3bd1
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 24, 2024
f28bcda
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 25, 2024
7d59fdd
Fix hnsparse
skundu692 Apr 25, 2024
f4c8f89
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 28, 2024
0b2c0ae
Modify PID and track sel
skundu692 Apr 28, 2024
3726188
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 30, 2024
8efd4ff
Remove fake track from mommentum correlation
skundu692 Apr 30, 2024
4e6a537
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Apr 30, 2024
796be9a
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 3, 2024
aaa8aa1
Add small centrality for callibration
skundu692 May 3, 2024
f80608b
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 6, 2024
954d51a
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 10, 2024
cd67ffc
Update track selection
skundu692 May 10, 2024
28bf833
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 14, 2024
fc333ae
PID improve for Flow
skundu692 May 14, 2024
aa73896
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 16, 2024
97f618c
Add improveddca variable
skundu692 May 16, 2024
e27104a
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 18, 2024
90ef410
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 20, 2024
d599d11
Improvement track cut
skundu692 May 20, 2024
4a0b839
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 23, 2024
9884680
Add occupancy
skundu692 May 23, 2024
39370d2
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 23, 2024
9ba57e7
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 24, 2024
e0e6991
Optimization
skundu692 May 24, 2024
883931f
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 24, 2024
678a733
fix histo
skundu692 May 24, 2024
15a2746
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 25, 2024
c82641a
Fix dca bin
skundu692 May 25, 2024
15e0387
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 27, 2024
a7c4e85
THnsparse dimmension
skundu692 May 27, 2024
5ce954f
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 May 31, 2024
0e53d94
Modify v2
skundu692 May 31, 2024
bb0fcaa
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 1, 2024
3f9f0cc
Update PID
skundu692 Jun 1, 2024
a08ff7f
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 3, 2024
c7ce254
Improved dca cut
skundu692 Jun 3, 2024
02f23d6
fix pt boundary
skundu692 Jun 3, 2024
7042b48
dca cut
skundu692 Jun 3, 2024
49d4186
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 4, 2024
c06240a
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 7, 2024
6bac6ea
Fix rotational bkg and typo of phi v2
skundu692 Jun 7, 2024
4f61b7d
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 7, 2024
f11fd98
pt bining
skundu692 Jun 7, 2024
12f4e98
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 11, 2024
dd442d0
Add sum of dca between daughters
skundu692 Jun 11, 2024
ac27ff6
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 13, 2024
9c0ba47
Add sign of v0 dca to PV
skundu692 Jun 13, 2024
82bb418
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 19, 2024
6d4cbd3
Add new event selection + modify PID and occupancy bining
skundu692 Jun 19, 2024
cb789c1
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 20, 2024
27d3c02
Improve PID + change THnsparse axes + switch for v2 method
skundu692 Jun 20, 2024
da8ced4
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 21, 2024
0a790f8
Reduce number of configurable + improved dca bining
skundu692 Jun 21, 2024
a8a38f4
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 22, 2024
632e25c
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jun 30, 2024
03cf3bc
Add occupancy dependence in EP resolution
skundu692 Jun 30, 2024
85008fe
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 9, 2024
eec089c
Modify PID selection
skundu692 Jul 9, 2024
acc0a44
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 10, 2024
2c3d9c7
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 11, 2024
853bced
Occupancy dependent mixed event
skundu692 Jul 11, 2024
c03659c
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 24, 2024
07e97bf
high mass lambda task with svertexer
skundu692 Jul 24, 2024
f3e16da
fix header
skundu692 Jul 26, 2024
0223170
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 26, 2024
7bacd62
improved kshort selection and thnsparse bining
skundu692 Jul 26, 2024
6ef6e88
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics in…
skundu692 Jul 31, 2024
ef9b3e6
Improved PID selection and DCA ditter
skundu692 Jul 31, 2024
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
163 changes: 58 additions & 105 deletions PWGLF/Tasks/Resonances/highmasslambdasvx.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ struct highmasslambdasvx {
Configurable<bool> additionalEvSel{"additionalEvSel", true, "additionalEvSel"};
Configurable<bool> additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"};
// events
Configurable<bool> cnfabsdca{"cnfabsdca", false, "Use Abs DCA for secondary vertex fitting"};
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
Configurable<float> cfgCutCentralityMax{"cfgCutCentralityMax", 50.0f, "Accepted maximum Centrality"};
Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 30.0f, "Accepted minimum Centrality"};
// proton track cut
Configurable<bool> ispTdifferentialDCA{"ispTdifferentialDCA", true, "is pT differential DCA"};
Configurable<bool> rejectPID{"rejectPID", true, "Reject PID"};
Configurable<float> confMinRot{"confMinRot", 5.0 * TMath::Pi() / 6.0, "Minimum of rotation"};
Configurable<float> confMaxRot{"confMaxRot", 7.0 * TMath::Pi() / 6.0, "Maximum of rotation"};
Configurable<float> confRapidity{"confRapidity", 0.8, "cut on Rapidity"};
Expand All @@ -116,15 +116,15 @@ struct highmasslambdasvx {
Configurable<int> cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"};
Configurable<bool> ispTdepPID{"ispTdepPID", true, "pT dependent PID"};
Configurable<float> nsigmaCutTPC{"nsigmacutTPC", 3.0, "Value of the TPC Nsigma cut"};
Configurable<float> nsigmaCutTOF{"nsigmacutTOF", 3.0, "Value of the TOF Nsigma cut"};
Configurable<float> nsigmaCutCombined{"nsigmaCutCombined", 2.0, "Combined nsigma cut"};
Configurable<float> nsigmaCutCombinedKaon{"nsigmaCutCombinedKaon", 1.5, "Combined nsigma cut Kaon"};
Configurable<float> nsigmaCutCombinedPion{"nsigmaCutCombinedPion", 2.0, "Combined nsigma cut Pion"};
Configurable<float> nsigmaCutTPCPre{"nsigmacutTPCPre", 5.0, "Value of the TPC Nsigma cut Pre filter"};
// Configs for V0
Configurable<float> ConfV0decaylengthmin{"ConfV0decaylengthmin", 2, "Minimum V0 decay length"};
Configurable<float> ConfV0decaylengthmax{"ConfV0decaylengthmax", 100, "Maximum V0 decay length"};
Configurable<float> ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"};
Configurable<double> ConfV0DCADaughMax{"ConfV0DCADaughMax", 0.2f, "Maximum DCA between the V0 daughters"};
Configurable<double> ConfV0CPAMin{"ConfV0CPAMin", 0.9998f, "Minimum CPA of V0"};
Configurable<float> ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 1.5f, "Minimum transverse radius"};
Configurable<float> ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 100.f, "Maximum transverse radius"};
Configurable<double> cMaxV0DCA{"cMaxV0DCA", 0.1, "Maximum V0 DCA to PV"};
Configurable<float> cMaxV0LifeTime{"cMaxV0LifeTime", 20, "Maximum V0 life time"};
Expand All @@ -135,6 +135,10 @@ struct highmasslambdasvx {
Configurable<float> ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 50.f, "V0 Daugh sel: Min. nCls TPC"};
Configurable<double> ConfDaughDCAMin{"ConfDaughDCAMin", 0.08f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"};
Configurable<float> ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for KS0 daughters"};
// SVX cut
Configurable<bool> useCPAlambdac{"useCPAlambdac", true, "use CPA lambdac"};
Configurable<float> cutCPAlambdac{"cutCPAlambdac", 0.0, "cut CPA lambdac"};
Configurable<float> cutmaxctaulambdac{"cutmaxctaulambdac", 0.06, "cut max ctau lambdac"};
// Fill strategy
// Configurable<int> cfgSelectDaughterTopology{"cfgSelectDaughterTopology", 2, "Select daughter for topology"};
// Mixed event
Expand All @@ -148,7 +152,7 @@ struct highmasslambdasvx {
ConfigurableAxis configThnAxisSA{"configThnAxisSA", {100, -1, 1}, "SA"};
ConfigurableAxis configThnAxisPhiminusPsi{"configThnAxisPhiminusPsi", {6, 0.0, TMath::Pi()}, "#phi - #psi"};
ConfigurableAxis configThnAxisCentrality{"configThnAxisCentrality", {1, 30., 50}, "Centrality"};
ConfigurableAxis configThnAxisDecayLength{"configThnAxisDecayLength", {100, 0.0, 0.1}, "Decay length"};
ConfigurableAxis configThnAxisDecayLength{"configThnAxisDecayLength", {60, 0.0, 0.06}, "Decay length"};

Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin);
Expand All @@ -162,7 +166,7 @@ struct highmasslambdasvx {

using TrackCandidates = soa::Filtered<soa::Join<aod::TracksIU, aod::TracksCovIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa>>;
using AllTrackCandidates = soa::Join<aod::TracksIU, aod::TracksCovIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi>;
using ResoV0s = aod::V0Datas;
using ResoV0s = soa::Join<aod::V0Datas, aod::V0Covs, aod::V0DauCovs>;

SliceCache cache;
// Partition<TrackCandidates> posTracks = aod::track::signed1Pt > cfgCutCharge;
Expand Down Expand Up @@ -199,11 +203,10 @@ struct highmasslambdasvx {
histos.add("hSparseV2SASameEventRotational_V2_IOP", "hSparseV2SASameEventRotational_V2_IOP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisPhiminusPsi, dcaAxis, decaylengthAxis, occupancyAxis});
histos.add("hSparseV2SAMixedEvent_V2_IOP", "hSparseV2SAMixedEvent_V2_IOP", HistType::kTHnSparseF, {thnAxisInvMass, ptAxis, thnAxisPhiminusPsi, dcaAxis, decaylengthAxis, occupancyAxis});

histos.add("hRejectPID", "hRejectPID", kTH1F, {{2, 0.0f, 2.0f}});
histos.add("hV0decaylength", "hV0decaylength", kTH1F, {{1000, 0.0f, 1000.0f}});
histos.add("hMomCorr", "hMomCorr", kTH3F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}, {8, 0.0f, 80.0f}});
histos.add("hInvMassKs0", "hInvMassKs0", kTH1F, {{200, 0.4f, 0.6f}});
histos.add("hchi2PCA", "hchi2PCA", kTH1F, {{10000, 0.0f, 10000.f}});
histos.add("hchi2PCA", "hchi2PCA", kTH1F, {{1000, 0.0f, 1.f}});
histos.add("hFTOCvsTPCNoCut", "Mult correlation FT0C vs. TPC without any cut", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}});
histos.add("hFTOCvsTPC", "Mult correlation FT0C vs. TPC", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}});
histos.add("hFTOCvsTPCSelected", "Mult correlation FT0C vs. TPC after selection", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}});
Expand All @@ -221,6 +224,7 @@ struct highmasslambdasvx {
histos.add("hDcaxy", "Dcaxy distribution", kTH1F, {{1000, -0.5f, 0.5f}});
histos.add("hsignprotonDca", "hsignprotonDca", kTH1F, {{2000, -1.0f, 1.0f}});
histos.add("hunsignprotonDca", "hunsignprotonDca", kTH1F, {{2000, -1.0f, 1.0f}});
histos.add("hsignCPALambdac", "hsignCPALambdac", kTH1F, {{2000, -1.0f, 1.0f}});

histos.add("hPsiFT0C", "PsiFT0C", kTH3F, {centAxis, phiAxis, occupancyAxis});
histos.add("hPsiFT0A", "PsiFT0A", kTH3F, {centAxis, phiAxis, occupancyAxis});
Expand All @@ -241,7 +245,7 @@ struct highmasslambdasvx {
df.setMaxDZIni(4);
df.setMinParamChange(1.e-3);
df.setMinRelChi2Change(0.9);
df.setUseAbsDCA(true);
df.setUseAbsDCA(cnfabsdca);
df.setWeightedFinalPCA(true);
ccdb->setURL(ccdburl);
ccdb->setCaching(true);
Expand All @@ -268,108 +272,48 @@ struct highmasslambdasvx {
}

template <typename T>
bool selectionPIDpTdependent(const T& candidate)
bool selectionPID(const T& candidate)
{
if (candidate.p() <= 0.5 && TMath::Abs(candidate.tpcNSigmaPr()) < 5.0) {
if (candidate.pt() < 0.7 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC) {
return true;
}
if (candidate.p() > 0.5 && candidate.p() <= 0.8 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) {
if (candidate.pt() >= 0.7 && !candidate.hasTOF() && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.p() > 0.8 && candidate.hasTOF() && TMath::Sqrt(candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < nsigmaCutTOF) {
if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) {
return true;
}
return false;
}

template <typename T>
bool selectionPID(const T& candidate)
{
if (candidate.hasTOF()) {
if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) {
return true;
}
if (candidate.pt() >= 0.8 && candidate.pt() < 3.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && TMath::Abs(candidate.tofNSigmaPr()) < 3.0) {
return true;
}
if (candidate.pt() >= 3.0 && candidate.pt() < 4.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && candidate.tofNSigmaPr() > -2.0 && candidate.tofNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 4.0 && candidate.pt() < 5.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && candidate.tofNSigmaPr() > -1.5 && candidate.tofNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 5.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && candidate.tofNSigmaPr() > -1.5 && candidate.tofNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) < 2.0 * nsigmaCutCombined * nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + candidate.tofNSigmaKa() * candidate.tofNSigmaKa()) > 2.0 * nsigmaCutCombinedKaon * nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi()) > 2.0 * nsigmaCutCombinedPion * nsigmaCutCombinedPion) {
return true;
}
if (!candidate.hasTOF()) {
if (candidate.pt() < 0.7 && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) {
return true;
}
if (candidate.pt() >= 0.7 && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 0.8 && candidate.tpcNSigmaPr() > -1.5 && candidate.tpcNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 0.8 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa()) > nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi()) > nsigmaCutCombinedPion) {
return true;
}

return false;
}

template <typename T>
bool selectionPIDNew(const T& candidate)
{
if (candidate.pt() < 0.7 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0) {
return true;
}
if (candidate.pt() >= 0.7 && !candidate.hasTOF() && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) {
return true;
}
if (candidate.pt() >= 0.8 && candidate.pt() < 1.0 && !candidate.hasTOF() && candidate.tpcNSigmaPr() > -1.5 && candidate.tpcNSigmaPr() < 3.0) {
return true;
}
if (candidate.pt() >= 0.8 && candidate.pt() < 3.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && TMath::Abs(candidate.tofNSigmaPr()) < 3.0) {
if (candidate.pt() < 0.7 && !candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC) {
return true;
}
if (candidate.pt() >= 3.0 && candidate.pt() < 4.0 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < 3.0 && candidate.tofNSigmaPr() > -2.0 && candidate.tofNSigmaPr() < 4.0) {
if (candidate.pt() >= 0.7 && !candidate.hasTOF() && candidate.pt() < 0.8 && candidate.tpcNSigmaPr() > -2.0 && candidate.tpcNSigmaPr() < nsigmaCutTPC) {
return true;
}
if (candidate.pt() >= 4.0 && candidate.pt() < 5.0 && candidate.hasTOF() && candidate.tofNSigmaPr() > -2.0) {
if (candidate.pt() < 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaPr()) < 10.0) {
return true;
}
if (candidate.pt() >= 5.0 && candidate.hasTOF() && candidate.tofNSigmaPr() > -1.5) {
if (candidate.pt() >= 0.8 && candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + candidate.tofNSigmaPr() * candidate.tofNSigmaPr()) < 2.0 * nsigmaCutCombined * nsigmaCutCombined && TMath::Abs(candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + candidate.tofNSigmaKa() * candidate.tofNSigmaKa()) > 2.0 * nsigmaCutCombinedKaon * nsigmaCutCombinedKaon && TMath::Abs(candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi()) > 2.0 * nsigmaCutCombinedPion * nsigmaCutCombinedPion) {
return true;
}
return false;
}

template <typename T>
bool RejectPion(const T& candidate)
{
if (candidate.p() > 1.0 && candidate.p() < 2.0 && !candidate.hasTOF() && candidate.tpcNSigmaPi() < 2) {
return false;
}
return true;
}

template <typename T>
bool RejectKaon(const T& candidate)
{
if (candidate.p() > 1.0 && candidate.p() < 2.0 && !candidate.hasTOF() && candidate.tpcNSigmaKa() < 2) {
return false;
}
return true;
}

template <typename Collision, typename V0>
bool SelectionV0(Collision const& collision, V0 const& candidate)
{
if (fabs(candidate.dcav0topv()) > cMaxV0DCA) {
return false;
}
const float pT = candidate.pt();
const std::vector<float> decVtx = {candidate.x(), candidate.y(), candidate.z()};
const float tranRad = candidate.v0radius();
Expand All @@ -383,22 +327,22 @@ struct highmasslambdasvx {
if (pT < ConfV0PtMin) {
return false;
}
if ((decaylength < ConfV0decaylengthmin) || (decaylength > ConfV0decaylengthmax)) {
if (fabs(CtauK0s) < 2.0 || fabs(CtauK0s) > cMaxV0LifeTime || candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) {
return false;
}
if (dcaDaughv0 > ConfV0DCADaughMax) {
return false;
}
if (cpav0 < ConfV0CPAMin) {
if (fabs(candidate.dcav0topv()) > cMaxV0DCA) {
return false;
}
if (tranRad < ConfV0TranRadV0Min) {
if (cpav0 < ConfV0CPAMin) {
return false;
}
if (tranRad > ConfV0TranRadV0Max) {
if (decaylength > ConfV0decaylengthmax) {
return false;
}
if (fabs(CtauK0s) > cMaxV0LifeTime || candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) {
if (tranRad > ConfV0TranRadV0Max) {
return false;
}
return true;
Expand Down Expand Up @@ -523,14 +467,7 @@ struct highmasslambdasvx {
if (!ispTdepPID && !selectionPID(track1)) {
continue;
}
if (!ispTdepPID && rejectPID && !RejectPion(track1)) {
histos.fill(HIST("hRejectPID"), 0.5);
continue;
}
if (!ispTdepPID && rejectPID && !RejectKaon(track1)) {
histos.fill(HIST("hRejectPID"), 1.5);
continue;
}

histos.fill(HIST("hMomCorr"), track1.p() / track1.sign(), track1.p() - track1.tpcInnerParam(), centrality);
histos.fill(HIST("hEta"), track1.eta());
histos.fill(HIST("hDcaz"), track1.dcaZ());
Expand Down Expand Up @@ -580,11 +517,16 @@ struct highmasslambdasvx {
v0y = v0.y();
v0z = v0.z();
const std::array<float, 3> vertexV0 = {v0x, v0y, v0z};

v0px = v0.px();
v0py = v0.py();
v0pz = v0.pz();
const std::array<float, 3> momentumV0 = {v0px, v0py, v0pz};

std::array<float, 6> covV0Pos = {0.};
for (int i = 0; i < 6; i++) {
covV0Pos[i] = v0.positionCovMat()[i];
}
// dcaV0dau = v0.dcaV0daughters();
// dcaPosToPV = v0.dcapostopv();
// dcaNegToPV = v0.dcanegtopv();
Expand All @@ -594,7 +536,8 @@ struct highmasslambdasvx {
trackParCovV0DaughNeg.propagateTo(negTrackX, bz); // propagate the track to the X closest to the V0 vertex

// we build the neutral track to then build the cascade
auto trackV0 = o2::dataformats::V0(vertexV0, momentumV0, {0, 0, 0, 0, 0, 0}, trackParCovV0DaughPos, trackParCovV0DaughNeg); // build the V0 track (indices for v0 daughters set to 0 for now)
// auto trackV0 = o2::dataformats::V0(vertexV0, momentumV0, {0, 0, 0, 0, 0, 0}, trackParCovV0DaughPos, trackParCovV0DaughNeg); // build the V0 track (indices for v0 daughters set to 0 for now)
auto trackV0 = o2::dataformats::V0(vertexV0, momentumV0, covV0Pos, trackParCovV0DaughPos, trackParCovV0DaughNeg); // build the V0 track (indices for v0 daughters set to 0 for now)
std::array<float, 3> pVecV0 = {0., 0., 0.};
std::array<float, 3> pVecBach = {0., 0., 0.};
std::array<float, 3> pVecCand = {0., 0., 0.};
Expand All @@ -620,6 +563,9 @@ struct highmasslambdasvx {

const auto& secondaryVertex = df.getPCACandidate();
auto chi2PCA = df.getChi2AtPCACandidate();
if (chi2PCA > 1) {
continue;
}
// auto covMatrixPCA = df.calcPCACovMatrixFlat();
if (firstprimarytrack == 0) {
histos.fill(HIST("hchi2PCA"), chi2PCA);
Expand Down Expand Up @@ -647,21 +593,28 @@ struct highmasslambdasvx {
}
double protonimpactparameter = impactParameter1.getY();
// double kshortimpactparameter=impactParameter0.getY();
if (firstprimarytrack == 0) {
histos.fill(HIST("hDcaxy"), track1.dcaXY());
histos.fill(HIST("hunsignprotonDca"), protonimpactparameter);
}
double decaylengthx = collision.posX() - secondaryVertex[0];
double decaylengthy = collision.posY() - secondaryVertex[1];
double decaylengthz = collision.posZ() - secondaryVertex[2];

double decaylengthx = secondaryVertex[0] - collision.posX();
double decaylengthy = secondaryVertex[1] - collision.posY();
double decaylengthz = secondaryVertex[2] - collision.posZ();
double decaylength = TMath::Sqrt(decaylengthx * decaylengthx + decaylengthy * decaylengthy + decaylengthz * decaylengthz);
double lambdaclifetime = decaylength;
double anglesign = decaylengthx * Lambdac.X() + decaylengthy * Lambdac.Y() + decaylengthz * Lambdac.Z();
double lambdaclifetime = (decaylength * Lambdac.M()) / Lambdac.P();
if (lambdaclifetime > cutmaxctaulambdac) {
continue;
}
double anglesign = decaylengthx * Lambdac.Px() + decaylengthy * Lambdac.Py() + decaylengthz * Lambdac.Pz();
double CPAlambdac = anglesign / (decaylength * Lambdac.P());
anglesign = anglesign / TMath::Abs(anglesign);
auto signprotonimpactparameter = protonimpactparameter * anglesign;
if (firstprimarytrack == 0) {
histos.fill(HIST("hDcaxy"), track1.dcaXY());
histos.fill(HIST("hunsignprotonDca"), protonimpactparameter);
histos.fill(HIST("hsignCPALambdac"), TMath::Abs(CPAlambdac));
histos.fill(HIST("hsignprotonDca"), signprotonimpactparameter);
}
if (useCPAlambdac && TMath::Abs(CPAlambdac) < cutCPAlambdac) {
continue;
}
firstprimarytrack = firstprimarytrack + 1;
auto phiminuspsi = GetPhiInRange(Lambdac.Phi() - psiFT0C);
v2 = TMath::Cos(2.0 * phiminuspsi);
Expand Down
Loading