From 43b0a04467607eaf89e9f5a5f4aa26908b495f23 Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:06:36 +0800 Subject: [PATCH 1/3] Add files via upload --- .../Strangeness/lambdaJetpolarization.cxx | 880 ++++++++++++++++++ 1 file changed, 880 insertions(+) create mode 100644 PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx diff --git a/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx b/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx new file mode 100644 index 00000000000..09d1b5c1e58 --- /dev/null +++ b/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx @@ -0,0 +1,880 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// + +/// \author Youpeng Su (yousu@cern.ch) +#include +#include +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Common/DataModel/EventSelection.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "PWGJE/Core/JetDerivedDataUtilities.h" +#include "PWGJE/DataModel/Jet.h" +#include +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include +#include +#include +using std::cout; +using std::endl; +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ + +DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision + o2::soa::Index<>, collision::PosZ); +using MyCollision = MyCollisions::iterator; + +DECLARE_SOA_TABLE(MyCollisionsV0, "AOD", "MYCOLLISIONV0", //! vertex information of collision + o2::soa::Index<>, collision::PosX); +using MyCollisionV0s = MyCollisionsV0::iterator; + +namespace myTable +{ +DECLARE_SOA_INDEX_COLUMN(MyCollision, mycollision); + +DECLARE_SOA_COLUMN(MyCollisionV0, mycollisionv0, Int_t); +DECLARE_SOA_COLUMN(V0px, v0px, Float_t); +DECLARE_SOA_COLUMN(V0py, v0py, Float_t); +DECLARE_SOA_COLUMN(V0pz, v0pz, Float_t); +DECLARE_SOA_COLUMN(V0pT, v0pt, Float_t); +DECLARE_SOA_COLUMN(V0Lambdamass, v0Lambdamass, Float_t); +DECLARE_SOA_COLUMN(V0protonpx, v0protonpx, Float_t); +DECLARE_SOA_COLUMN(V0protonpy, v0protonpy, Float_t); +DECLARE_SOA_COLUMN(V0protonpz, v0protonpz, Float_t); + +DECLARE_SOA_COLUMN(MyCollisionJet, mycollisionjet, Int_t); +DECLARE_SOA_COLUMN(Jetpx, jetpx, Float_t); +DECLARE_SOA_COLUMN(Jetpy, jetpy, Float_t); +DECLARE_SOA_COLUMN(Jetpz, jetpz, Float_t); +DECLARE_SOA_COLUMN(JetpT, jetpt, Float_t); + +DECLARE_SOA_COLUMN(MyCollisionLeadingJet, mycollisionleadingjet, Int_t); +DECLARE_SOA_COLUMN(LeadingJetpx, leadingjetpx, Float_t); +DECLARE_SOA_COLUMN(LeadingJetpy, leadingjetpy, Float_t); +DECLARE_SOA_COLUMN(LeadingJetpz, leadingjetpz, Float_t); +DECLARE_SOA_COLUMN(LeadingJetpT, leadingjetpt, Float_t); + +} // namespace myTable +DECLARE_SOA_TABLE(MyTable, "AOD", "MYTABLE", o2::soa::Index<>, + myTable::MyCollisionId, myTable::MyCollisionV0, myTable::V0px, myTable::V0py, myTable::V0pz, myTable::V0pT, myTable::V0Lambdamass, + myTable::V0protonpx, myTable::V0protonpy, myTable::V0protonpz); + +DECLARE_SOA_TABLE(MyTableJet, "AOD", "MYTABLEJet", o2::soa::Index<>, + myTable::MyCollisionId, myTable::MyCollisionJet, myTable::Jetpx, myTable::Jetpy, myTable::Jetpz, myTable::JetpT); + +DECLARE_SOA_TABLE(MyTableLeadingJet, "AOD", "LeadingJet", o2::soa::Index<>, myTable::MyCollisionId, myTable::MyCollisionLeadingJet, myTable::LeadingJetpx, myTable::LeadingJetpy, myTable::LeadingJetpz, myTable::LeadingJetpT); + +} // namespace o2::aod + +struct myAnalysis { + Produces myTable; + Produces myTableJet; + Produces outputCollisions; + Produces outputCollisionsV0; + Produces myTableLeadingJet; + + HistogramRegistry registry{"registry"}; + Configurable v0cospa{"v0cospa", 0.995, "V0 CosPA"}; + Configurable dcanegtopv{"dcanegtopv", 0.05, "DCA Neg To PV"}; + Configurable dcapostopv{"dcapostopv", 0.05, "DCA Pos To PV"}; + SliceCache cache; + HistogramRegistry JEhistos{"JEhistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgeventSelections{"cfgeventSelections", "sel8", "choose event selection"}; + Configurable cfgtrackSelections{"cfgtrackSelections", "globalTracks", "set track selections"}; + Configurable cfgDataHists{"cfgDataHists", true, "Enables DataHists"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + // Others configure + Configurable cDebugLevel{"cDebugLevel", 1, "Resolution of Debug"}; + Configurable cfgVtxCut{"cfgVtxCut", 10.0, "V_z cut selection"}; + Configurable cfgjetPtMin{"cfgjetPtMin", 15.0, "minimum jet pT cut"}; + Configurable cfgjetR{"cfgjetR", 0.4, "jet resolution parameter"}; + Configurable cfgtrkMinPt{"cfgtrkMinPt", 0.15, "set track min pT"}; + Configurable cfgtrkMaxEta{"cfgtrkMaxEta", 0.8, "set track max Eta"}; + Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.5, "Track DCAr cut to PV Maximum"}; + Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; + Configurable cfgnFindableTPCClusters{"cfgnFindableTPCClusters", 50, "nFindable TPC Clusters"}; + Configurable cfgnTPCCrossedRows{"cfgnTPCCrossedRows", 70, "nCrossed TPC Rows"}; + Configurable cfgnRowsOverFindable{"cfgnRowsOverFindable", 1.2, "nRowsOverFindable TPC CLusters"}; + Configurable cfgnTPCChi2{"cfgnTPChi2", 4.0, "nTPC Chi2 per Cluster"}; + Configurable cfgnITSChi2{"cfgnITShi2", 36.0, "nITS Chi2 per Cluster"}; + Configurable cfgConnectedToPV{"cfgConnectedToPV", true, "PV contributor track selection"}; + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; + Configurable cfgnTPCPID{"cfgnTPCPID", 4, "nTPC PID"}; + Configurable cfgnTOFPID{"cfgnTOFPID", 4, "nTOF PID"}; + + // V0 track selection//////////////////////////////////////////////////////////////// + Configurable requireITS{"requireITS", false, "require ITS hit"}; + Configurable requireTOF{"requireTOF", false, "require TOF hit"}; + Configurable requireTPC{"requireTPC", true, "require TPC hit"}; + Configurable requirepassedSingleTrackSelection{"requirepassedSingleTrackSelection", false, "requirepassedSingleTrackSelection"}; + Configurable minITSnCls{"minITSnCls", 4.0f, "min number of ITS clusters"}; + Configurable minTPCnClsFound{"minTPCnClsFound", 80.0f, "min number of found TPC clusters"}; + Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 80.0f, "min number of TPC crossed rows"}; + Configurable maxChi2TPC{"maxChi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable maxChi2ITS{"maxChi2ITS", 36.0f, "max chi2 per cluster ITS"}; + Configurable etaMin{"etaMin", -0.8f, "eta min"}; + Configurable etaMax{"etaMax", +0.8f, "eta max"}; + Configurable ptMin_V0_proton{"ptMin_V0_proton", 0.3f, "pt min of proton from V0"}; + Configurable ptMax_V0_proton{"ptMax_V0_proton", 10.0f, "pt max of proton from V0"}; + Configurable ptMin_V0_pion{"ptMin_V0_pion", 0.1f, "pt min of pion from V0"}; + Configurable ptMax_V0_pion{"ptMax_V0_pion", 1.5f, "pt max of pion from V0"}; + Configurable ptMin_K0_pion{"ptMin_K0_pion", 0.3f, "pt min of pion from K0"}; + Configurable ptMax_K0_pion{"ptMax_K0_pion", 10.0f, "pt max of pion from K0"}; + Configurable minimumV0Radius{"minimumV0Radius", 0.2f, "Minimum V0 Radius"}; + Configurable maximumV0Radius{"maximumV0Radius", 40.0f, "Maximum V0 Radius"}; + Configurable nsigmaTPCmin{"nsigmaTPCmin", -5.0f, "Minimum nsigma TPC"}; + Configurable nsigmaTPCmax{"nsigmaTPCmax", +5.0f, "Maximum nsigma TPC"}; + Configurable nsigmaTOFmin{"nsigmaTOFmin", -5.0f, "Minimum nsigma TOF"}; + Configurable nsigmaTOFmax{"nsigmaTOFmax", +5.0f, "Maximum nsigma TOF"}; + Configurable yMin{"yMin", -0.5f, "minimum y"}; + Configurable yMax{"yMax", +0.5f, "maximum y"}; + Configurable v0rejLambda{"v0rejLambda", 0.01, "V0 rej K0s"}; + Configurable CtauLambda{"ctauLambda", 30, "C tau Lambda (cm)"}; + // Event Selection///////////////////////////////// + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable sel8{"sel8", 0, "Apply sel8 event selection"}; + Configurable isTriggerTVX{"isTriggerTVX", 1, "TVX trigger"}; + Configurable iscutzvertex{"iscutzvertex", 1, "Accepted z-vertex range (cm)"}; + Configurable isNoTimeFrameBorder{"isNoTimeFrameBorder", 1, "TF border cut"}; + Configurable isNoITSROFrameBorder{"isNoITSROFrameBorder", 1, "ITS ROF border cut"}; + Configurable isVertexTOFmatched{"isVertexTOFmatched", 1, "Is Vertex TOF matched"}; + Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", 0, "isGoodZvtxFT0vsPV"}; + /////////////////////////V0 QA analysis/////////////////////////////// + Configurable dcav0dau{"dcav0dau", 1.0, "DCA V0 Daughters"}; + Configurable doArmenterosCut{"doArmenterosCut", 1, "do Armenteros Cut"}; + Configurable paramArmenterosCut{"paramArmenterosCut", 0.2, "parameter Armenteros Cut"}; + // CONFIG DONE + ///////////////////////////////////////// //INIT//////////////////////////////////////////////////////////////////// + int eventSelection = -1; + int trackSelection = -1; + + void init(o2::framework::InitContext&) + { + // HISTOGRAMS + const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; + const AxisSpec axisPhi{200, -1, +7, "#phi"}; + const AxisSpec axisPt{200, 0, +200, "#pt"}; + const AxisSpec MinvAxis = {500, 0.1, 1.25}; + const AxisSpec PtAxis = {200, 0, 20.0}; + const AxisSpec MultAxis = {100, 0, 100}; + const AxisSpec dRAxis = {100, 0, 100}; + + const AxisSpec axisPx{200, -10, 10, "#px"}; + const AxisSpec axisPy{200, -10, 10, "#py"}; + const AxisSpec axisPz{200, -10, 10, "#pz"}; + const AxisSpec massAxis{200, 0.9f, 1.2f, "mass"}; + const AxisSpec eventAxis{1000000, 0.5f, 1000000.5f, "event"}; + + if (cfgDataHists) { + + JEhistos.add("h_track_pt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", kTH1F, {{200, 0., 200.}}); + JEhistos.add("h_track_eta", "track #eta;#eta_{track};entries", kTH1F, {{100, -1.f, 1.f}}); + JEhistos.add("h_track_phi", "track #varphi;#varphi_{track};entries", kTH1F, {{80, -1.f, 7.f}}); + JEhistos.add("nJetsPerEvent", "nJetsPerEvent", kTH1F, {{10, 0.0, 10.0}}); + JEhistos.add("FJetaHistogram", "FJetaHistogram", kTH1F, {axisEta}); + JEhistos.add("FJphiHistogram", "FJphiHistogram", kTH1F, {axisPhi}); + JEhistos.add("FJptHistogram", "FJptHistogram", kTH1F, {axisPt}); + JEhistos.add("hDCArToPv", "DCArToPv", kTH1F, {{300, 0.0, 3.0}}); + JEhistos.add("hDCAzToPv", "DCAzToPv", kTH1F, {{300, 0.0, 3.0}}); + JEhistos.add("rawpT", "rawpT", kTH1F, {{1000, 0.0, 10.0}}); + JEhistos.add("rawDpT", "rawDpT", kTH2F, {{1000, 0.0, 10.0}, {300, -1.5, 1.5}}); + JEhistos.add("hIsPrim", "hIsPrim", kTH1F, {{2, -0.5, +1.5}}); + JEhistos.add("hIsGood", "hIsGood", kTH1F, {{2, -0.5, +1.5}}); + JEhistos.add("hIsPrimCont", "hIsPrimCont", kTH1F, {{2, -0.5, +1.5}}); + JEhistos.add("hFindableTPCClusters", "hFindableTPCClusters", kTH1F, {{200, 0, 200}}); + JEhistos.add("hFindableTPCRows", "hFindableTPCRows", kTH1F, {{200, 0, 200}}); + JEhistos.add("hClustersVsRows", "hClustersVsRows", kTH1F, {{200, 0, 2}}); + JEhistos.add("hTPCChi2", "hTPCChi2", kTH1F, {{200, 0, 100}}); + JEhistos.add("hITSChi2", "hITSChi2", kTH1F, {{200, 0, 100}}); + JEhistos.add("etaHistogram", "etaHistogram", kTH1F, {axisEta}); + JEhistos.add("phiHistogram", "phiHistogram", kTH1F, {axisPhi}); + JEhistos.add("ptHistogram", "ptHistogram", kTH1F, {axisPt}); + JEhistos.add("V0Counts", "V0Counts", kTH1F, {{10, 0, 10}}); + JEhistos.add("hUSS_1D", "hUSS_1D", kTH1F, {MinvAxis}); + JEhistos.add("hPt", "hPt", {HistType::kTH1F, {{100, 0.0f, 10.0f}}}); + JEhistos.add("hMassVsPtLambda", "hMassVsPtLambda", {HistType::kTH2F, {{100, 0.0f, 10.0f}, {200, 1.016f, 1.216f}}}); + JEhistos.add("hMassVsPtAntiLambda", "hMassVsPtAntiLambda", {HistType::kTH2F, {{100, 0.0f, 10.0f}, {200, 1.016f, 1.216f}}}); + JEhistos.add("hMassLambda", "hMassLambda", {HistType::kTH1F, {{200, 0.9f, 1.2f}}}); + JEhistos.add("hMassAntiLambda", "hMassAntiLambda", {HistType::kTH1F, {{200, 0.9f, 1.2f}}}); + JEhistos.add("V0Radius", "V0Radius", {HistType::kTH1D, {{100, 0.0f, 20.0f}}}); + JEhistos.add("CosPA", "CosPA", {HistType::kTH1F, {{100, 0.9f, 1.0f}}}); + JEhistos.add("V0DCANegToPV", "V0DCANegToPV", {HistType::kTH1F, {{100, -1.0f, 1.0f}}}); + JEhistos.add("V0DCAPosToPV", "V0DCAPosToPV", {HistType::kTH1F, {{100, -1.0f, 1.0f}}}); + JEhistos.add("V0DCAV0Daughters", "V0DCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.20f}}}); + JEhistos.add("TPCNSigmaPosPi", "TPCNSigmaPosPi", {HistType::kTH1F, {{100, -10.0f, 10.0f}}}); + JEhistos.add("TPCNSigmaNegPi", "TPCNSigmaNegPi", {HistType::kTH1F, {{100, -10.0f, 10.0f}}}); + JEhistos.add("TPCNSigmaPosPr", "TPCNSigmaPosPr", {HistType::kTH1F, {{100, -10.0f, 10.0f}}}); + JEhistos.add("TPCNSigmaNegPr", "TPCNSigmaNegPr", {HistType::kTH1F, {{100, -10.0f, 10.0f}}}); + JEhistos.add("hNEvents", "hNEvents", {HistType::kTH1I, {{10, 0.f, 10.f}}}); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "all"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "sel8"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(3, "TVX"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(4, "zvertex"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(5, "TFBorder"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "ITSROFBorder"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(7, "isTOFVertexMatched"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(8, "isGoodZvtxFT0vsPV"); + JEhistos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(9, "Applied selected"); + registry.add("hNEventsJet", "hNEventsJet", {HistType::kTH1I, {{4, 0.f, 4.f}}}); + registry.get(HIST("hNEventsJet"))->GetXaxis()->SetBinLabel(1, "all"); + registry.get(HIST("hNEventsJet"))->GetXaxis()->SetBinLabel(2, "zvertex"); + registry.get(HIST("hNEventsJet"))->GetXaxis()->SetBinLabel(3, "JCollisionSel::sel8"); + JEhistos.add("v0Lambdapx", "v0Lambdapx", kTH1F, {axisPx}); + JEhistos.add("v0Lambdapy", "v0Lambdapy", kTH1F, {axisPy}); + JEhistos.add("v0Lambdapz", "v0Lambdapz", kTH1F, {axisPz}); + JEhistos.add("v0AntiLambdapx", "v0AntiLambdapx", kTH1F, {axisPx}); + JEhistos.add("v0AntiLambdapy", "v0AntiLambdapy", kTH1F, {axisPy}); + JEhistos.add("v0AntiLambdapz", "v0AntiLambdapz", kTH1F, {axisPz}); + JEhistos.add("jetpx", "jetpx", kTH1F, {axisPx}); + JEhistos.add("jetpy", "jetpy", kTH1F, {axisPy}); + JEhistos.add("jetpz", "jetpz", kTH1F, {axisPz}); + JEhistos.add("hV0Lambda", "V0Lambda", + {HistType::kTHnSparseF, {eventAxis, axisPx, axisPy, axisPz, massAxis, axisPx, axisPy, axisPz}}); + JEhistos.add("EventIndexselection", "EventIndexselection", {HistType::kTH1F, {{1000000, 0.5f, 1000000.5f}}}); + } + eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(cfgeventSelections)); + trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + } // end of init + + double massPi = o2::constants::physics::MassPiMinus; + double massPr = o2::constants::physics::MassProton; + using DauTracks = soa::Join; + using EventCandidates = soa::Join; // , aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs + using TrackCandidates = soa::Join; + using JCollisions = soa::Join; + using V0Collisions = soa::Join; + + Filter jetCuts = aod::jet::pt > cfgjetPtMin&& aod::jet::r == nround(cfgjetR.node() * 100.0f); + template + bool TrackSelection(const TrackType track) + { + // basic track cuts + if (track.pt() < cfgtrkMinPt) + return false; + + if (std::abs(track.eta()) > cfgtrkMaxEta) + return false; + + if (std::abs(track.dcaXY()) > cfgMaxDCArToPVcut) + return false; + + if (std::abs(track.dcaZ()) > cfgMaxDCAzToPVcut) + return false; + + if (cfgPrimaryTrack && !track.isPrimaryTrack()) + return false; + + if (track.tpcNClsFindable() < cfgnFindableTPCClusters) + return false; + + if (track.tpcNClsCrossedRows() < cfgnTPCCrossedRows) + return false; + + if (track.tpcCrossedRowsOverFindableCls() > cfgnRowsOverFindable) + return false; + + if (track.tpcChi2NCl() > cfgnTPCChi2) + return false; + + if (track.itsChi2NCl() > cfgnITSChi2) + return false; + + if (cfgConnectedToPV && !track.isPVContributor()) + return false; + + return true; + }; + + template + bool trackPIDPion(const T& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + if (std::abs(candidate.tpcNSigmaPi()) < cfgnTPCPID) + tpcPIDPassed = true; + + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cfgnTOFPID) { + tofPIDPassed = true; + } + } else { + tofPIDPassed = true; + } + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + + template + bool trackPIDProton(const T& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + if (std::abs(candidate.tpcNSigmaPr()) < cfgnTPCPID) + tpcPIDPassed = true; + + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPr()) < cfgnTOFPID) { + tofPIDPassed = true; + } + } else { + tofPIDPassed = true; + } + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + + // Single-Track Selection + template + bool passedSingleTrackSelection(const Track& track) + { + if (requireITS && (!track.hasITS())) + return false; + if (requireITS && track.itsNCls() < minITSnCls) + return false; + if (!track.hasTPC()) + return false; + if (track.tpcNClsFound() < minTPCnClsFound) + return false; + if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) + return false; + if (track.tpcChi2NCl() > maxChi2TPC) + return false; + if (track.eta() < etaMin || track.eta() > etaMax) + return false; + if (requireTOF && (!track.hasTOF())) + return false; + return true; + } + // Lambda Selections + template + bool passedLambdaSelection(const Lambda& v0, const TrackPos& ptrack, const TrackNeg& ntrack) + { + + // Single-Track Selections + if (requirepassedSingleTrackSelection && !passedSingleTrackSelection(ptrack)) + return false; + if (requirepassedSingleTrackSelection && !passedSingleTrackSelection(ntrack)) + return false; + + if (v0.v0radius() < minimumV0Radius || v0.v0cosPA() < v0cospa || + TMath::Abs(ptrack.eta()) > etaMax || + TMath::Abs(ntrack.eta()) > etaMax) { + return false; + } + if (TMath::Abs(v0.dcanegtopv()) < dcanegtopv) + return false; + if (TMath::Abs(v0.dcapostopv()) < dcapostopv) + return false; + if (v0.dcaV0daughters() > dcav0dau) + return false; + + // PID Selections (TPC) + if (requireTPC) { + if (ptrack.tpcNSigmaPr() < nsigmaTPCmin || ptrack.tpcNSigmaPr() > nsigmaTPCmax) + return false; + if (ntrack.tpcNSigmaPi() < nsigmaTPCmin || ntrack.tpcNSigmaPi() > nsigmaTPCmax) + return false; + } + + if (requireTOF) { + if (ptrack.tofNSigmaPr() < nsigmaTOFmin || ptrack.tofNSigmaPr() > nsigmaTOFmax) + return false; + if (ntrack.tofNSigmaPi() < nsigmaTOFmin || ntrack.tofNSigmaPi() > nsigmaTOFmax) + return false; + } + + TLorentzVector lorentzVect; + lorentzVect.SetXYZM(v0.px(), v0.py(), v0.pz(), 1.115683); + + if (lorentzVect.Rapidity() < yMin || lorentzVect.Rapidity() > yMax) { + return false; + } + + if (TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < v0rejLambda) { + return false; + } + if (TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) > 0.075) { + return false; + } + + return true; + } + // AntiLambda Selections + template + bool passedAntiLambdaSelection(const AntiLambda& v0, const TrackPos& ptrack, const TrackNeg& ntrack) + { + // Single-Track Selections + if (requirepassedSingleTrackSelection && !passedSingleTrackSelection(ptrack)) + return false; + if (requirepassedSingleTrackSelection && !passedSingleTrackSelection(ntrack)) + return false; + + if (v0.v0radius() < minimumV0Radius || v0.v0cosPA() < v0cospa || + TMath::Abs(ptrack.eta()) > etaMax || + TMath::Abs(ntrack.eta()) > etaMax) { + return false; + } + + if (TMath::Abs(v0.dcanegtopv()) < dcanegtopv) // + return false; + if (TMath::Abs(v0.dcapostopv()) < dcapostopv) // + return false; + if (v0.dcaV0daughters() > dcav0dau) // + return false; + // PID Selections (TOF) + if (requireTOF) { + if (ptrack.tofNSigmaPi() < nsigmaTOFmin || ptrack.tofNSigmaPi() > nsigmaTOFmax) + return false; + if (ntrack.tofNSigmaPr() < nsigmaTOFmin || ntrack.tofNSigmaPr() > nsigmaTOFmax) + return false; + } + if (requireTPC) { + if (ptrack.tpcNSigmaPi() < nsigmaTPCmin || ptrack.tpcNSigmaPi() > nsigmaTPCmax) + return false; + if (ntrack.tpcNSigmaPr() < nsigmaTPCmin || ntrack.tpcNSigmaPr() > nsigmaTPCmax) + return false; + } + + TLorentzVector lorentzVect; + lorentzVect.SetXYZM(v0.px(), v0.py(), v0.pz(), 1.115683); + if (lorentzVect.Rapidity() < yMin || lorentzVect.Rapidity() > yMax) { + return false; + } + + if (TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < v0rejLambda) { + return false; + } + if (TMath::Abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) > 0.075) { + return false; + } + return true; + } + ///////Event selection + template + bool AcceptEvent(TCollision const& collision) + { + if (sel8 && !collision.sel8()) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 1.5); + + if (isTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 2.5); + + if (iscutzvertex && TMath::Abs(collision.posZ()) > cutzvertex) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 3.5); + + if (isNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return false; + } + + JEhistos.fill(HIST("hNEvents"), 4.5); + + if (isNoITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 5.5); + if (isVertexTOFmatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 6.5); + if (isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + JEhistos.fill(HIST("hNEvents"), 7.5); + + return true; + } + // Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > dcapostopv&&nabs(aod::v0data::dcanegtopv) > dcanegtopv&& aod::v0data::dcaV0daughters < dcaV0DaughtersMax; + + int nEventsJet = 0; + void processJetTracks(JCollisions::iterator const& collision, soa::Filtered> const& chargedjets, soa::Join const& tracks, TrackCandidates const&) + { + + registry.fill(HIST("hNEventsJet"), 0.5); + if (fabs(collision.posZ()) > cfgVtxCut) { + + return; + } + registry.fill(HIST("hNEventsJet"), 1.5); + + if (!jetderiveddatautilities::selectCollision(collision, jetderiveddatautilities::JCollisionSel::sel8)) { + + return; + } + registry.fill(HIST("hNEventsJet"), 2.5); + outputCollisions(collision.posZ()); + + for (auto const& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + + auto originalTrack = track.track_as>(); + JEhistos.fill(HIST("hDCArToPv"), originalTrack.dcaXY()); + JEhistos.fill(HIST("hDCAzToPv"), originalTrack.dcaZ()); + JEhistos.fill(HIST("rawpT"), originalTrack.pt()); + JEhistos.fill(HIST("rawDpT"), track.pt(), track.pt() - originalTrack.pt()); + JEhistos.fill(HIST("hIsPrim"), originalTrack.isPrimaryTrack()); + JEhistos.fill(HIST("hIsGood"), originalTrack.isGlobalTrackWoDCA()); + JEhistos.fill(HIST("hIsPrimCont"), originalTrack.isPVContributor()); + JEhistos.fill(HIST("hFindableTPCClusters"), originalTrack.tpcNClsFindable()); + JEhistos.fill(HIST("hFindableTPCRows"), originalTrack.tpcNClsCrossedRows()); + JEhistos.fill(HIST("hClustersVsRows"), originalTrack.tpcCrossedRowsOverFindableCls()); + JEhistos.fill(HIST("hTPCChi2"), originalTrack.tpcChi2NCl()); + JEhistos.fill(HIST("hITSChi2"), originalTrack.itsChi2NCl()); + JEhistos.fill(HIST("h_track_pt"), track.pt()); + JEhistos.fill(HIST("h_track_eta"), track.eta()); + JEhistos.fill(HIST("h_track_phi"), track.phi()); + + if (track.pt() < cfgtrkMinPt && std::abs(track.eta()) > cfgtrkMaxEta) { + continue; + } + JEhistos.fill(HIST("ptHistogram"), track.pt()); + JEhistos.fill(HIST("etaHistogram"), track.eta()); + JEhistos.fill(HIST("phiHistogram"), track.phi()); + } + int nJets = 0; + int lastindex = 0; + int collisionId = 0; + float maxJetpx = 0; + float maxJetpy = 0; + float maxJetpz = 0; + float maxJetpT = 0; + float maxJetPt = -999; + nEventsJet++; + for (auto chargedjet : chargedjets) { + JEhistos.fill(HIST("FJetaHistogram"), chargedjet.eta()); + JEhistos.fill(HIST("FJphiHistogram"), chargedjet.phi()); + JEhistos.fill(HIST("FJptHistogram"), chargedjet.pt()); + + JEhistos.fill(HIST("jetpx"), chargedjet.px()); + JEhistos.fill(HIST("jetpy"), chargedjet.py()); + JEhistos.fill(HIST("jetpz"), chargedjet.pz()); + + myTableJet(outputCollisions.lastIndex(), chargedjet.collisionId(), chargedjet.px(), chargedjet.py(), chargedjet.pz(), chargedjet.pt()); + + nJets++; + if (chargedjet.pt() > maxJetPt) { + maxJetpx = chargedjet.px(); + maxJetpy = chargedjet.py(); + maxJetpz = chargedjet.pz(); + maxJetpT = chargedjet.pt(); + collisionId = chargedjet.collisionId(); + lastindex = outputCollisions.lastIndex(); + } + } + if (maxJetpT > 0) { + myTableLeadingJet(lastindex, collisionId, maxJetpx, maxJetpy, maxJetpz, maxJetpT); + } + + ////// + + JEhistos.fill(HIST("nJetsPerEvent"), nJets); + } + PROCESS_SWITCH(myAnalysis, processJetTracks, "process JE Framework", true); + int nEventsV0 = 0; + + void processV0(V0Collisions::iterator const& collision, aod::V0Datas const& V0s, TrackCandidates const&) + { + nEventsV0++; + JEhistos.fill(HIST("hNEvents"), 0.5); + if (!AcceptEvent(collision)) { + return; + } + JEhistos.fill(HIST("hNEvents"), 8.5); + int V0NumbersPerEvent = 0; + int V0LambdaNumbers = 0; + outputCollisionsV0(collision.posX()); + for (auto& v0 : V0s) { + float ctauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float ctauAntiLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0Bar; + + const auto& pos = v0.posTrack_as(); + const auto& neg = v0.negTrack_as(); + V0NumbersPerEvent = V0NumbersPerEvent + 1; + if (passedLambdaSelection(v0, pos, neg) && ctauLambda < CtauLambda) { + JEhistos.fill(HIST("hPt"), v0.pt()); + JEhistos.fill(HIST("V0Radius"), v0.v0radius()); + JEhistos.fill(HIST("CosPA"), v0.v0cosPA()); + JEhistos.fill(HIST("V0DCANegToPV"), v0.dcanegtopv()); + JEhistos.fill(HIST("V0DCAPosToPV"), v0.dcapostopv()); + JEhistos.fill(HIST("V0DCAV0Daughters"), v0.dcaV0daughters()); + } + + if (passedLambdaSelection(v0, pos, neg) && ctauAntiLambda < CtauLambda) { + + V0LambdaNumbers = V0LambdaNumbers + 1; + JEhistos.fill(HIST("hMassVsPtLambda"), v0.pt(), v0.mLambda()); + JEhistos.fill(HIST("hMassLambda"), v0.mLambda()); + JEhistos.fill(HIST("TPCNSigmaPosPr"), pos.tpcNSigmaPr()); + JEhistos.fill(HIST("TPCNSigmaNegPi"), neg.tpcNSigmaPi()); + + JEhistos.fill(HIST("v0Lambdapx"), v0.px()); + JEhistos.fill(HIST("v0Lambdapy"), v0.py()); + JEhistos.fill(HIST("v0Lambdapz"), v0.pz()); + myTable(outputCollisionsV0.lastIndex(), v0.collisionId(), v0.px(), v0.py(), v0.pz(), v0.pt(), v0.mLambda(), pos.px(), pos.py(), pos.pz()); + JEhistos.fill(HIST("hV0Lambda"), nEventsV0, v0.px(), v0.py(), v0.pz(), v0.mLambda(), pos.px(), pos.py(), pos.pz()); + } + + if (passedAntiLambdaSelection(v0, pos, neg)) { + + JEhistos.fill(HIST("hMassVsPtAntiLambda"), v0.pt(), v0.mAntiLambda()); + JEhistos.fill(HIST("hMassAntiLambda"), v0.mAntiLambda()); + JEhistos.fill(HIST("TPCNSigmaPosPi"), pos.tpcNSigmaPi()); + JEhistos.fill(HIST("TPCNSigmaNegPr"), neg.tpcNSigmaPr()); + + JEhistos.fill(HIST("v0AntiLambdapx"), v0.px()); + JEhistos.fill(HIST("v0AntiLambdapy"), v0.py()); + JEhistos.fill(HIST("v0AntiLambdapz"), v0.pz()); + } + } + JEhistos.fill(HIST("V0Counts"), V0NumbersPerEvent); + } + PROCESS_SWITCH(myAnalysis, processV0, "processV0", true); +}; +///////////////////////////// +struct LfMyV0s { + HistogramRegistry registry{"registry"}; + void init(InitContext const&) + { + + const AxisSpec axisPx{100, -10, 10, "#px (GeV/c)"}; + const AxisSpec axisPy{100, -10, 10, "#py (GeV/c)"}; + const AxisSpec axisPz{100, -10, 10, "#pz (GeV/c)"}; + const AxisSpec axisPT{200, 0, 50, "#p_{T} (GeV/c)"}; + const AxisSpec axisPhi{100, -3.14, 3.14, "#Phi"}; + + registry.add("hMassLambda", "hMassLambda", {HistType::kTH1F, {{200, 0.9f, 1.2f}}}); + registry.add("V0pTInLab", "V0pTInLab", kTH1F, {axisPT}); + registry.add("hMassVsPtLambda", "hMassVsPtLambda", {HistType::kTH2F, {{100, 0.0f, 10.0f}, {200, 1.016f, 1.216f}}}); + + registry.add("V0pxInLab", "V0pxInLab", kTH1F, {axisPx}); + registry.add("V0pyInLab", "V0pyInLab", kTH1F, {axisPy}); + registry.add("V0pzInLab", "V0pzInLab", kTH1F, {axisPz}); + + registry.add("V0pxInRest_frame", "V0pxInRest_frame", kTH1F, {axisPx}); + registry.add("V0pyInRest_frame", "V0pyInRest_frame", kTH1F, {axisPy}); + registry.add("V0pzInRest_frame", "V0pzInRest_frame", kTH1F, {axisPz}); + + registry.add("JetpxInLab", "JetpxInLab", kTH1F, {axisPx}); + registry.add("JetpyInLab", "JetpyInLab", kTH1F, {axisPy}); + registry.add("JetpzInLab", "JetpzInLab", kTH1F, {axisPz}); + registry.add("JetpTInLab", "JetpTInLab", kTH1F, {axisPT}); + + registry.add("LeadingJetpx", "LeadingJetpx", kTH1F, {axisPx}); + registry.add("LeadingJetpy", "LeadingJetpy", kTH1F, {axisPy}); + registry.add("LeadingJetpz", "LeadingJetpz", kTH1F, {axisPz}); + registry.add("LeadingJetpT", "LeadingJetpT", kTH1F, {axisPT}); + + registry.add("V0protonpxInLab", "V0protonpxInLab", kTH1F, {axisPx}); + registry.add("V0protonpyInLab", "V0protonpyInLab", kTH1F, {axisPy}); + registry.add("V0protonpzInLab", "V0protonpzInLab", kTH1F, {axisPz}); + registry.add("V0protonphiInLab", "V0protonphiInLab", kTH1F, {axisPhi}); + + registry.add("V0protonpxInRest_frame", "V0protonpxInRest_frame", kTH1F, {axisPx}); + registry.add("V0protonpyInRest_frame", "V0protonpyInRest_frame", kTH1F, {axisPy}); + registry.add("V0protonpzInRest_frame", "V0protonpzInRest_frame", kTH1F, {axisPz}); + registry.add("V0protonphiInRest_frame", "V0protonphiInRest_frame", kTH1F, {axisPhi}); + + registry.add("V0protonpxInJetV0frame", "V0protonpxInJetV0frame", kTH1F, {axisPx}); + registry.add("V0protonpyInJetV0frame", "V0protonpyInJetV0frame", kTH1F, {axisPy}); + registry.add("V0protonpzInJetV0frame", "V0protonpzInJetV0frame", kTH1F, {axisPz}); + registry.add("V0protonphiInJetV0frame", "V0protonphiInJetV0frame", kTH1F, {axisPhi}); + + registry.add("hLambdamassandSinPhi", "V0protonphiInJetV0frame", kTH2F, {{200, 0.9, 1.2}, {200, -1, 1}}); + registry.add("profile", "Invariant Mass vs sin(phi)", {HistType::kTProfile, {{200, 0.9, 1.2}}}); + } + double massPr = o2::constants::physics::MassProton; + double massLambda = o2::constants::physics::MassLambda; + + TMatrixD LorentzTransInV0frame(double ELambda, double Lambdapx, double Lambdapy, double Lambdapz) + { + double PLambda = sqrt(Lambdapx * Lambdapx + Lambdapy * Lambdapy + Lambdapz * Lambdapz); + double LambdaMass = sqrt(ELambda * ELambda - PLambda * PLambda); + double Alpha = 1 / (LambdaMass * (ELambda + LambdaMass)); + TMatrixD matrixLabToLambda(4, 4); + matrixLabToLambda(0, 0) = ELambda / LambdaMass; + matrixLabToLambda(0, 1) = -Lambdapx / LambdaMass; + matrixLabToLambda(0, 2) = -Lambdapy / LambdaMass; + matrixLabToLambda(0, 3) = -Lambdapz / LambdaMass; + matrixLabToLambda(1, 0) = -Lambdapx / LambdaMass; + matrixLabToLambda(1, 1) = 1 + Alpha * Lambdapx * Lambdapx; + matrixLabToLambda(1, 2) = Alpha * Lambdapx * Lambdapy; + matrixLabToLambda(1, 3) = Alpha * Lambdapx * Lambdapz; + matrixLabToLambda(2, 0) = -Lambdapy / LambdaMass; + matrixLabToLambda(2, 1) = Alpha * Lambdapy * Lambdapx; + matrixLabToLambda(2, 2) = 1 + Alpha * Lambdapy * Lambdapy; + matrixLabToLambda(2, 3) = Alpha * Lambdapy * Lambdapz; + matrixLabToLambda(3, 0) = -Lambdapz / LambdaMass; + matrixLabToLambda(3, 1) = Alpha * Lambdapz * Lambdapx; + matrixLabToLambda(3, 2) = Alpha * Lambdapz * Lambdapy; + matrixLabToLambda(3, 3) = 1 + Alpha * Lambdapz * Lambdapz; + return matrixLabToLambda; + } + TMatrixD MyTMatrixTranslationToJet(double Jetpx, double Jetpy, double Jetpz, double Lambdapx, double Lambdapy, double Lambdapz) + { + TVector3 UnitX(1.0, 0.0, 0.0); + TVector3 UnitY(0.0, 1.0, 0.0); + TVector3 UnitZ(0.0, 0.0, 1.0); + TVector3 JetP(Jetpx, Jetpy, Jetpz); + TVector3 V0LambdaP(Lambdapx, Lambdapy, Lambdapz); + TVector3 JetCrossV0 = (JetP.Cross(V0LambdaP)); + TVector3 YinJet = (JetCrossV0).Cross(JetP); + TVector3 UnitXInJet = JetP.Unit(); + TVector3 UnitYInJet = YinJet.Unit(); + TVector3 UnitZInJet = JetCrossV0.Unit(); + TMatrixD matrixLabToJet(4, 4); + matrixLabToJet(0, 0) = 1.12; + matrixLabToJet(0, 1) = 0.0; + matrixLabToJet(0, 2) = 0.0; + matrixLabToJet(0, 3) = 0.0; + matrixLabToJet(1, 0) = 0.0; + matrixLabToJet(1, 1) = UnitXInJet * UnitX; + matrixLabToJet(1, 2) = UnitXInJet * UnitY; + matrixLabToJet(1, 3) = UnitXInJet * UnitZ; + matrixLabToJet(2, 0) = 0.0; + matrixLabToJet(2, 1) = UnitYInJet * UnitX; + matrixLabToJet(2, 2) = UnitYInJet * UnitY; + matrixLabToJet(2, 3) = UnitYInJet * UnitZ; + matrixLabToJet(3, 0) = 0.0; + matrixLabToJet(3, 1) = UnitZInJet * UnitX; + matrixLabToJet(3, 2) = UnitZInJet * UnitY; + matrixLabToJet(3, 3) = UnitZInJet * UnitZ; + return matrixLabToJet; + } + + int N = 0; + int JetNumbers = 0; + void processJetV0Analysis(aod::MyCollision const& collision, aod::MyTable const& myv0s, aod::MyTableJet const& myJets) + { + int JetNumbers = 0; + + for (auto& candidate : myv0s) { + registry.fill(HIST("hMassLambda"), candidate.v0Lambdamass()); + registry.fill(HIST("V0pTInLab"), candidate.v0pt()); + registry.fill(HIST("hMassVsPtLambda"), candidate.v0pt(), candidate.v0Lambdamass()); + registry.fill(HIST("V0pxInLab"), candidate.v0px()); + registry.fill(HIST("V0pyInLab"), candidate.v0py()); + registry.fill(HIST("V0pzInLab"), candidate.v0pz()); + registry.fill(HIST("V0protonpxInLab"), candidate.v0protonpx()); + registry.fill(HIST("V0protonpyInLab"), candidate.v0protonpy()); + registry.fill(HIST("V0protonpzInLab"), candidate.v0protonpz()); + + double protonsinPhiInLab = candidate.v0protonpy() / sqrt(candidate.v0protonpx() * candidate.v0protonpx() + candidate.v0protonpy() * candidate.v0protonpy()); + registry.fill(HIST("V0protonphiInLab"), protonsinPhiInLab); + + double PLambda = sqrt(candidate.v0px() * candidate.v0px() + candidate.v0py() * candidate.v0py() + candidate.v0pz() * candidate.v0pz()); + double ELambda = sqrt(candidate.v0Lambdamass() * candidate.v0Lambdamass() + PLambda * PLambda); + TMatrixD pLabV0(4, 1); + pLabV0(0, 0) = ELambda; + pLabV0(1, 0) = candidate.v0px(); + pLabV0(2, 0) = candidate.v0py(); + pLabV0(3, 0) = candidate.v0pz(); + TMatrixD V0InV0(4, 1); + V0InV0 = LorentzTransInV0frame(ELambda, candidate.v0px(), candidate.v0py(), candidate.v0pz()) * pLabV0; + registry.fill(HIST("V0pxInRest_frame"), V0InV0(1, 0)); + registry.fill(HIST("V0pyInRest_frame"), V0InV0(2, 0)); + registry.fill(HIST("V0pzInRest_frame"), V0InV0(3, 0)); + } + for (auto& candidate : myv0s) { + + double PLambda = sqrt(candidate.v0px() * candidate.v0px() + candidate.v0py() * candidate.v0py() + candidate.v0pz() * candidate.v0pz()); + double ELambda = sqrt(candidate.v0Lambdamass() * candidate.v0Lambdamass() + PLambda * PLambda); + + TMatrixD pLabproton(4, 1); + double protonE = sqrt(0.938 * 0.938 + candidate.v0protonpx() * candidate.v0protonpx() + candidate.v0protonpy() * candidate.v0protonpy() + candidate.v0protonpz() * candidate.v0protonpz()); + pLabproton(0, 0) = protonE; + pLabproton(1, 0) = candidate.v0protonpx(); + pLabproton(2, 0) = candidate.v0protonpy(); + pLabproton(3, 0) = candidate.v0protonpz(); + TMatrixD protonInV0(4, 1); + protonInV0 = LorentzTransInV0frame(ELambda, candidate.v0px(), candidate.v0py(), candidate.v0pz()) * pLabproton; + registry.fill(HIST("V0protonpxInRest_frame"), protonInV0(1, 0)); + registry.fill(HIST("V0protonpyInRest_frame"), protonInV0(2, 0)); + registry.fill(HIST("V0protonpzInRest_frame"), protonInV0(3, 0)); + double protonsinPhiInV0frame = protonInV0(2, 0) / sqrt(protonInV0(1, 0) * protonInV0(1, 0) + protonInV0(2, 0) * protonInV0(2, 0)); + registry.fill(HIST("V0protonphiInRest_frame"), protonsinPhiInV0frame); + } + + for (auto& Jet : myJets) { + JetNumbers++; + registry.fill(HIST("JetpxInLab"), Jet.jetpx()); + registry.fill(HIST("JetpyInLab"), Jet.jetpy()); + registry.fill(HIST("JetpzInLab"), Jet.jetpz()); + registry.fill(HIST("JetpTInLab"), Jet.jetpt()); + } + } + + PROCESS_SWITCH(LfMyV0s, processJetV0Analysis, "processJetV0Analysis", true); + // aod::MyTableJet + void processLeadingJetV0Analysis(aod::MyCollision const& collision, aod::MyTable const& myv0s, aod::MyTableLeadingJet const& myleadingJets) + { + int JetNumbers = 0; + + for (auto& candidate : myv0s) { + for (auto& LeadingJet : myleadingJets) { + if (candidate.mycollisionv0() == LeadingJet.mycollisionleadingjet()) { + double PLambda = sqrt(candidate.v0px() * candidate.v0px() + candidate.v0py() * candidate.v0py() + candidate.v0pz() * candidate.v0pz()); + double ELambda = sqrt(candidate.v0Lambdamass() * candidate.v0Lambdamass() + PLambda * PLambda); + TMatrixD pLabproton(4, 1); + double protonE = sqrt(massPr * massPr + candidate.v0protonpx() * candidate.v0protonpx() + candidate.v0protonpy() * candidate.v0protonpy() + candidate.v0protonpz() * candidate.v0protonpz()); + pLabproton(0, 0) = protonE; + pLabproton(1, 0) = candidate.v0protonpx(); + pLabproton(2, 0) = candidate.v0protonpy(); + pLabproton(3, 0) = candidate.v0protonpz(); + TMatrixD protonInJetV0(4, 1); + protonInJetV0 = LorentzTransInV0frame(ELambda, candidate.v0px(), candidate.v0py(), candidate.v0pz()) * MyTMatrixTranslationToJet(LeadingJet.leadingjetpx(), LeadingJet.leadingjetpy(), LeadingJet.leadingjetpz(), candidate.v0px(), candidate.v0py(), candidate.v0pz()) * pLabproton; + registry.fill(HIST("V0protonpxInJetV0frame"), protonInJetV0(1, 0)); + registry.fill(HIST("V0protonpyInJetV0frame"), protonInJetV0(2, 0)); + registry.fill(HIST("V0protonpzInJetV0frame"), protonInJetV0(3, 0)); + + double protonsinPhiInJetV0frame = protonInJetV0(2, 0) / sqrt(protonInJetV0(1, 0) * protonInJetV0(1, 0) + protonInJetV0(2, 0) * protonInJetV0(2, 0)); + registry.fill(HIST("V0protonphiInJetV0frame"), protonsinPhiInJetV0frame); + registry.fill(HIST("hLambdamassandSinPhi"), candidate.v0Lambdamass(), protonsinPhiInJetV0frame); + registry.fill(HIST("profile"), candidate.v0Lambdamass(), protonsinPhiInJetV0frame); + } + } + } + for (auto& LeadingJet : myleadingJets) { + registry.fill(HIST("LeadingJetpx"), LeadingJet.leadingjetpx()); + registry.fill(HIST("LeadingJetpy"), LeadingJet.leadingjetpy()); + registry.fill(HIST("LeadingJetpz"), LeadingJet.leadingjetpz()); + registry.fill(HIST("LeadingJetpT"), LeadingJet.leadingjetpt()); + } + } + PROCESS_SWITCH(LfMyV0s, processLeadingJetV0Analysis, "processLeadingJetV0Analysis", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + }; +} From c806d9a2e6ef18774045c57274781adde22bb9e0 Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:07:31 +0800 Subject: [PATCH 2/3] Update CMakeLists.txt --- PWGLF/Tasks/Strangeness/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/CMakeLists.txt b/PWGLF/Tasks/Strangeness/CMakeLists.txt index 839b94a14fd..3c70877da20 100644 --- a/PWGLF/Tasks/Strangeness/CMakeLists.txt +++ b/PWGLF/Tasks/Strangeness/CMakeLists.txt @@ -128,3 +128,8 @@ o2physics_add_dpl_workflow(lambdalambda SOURCES lambdalambda.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lambdajetpolarization + SOURCES lambdaJetpolarization.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From f24dd191c7813ded87be3593a62ad2a5c5b9218f Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:09:23 +0800 Subject: [PATCH 3/3] Add files via upload --- PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx b/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx index 09d1b5c1e58..4372bc1d21a 100644 --- a/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaJetpolarization.cxx @@ -750,7 +750,7 @@ struct LfMyV0s { TVector3 UnitYInJet = YinJet.Unit(); TVector3 UnitZInJet = JetCrossV0.Unit(); TMatrixD matrixLabToJet(4, 4); - matrixLabToJet(0, 0) = 1.12; + matrixLabToJet(0, 0) = 1; matrixLabToJet(0, 1) = 0.0; matrixLabToJet(0, 2) = 0.0; matrixLabToJet(0, 3) = 0.0; @@ -808,7 +808,7 @@ struct LfMyV0s { double ELambda = sqrt(candidate.v0Lambdamass() * candidate.v0Lambdamass() + PLambda * PLambda); TMatrixD pLabproton(4, 1); - double protonE = sqrt(0.938 * 0.938 + candidate.v0protonpx() * candidate.v0protonpx() + candidate.v0protonpy() * candidate.v0protonpy() + candidate.v0protonpz() * candidate.v0protonpz()); + double protonE = sqrt(massPr * massPr + candidate.v0protonpx() * candidate.v0protonpx() + candidate.v0protonpy() * candidate.v0protonpy() + candidate.v0protonpz() * candidate.v0protonpz()); pLabproton(0, 0) = protonE; pLabproton(1, 0) = candidate.v0protonpx(); pLabproton(2, 0) = candidate.v0protonpy();