From 7f2189e8d4d6942bb34ce66437d0358b2fa0b787 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 00:16:40 +0530 Subject: [PATCH 01/23] MeanpTFluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 4 +- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 1173 -------------- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 1383 +++++++++++++++++ 3 files changed, 1385 insertions(+), 1175 deletions(-) delete mode 100644 PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx create mode 100644 PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 1dd4e544331..ee21f820c35 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -34,8 +34,8 @@ o2physics_add_dpl_workflow(antiproton-cumulants-mc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(identified-meanpt-fluctuations - SOURCES IdentifiedMeanPtFluctuations.cxx +o2physics_add_dpl_workflow(event-meanpt-id + SOURCES eventMeanPtId.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx deleted file mode 100644 index 2217a2c1f4f..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ /dev/null @@ -1,1173 +0,0 @@ -// 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 Sweta Singh (sweta.singh@cern.ch) - -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/Core/trackUtilities.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" -#include "CommonConstants/MathConstants.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" -#include "TDatabasePDG.h" -#include -#include "Common/CCDB/TriggerAliases.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace std; - -namespace o2::aod -{ - -using MyCollisions = soa::Join; -using MyTracks = soa::Join; - -using MyMCRecoCollisions = soa::Join; - -using MyMCRecoTracks = soa::Join; - -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod - -double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); -double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); -double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); - -struct IdentifiedMeanPtFluctuations { - - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - - void init(o2::framework::InitContext&) - { - AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; - AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; - AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {400, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; - AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; - AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; - AxisSpec etaAxis = {100, -1.5, 1.5, "#eta"}; - AxisSpec nSigmaTPCAxis = {170, -8.5, 8.5, "n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {170, -8.5, 8.5, "n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; - // AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; - AxisSpec centAxis = {100, 0., 100., "centrality"}; - AxisSpec subAxis = {30, 0., 30., "sample"}; - AxisSpec nchAxis = {4000, 0., 4000., "nch"}; - AxisSpec varAxis1 = {400, 0., 4., "var1"}; - AxisSpec varAxis2 = {400, 0., 4., "var2"}; - AxisSpec Chi2Axis = {100, 0., 100., "Chi2"}; - AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; - AxisSpec Counter = {10, 0., 10., "events"}; - - // QA Plots - histos.add("hEventCounter", "event counts", kTH1D, {Counter}); - - auto h = histos.add("tracksel", "tracksel", HistType::kTH1D, {{10, 0.5, 10.5}}); - h->GetXaxis()->SetBinLabel(1, "Tracks read"); - h->GetXaxis()->SetBinLabel(2, "Global track passed"); - h->GetXaxis()->SetBinLabel(3, "DCAxy passed"); - h->GetXaxis()->SetBinLabel(4, "DCAz passed"); - h->GetXaxis()->SetBinLabel(5, "Eta-cut passed"); - h->GetXaxis()->SetBinLabel(6, "pT-cut passed"); - h->GetXaxis()->SetBinLabel(7, "TPC crossed rows passed"); - h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); - h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); - - histos.add("hEventCounter_recMC", "event counts rec MC", kTH1D, {Counter}); - - auto h_rec = histos.add("tracksel_rec", "tracksel_rec", HistType::kTH1D, {{10, 0.5, 10.5}}); - h_rec->GetXaxis()->SetBinLabel(1, "has_mcCollision() read"); - h_rec->GetXaxis()->SetBinLabel(2, "Vertex Z > 10cm passed"); - h_rec->GetXaxis()->SetBinLabel(3, "sel 8 passed"); - h_rec->GetXaxis()->SetBinLabel(4, "kNoSameBunchPileup passed"); - h_rec->GetXaxis()->SetBinLabel(5, "kNoITSROFrameBorder passed"); - h_rec->GetXaxis()->SetBinLabel(6, "klsGoodZvtxFT0vsPV passed"); - h_rec->GetXaxis()->SetBinLabel(7, "klsVertexITSTPC passed"); - - histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1D, {vtxZAxis}); - histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1D, {vtxZAxis}); - histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1D, {vtxZAxis}); - histos.add("hP", "hP", kTH1D, {pAxis}); - histos.add("hEta", ";hEta", kTH1D, {etaAxis}); - histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2D, - {pAxis, nSigmaTPCAxis}); - histos.add("hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); - histos.add("hDCAz", "hDCAz", kTH1D, {dcazAxis}); - - histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); - histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2D, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2D, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2D, {ptAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2D, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2D, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2D, {ptAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion_rec", "NSigamaTOFpion_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon_rec", "NSigamaTOFkaon_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton_rec", "NSigamaTOFproton_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion_rec", "NSigamaTPCTOFpion_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon_rec", "NSigamaTPCTOFkaon_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton_rec", "NSigamaTPCTOFproton_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCpion_rec_bf_sel", "NSigamaTPCpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon_rec_bf_sel", "NSigamaTPCkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton_rec_bf_sel", "NSigamaTPCproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion_rec_bf_sel", "NSigamaTOFpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon_rec_bf_sel", "NSigamaTOFkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton_rec_bf_sel", "NSigamaTOFproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion_rec_bf_sel", "NSigamaTPCTOFpion_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon_rec_bf_sel", "NSigamaTPCTOFkaon_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton_rec_bf_sel", "NSigamaTPCTOFproton_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - - histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); - histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); - histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); - //=====================rapidity===================================== - histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", kTH1D, {etaAxis}); - histos.add("hyProton", ";hyProton", kTH1D, {etaAxis}); - - histos.add("hPtCh", "hPtCh", kTH2D, {nchAxis, ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2D, {nchAxis, ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2D, {nchAxis, ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2D, {nchAxis, ptAxis}); - - histos.add("hPtCent", "hPtCent", kTH2D, {centAxis, ptAxis}); - histos.add("hPtCentPion", "hPtCentPion", kTH2D, {centAxis, ptAxis}); - histos.add("hPtCentKaon", "hPtCentKaon", kTH2D, {centAxis, ptAxis}); - histos.add("hPtCentProton", "hPtCentProton", kTH2D, {centAxis, ptAxis}); - - histos.add("hMeanPtCh", "hMeanPtCh", kTH2D, {nchAxis, ptAxis}); - histos.add("hCent", "hCent", kTH2D, {nchAxis, centAxis}); - - histos.add("hVar1", "hVar1", kTH2D, {subAxis, centAxis}); - histos.add("hVar2", "hVar2", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanpt", "hVar2meanpt", kTH2D, {centAxis, varAxis2}); - histos.add("hVar", "hVar", kTH2D, {subAxis, centAxis}); - histos.add("hVarc", "hVarc", kTH2D, {subAxis, centAxis}); - - histos.add("hVar1pi", "hVar1pi", kTH2D, {subAxis, centAxis}); - histos.add("hVar2pi", "hVar2pi", kTH2D, {subAxis, centAxis}); - histos.add("hVarpi", "hVarpi", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanptpi", "hVar2meanptpi", kTH2D, {centAxis, varAxis2}); - - histos.add("hVar1k", "hVar1k", kTH2D, {subAxis, centAxis}); - histos.add("hVar2k", "hVar2k", kTH2D, {subAxis, centAxis}); - histos.add("hVark", "hVark", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanptk", "hVar2meanptk", kTH2D, {centAxis, varAxis2}); - - histos.add("hVar1p", "hVar1p", kTH2D, {subAxis, centAxis}); - histos.add("hVar2p", "hVar2p", kTH2D, {subAxis, centAxis}); - histos.add("hVarp", "hVarp", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanptp", "hVar2meanptp", kTH2D, {centAxis, varAxis2}); - - //--------------------------------nch---------------------------------- - histos.add("hVar1x", "hVar1x", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x", "hVar2x", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx", "hVarx", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptx", "hVar2meanptx", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1pix", "hVar1pix", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2pix", "hVar2pix", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpix", "hVarpix", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpix", "hVar2meanptpix", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1kx", "hVar1kx", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2kx", "hVar2kx", kTH2D, {subAxis, nchAxis}); - histos.add("hVarkx", "hVarkx", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptkx", "hVar2meanptkx", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1px", "hVar1px", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2px", "hVar2px", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpx", "hVarpx", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); - - histos.add("ht", "ht", kTH1D, {centAxis}); - - histos.add("hCentrality", "hCentrality", kTH1D, {centAxis}); - - histos.add("hPEta", "hPEta", kTH2D, {pAxis, etaAxis}); - histos.add("hPtEta", "hPtEta", kTH2D, {ptAxis, etaAxis}); - histos.add("hPy", "hPy", kTH2D, {pAxis, etaAxis}); - histos.add("hPty", "hPty", kTH2D, {ptAxis, etaAxis}); - - histos.add("hPtyPion", "hPtyPion", kTH2D, {ptAxis, etaAxis}); - histos.add("hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); - histos.add("hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); - - histos.add("hPtyPion_rec", "hPtyPion_rec", kTH2D, {ptAxis, etaAxis}); - histos.add("hPtyKaon_rec", "hPtyKaon_rec", kTH2D, {ptAxis, etaAxis}); - histos.add("hPtyProton_rec", "hPtyProton_rec", kTH2D, {ptAxis, etaAxis}); - - histos.add("hPyPion_rec", "hPyPion_rec", kTH2D, {pAxis, etaAxis}); - histos.add("hPyKaon_rec", "hPyKaon_rec", kTH2D, {pAxis, etaAxis}); - histos.add("hPyProton_rec", "hPyProton_rec", kTH2D, {pAxis, etaAxis}); - - histos.add("hTOFbeta", "hTOFbeta", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx", "hdEdx", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hTOFbeta_afterselection", "hTOFbeta_afterselection", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_afterselection", "hdEdx_afterselection", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_afterselection1", "hdEdx_afterselection1", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hTOFbeta_afterselection_rec_afterpidcut", "hTOFbeta_afterselection_rec_afterpidcut", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_afterselection_rec_afterpidcut", "hdEdx_afterselection_rec_afterpidcut", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hTOFbeta_afterselection_rec_beforepidcut", "hTOFbeta_afterselection_rec_beforepidcut", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_afterselection_rec_beforepidcut", "hdEdx_afterselection_rec_beforepidcut", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hdEdx_rec_bf_anycut", "hdEdx_rec_bf_anycut", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); - histos.add("hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); - histos.add("hTPCCrossedrows_before", "Crossed TPC rows", kTH1D, {CrossedrowTPCAxis}); - - histos.add("hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); - histos.add("hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); - histos.add("hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {CrossedrowTPCAxis}); - - //--------------------------------nch---------------------------------- - histos.add("hVar1x_rec", "hVar1x_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x_rec", "hVar2x_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_rec", "hVarx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptx_rec", "hVar2meanptx_rec", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1pix_rec", "hVar1pix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2pix_rec", "hVar2pix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpix_rec", "hVarpix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpix_rec", "hVar2meanptpix_rec", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1kx_rec", "hVar1kx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2kx_rec", "hVar2kx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarkx_rec", "hVarkx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptkx_rec", "hVar2meanptkx_rec", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1px_rec", "hVar1px_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2px_rec", "hVar2px_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpx_rec", "hVarpx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpx_rec", "hVar2meanptpx_rec", kTH2D, {nchAxis, varAxis2}); - - //=======================MC histograms Generated ================================================ - histos.add("ptHistogram_allcharge_gen", "ptHistogram_allcharge_gen", kTH1D, {ptAxis}); - histos.add("ptHistogramPion", "ptHistogramPion", kTH1D, {ptAxis}); - histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); - histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); - - histos.add("hMC_Pt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - histos.add("MC_hZvtx_after_sel", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {vtxZAxis}); - - histos.add("hTOFbeta_gen_pion", "hTOFbeta_gen_pion", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_gen_pion", "hdEdx_gen_pion", kTH2D, {pAxis, dEdxAxis}); - - histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptx_gen", "hVar2meanptx_gen", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1pix_gen", "hVar1pix_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2pix_gen", "hVar2pix_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpix_gen", "hVarpix_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpix_gen", "hVar2meanptpix_gen", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1kx_gen", "hVar1kx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2kx_gen", "hVar2kx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVarkx_gen", "hVarkx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptkx_gen", "hVar2meanptkx_gen", kTH2D, {nchAxis, varAxis2}); - - histos.add("hVar1px_gen", "hVar1px_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2px_gen", "hVar2px_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpx_gen", "hVarpx_gen", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); - - //========================MC Histograms Reconstructed================================================= - - histos.add("hZvtx_after_sel_rec", "hZvtx_after_sel_rec", kTH1D, {vtxZAxis}); - histos.add("hZvtx_after_sel8_rec", "hZvtx_after_sel8_rec", kTH1D, {vtxZAxis}); - - histos.add("ptHistogram_allcharge_rec", "ptHistogram_allcharge_rec", kTH1D, {ptAxis}); - histos.add("ptHistogramPionrec", "ptHistogramPionrec", kTH1D, {ptAxis}); - histos.add("ptHistogramKaonrec", "ptHistogramKaonrec", kTH1D, {ptAxis}); - histos.add("ptHistogramProtonrec", "ptHistogramProtonrec", kTH1D, {ptAxis}); - - histos.add("ptHistogramPionrec_purity", "ptHistogramPionrec_purity", kTH1D, {ptAxis}); - histos.add("ptHistogramKaonrec_purity", "ptHistogramKaonrec_purity", kTH1D, {ptAxis}); - histos.add("ptHistogramProtonrec_purity", "ptHistogramProtonrec_purity", kTH1D, {ptAxis}); - - histos.add("ptHistogramPionrec_pdg", "ptHistogramPionrec_pdg", kTH1D, {ptAxis}); - histos.add("ptHistogramKaonrec_pdg", "ptHistogramKaonrec_pdg", kTH1D, {ptAxis}); - histos.add("ptHistogramProtonrec_pdg", "ptHistogramProtonrec_pdg", kTH1D, {ptAxis}); - - histos.add("Histogram_mass2_p_rec_beforesel", "Histogram_mass2_p_rec_beforesel", kTH1D, {ptAxis}); - histos.add("Histogram_mass2_p_rec_aftersel", "Histogram_mass2_p_rec_aftersel", kTH1D, {ptAxis}); - } - - //++++++++++++++++++++++++Monte Carlo Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - template - void SelTPConlyPions(const T& track1) - { - (track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0)); - } - template - void SelTPConlyKaons(const T& track1) - { - (track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0)); - } - template - void SelTPConlyProtons(const T& track1) - { - (track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0)); - } - - template - void SelTPCTOFPions(const T& track1) - { - (track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((track1.tofNSigmaPr() + 2) / 3.0, (track1.tpcNSigmaPr() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaKa() + 2) / 3.0, (track1.tpcNSigmaKa() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaPi() + 2) / 3.0, (track1.tpcNSigmaPi() - 6) / 4.0) < 3.); - } - - template - void SelTPCTOFKaons(const T& track1) - { - (track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((track1.tofNSigmaPr() + 2) / 3.0, (track1.tpcNSigmaPr() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaPi() + 2) / 3.0, (track1.tpcNSigmaPi() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaKa() + 2) / 3.0, (track1.tpcNSigmaKa() - 6) / 4.0) < 3.); - } - - template - void SelTPCTOFProtons(const T& track1) - { - if (track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((track1.tofNSigmaPi() + 2) / 3.0, (track1.tpcNSigmaPi() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaKa() + 2) / 3.0, (track1.tpcNSigmaKa() - 6) / 4.0) > 3. && TMath::Hypot((track1.tofNSigmaPr() + 2) / 3.0, (track1.tpcNSigmaPr() - 6) / 4.0) < 3.) { - }; - } - - void processMCReco(aod::MyMCRecoCollisions::iterator const& mccoll, aod::MyMCRecoTracks const& mcrectrack, aod::McParticles const& /*mcParticles*/) - { - if (!mccoll.has_mcCollision()) { - return; - } - histos.fill(HIST("tracksel_rec"), 1); - - if (fabs(mccoll.posZ()) > 10.f) { - return; - } - histos.fill(HIST("hZvtx_after_sel_rec"), mccoll.posZ()); - - histos.fill(HIST("tracksel_rec"), 2); - - if (!mccoll.sel8()) { - return; - } - - histos.fill(HIST("hZvtx_after_sel8_rec"), mccoll.posZ()); - - histos.fill(HIST("tracksel_rec"), 3); - - if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - return; - } - histos.fill(HIST("tracksel_rec"), 4); - - if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - return; - } - histos.fill(HIST("tracksel_rec"), 5); - - if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return; - } - histos.fill(HIST("tracksel_rec"), 6); - - if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - return; - } - histos.fill(HIST("tracksel_rec"), 7); - - double nCh_rec = 0.; - double nChpi_rec = 0.; - double nChk_rec = 0.; - double nChp_rec = 0.; - - double Q1_rec = 0, Q2_rec = 0; - double Q1pi_rec = 0, Q2pi_rec = 0; - double Q1k_rec = 0, Q2k_rec = 0; - double Q1p_rec = 0, Q2p_rec = 0; - double var1_rec = 0, var2_rec = 0; - double var1pi_rec = 0, var2pi_rec = 0; - double var1k_rec = 0, var2k_rec = 0; - double var1p_rec = 0, var2p_rec = 0; - - int sample_rec = histos.get(HIST("hZvtx_after_sel8_rec"))->GetEntries(); - sample_rec = sample_rec % 30; - - for (auto track1 : mcrectrack) { - if (!(track1.has_collision())) - continue; - if (!(track1.has_mcParticle())) - continue; - if (!(track1.mcParticle().isPhysicalPrimary())) - continue; - if (!track1.isGlobalTrack()) - continue; - - if (!(track1.pt() > 0.15) || !(track1.pt() < 2.0)) - continue; // pt = 0.15 - if (!(track1.eta() > -0.8) || !(track1.eta() < 0.8)) - continue; // eta cut - - nCh_rec += 1.; - - Q1_rec += track1.pt(); - Q2_rec += (track1.pt() * track1.pt()); - - histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); - - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); - - //======================================================================== - - if (abs(track1.mcParticle().pdgCode()) == 211) { - - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); - } - if (abs(track1.mcParticle().pdgCode()) == 321) { - - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); - } - if (abs(track1.mcParticle().pdgCode()) == 2212) { - - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); - } - - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) - continue; - - //============Reconstructed MC=================PIONS selection==============================================================// - - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) - histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track1.p(), track1.beta()); - - if (track1.hasTPC() && track1.hasTOF()) { - - histos.fill(HIST("NSigamaTPCpion_rec_bf_sel"), track1.p(), track1.tpcNSigmaPi()); - histos.fill(HIST("NSigamaTOFpion_rec_bf_sel"), track1.p(), track1.tofNSigmaPi()); - histos.fill(HIST("NSigamaTPCTOFpion_rec_bf_sel"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - } - - SelTPConlyPions(track1); // Pion (TPC only) - SelTPCTOFPions(track1); // Pion passes TPC and TOF both! - - { - - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); - - nChpi_rec += 1.; - Q1pi_rec += track1.pt(); - Q2pi_rec += (track1.pt() * track1.pt()); - - histos.fill(HIST("NSigamaTPCpion_rec"), track1.p(), track1.tpcNSigmaPi()); - histos.fill(HIST("NSigamaTOFpion_rec"), track1.p(), track1.tofNSigmaPi()); - histos.fill(HIST("NSigamaTPCTOFpion_rec"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - - if (track1.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); - - if (abs(track1.mcParticle().pdgCode()) == 211) { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); - } - - if (abs(track1.rapidity(massPi)) < 0.5) { - - histos.fill(HIST("hPyPion_rec"), track1.p(), track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track1.pt(), track1.rapidity(massPi)); - } - } - - //============Reconstructed MC=================KAONS selection==============================================================// - - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) - histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track1.p(), track1.beta()); - - if (track1.hasTPC() && track1.hasTOF()) { - - histos.fill(HIST("NSigamaTPCkaon_rec_bf_sel"), track1.p(), track1.tpcNSigmaKa()); - histos.fill(HIST("NSigamaTOFkaon_rec_bf_sel"), track1.p(), track1.tofNSigmaKa()); - histos.fill(HIST("NSigamaTPCTOFkaon_rec_bf_sel"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); - } - - SelTPConlyKaons(track1); // Kaons passes from TPC only! - SelTPCTOFKaons(track1); // Kaons passes from TPC and TOF both! - - { - - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); - - nChk_rec += 1.; - Q1k_rec += track1.pt(); - Q2k_rec += (track1.pt() * track1.pt()); - - histos.fill(HIST("NSigamaTPCkaon_rec"), track1.p(), track1.tpcNSigmaKa()); - histos.fill(HIST("NSigamaTOFkaon_rec"), track1.p(), track1.tofNSigmaKa()); - histos.fill(HIST("NSigamaTPCTOFkaon_rec"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); - - if (track1.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); - - if (abs(track1.mcParticle().pdgCode()) == 321) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); - } - - if (abs(track1.rapidity(massKa)) < 0.5) { - - histos.fill(HIST("hPyKaon_rec"), track1.p(), track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"), track1.pt(), track1.rapidity(massKa)); - } - } - - //============Reconstructed MC=================PROTONS selection==============================================================// - - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) - histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track1.p(), track1.beta()); - - if (track1.hasTPC() && track1.hasTOF()) { - - histos.fill(HIST("NSigamaTPCproton_rec_bf_sel"), track1.p(), track1.tpcNSigmaPr()); - histos.fill(HIST("NSigamaTOFproton_rec_bf_sel"), track1.p(), track1.tofNSigmaPr()); - histos.fill(HIST("NSigamaTPCTOFproton_rec_bf_sel"), track1.tpcNSigmaPr(), track1.tofNSigmaPr()); - } - - SelTPConlyProtons(track1); // Protons passes from TPC only! - SelTPCTOFProtons(track1); // Protons passes from TPC and TOF both! - - { - - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); - - nChp_rec += 1.; - Q1p_rec += track1.pt(); - Q2p_rec += (track1.pt() * track1.pt()); - - histos.fill(HIST("NSigamaTPCproton_rec"), track1.p(), track1.tpcNSigmaPr()); - histos.fill(HIST("NSigamaTOFproton_rec"), track1.p(), track1.tofNSigmaPr()); - histos.fill(HIST("NSigamaTPCTOFproton_rec"), track1.tpcNSigmaPr(), track1.tofNSigmaPr()); - - if (track1.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); - - if (abs(track1.mcParticle().pdgCode()) == 2212) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); - } - - if (abs(track1.rapidity(massPr)) < 0.5) { - - histos.fill(HIST("hPyProton_rec"), track1.p(), track1.rapidity(massPr)); - histos.fill(HIST("hPtyProton_rec"), track1.pt(), track1.rapidity(massPr)); - } - } - - //============================================================================ - - } // track loop ends - - if (nCh_rec < 2) - return; - - //------------------ all charges------------------------------------- - var1_rec = (Q1_rec * Q1_rec - Q2_rec) / (nCh_rec * (nCh_rec - 1)); - var2_rec = (Q1_rec / nCh_rec); - - //---------------------- pions ---------------------------------------- - - if (nChpi_rec > 2) { - var1pi_rec = (Q1pi_rec * Q1pi_rec - Q2pi_rec) / (nChpi_rec * (nChpi_rec - 1)); - var2pi_rec = (Q1pi_rec / nChpi_rec); - } - - //----------------------- kaons --------------------------------------- - if (nChk_rec > 2) { - var1k_rec = (Q1k_rec * Q1k_rec - Q2k_rec) / (nChk_rec * (nChk_rec - 1)); - var2k_rec = (Q1k_rec / nChk_rec); - } - - //---------------------------- protons ---------------------------------- - if (nChp_rec > 2) { - var1p_rec = (Q1p_rec * Q1p_rec - Q2p_rec) / (nChp_rec * (nChp_rec - 1)); - var2p_rec = (Q1p_rec / nChp_rec); - } - - //-----------------------nch------------------------------------- - histos.fill(HIST("hVar1x_rec"), sample_rec, nCh_rec, var1_rec); - histos.fill(HIST("hVar2x_rec"), sample_rec, nCh_rec, var2_rec); - histos.fill(HIST("hVarx_rec"), sample_rec, nCh_rec); - histos.fill(HIST("hVar2meanptx_rec"), nCh_rec, var2_rec); - - histos.fill(HIST("hVar1pix_rec"), sample_rec, nCh_rec, var1pi_rec); - histos.fill(HIST("hVar2pix_rec"), sample_rec, nCh_rec, var2pi_rec); - histos.fill(HIST("hVarpix_rec"), sample_rec, nChpi_rec); - histos.fill(HIST("hVar2meanptpix_rec"), nCh_rec, var2pi_rec); - - histos.fill(HIST("hVar1kx_rec"), sample_rec, nCh_rec, var1k_rec); - histos.fill(HIST("hVar2kx_rec"), sample_rec, nCh_rec, var2k_rec); - histos.fill(HIST("hVarkx_rec"), sample_rec, nChk_rec); - histos.fill(HIST("hVar2meanptkx_rec"), nCh_rec, var2k_rec); - - histos.fill(HIST("hVar1px_rec"), sample_rec, nCh_rec, var1p_rec); - histos.fill(HIST("hVar2px_rec"), sample_rec, nCh_rec, var2p_rec); - histos.fill(HIST("hVarpx_rec"), sample_rec, nChp_rec); - histos.fill(HIST("hVar2meanptpx_rec"), nCh_rec, var2p_rec); - - } // ends - - PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCReco, "process reconstructed information", true); - - //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) - - { - - if (fabs(mcCollision.posZ()) > 10.f) { - return; - } - histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - - double nCh_gen = 0.; - double nChpi_gen = 0.; - double nChk_gen = 0.; - double nChp_gen = 0.; - - double Q1_gen = 0, Q2_gen = 0; - double Q1pi_gen = 0, Q2pi_gen = 0; - double Q1k_gen = 0, Q2k_gen = 0; - double Q1p_gen = 0, Q2p_gen = 0; - - double var1_gen = 0, var2_gen = 0; - double var1pi_gen = 0, var2pi_gen = 0; - double var1k_gen = 0, var2k_gen = 0; - double var1p_gen = 0, var2p_gen = 0; - - int sample_gen = histos.get(HIST("hZvtx_after_sel"))->GetEntries(); - sample_gen = sample_gen % 30; - - for (auto& mcgentrack : mcParticles) - - { - auto pdgcode = std::abs(mcgentrack.pdgCode()); - if (!(mcgentrack.has_mcCollision())) - continue; - if (!(mcgentrack.isPhysicalPrimary())) - continue; - if (!(mcgentrack.pt() > 0.15) || !(mcgentrack.pt() < 2.)) - continue; - if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) - continue; - - nCh_gen += 1.; - - Q1_gen += mcgentrack.pt(); - Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); - - histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - - if (pdgcode == 211) { - - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - - if (pdgcode == 321) { - - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - - if (pdgcode == 2212) { - - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); - - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - - //================================= Pion Generated Calculation ==================================== - - } // track loop ends! - - if (nCh_gen < 2) - return; - - //------------------ all charges------------------------------------- - var1_gen = (Q1_gen * Q1_gen - Q2_gen) / (nCh_gen * (nCh_gen - 1)); - var2_gen = (Q1_gen / nCh_gen); - - //---------------------- pions ---------------------------------------- - - if (nChpi_gen > 2) { - var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); - var2pi_gen = (Q1pi_gen / nChpi_gen); - } - - //----------------------- kaons --------------------------------------- - if (nChk_gen > 2) { - var1k_gen = (Q1k_gen * Q1k_gen - Q2k_gen) / (nChk_gen * (nChk_gen - 1)); - var2k_gen = (Q1k_gen / nChk_gen); - } - - //---------------------------- protons ---------------------------------- - if (nChp_gen > 2) { - var1p_gen = (Q1p_gen * Q1p_gen - Q2p_gen) / (nChp_gen * (nChp_gen - 1)); - var2p_gen = (Q1p_gen / nChp_gen); - } - - //-----------------------nch------------------------------------- - histos.fill(HIST("hVar1x_gen"), sample_gen, nCh_gen, var1_gen); - histos.fill(HIST("hVar2x_gen"), sample_gen, nCh_gen, var2_gen); - histos.fill(HIST("hVarx_gen"), sample_gen, nCh_gen); - histos.fill(HIST("hVar2meanptx_gen"), nCh_gen, var2_gen); - - histos.fill(HIST("hVar1pix_gen"), sample_gen, nCh_gen, var1pi_gen); - histos.fill(HIST("hVar2pix_gen"), sample_gen, nCh_gen, var2pi_gen); - histos.fill(HIST("hVarpix_gen"), sample_gen, nChpi_gen); - histos.fill(HIST("hVar2meanptpix_gen"), nCh_gen, var2pi_gen); - - histos.fill(HIST("hVar1kx_gen"), sample_gen, nCh_gen, var1k_gen); - histos.fill(HIST("hVar2kx_gen"), sample_gen, nCh_gen, var2k_gen); - histos.fill(HIST("hVarkx_gen"), sample_gen, nChk_gen); - histos.fill(HIST("hVar2meanptkx_gen"), nCh_gen, var2k_gen); - - histos.fill(HIST("hVar1px_gen"), sample_gen, nCh_gen, var1p_gen); - histos.fill(HIST("hVar2px_gen"), sample_gen, nCh_gen, var2p_gen); - histos.fill(HIST("hVarpx_gen"), sample_gen, nChp_gen); - histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen, var2p_gen); - } - PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated information", true); - - //+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - - { - histos.fill(HIST("hEventCounter"), 1.); - - histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); - if (fabs(coll.posZ()) > 10.f) { - return; - } - - histos.fill(HIST("hEventCounter"), 2.); - - histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - - if (!coll.sel8()) { - return; - } - histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); - - histos.fill(HIST("hEventCounter"), 3.); - - const auto cent = coll.centFT0C(); - histos.fill(HIST("hCentrality"), cent); - - double nCh = 0.; - double nChpi = 0.; - double nChk = 0.; - double nChp = 0.; - - double Q1 = 0., Q2 = 0.; - double Q1pi = 0., Q2pi = 0.; - double Q1k = 0., Q2k = 0.; - double Q1p = 0., Q2p = 0.; - double var1 = 0., var2 = 0., twopar_allcharge = 0.; - double var1pi = 0., var2pi = 0.; - double var1k = 0., var2k = 0.; - double var1p = 0., var2p = 0.; - // cent = 0; - - // sampling - int sample = histos.get(HIST("hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - - // Perfroming the track selection========================================== - for (auto track : inputTracks) { - // Loop over tracks - - // inital tracks - histos.fill(HIST("tracksel"), 1); - - histos.fill(HIST("hTPCchi2perCluster_before"), track.tpcChi2NCl()); - histos.fill(HIST("hITSchi2perCluster_before"), track.itsChi2NCl()); - histos.fill(HIST("hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - - // tracks passed after GlobalTrackcut - if (!track.isGlobalTrack()) - continue; - histos.fill(HIST("tracksel"), 2); - - // tracks passed after DCAxy - // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes - histos.fill(HIST("tracksel"), 3); - - // tracks passed after DCAz - // - histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); - - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm - histos.fill(HIST("tracksel"), 4); - - // tracks passed after Eta-cut - if (!(fabs(track.eta()) < 0.8)) - continue; - histos.fill(HIST("tracksel"), 5); - - // tracks passed after pT-cut - if (!(track.pt() > 0.15 && track.pt() < 2.)) - continue; // pt = 0.15 - histos.fill(HIST("tracksel"), 6); - - // if (track.tpcNClsCrossedRows() < 70.0) continue; - histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); - histos.fill(HIST("tracksel"), 7); - - // if (track.tpcChi2NCl() > 4.0) continue; - histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); - histos.fill(HIST("tracksel"), 8); - - // if (track.itsChi2NCl() > 36.0) continue; - histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); - histos.fill(HIST("tracksel"), 9); - - nCh += 1.; - - Q1 += track.pt(); - Q2 += (track.pt() * track.pt()); - - histos.fill(HIST("hP"), track.p()); - histos.fill(HIST("hPt"), track.pt()); - histos.fill(HIST("hEta"), track.eta()); - histos.fill(HIST("hPtDCAxy"), track.pt(), track.dcaXY()); - histos.fill(HIST("hPtDCAz"), track.pt(), track.dcaZ()); - - histos.fill(HIST("hPtEta"), track.pt(), track.eta()); - histos.fill(HIST("hPEta"), track.p(), track.eta()); - - histos.fill(HIST("hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - - // only TPC tracks: Pion, Kaon, Proton - if (track.hasTPC() && abs(track.tpcNSigmaPi()) < 2.) - histos.fill(HIST("NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); - if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) - histos.fill(HIST("NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); - if (track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) - histos.fill(HIST("NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); - - // only TOF tracks: Pion, Kaon, Proton - if (track.hasTOF() && abs(track.tofNSigmaPi()) < 2.) - histos.fill(HIST("NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); - if (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.) - histos.fill(HIST("NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); - if (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.) - histos.fill(HIST("NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); - - if (track.hasTPC()) - histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); - if (track.hasTOF()) - histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - - //=============================pion============================================================== - // only TPC+TOF tracks: Pion, Kaon, Proton - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 2.)) { - histos.fill(HIST("NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - - histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); - } - - // pion-TPC----------------------------------------------------------------------------------- - - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massPi)) < 0.5) && (std::abs(track.tpcNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaKa()) > 2.0 && std::abs(track.tpcNSigmaPr()) > 2.0))) { - - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - histos.fill(HIST("hyPion"), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion"), track.pt(), track.rapidity(massPi)); - - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - // pion->(TPC+TOF)------------------------------------------------------------------------------------ - if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massPi)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0) && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.) { - - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - histos.fill(HIST("hyPion"), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion"), track.pt(), track.rapidity(massPi)); - - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - //===========================kaon=============================================================== - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) { - histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); - } - - if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massKa)) < 0.5) && (std::abs(track.tpcNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaPi()) > 2.0 && std::abs(track.tpcNSigmaPr()) > 2.0)) { - - histos.fill(HIST("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - histos.fill(HIST("hyKaon"), track.rapidity(massKa)); - histos.fill(HIST("hPtyKaon"), track.pt(), track.rapidity(massKa)); - - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massKa)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaPi()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0) && (abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - - histos.fill(HIST("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - histos.fill(HIST("hyKaon"), track.rapidity(massKa)); - histos.fill(HIST("hPtyKaon"), track.pt(), track.rapidity(massKa)); - - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - //============================proton=========================================================== - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) { - histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); - } - - if (track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() >= 0.4 && track.pt() < 0.85) && (abs(track.rapidity(massPr)) < 0.5) && (std::abs(track.tpcNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaKa()) > 2.0 && std::abs(track.tpcNSigmaPi()) > 2.0)) { - - histos.fill(HIST("hPtProton"), track.pt()); - histos.fill(HIST("hEtaProton"), track.eta()); - histos.fill(HIST("hyProton"), track.rapidity(massPr)); - histos.fill(HIST("hPtyProton"), track.pt(), track.rapidity(massPr)); - - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPi()) > 2.0) && (abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { - - histos.fill(HIST("hPtProton"), track.pt()); - histos.fill(HIST("hEtaProton"), track.eta()); - histos.fill(HIST("hyProton"), track.rapidity(massPr)); - histos.fill(HIST("hPtyProton"), track.pt(), track.rapidity(massPr)); - - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); - - if (track.beta() > 1) - continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - - //==================================================================================================== - } - // Track loop ends! - - if (nCh < 2) - return; - - //------------------ all charges------------------------------------- - var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), sample, cent, var1); - var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"), sample, cent, var2); - histos.fill(HIST("hVarc"), sample, cent); - histos.fill(HIST("hVar2meanpt"), cent, var2); - - twopar_allcharge = (var1 - var2); - histos.fill(HIST("hVar"), nCh, twopar_allcharge); - - //---------------------- pions ---------------------------------------- - - if (nChpi > 2) { - var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); - var2pi = (Q1pi / nChpi); - } - - //----------------------- kaons --------------------------------------- - if (nChk > 2) { - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - var2k = (Q1k / nChk); - } - - //---------------------------- protons ---------------------------------- - if (nChp > 2) { - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - var2p = (Q1p / nChp); - } - - //========================centrality========================================== - - histos.fill(HIST("hVar1pi"), sample, cent, var1pi); - histos.fill(HIST("hVar2pi"), sample, cent, var2pi); - histos.fill(HIST("hVar2meanptpi"), cent, var2pi); - - histos.fill(HIST("hVar1k"), sample, cent, var1k); - histos.fill(HIST("hVar2k"), sample, cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); - - histos.fill(HIST("hVar1p"), sample, cent, var1p); - histos.fill(HIST("hVar2p"), sample, cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); - - //-----------------------nch------------------------------------- - histos.fill(HIST("hVar1x"), sample, nCh, var1); - histos.fill(HIST("hVar2x"), sample, nCh, var2); - histos.fill(HIST("hVarx"), sample, nCh); - histos.fill(HIST("hVar2meanptx"), nCh, var2); - - histos.fill(HIST("hVar1pix"), sample, nCh, var1pi); - histos.fill(HIST("hVar2pix"), sample, nCh, var2pi); - histos.fill(HIST("hVarpix"), sample, nChpi); - histos.fill(HIST("hVar2meanptpix"), nCh, var2pi); - - histos.fill(HIST("hVar1kx"), sample, nCh, var1k); - histos.fill(HIST("hVar2kx"), sample, nCh, var2k); - histos.fill(HIST("hVarkx"), sample, nChk); - histos.fill(HIST("hVar2meanptkx"), nCh, var2k); - - histos.fill(HIST("hVar1px"), sample, nCh, var1p); - histos.fill(HIST("hVar2px"), sample, nCh, var2p); - histos.fill(HIST("hVarpx"), sample, nChp); - histos.fill(HIST("hVar2meanptpx"), nCh, var2p); - - } // event loop ends! - - PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", true); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; - return workflow; -} diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx new file mode 100644 index 00000000000..8ba34450ec6 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -0,0 +1,1383 @@ +// 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. +// +/// \file eventMeanPtId.cxx +/// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method +/// \author Sweta Singh (sweta.singh@cern.ch) + +#include +#include +#include +#include + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/Core/trackUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "CommonConstants/MathConstants.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" +#include +#include "Common/CCDB/TriggerAliases.h" +#include "CCDB/BasicCCDBManager.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "CommonConstants/PhysicsConstants.h" + +double massPi = o2::constants::physics::MassPionCharged; +double massKa = o2::constants::physics::MassKaonCharged; +double massPr = o2::constants::physics::MassProton; + +using namespace o2::constants::physics; +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace std; +using o2::constants::physics::Pdg; + +namespace o2::aod +{ +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + +using MyMCRecoCollisions = soa::Join; +using MyMCRecoCollision = MyMCRecoCollisions::iterator; + +using MyMCRecoTracks = soa::Join; +using MyMCRecoTrack = MyMCRecoTracks::iterator; + +using EventCandidatesMC = soa::Join; +using MyCollision = MyCollisions::iterator; +using MyTrack = MyTracks::iterator; +} // namespace o2::aod + +struct EventMeanPtId { + Service ccdb; + Service pdg; + + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; + Configurable cfgPathCCDB{"cfgPathCCDB", "Users/s/swsingh/My/Object/eff_Pb", "Path for ccdb-object"}; + Configurable cfgLoadEff{"cfgLoadEff", true, "Load efficiency"}; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + TH1D* ptHistogramAllchargeRec = nullptr; + TH1D* ptHistogramPionrec = nullptr; + TH1D* ptHistogramKaonrec = nullptr; + TH1D* ptHistogramProtonrec = nullptr; + TH1D* hRecoPi = nullptr; + TH1D* hRecoKa = nullptr; + TH1D* hRecoPr = nullptr; + TH2D* hPtyPion = nullptr; + TH2D* hPtyKaon = nullptr; + TH2D* hPtyProton = nullptr; + + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; + Configurable ptMin{"ptMin", 0.15, "minimum pT"}; + Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + + void init(o2::framework::InitContext&) + { + if (cfgLoadEff) { + // Set CCDB url + ccdb->setURL(cfgUrlCCDB.value); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + //ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + //LOGF(info, "Getting object %s", ccdbPath.value.data()); + + TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); + ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("ptHistogramAllchargeRec")); + ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); + ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); + ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); + hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); + hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); + hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); + hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); + hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); + hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); + + if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { + LOGF(info, "FATAL!! Could not find required histograms in CCDB"); + } + } + + std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; + // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; + AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; + AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; + AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; + AxisSpec etaAxis = {300, -1.5, 1.5, "#eta"}; // 300, -1.5, 1.5 + AxisSpec nSigmaTPCAxis = {170, -8.5, 8.5, "n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {170, -8.5, 8.5, "n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; + AxisSpec centAxis = {100, 0., 100., "centrality"}; + AxisSpec subAxis = {30, 0., 30., "sample"}; + AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + AxisSpec varAxis1 = {400, 0., 4., "var1"}; + AxisSpec varAxis2 = {400, 0., 4., "var2"}; + AxisSpec chi2Axis = {100, 0., 100., "Chi2"}; + AxisSpec crossedRowTpcAxis = {600, 0., 600., "TPC Crossed rows"}; + AxisSpec counter = {10, 0., 10., "events"}; + + // QA Plots + histos.add("hEventcounter", "event counts", kTH1D, {counter}); + auto h = histos.add("tracksel", "tracksel", HistType::kTH1D, {{10, 0.5, 10.5}}); + h->GetXaxis()->SetBinLabel(1, "Tracks read"); + h->GetXaxis()->SetBinLabel(2, "Global track passed"); + h->GetXaxis()->SetBinLabel(3, "DCAxy passed"); + h->GetXaxis()->SetBinLabel(4, "DCAz passed"); + h->GetXaxis()->SetBinLabel(5, "Eta-cut passed"); + h->GetXaxis()->SetBinLabel(6, "pT-cut passed"); + h->GetXaxis()->SetBinLabel(7, "TPC crossed rows passed"); + h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); + h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); + + histos.add("hEventcounter_recMC", "event counts rec MC", kTH1D, {counter}); + auto hRec = histos.add("trackSelRec", "trackSelRec", HistType::kTH1D, {{10, 0.5, 10.5}}); + hRec->GetXaxis()->SetBinLabel(1, "has_mcCollision() read"); + hRec->GetXaxis()->SetBinLabel(2, "Vertex Z > 10cm passed"); + hRec->GetXaxis()->SetBinLabel(3, "sel 8 passed"); + hRec->GetXaxis()->SetBinLabel(4, "kNoSameBunchPileup passed"); + hRec->GetXaxis()->SetBinLabel(5, "kNoITSROFrameBorder passed"); + hRec->GetXaxis()->SetBinLabel(6, "klsGoodZvtxFT0vsPV passed"); + hRec->GetXaxis()->SetBinLabel(7, "klsVertexITSTPC passed"); + + histos.add("Data/hZvtx_before_sel", "hZvtx_before_sel", kTH1D, {vtxZAxis}); + histos.add("Data/hZvtx_after_sel", "hZvtx_after_sel", kTH1D, {vtxZAxis}); + histos.add("Data/hZvtx_after_sel8", "hZvtx_after_sel8", kTH1D, {vtxZAxis}); + histos.add("Data/hP", "hP", kTH1D, {pAxis}); + histos.add("Data/hEta", ";hEta", kTH1D, {etaAxis}); + histos.add("Data/hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hNsigmaTPC", "hNsigmaTPC", kTH2D, {pAxis, nSigmaTPCAxis}); + histos.add("Data/hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); + histos.add("Data/hDCAz", "hDCAz", kTH1D, {dcazAxis}); + histos.add("Data/hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); + histos.add("Data/hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); + histos.add("Data/NSigamaTPCpion", "NSigamaTPCpion", kTH2D, {ptAxis, nSigmaTPCAxispid}); + histos.add("Data/NSigamaTPCkaon", "NSigamaTPCkaon", kTH2D, {ptAxis, nSigmaTPCAxispid}); + histos.add("Data/NSigamaTPCproton", "NSigamaTPCproton", kTH2D, {ptAxis, nSigmaTPCAxispid}); + histos.add("Data/NSigamaTOFpion", "NSigamaTOFpion", kTH2D, {ptAxis, nSigmaTOFAxispid}); + histos.add("Data/NSigamaTOFkaon", "NSigamaTOFkaon", kTH2D, {ptAxis, nSigmaTOFAxispid}); + histos.add("Data/NSigamaTOFproton", "NSigamaTOFproton", kTH2D, {ptAxis, nSigmaTOFAxispid}); + histos.add("Data/NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("Data/NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("Data/NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("Data/hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hEtaPion", ";hEta", kTH1D, {etaAxis}); + histos.add("Data/hEtaKaon", ";hEta", kTH1D, {etaAxis}); + histos.add("Data/hEtaProton", ";hEta", kTH1D, {etaAxis}); + histos.add("Data/hyPion", ";hyPion", kTH1D, {etaAxis}); + histos.add("Data/hyKaon", ";hyKaon", kTH1D, {etaAxis}); + histos.add("Data/hyProton", ";hyProton", kTH1D, {etaAxis}); + histos.add("Data/hPtCh", "hPtCh", kTH2D, {nchAxis, ptAxis}); + histos.add("Data/hPtChPion", "hPtChPion", kTH2D, {nchAxis, ptAxis}); + histos.add("Data/hPtChKaon", "hPtChKaon", kTH2D, {nchAxis, ptAxis}); + histos.add("Data/hPtChProton", "hPtChProton", kTH2D, {nchAxis, ptAxis}); + histos.add("Data/hPtCent", "hPtCent", kTH2D, {centAxis, ptAxis}); + histos.add("Data/hPtCentPion", "hPtCentPion", kTH2D, {centAxis, ptAxis}); + histos.add("Data/hPtCentKaon", "hPtCentKaon", kTH2D, {centAxis, ptAxis}); + histos.add("Data/hPtCentProton", "hPtCentProton", kTH2D, {centAxis, ptAxis}); + histos.add("Data/hMeanPtCh", "hMeanPtCh", kTH2D, {nchAxis, ptAxis}); + histos.add("Data/hCent", "hCent", kTH2D, {nchAxis, centAxis}); + + histos.add("Data/hVar1", "hVar1", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2", "hVar2", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2meanpt", "hVar2meanpt", kTH2D, {centAxis, varAxis2}); + histos.add("Data/hVar", "hVar", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVarc", "hVarc", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar1pi", "hVar1pi", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2pi", "hVar2pi", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVarpi", "hVarpi", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2meanptpi", "hVar2meanptpi", kTH2D, {centAxis, varAxis2}); + histos.add("Data/hVar1k", "hVar1k", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2k", "hVar2k", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVark", "hVark", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2meanptk", "hVar2meanptk", kTH2D, {centAxis, varAxis2}); + histos.add("Data/hVar1p", "hVar1p", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2p", "hVar2p", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVarp", "hVarp", kTH2D, {subAxis, centAxis}); + histos.add("Data/hVar2meanptp", "hVar2meanptp", kTH2D, {centAxis, varAxis2}); + + histos.add("Data/hnchAll", ";hnchAll", kTH1D, {nchAxis}); + histos.add("Data/hnchAll_bf_cut", ";hnchAll_bf_cut", kTH1D, {nchAxis}); + histos.add("Data/hnch", ";hnch", kTH1D, {nchAxis}); + histos.add("Data/hnchTrue", ";hnchTrue", kTH1D, {nchAxis}); + histos.add("Data/hnchTrue_pt", ";hnchTrue_pt", kTH1D, {nchAxis}); + + histos.add("Data/hVar1x", "hVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2x", "hVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVarx", "hVarx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2meanptx", "hVar2meanptx", kTH2D, {nchAxis, varAxis2}); + histos.add("Data/hVar1pix", "hVar1pix", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2pix", "hVar2pix", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVarpix", "hVarpix", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2meanptpix", "hVar2meanptpix", kTH2D, {nchAxis, varAxis2}); + histos.add("Data/hVar1kx", "hVar1kx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2kx", "hVar2kx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVarkx", "hVarkx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2meanptkx", "hVar2meanptkx", kTH2D, {nchAxis, varAxis2}); + histos.add("Data/hVar1px", "hVar1px", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2px", "hVar2px", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVarpx", "hVarpx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); + histos.add("Data/ht", "ht", kTH1D, {centAxis}); + histos.add("Data/hCentrality", "hCentrality", kTH1D, {centAxis}); + histos.add("Data/hPEta", "hPEta", kTH2D, {pAxis, etaAxis}); + histos.add("Data/hPtEta", "hPtEta", kTH2D, {ptAxis, etaAxis}); + histos.add("Data/hPy", "hPy", kTH2D, {pAxis, etaAxis}); + histos.add("Data/hPty", "hPty", kTH2D, {ptAxis, etaAxis}); + histos.add("Data/hPtyPion", "hPtyPion", kTH2D, {ptAxis, etaAxis}); + histos.add("Data/hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); + histos.add("Data/hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); + histos.add("Data/hTOFbeta", "hTOFbeta", kTH2D, {pAxis, betaAxis}); + histos.add("Data/hdEdx", "hdEdx", kTH2D, {pAxis, dEdxAxis}); + histos.add("Data/hTOFbeta_afterselection", "hTOFbeta_afterselection", kTH2D, {pAxis, betaAxis}); + histos.add("Data/hdEdx_afterselection", "hdEdx_afterselection", kTH2D, {pAxis, dEdxAxis}); + histos.add("Data/hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); + histos.add("Data/hdEdx_afterselection1", "hdEdx_afterselection1", kTH2D, {pAxis, dEdxAxis}); + histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCCrossedrows_before", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); + histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); + histos.add("Data/hdEdx_rec_bf_anycut", "hdEdx_rec_bf_anycut", kTH2D, {pAxis, dEdxAxis}); + histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); + + histos.addClone("Data/", "Rec/"); + // rec histograms + histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTOFpion_rec", "NSigamaTOFpion_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon_rec", "NSigamaTOFkaon_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton_rec", "NSigamaTOFproton_rec", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFpion_rec", "NSigamaTPCTOFpion_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon_rec", "NSigamaTPCTOFkaon_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton_rec", "NSigamaTPCTOFproton_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCpion_rec_bf_sel", "NSigamaTPCpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon_rec_bf_sel", "NSigamaTPCkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton_rec_bf_sel", "NSigamaTPCproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTOFpion_rec_bf_sel", "NSigamaTOFpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon_rec_bf_sel", "NSigamaTOFkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton_rec_bf_sel", "NSigamaTOFproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFpion_rec_bf_sel", "NSigamaTPCTOFpion_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon_rec_bf_sel", "NSigamaTPCTOFkaon_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton_rec_bf_sel", "NSigamaTPCTOFproton_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("hPtyPion_rec", "hPtyPion_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtyKaon_rec", "hPtyKaon_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtyProton_rec", "hPtyProton_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPyPion_rec", "hPyPion_rec", kTH2D, {pAxis, etaAxis}); + histos.add("hPyKaon_rec", "hPyKaon_rec", kTH2D, {pAxis, etaAxis}); + histos.add("hPyProton_rec", "hPyProton_rec", kTH2D, {pAxis, etaAxis}); + histos.add("hTOFbeta_afterselection_rec_afterpidcut", "hTOFbeta_afterselection_rec_afterpidcut", kTH2D, {pAxis, betaAxis}); + histos.add("hdEdx_afterselection_rec_afterpidcut", "hdEdx_afterselection_rec_afterpidcut", kTH2D, {pAxis, dEdxAxis}); + histos.add("hTOFbeta_afterselection_rec_beforepidcut", "hTOFbeta_afterselection_rec_beforepidcut", kTH2D, {pAxis, betaAxis}); + histos.add("hdEdx_afterselection_rec_beforepidcut", "hdEdx_afterselection_rec_beforepidcut", kTH2D, {pAxis, dEdxAxis}); + + histos.add("heffVar1x", "heffVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("heffVar2x", "heffVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("heffVarx", "heffVarx", kTH2D, {subAxis, nchAxis}); + histos.add("heffVar2meanptx", "heffVar2meanptx", kTH2D, {nchAxis, varAxis2}); + histos.add("hnchRec_all", ";hnchRec_all", kTH1D, {nchAxis}); + histos.add("hnchRec", ";hnchRec", kTH1D, {nchAxis}); + histos.add("hnchRec_true", ";hnchRec_true", kTH1D, {nchAxis}); + histos.add("hVar1x_rec_old", "hVar1x_rec_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2x_rec_old", "hVar2x_rec_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVarx_rec_old", "hVarx_rec_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVar1x_rec", "hVar1x_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2x_rec", "hVar2x_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVarx_rec", "hVarx_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptx_rec", "hVar2meanptx_rec", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1pix_rec", "hVar1pix_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2pix_rec", "hVar2pix_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVarpix_rec", "hVarpix_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptpix_rec", "hVar2meanptpix_rec", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1kx_rec", "hVar1kx_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2kx_rec", "hVar2kx_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVarkx_rec", "hVarkx_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptkx_rec", "hVar2meanptkx_rec", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1px_rec", "hVar1px_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2px_rec", "hVar2px_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVarpx_rec", "hVarpx_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptpx_rec", "hVar2meanptpx_rec", kTH2D, {nchAxis, varAxis2}); + histos.add("hZvtx_after_sel_rec", "hZvtx_after_sel_rec", kTH1D, {vtxZAxis}); + histos.add("hZvtx_after_sel8_rec", "hZvtx_after_sel8_rec", kTH1D, {vtxZAxis}); + histos.add("etaHistogram_allcharge_rec", "etaHistogram_allcharge_rec", kTH1D, {etaAxis}); + histos.add("ptHistogram_allcharge_bfptcut_rec", "ptHistogram_allcharge_bfptcut_rec", kTH1D, {ptAxis}); + histos.add("ptHistogramAllchargeRec", "ptHistogramAllchargeRec", kTH1D, {ptAxis}); + histos.add("ptHistogramPionrec", "ptHistogramPionrec", kTH1D, {ptAxis}); + histos.add("ptHistogramKaonrec", "ptHistogramKaonrec", kTH1D, {ptAxis}); + histos.add("ptHistogramProtonrec", "ptHistogramProtonrec", kTH1D, {ptAxis}); + histos.add("ptHistogramPionrec_purity", "ptHistogramPionrec_purity", kTH1D, {ptAxis}); + histos.add("ptHistogramKaonrec_purity", "ptHistogramKaonrec_purity", kTH1D, {ptAxis}); + histos.add("ptHistogramProtonrec_purity", "ptHistogramProtonrec_purity", kTH1D, {ptAxis}); + histos.add("ptHistogramPionrec_pdg", "ptHistogramPionrec_pdg", kTH1D, {ptAxis}); + histos.add("ptHistogramKaonrec_pdg", "ptHistogramKaonrec_pdg", kTH1D, {ptAxis}); + histos.add("ptHistogramProtonrec_pdg", "ptHistogramProtonrec_pdg", kTH1D, {ptAxis}); + histos.add("Histogram_mass2_p_rec_beforesel", "Histogram_mass2_p_rec_beforesel", kTH1D, {ptAxis}); + histos.add("Histogram_mass2_p_rec_aftersel", "Histogram_mass2_p_rec_aftersel", kTH1D, {ptAxis}); + histos.add("hEffVar1x", "hEffVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x", "hEffVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx", "hEffVarx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1pix", "hEffVar1pix", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2pix", "hEffVar2pix", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarpix", "hEffVarpix", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1kx", "hEffVar1kx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2kx", "hEffVar2kx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarkx", "hEffVarkx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1px", "hEffVar1px", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2px", "hEffVar2px", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarpx", "hEffVarpx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2Meanptx", "hEffVar2Meanptx", kTH2D, {nchAxis, varAxis2}); + histos.add("hEffVar2Meanptpix", "hEffVar2Meanptpix", kTH2D, {nchAxis, varAxis2}); + histos.add("hEffVar2Meanptkx", "hEffVar2Meanptkx", kTH2D, {nchAxis, varAxis2}); + histos.add("hEffVar2Meanptpx", "hEffVar2Meanptpx", kTH2D, {nchAxis, varAxis2}); + //=======================MC histograms Generated ================================================ + histos.add("ptHistogram_allcharge_gen", "ptHistogram_allcharge_gen", kTH1D, {ptAxis}); + histos.add("ptHistogramPion", "ptHistogramPion", kTH1D, {ptAxis}); + histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); + histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); + histos.add("hMC_Pt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("MC_hZvtx_after_sel", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {vtxZAxis}); + histos.add("hTOFbeta_gen_pion", "hTOFbeta_gen_pion", kTH2D, {pAxis, betaAxis}); + histos.add("hdEdx_gen_pion", "hdEdx_gen_pion", kTH2D, {pAxis, dEdxAxis}); + histos.add("hnch_gen_all", ";hnch_gen_all", kTH1D, {nchAxis}); + histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); + histos.add("hnch_gen_true", ";hnch_gen_true", kTH1D, {nchAxis}); + histos.add("hnch_gen_eta", ";hnch_gen_eta", kTH1D, {etaAxis}); + histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); + histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); + histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); + histos.add("hnch_pi", ";hnch_pi", kTH1D, {nchAxis}); + histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); + histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); + + histos.add("hVar1x_gen_old", "hVar1x_gen_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2x_gen_old", "hVar2x_gen_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVarx_gen_old", "hVarx_gen_old", kTH2D, {subAxis, nchAxis}); + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptx_gen", "hVar2meanptx_gen", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1pix_gen", "hVar1pix_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2pix_gen", "hVar2pix_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVarpix_gen", "hVarpix_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptpix_gen", "hVar2meanptpix_gen", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1kx_gen", "hVar1kx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2kx_gen", "hVar2kx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVarkx_gen", "hVarkx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptkx_gen", "hVar2meanptkx_gen", kTH2D, {nchAxis, varAxis2}); + histos.add("hVar1px_gen", "hVar1px_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2px_gen", "hVar2px_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVarpx_gen", "hVarpx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); + histos.add("hcent_nacc_rec", "hcent_nacc_rec", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_gen", "hcent_nacc_gen", kTH2D, {centAxis, nchAxis}); + histos.add("hGenCentrality", "hGenCentrality", kTH1D, {centAxis}); + histos.add("hVtxZ_before_gen", "", kTH1F, {vtxZAxis}); + histos.add("hVtxZ_after_gen", "", kTH1F, {vtxZAxis}); + histos.add("hEta_gen", "", kTH1F, {etaAxis}); + histos.add("hEta_rec", "", kTH1F, {etaAxis}); + histos.add("hPt_gen", "", kTH1F, {ptAxis}); + histos.add("hPt_rec", "", kTH1F, {ptAxis}); + } + // Configurables + Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 0.3, "DCA Z cut"}; + Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; + Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; + Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; + Configurable cItsChiCut{"cItsChiCut", 70, "ITS chi2 cluster cut"}; + Configurable cTpcChiCut{"cTpcChiCut", 70, "TPC chi2 cluster cut"}; + + // Event selections + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cTFBorder{"cTFBorder", true, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", true, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", true, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", true, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", true, "z-vtx time diff selection"}; + Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; + Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; + Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; + Configurable cfgRejEl{"cfgRejEl", true, "Rejected electrons"}; + + // PID selection configurables + Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; + Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; + Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; + Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; + Configurable cPionPthcut{"cPionPthcut", 0.65, "pion threshold cut of pion"}; + Configurable cKaonPthcut{"cKaonPthcut", 0.65, "kaon threshold cut of kaon"}; + Configurable cProtonPthcut{"cProtonPthcut", 1.0, "proton threshold cut of proton"}; + Configurable cNSigCut2{"cNSigCut2", 2.0, "nSigma cut (2)"}; + Configurable cNSigCut3{"cNSigCut3", 3.0, "nSigma cut (3)"}; + Configurable cElMinCut{"cElMinCut", -3.0, "electron min cut"}; + Configurable cElMaxCut{"cElMaxCut", 5.0, "electron max cut"}; + Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut"}; + Configurable cRapidityCut05{"cRapidityCut05", 0.5, "rapidity cut"}; + + template + bool selCollision(C const& coll) + { + + if (std::abs(coll.posZ()) > cVtxZcut) { + return false; + } // Reject the collisions with large vertex-z + histos.fill(HIST("hEventcounter"), 2.); + + // cent = coll.centFT0M(); //centrality for run3 + if (cSel8Trig && !coll.sel8()) { + return false; + } // require min bias trigger + histos.fill(HIST("hEventcounter"), 3.); + + if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return false; + } + if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return false; + } + histos.fill(HIST("trackSelRec"), 4); + + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + histos.fill(HIST("trackSelRec"), 5); + + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + histos.fill(HIST("trackSelRec"), 6); + + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return false; + } + histos.fill(HIST("trackSelRec"), 7); + + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + histos.fill(HIST("trackSelRec"), 8); + + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return false; + } + histos.fill(HIST("trackSelRec"), 9); + + return true; // if all checks pass, accept the collision + } + + template + bool selTrack(T const& track) + { + if (!track.isGlobalTrack()) { + return false; + } // accept only global tracks + histos.fill(HIST("tracksel"), 2); + + // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + histos.fill(HIST("tracksel"), 3); + + // if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + histos.fill(HIST("tracksel"), 4); + + if (std::fabs(track.eta()) >= cEtacut) { + return false; + } + histos.fill(HIST("tracksel"), 5); + + if (track.pt() < cPtmincut) { + return false; + } + if (track.pt() > cPtmaxcut) { + return false; + } + histos.fill(HIST("tracksel"), 6); + + // if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + histos.fill(HIST("tracksel"), 7); + + // if (track.itsChi2NCl() > cItsChiCut) {return false;} + histos.fill(HIST("tracksel"), 8); + + // if (track.tpcChi2NCl() > cTpcChiCut) {return false;} + histos.fill(HIST("tracksel"), 9); + + if (track.sign() == 0) + return false; + + return true; // if all checks pass, accept the collision + } + + template + bool rejEl(T const& track) + { + if (track.tpcNSigmaEl() > cElMinCut && track.tpcNSigmaEl() < cElMaxCut && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { + return true; + } + return false; + } + + template + bool selProton(T const& track) + { + //! if pt < threshold (For tracks without TOF information) + if (track.p() > cProtonPmincut && track.p() <= cProtonPthcut) { + if (track.hasTPC() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } + } + + //! if pt < threshold (For tracks with TOF information) + if (track.p() > cProtonPmincut && track.p() <= cProtonPthcut) { + if (track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } + } + + //! if pt > threshold (For tracks with TOF information) + if (track.p() > cProtonPthcut && track.p() <= cProtonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } + } + + return false; + } + + template + bool selKaon(T const& track) + { + //! if pt < threshold (For tracks without TOF information) + if (track.p() > cKaonPmincut && track.p() <= cKaonPthcut) { + if (track.hasTPC() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + //! if pt < threshold (For tracks with TOF information) + if (track.p() > cKaonPmincut && track.p() <= cKaonPthcut) { + if (track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::fabs(track.tpcNSigmaPi()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + //! if pt > threshold (For tracks with TOF information) + if (track.p() > cKaonPthcut && track.p() <= cKaonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && std::hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + return false; + } + + template + bool selPion(T const& track) + { + //! if pt < threshold (For tracks without TOF information) + if (track.p() > cPionPmincut && track.p() <= cPionPthcut) { + if (track.hasTPC() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + //! if pt < threshold (For tracks with TOF information) + if (track.p() > cPionPmincut && track.p() <= cPionPthcut) { + if (track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::fabs(track.tpcNSigmaKa()) > cNSigCut2 && std::fabs(track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + //! if pt > threshold (For tracks with TOF information) + if (track.p() > cPionPthcut && track.p() <= cPionPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && std::hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && std::hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } + } + + return false; + } + + double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec){ + int bin = ptHistogramAllchargeRec->FindBin(pt); + double eff = ptHistogramAllchargeRec->GetBinContent(bin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + { + histos.fill(HIST("hEventcounter"), 1.); + histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); + + if (!selCollision(coll)) + return; + { + histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); + } + + const auto cent = coll.centFT0C(); + histos.fill(HIST("Data/hCentrality"), cent); + + double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; + double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; + double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; + double var1 = 0., var2 = 0., twoParAllCharge = 0.; + double var1Pi = 0., var2Pi = 0.; + double var1Ka = 0., var2Ka = 0.; + double var1Pr = 0., var2Pr = 0.; + + int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; // subsample error estimation + for (const auto& track : inputTracks) { + nchAllBfCut += 1.; + histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); + + histos.fill(HIST("tracksel"), 1); + histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); + histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); + histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); + + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; + histos.fill(HIST("Data/hnchTrue"), nchEta); + } + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; + histos.fill(HIST("Data/hnchTrue_pt"), nchPt); + } + + if (track.sign() == 0) + continue; + if (!selTrack(track)) + continue; + + nchAll += 1.; + histos.fill(HIST("Data/hnchAll"), nchAll); + histos.fill(HIST("Data/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Data/hDCAz"), track.dcaZ()); + histos.fill(HIST("Data/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); + histos.fill(HIST("Data/hTPCchi2perCluster_after"), track.tpcChi2NCl()); + histos.fill(HIST("Data/hITSchi2perCluster_after"), track.itsChi2NCl()); + histos.fill(HIST("Data/hP"), track.p()); + histos.fill(HIST("Data/hPt"), track.pt()); + histos.fill(HIST("Data/hEta"), track.eta()); + histos.fill(HIST("Data/hPtDCAxy"), track.pt(), track.dcaXY()); + histos.fill(HIST("Data/hPtDCAz"), track.pt(), track.dcaZ()); + histos.fill(HIST("Data/hPtEta"), track.pt(), track.eta()); + histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); + histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); + + if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) + { + nch += 1.; + q1Old += track.pt(); + q2Old += (track.pt() * track.pt()); + histos.fill(HIST("Data/hnch"), nch); + } + + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Data/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); + + if (track.hasTPC()) + histos.fill(HIST("Data/hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("Data/hTOFbeta"), track.p(), track.beta()); + + //===================================pion============================================================== + // only TPC+TOF tracks: Pion, Kaon, Proton + if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selPion(track)) { + histos.fill(HIST("Data/hPtPion"), track.pt()); + histos.fill(HIST("Data/hEtaPion"), track.eta()); + histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); + histos.fill(HIST("Data/hPtyPion"), track.pt(), track.rapidity(massPi)); + nchPi += 1.; + q1Pi += track.pt(); + q2Pi += (track.pt() * track.pt()); + + if (track.beta() > 1) + continue; + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + } + + //===========================kaon=============================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selKaon(track)) { + histos.fill(HIST("Data/hPtKaon"), track.pt()); + histos.fill(HIST("Data/hEtaKaon"), track.eta()); + histos.fill(HIST("Data/hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("Data/hPtyKaon"), track.pt(), track.rapidity(massKa)); + nchKa += 1.; + q1Ka += track.pt(); + q2Ka += (track.pt() * track.pt()); + + if (track.beta() > 1) + continue; + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + } + + //============================proton=========================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { + histos.fill(HIST("Data/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selProton(track)) { + histos.fill(HIST("Data/hPtProton"), track.pt()); + histos.fill(HIST("Data/hEtaProton"), track.eta()); + histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); + histos.fill(HIST("Data/hPtyProton"), track.pt(), track.rapidity(massPr)); + nchPr += 1.; + q1Pr += track.pt(); + q2Pr += (track.pt() * track.pt()); + + if (track.beta() > 1) + continue; + histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); + } + } // Track loop ends! + histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); + + if (nchAll < cTwoPtlCut2) + return; + var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); + var2 = (q1 / nchAll); + + //------------------ all charges------------------------------------- + histos.fill(HIST("Data/hVar1"), sample, cent, var1); + histos.fill(HIST("Data/hVar2"), sample, cent, var2); + histos.fill(HIST("Data/hVarc"), sample, cent); + histos.fill(HIST("Data/hVar2meanpt"), cent, var2); + twoParAllCharge = (var1 - var2); + histos.fill(HIST("Data/hVar"), nchAll, twoParAllCharge); + + //---------------------- pions ---------------------------------------- + if (nchPi >= cTwoPtlCut2) { + var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); + var2Pi = (q1Pi / nchPi); + } + + //----------------------- kaons --------------------------------------- + if (nchKa >= cTwoPtlCut2) { + var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); + var2Ka = (q1Ka / nchKa); + } + + //---------------------------- protons ---------------------------------- + if (nchPr >= cTwoPtlCut2) { + var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); + var2Pr = (q1Pr / nchPr); + } + + //========================centrality========================================== + histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); + histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); + histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); + + histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); + histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); + histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); + + histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); + histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); + histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); + + //-----------------------nch------------------------------------- + histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); + histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); + histos.fill(HIST("Data/hVarx"), sample, nchAll); + histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); + + histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); + histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); + histos.fill(HIST("Data/hVarpix"), sample, nchPi); + histos.fill(HIST("Data/hVar2meanptpix"), nchAll, var2Pi); + + histos.fill(HIST("Data/hVar1kx"), sample, nchAll, var1Ka); + histos.fill(HIST("Data/hVar2kx"), sample, nchAll, var2Ka); + histos.fill(HIST("Data/hVarkx"), sample, nchKa); + histos.fill(HIST("Data/hVar2meanptkx"), nchAll, var2Ka); + + histos.fill(HIST("Data/hVar1px"), sample, nchAll, var1Pr); + histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); + histos.fill(HIST("Data/hVarpx"), sample, nchPr); + histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); + + } // event loop ends! + + PROCESS_SWITCH(EventMeanPtId, process, "process real data information", false); + + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// + + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); + histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); + + if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return; + } + if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return; + } + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return; + } + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return; + } + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return; + } + if (std::abs(coll.posZ()) > cVtxZcut) { + return; + } + + if (!coll.sel8()) { + return; + } + float cent = coll.centFT0C(); + histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); + + double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; + double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; + double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; + double var1 = 0., var2 = 0., twoParAllCharge = 0.; + double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; + double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; + double sumPtWeightPi = 0., sumWeightPi = 0., sumPtPtWeightPi = 0., var1EffPi = 0., var2EffPi = 0.; + double sumPtWeightKa = 0., sumWeightKa = 0., sumPtPtWeightKa = 0., var1EffKa = 0., var2EffKa = 0.; + double sumPtWeightPr = 0., sumWeightPr = 0., sumPtPtWeightPr = 0., var1EffPr = 0., var2EffPr = 0.; + + + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; + + for (const auto& track : inputTracks) { + nchAllBfCut += 1.; + histos.fill(HIST("Rec/hnchAll_bf_cut"), nchAllBfCut); + histos.fill(HIST("Rec/hTPCchi2perCluster_before"), track.tpcChi2NCl()); + histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); + histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); + + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; + histos.fill(HIST("Rec/hnchTrue"), nchEta); + } + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; + histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); + } + if (!track.isGlobalTrack()) + continue; + if (std::fabs(track.eta()) > cEtacut) + continue; + if ((track.pt() <= cPtmincut) || (track.pt() >= cPtmaxcut)) + continue; + if (track.sign() == 0) + continue; + // if (std::fabs(track.y()) > 0.5) continue; + histos.fill(HIST("hPt_rec"), track.pt()); + histos.fill(HIST("hEta_rec"), track.eta()); + + auto mcParticle = track.mcParticle(); + nchAll += 1.; + histos.fill(HIST("Rec/hnchAll"), nchAll); + histos.fill(HIST("ptHistogramAllchargeRec"), track.pt()); + histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); + histos.fill(HIST("Rec/hDCAz"), track.dcaZ()); + histos.fill(HIST("Rec/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); + histos.fill(HIST("Rec/hTPCchi2perCluster_after"), track.tpcChi2NCl()); + histos.fill(HIST("Rec/hITSchi2perCluster_after"), track.itsChi2NCl()); + histos.fill(HIST("Rec/hP"), track.p()); + histos.fill(HIST("Rec/hPt"), track.pt()); + histos.fill(HIST("Rec/hEta"), track.eta()); + histos.fill(HIST("Rec/hPtDCAxy"), track.pt(), track.dcaXY()); + histos.fill(HIST("Rec/hPtDCAz"), track.pt(), track.dcaZ()); + histos.fill(HIST("Rec/hPtEta"), track.pt(), track.eta()); + histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); + histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); + + if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) + { + nch += 1.; + q1Old += track.pt(); + q2Old += (track.pt() * track.pt()); + histos.fill(HIST("Rec/hnch"), nch); + } + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + + double eff = getEfficiency(track.pt(), ptHistogramAllchargeRec); + // LOGF(info, " with value %.2f", eff); + sumPtWeight += track.pt()/eff ; + sumPtPtWeight += (track.pt()*track.pt())/(eff * eff) ; + sumWeight += 1. / eff ; + + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) + histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) + histos.fill(HIST("ptHistogramKaonrec_pdg"), track.pt()); + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) + histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); + + if (cfgRejEl == false && rejEl(track)) { + return; + } + + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3) + histos.fill(HIST("Rec/NSigamaTOFproton"), track.pt(), track.tofNSigmaPr()); + + if (track.hasTPC()) + histos.fill(HIST("Rec/hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("Rec/hTOFbeta"), track.p(), track.beta()); + if (track.hasTPC()) + histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track.p(), track.beta()); + + //===================================pion============================================================== + if ((track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPi()) < cNSigCut3)) { + histos.fill(HIST("Rec/NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + + histos.fill(HIST("Rec/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selPion(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; + histos.fill(HIST("ptHistogramPionrec"), track.pt()); + histos.fill(HIST("Rec/hPtPion"), track.pt()); + histos.fill(HIST("Rec/hEtaPion"), track.eta()); + histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); + histos.fill(HIST("Rec/hPtyPion"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("NSigamaTPCpion_rec"), track.p(), track.tpcNSigmaPi()); + histos.fill(HIST("NSigamaTOFpion_rec"), track.p(), track.tofNSigmaPi()); + histos.fill(HIST("NSigamaTPCTOFpion_rec"), track.tpcNSigmaPi(), track.tofNSigmaPi()); + histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + } + nchPi += 1.; + q1Pi += track.pt(); + q2Pi += (track.pt() * track.pt()); + + double effPi = getEfficiency(track.pt(), ptHistogramPionrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPi += track.pt()/effPi ; + sumPtPtWeightPi += (track.pt()*track.pt())/(effPi * effPi) ; + sumWeightPi += 1. / effPi ; + + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + } + + //===========================kaon=============================================================== + + if ((track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaKa()) < cNSigCut3)) { + histos.fill(HIST("Rec/NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Rec/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selKaon(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; + histos.fill(HIST("ptHistogramKaonrec"), track.pt()); + histos.fill(HIST("Rec/hPtKaon"), track.pt()); + histos.fill(HIST("Rec/hEtaKaon"), track.eta()); + histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("Rec/hPtyKaon"), track.pt(), track.rapidity(massKa)); + histos.fill(HIST("NSigamaTPCkaon_rec"), track.p(), track.tpcNSigmaKa()); + histos.fill(HIST("NSigamaTOFkaon_rec"), track.p(), track.tofNSigmaKa()); + histos.fill(HIST("NSigamaTPCTOFkaon_rec"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + } + nchKa += 1.; + q1Ka += track.pt(); + q2Ka += (track.pt() * track.pt()); + + double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightKa += track.pt()/effKa ; + sumPtPtWeightKa += (track.pt()*track.pt())/(effKa * effKa) ; + sumWeightKa += 1. / effKa ; + + histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); + histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); + } + + //============================proton=========================================================== + + if ((track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cNSigCut3) && (track.hasTOF() && std::abs(track.tofNSigmaPr()) < cNSigCut3)) { + histos.fill(HIST("Rec/NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Rec/hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); + } + + if (selProton(track)) { + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; + histos.fill(HIST("ptHistogramProtonrec"), track.pt()); + histos.fill(HIST("Rec/hPtProton"), track.pt()); + histos.fill(HIST("Rec/hEtaProton"), track.eta()); + histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); + histos.fill(HIST("Rec/hPtyProton"), track.pt(), track.rapidity(massPr)); + histos.fill(HIST("NSigamaTPCproton_rec"), track.p(), track.tpcNSigmaPr()); + histos.fill(HIST("NSigamaTOFproton_rec"), track.p(), track.tofNSigmaPr()); + histos.fill(HIST("NSigamaTPCTOFproton_rec"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); + if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + } + nchPr += 1.; + q1Pr += track.pt(); + q2Pr += (track.pt() * track.pt()); + + double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPr += track.pt()/effPr ; + sumPtPtWeightPr += (track.pt()*track.pt())/(effPr * effPr) ; + sumWeightPr += 1. / effPr ; + + histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); + histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); + } + + } // loop over tracks + histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); + + if (nchAll < cTwoPtlCut2) + return; + var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); + var2 = (q1 / nchAll); + + //------------------ Efficiency corrected histograms --------------- + + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); + + histos.fill(HIST("Rec/hVar1"), sample, cent, var1); + histos.fill(HIST("Rec/hVar2"), sample, cent, var2); + histos.fill(HIST("Rec/hVarc"), sample, cent); + histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); + twoParAllCharge = (var1 - var2); + histos.fill(HIST("Rec/hVar"), nchAll, twoParAllCharge); + + //---------------------- pions ---------------------------------------- + if (nchPi >= cTwoPtlCut2) { + var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); + var2Pi = (q1Pi / nchPi); + + var1EffPi = (sumPtWeightPi * sumPtWeightPi - sumPtPtWeightPi) / (sumWeightPi * (sumWeightPi - 1)); + var2EffPi = (sumPtWeightPi / sumWeightPi); + } + //----------------------- kaons --------------------------------------- + if (nchKa >= cTwoPtlCut2) { + var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); + var2Ka = (q1Ka / nchKa); + + var1EffKa = (sumPtWeightKa * sumPtWeightKa - sumPtPtWeightKa) / (sumWeightKa * (sumWeightKa - 1)); + var2EffKa = (sumPtWeightKa / sumWeightKa); + } + //---------------------------- protons ---------------------------------- + if (nchPr >= cTwoPtlCut2) { + var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); + var2Pr = (q1Pr / nchPr); + + var1EffPr = (sumPtWeightPr * sumPtWeightPr - sumPtPtWeightPr) / (sumWeightPr * (sumWeightPr - 1)); + var2EffPr = (sumPtWeightPr / sumWeightPr); + } + //========================centrality========================================== + + histos.fill(HIST("Rec/hVar1pi"), sample, cent, var1Pi); + histos.fill(HIST("Rec/hVar2pi"), sample, cent, var2Pi); + histos.fill(HIST("Rec/hVar2meanptpi"), cent, var2Pi); + histos.fill(HIST("Rec/hVar1k"), sample, cent, var1Ka); + histos.fill(HIST("Rec/hVar2k"), sample, cent, var2Ka); + histos.fill(HIST("Rec/hVar2meanptk"), cent, var2Ka); + histos.fill(HIST("Rec/hVar1p"), sample, cent, var1Pr); + histos.fill(HIST("Rec/hVar2p"), sample, cent, var2Pr); + histos.fill(HIST("Rec/hVar2meanptp"), cent, var2Pr); + + //-----------------------nch------------------------------------- + histos.fill(HIST("Rec/hVar1x"), sample, nchAll, var1); + histos.fill(HIST("Rec/hVar2x"), sample, nchAll, var2); + histos.fill(HIST("Rec/hVarx"), sample, nchAll); + histos.fill(HIST("Rec/hVar2meanptx"), nchAll, var2); + histos.fill(HIST("Rec/hVar1pix"), sample, nchAll, var1Pi); + histos.fill(HIST("Rec/hVar2pix"), sample, nchAll, var2Pi); + histos.fill(HIST("Rec/hVarpix"), sample, nchPi); + histos.fill(HIST("Rec/hVar2meanptpix"), nchAll, var2Pi); + histos.fill(HIST("Rec/hVar1kx"), sample, nchAll, var1Ka); + histos.fill(HIST("Rec/hVar2kx"), sample, nchAll, var2Ka); + histos.fill(HIST("Rec/hVarkx"), sample, nchKa); + histos.fill(HIST("Rec/hVar2meanptkx"), nchAll, var2Ka); + histos.fill(HIST("Rec/hVar1px"), sample, nchAll, var1Pr); + histos.fill(HIST("Rec/hVar2px"), sample, nchAll, var2Pr); + histos.fill(HIST("Rec/hVarpx"), sample, nchPr); + histos.fill(HIST("Rec/hVar2meanptpx"), nchAll, var2Pr); + + histos.fill(HIST("hEffVar1x"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptx"), nchAll, var2Eff); + + histos.fill(HIST("hEffVar1pix"), sample, nchAll, var1EffPi); + histos.fill(HIST("hEffVar2pix"), sample, nchAll, var2EffPi); + histos.fill(HIST("hEffVarpix"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptpix"), nchAll, var2EffPi); + + histos.fill(HIST("hEffVar1kx"), sample, nchAll, var1EffKa); + histos.fill(HIST("hEffVar2kx"), sample, nchAll, var2EffKa); + histos.fill(HIST("hEffVarkx"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptkx"), nchAll, var2EffKa); + + histos.fill(HIST("hEffVar1px"), sample, nchAll, var1EffPr); + histos.fill(HIST("hEffVar2px"), sample, nchAll, var2EffPr); + histos.fill(HIST("hEffVarpx"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptpx"), nchAll, var2EffPr); + + + //================= generated level============================== + + const auto& mccolgen = coll.mcCollision_as(); + if (std::abs(mccolgen.posZ()) > cVtxZcut) { + return; + } + const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); + histos.fill(HIST("hVtxZ_after_gen"), mccolgen.posZ()); + + double nchGen = 0., nchGenAll = 0., nchGenTrue = 0.; + double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; + double nch1 = 0., nch2 = 0., nch3 = 0.; + double q1AllGen = 0, q2AllGen = 0.; + double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0; + double var1AllGen = 0, var2AllGen = 0.; + double var1PiGen = 0, var2PiGen = 0, var1KaGen = 0, var2KaGen = 0, var1PrGen = 0, var2PrGen = 0; + + int sampleGen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); + sampleGen = sampleGen % 30; + + for (const auto& mcpart : mcpartgen) { + // auto pdgcode = std::abs(mcpart.pdgCode()); + if (!mcpart.isPhysicalPrimary()) { + continue; + } + nch1++; + histos.fill(HIST("hnch1"), nch1); + nch2++; + histos.fill(HIST("hnch2"), nch2); + nch3++; + histos.fill(HIST("hnch3"), nch3); + + int pid = mcpart.pdgCode(); + auto sign = 0; + auto* pd = pdg->GetParticle(pid); + if (pd != nullptr) { + sign = pd->Charge() / 3.; + } + if (sign == 0) { + continue; + } + // histos.fill(HIST("gen_hSign"), sign); + if (std::fabs(mcpart.eta()) > cEtacut) + continue; + nchGenTrue++; + histos.fill(HIST("hnch_gen_true"), nchGenTrue); + if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) + continue; + histos.fill(HIST("hPt_gen"), mcpart.pt()); + histos.fill(HIST("hEta_gen"), mcpart.eta()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); + nchGenAll += 1.; + q1AllGen += mcpart.pt(); + q2AllGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_gen_all"), nchGenAll); + if (std::fabs(mcpart.y()) < cRapidityCut05) { + + if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { + histos.fill(HIST("ptHistogramPion"), mcpart.pt()); + nchPiGen += 1.; + q1PiGen += mcpart.pt(); + q2PiGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pi"), nchPiGen); + } + + if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { + histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); + nchKaGen += 1.; + q1KaGen += mcpart.pt(); + q2KaGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_ka"), nchKaGen); + } + + if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("ptHistogramProton"), mcpart.pt()); + nchPrGen += 1.; + q1PrGen += mcpart.pt(); + q2PrGen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pr"), nchPrGen); + } + + } //|y| < 0.5 cut ends! + + } // particle + histos.fill(HIST("hcent_nacc_gen"), cent, nchGen); + + if (nchGenAll < cTwoPtlCut2) + return; + var1AllGen = (q1AllGen * q1AllGen - q2AllGen) / (nchGenAll * (nchGenAll - 1)); + var2AllGen = (q1AllGen / nchGenAll); + + if (nchPiGen >= cTwoPtlCut2) { + var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); + var2PiGen = (q1PiGen / nchPiGen); + } + + //----------------------- kaons --------------------------------------- + if (nchKaGen >= cTwoPtlCut2) { + var1KaGen = (q1KaGen * q1KaGen - q2KaGen) / (nchKaGen * (nchKaGen - 1)); + var2KaGen = (q1KaGen / nchKaGen); + } + //---------------------------- protons ---------------------------------- + if (nchPrGen >= cTwoPtlCut2) { + var1PrGen = (q1PrGen * q1PrGen - q2PrGen) / (nchPrGen * (nchPrGen - 1)); + var2PrGen = (q1PrGen / nchPrGen); + } + //-----------------------nch------------------------------------- + histos.fill(HIST("hVar1x_gen"), sampleGen, nchGenAll, var1AllGen); + histos.fill(HIST("hVar2x_gen"), sampleGen, nchGenAll, var2AllGen); + histos.fill(HIST("hVarx_gen"), sampleGen, nchGenAll); + histos.fill(HIST("hVar2meanptx_gen"), nchGenAll, var2AllGen); + histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); + histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); + histos.fill(HIST("hVarpix_gen"), sampleGen, nchPiGen); + histos.fill(HIST("hVar2meanptpix_gen"), nchGenAll, var2PiGen); + histos.fill(HIST("hVar1kx_gen"), sampleGen, nchGenAll, var1KaGen); + histos.fill(HIST("hVar2kx_gen"), sampleGen, nchGenAll, var2KaGen); + histos.fill(HIST("hVarkx_gen"), sampleGen, nchKaGen); + histos.fill(HIST("hVar2meanptkx_gen"), nchGenAll, var2KaGen); + histos.fill(HIST("hVar1px_gen"), sampleGen, nchGenAll, var1PrGen); + histos.fill(HIST("hVar2px_gen"), sampleGen, nchGenAll, var2PrGen); + histos.fill(HIST("hVarpx_gen"), sampleGen, nchPrGen); + histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); + + } // void process + PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From ab365df9d4a3593c97801841c1a2e05fa5b783c5 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 11:13:13 +0530 Subject: [PATCH 02/23] MeanpTFlucta --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 158 +++++++++--------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 8ba34450ec6..693a150deb1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -13,34 +13,37 @@ /// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method /// \author Sweta Singh (sweta.singh@cern.ch) -#include -#include -#include -#include +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" -#include "Common/Core/trackUtilities.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" + +#include "CCDB/BasicCCDBManager.h" #include "CommonConstants/MathConstants.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Framework/AnalysisDataModel.h" +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/RunningWorkflowInfo.h" -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" +#include "Framework/runDataProcessing.h" + #include -#include "Common/CCDB/TriggerAliases.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "CommonConstants/PhysicsConstants.h" + +#include +#include +#include +#include double massPi = o2::constants::physics::MassPionCharged; double massKa = o2::constants::physics::MassKaonCharged; @@ -88,15 +91,15 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH1D* ptHistogramAllchargeRec = nullptr; - TH1D* ptHistogramPionrec = nullptr; - TH1D* ptHistogramKaonrec = nullptr; - TH1D* ptHistogramProtonrec = nullptr; - TH1D* hRecoPi = nullptr; - TH1D* hRecoKa = nullptr; - TH1D* hRecoPr = nullptr; - TH2D* hPtyPion = nullptr; - TH2D* hPtyKaon = nullptr; - TH2D* hPtyProton = nullptr; + TH1D* ptHistogramPionrec = nullptr; + TH1D* ptHistogramKaonrec = nullptr; + TH1D* ptHistogramProtonrec = nullptr; + TH1D* hRecoPi = nullptr; + TH1D* hRecoKa = nullptr; + TH1D* hRecoPr = nullptr; + TH2D* hPtyPion = nullptr; + TH2D* hPtyKaon = nullptr; + TH2D* hPtyProton = nullptr; Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; @@ -105,30 +108,30 @@ struct EventMeanPtId { void init(o2::framework::InitContext&) { - if (cfgLoadEff) { + if (cfgLoadEff) { // Set CCDB url ccdb->setURL(cfgUrlCCDB.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - //ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); - //LOGF(info, "Getting object %s", ccdbPath.value.data()); - + // ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + // LOGF(info, "Getting object %s", ccdbPath.value.data()); + TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("ptHistogramAllchargeRec")); - ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); - ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); - ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); - hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); - hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); - hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); - hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); - hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); - hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); - - if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { + ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); + ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); + ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); + hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); + hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); + hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); + hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); + hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); + hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); + + if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { LOGF(info, "FATAL!! Could not find required histograms in CCDB"); } - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -640,11 +643,12 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec){ - int bin = ptHistogramAllchargeRec->FindBin(pt); - double eff = ptHistogramAllchargeRec->GetBinContent(bin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero - } + double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec) + { + int bin = ptHistogramAllchargeRec->FindBin(pt); + double eff = ptHistogramAllchargeRec->GetBinContent(bin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// @@ -669,7 +673,7 @@ struct EventMeanPtId { double var1Pi = 0., var2Pi = 0.; double var1Ka = 0., var2Ka = 0.; double var1Pr = 0., var2Pr = 0.; - + int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; // subsample error estimation for (const auto& track : inputTracks) { @@ -816,8 +820,8 @@ struct EventMeanPtId { if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); - var2 = (q1 / nchAll); - + var2 = (q1 / nchAll); + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); @@ -829,20 +833,20 @@ struct EventMeanPtId { //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); - var2Pi = (q1Pi / nchPi); + var2Pi = (q1Pi / nchPi); } //----------------------- kaons --------------------------------------- if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - } + } //========================centrality========================================== histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); @@ -932,7 +936,6 @@ struct EventMeanPtId { double sumPtWeightKa = 0., sumWeightKa = 0., sumPtPtWeightKa = 0., var1EffKa = 0., var2EffKa = 0.; double sumPtWeightPr = 0., sumWeightPr = 0., sumPtPtWeightPr = 0., var1EffPr = 0., var2EffPr = 0.; - int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -992,10 +995,10 @@ struct EventMeanPtId { q2 += (track.pt() * track.pt()); double eff = getEfficiency(track.pt(), ptHistogramAllchargeRec); - // LOGF(info, " with value %.2f", eff); - sumPtWeight += track.pt()/eff ; - sumPtPtWeight += (track.pt()*track.pt())/(eff * eff) ; - sumWeight += 1. / eff ; + // LOGF(info, " with value %.2f", eff); + sumPtWeight += track.pt() / eff; + sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); + sumWeight += 1. / eff; if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); @@ -1063,11 +1066,11 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - double effPi = getEfficiency(track.pt(), ptHistogramPionrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPi += track.pt()/effPi ; - sumPtPtWeightPi += (track.pt()*track.pt())/(effPi * effPi) ; - sumWeightPi += 1. / effPi ; + double effPi = getEfficiency(track.pt(), ptHistogramPionrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPi += track.pt() / effPi; + sumPtPtWeightPi += (track.pt() * track.pt()) / (effPi * effPi); + sumWeightPi += 1. / effPi; histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); @@ -1103,11 +1106,11 @@ struct EventMeanPtId { q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightKa += track.pt()/effKa ; - sumPtPtWeightKa += (track.pt()*track.pt())/(effKa * effKa) ; - sumWeightKa += 1. / effKa ; + double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightKa += track.pt() / effKa; + sumPtPtWeightKa += (track.pt() * track.pt()) / (effKa * effKa); + sumWeightKa += 1. / effKa; histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); @@ -1143,11 +1146,11 @@ struct EventMeanPtId { q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPr += track.pt()/effPr ; - sumPtPtWeightPr += (track.pt()*track.pt())/(effPr * effPr) ; - sumWeightPr += 1. / effPr ; + double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPr += track.pt() / effPr; + sumPtPtWeightPr += (track.pt() * track.pt()) / (effPr * effPr); + sumWeightPr += 1. / effPr; histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); @@ -1163,8 +1166,8 @@ struct EventMeanPtId { //------------------ Efficiency corrected histograms --------------- - var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); - var2Eff = (sumPtWeight / sumWeight); + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); histos.fill(HIST("Rec/hVar1"), sample, cent, var1); histos.fill(HIST("Rec/hVar2"), sample, cent, var2); @@ -1231,7 +1234,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptx"), nchAll, var2Eff); - + histos.fill(HIST("hEffVar1pix"), sample, nchAll, var1EffPi); histos.fill(HIST("hEffVar2pix"), sample, nchAll, var2EffPi); histos.fill(HIST("hEffVarpix"), sample, nchAll); @@ -1247,7 +1250,6 @@ struct EventMeanPtId { histos.fill(HIST("hEffVarpx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptpx"), nchAll, var2EffPr); - //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); From 4a3df15d54f805c8fdd9c8d29bf7b61340d76923 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 11:29:30 +0530 Subject: [PATCH 03/23] MeanpTfluct --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 158 +++++++++--------- 1 file changed, 78 insertions(+), 80 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 693a150deb1..8ba34450ec6 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -13,37 +13,34 @@ /// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method /// \author Sweta Singh (sweta.singh@cern.ch) -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" +#include +#include +#include +#include -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/Core/trackUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" +#include "Common/DataModel/Centrality.h" #include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" +#include "Common/DataModel/FT0Corrected.h" #include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" - +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" #include - -#include -#include -#include -#include +#include "Common/CCDB/TriggerAliases.h" +#include "CCDB/BasicCCDBManager.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "CommonConstants/PhysicsConstants.h" double massPi = o2::constants::physics::MassPionCharged; double massKa = o2::constants::physics::MassKaonCharged; @@ -91,15 +88,15 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH1D* ptHistogramAllchargeRec = nullptr; - TH1D* ptHistogramPionrec = nullptr; - TH1D* ptHistogramKaonrec = nullptr; - TH1D* ptHistogramProtonrec = nullptr; - TH1D* hRecoPi = nullptr; - TH1D* hRecoKa = nullptr; - TH1D* hRecoPr = nullptr; - TH2D* hPtyPion = nullptr; - TH2D* hPtyKaon = nullptr; - TH2D* hPtyProton = nullptr; + TH1D* ptHistogramPionrec = nullptr; + TH1D* ptHistogramKaonrec = nullptr; + TH1D* ptHistogramProtonrec = nullptr; + TH1D* hRecoPi = nullptr; + TH1D* hRecoKa = nullptr; + TH1D* hRecoPr = nullptr; + TH2D* hPtyPion = nullptr; + TH2D* hPtyKaon = nullptr; + TH2D* hPtyProton = nullptr; Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; @@ -108,30 +105,30 @@ struct EventMeanPtId { void init(o2::framework::InitContext&) { - if (cfgLoadEff) { + if (cfgLoadEff) { // Set CCDB url ccdb->setURL(cfgUrlCCDB.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - // ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); - // LOGF(info, "Getting object %s", ccdbPath.value.data()); - + //ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + //LOGF(info, "Getting object %s", ccdbPath.value.data()); + TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("ptHistogramAllchargeRec")); - ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); - ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); - ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); - hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); - hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); - hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); - hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); - hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); - hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); - - if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { + ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); + ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); + ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); + hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); + hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); + hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); + hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); + hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); + hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); + + if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { LOGF(info, "FATAL!! Could not find required histograms in CCDB"); } - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -643,12 +640,11 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec) - { - int bin = ptHistogramAllchargeRec->FindBin(pt); - double eff = ptHistogramAllchargeRec->GetBinContent(bin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero - } + double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec){ + int bin = ptHistogramAllchargeRec->FindBin(pt); + double eff = ptHistogramAllchargeRec->GetBinContent(bin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// @@ -673,7 +669,7 @@ struct EventMeanPtId { double var1Pi = 0., var2Pi = 0.; double var1Ka = 0., var2Ka = 0.; double var1Pr = 0., var2Pr = 0.; - + int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; // subsample error estimation for (const auto& track : inputTracks) { @@ -820,8 +816,8 @@ struct EventMeanPtId { if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); - var2 = (q1 / nchAll); - + var2 = (q1 / nchAll); + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); @@ -833,20 +829,20 @@ struct EventMeanPtId { //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); - var2Pi = (q1Pi / nchPi); + var2Pi = (q1Pi / nchPi); } //----------------------- kaons --------------------------------------- if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - } + } //========================centrality========================================== histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); @@ -936,6 +932,7 @@ struct EventMeanPtId { double sumPtWeightKa = 0., sumWeightKa = 0., sumPtPtWeightKa = 0., var1EffKa = 0., var2EffKa = 0.; double sumPtWeightPr = 0., sumWeightPr = 0., sumPtPtWeightPr = 0., var1EffPr = 0., var2EffPr = 0.; + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -995,10 +992,10 @@ struct EventMeanPtId { q2 += (track.pt() * track.pt()); double eff = getEfficiency(track.pt(), ptHistogramAllchargeRec); - // LOGF(info, " with value %.2f", eff); - sumPtWeight += track.pt() / eff; - sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += 1. / eff; + // LOGF(info, " with value %.2f", eff); + sumPtWeight += track.pt()/eff ; + sumPtPtWeight += (track.pt()*track.pt())/(eff * eff) ; + sumWeight += 1. / eff ; if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); @@ -1066,11 +1063,11 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - double effPi = getEfficiency(track.pt(), ptHistogramPionrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPi += track.pt() / effPi; - sumPtPtWeightPi += (track.pt() * track.pt()) / (effPi * effPi); - sumWeightPi += 1. / effPi; + double effPi = getEfficiency(track.pt(), ptHistogramPionrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPi += track.pt()/effPi ; + sumPtPtWeightPi += (track.pt()*track.pt())/(effPi * effPi) ; + sumWeightPi += 1. / effPi ; histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); @@ -1106,11 +1103,11 @@ struct EventMeanPtId { q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightKa += track.pt() / effKa; - sumPtPtWeightKa += (track.pt() * track.pt()) / (effKa * effKa); - sumWeightKa += 1. / effKa; + double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightKa += track.pt()/effKa ; + sumPtPtWeightKa += (track.pt()*track.pt())/(effKa * effKa) ; + sumWeightKa += 1. / effKa ; histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); @@ -1146,11 +1143,11 @@ struct EventMeanPtId { q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPr += track.pt() / effPr; - sumPtPtWeightPr += (track.pt() * track.pt()) / (effPr * effPr); - sumWeightPr += 1. / effPr; + double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPr += track.pt()/effPr ; + sumPtPtWeightPr += (track.pt()*track.pt())/(effPr * effPr) ; + sumWeightPr += 1. / effPr ; histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); @@ -1166,8 +1163,8 @@ struct EventMeanPtId { //------------------ Efficiency corrected histograms --------------- - var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); - var2Eff = (sumPtWeight / sumWeight); + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); histos.fill(HIST("Rec/hVar1"), sample, cent, var1); histos.fill(HIST("Rec/hVar2"), sample, cent, var2); @@ -1234,7 +1231,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptx"), nchAll, var2Eff); - + histos.fill(HIST("hEffVar1pix"), sample, nchAll, var1EffPi); histos.fill(HIST("hEffVar2pix"), sample, nchAll, var2EffPi); histos.fill(HIST("hEffVarpix"), sample, nchAll); @@ -1250,6 +1247,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVarpx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptpx"), nchAll, var2EffPr); + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); From 2e3f700edca08732420713a872d8103a09af3231 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 11:35:02 +0530 Subject: [PATCH 04/23] MeanpTfluct --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 158 +++++++++--------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 8ba34450ec6..693a150deb1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -13,34 +13,37 @@ /// \brief Analysis task to study Mean pT Fluctuations using two particle correlator using Cumulant Method /// \author Sweta Singh (sweta.singh@cern.ch) -#include -#include -#include -#include +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" -#include "Common/Core/trackUtilities.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" + +#include "CCDB/BasicCCDBManager.h" #include "CommonConstants/MathConstants.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Framework/AnalysisDataModel.h" +#include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/RunningWorkflowInfo.h" -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" +#include "Framework/runDataProcessing.h" + #include -#include "Common/CCDB/TriggerAliases.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "CommonConstants/PhysicsConstants.h" + +#include +#include +#include +#include double massPi = o2::constants::physics::MassPionCharged; double massKa = o2::constants::physics::MassKaonCharged; @@ -88,15 +91,15 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH1D* ptHistogramAllchargeRec = nullptr; - TH1D* ptHistogramPionrec = nullptr; - TH1D* ptHistogramKaonrec = nullptr; - TH1D* ptHistogramProtonrec = nullptr; - TH1D* hRecoPi = nullptr; - TH1D* hRecoKa = nullptr; - TH1D* hRecoPr = nullptr; - TH2D* hPtyPion = nullptr; - TH2D* hPtyKaon = nullptr; - TH2D* hPtyProton = nullptr; + TH1D* ptHistogramPionrec = nullptr; + TH1D* ptHistogramKaonrec = nullptr; + TH1D* ptHistogramProtonrec = nullptr; + TH1D* hRecoPi = nullptr; + TH1D* hRecoKa = nullptr; + TH1D* hRecoPr = nullptr; + TH2D* hPtyPion = nullptr; + TH2D* hPtyKaon = nullptr; + TH2D* hPtyProton = nullptr; Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; @@ -105,30 +108,30 @@ struct EventMeanPtId { void init(o2::framework::InitContext&) { - if (cfgLoadEff) { + if (cfgLoadEff) { // Set CCDB url ccdb->setURL(cfgUrlCCDB.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - //ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); - //LOGF(info, "Getting object %s", ccdbPath.value.data()); - + // ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + // LOGF(info, "Getting object %s", ccdbPath.value.data()); + TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("ptHistogramAllchargeRec")); - ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); - ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); - ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); - hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); - hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); - hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); - hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); - hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); - hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); - - if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { + ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); + ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); + ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); + hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); + hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); + hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); + hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); + hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); + hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); + + if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { LOGF(info, "FATAL!! Could not find required histograms in CCDB"); } - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -640,11 +643,12 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec){ - int bin = ptHistogramAllchargeRec->FindBin(pt); - double eff = ptHistogramAllchargeRec->GetBinContent(bin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero - } + double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec) + { + int bin = ptHistogramAllchargeRec->FindBin(pt); + double eff = ptHistogramAllchargeRec->GetBinContent(bin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// @@ -669,7 +673,7 @@ struct EventMeanPtId { double var1Pi = 0., var2Pi = 0.; double var1Ka = 0., var2Ka = 0.; double var1Pr = 0., var2Pr = 0.; - + int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; // subsample error estimation for (const auto& track : inputTracks) { @@ -816,8 +820,8 @@ struct EventMeanPtId { if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); - var2 = (q1 / nchAll); - + var2 = (q1 / nchAll); + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); @@ -829,20 +833,20 @@ struct EventMeanPtId { //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); - var2Pi = (q1Pi / nchPi); + var2Pi = (q1Pi / nchPi); } //----------------------- kaons --------------------------------------- if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - } + } //========================centrality========================================== histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); @@ -932,7 +936,6 @@ struct EventMeanPtId { double sumPtWeightKa = 0., sumWeightKa = 0., sumPtPtWeightKa = 0., var1EffKa = 0., var2EffKa = 0.; double sumPtWeightPr = 0., sumWeightPr = 0., sumPtPtWeightPr = 0., var1EffPr = 0., var2EffPr = 0.; - int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -992,10 +995,10 @@ struct EventMeanPtId { q2 += (track.pt() * track.pt()); double eff = getEfficiency(track.pt(), ptHistogramAllchargeRec); - // LOGF(info, " with value %.2f", eff); - sumPtWeight += track.pt()/eff ; - sumPtPtWeight += (track.pt()*track.pt())/(eff * eff) ; - sumWeight += 1. / eff ; + // LOGF(info, " with value %.2f", eff); + sumPtWeight += track.pt() / eff; + sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); + sumWeight += 1. / eff; if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); @@ -1063,11 +1066,11 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - double effPi = getEfficiency(track.pt(), ptHistogramPionrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPi += track.pt()/effPi ; - sumPtPtWeightPi += (track.pt()*track.pt())/(effPi * effPi) ; - sumWeightPi += 1. / effPi ; + double effPi = getEfficiency(track.pt(), ptHistogramPionrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPi += track.pt() / effPi; + sumPtPtWeightPi += (track.pt() * track.pt()) / (effPi * effPi); + sumWeightPi += 1. / effPi; histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); @@ -1103,11 +1106,11 @@ struct EventMeanPtId { q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightKa += track.pt()/effKa ; - sumPtPtWeightKa += (track.pt()*track.pt())/(effKa * effKa) ; - sumWeightKa += 1. / effKa ; + double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightKa += track.pt() / effKa; + sumPtPtWeightKa += (track.pt() * track.pt()) / (effKa * effKa); + sumWeightKa += 1. / effKa; histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); @@ -1143,11 +1146,11 @@ struct EventMeanPtId { q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPr += track.pt()/effPr ; - sumPtPtWeightPr += (track.pt()*track.pt())/(effPr * effPr) ; - sumWeightPr += 1. / effPr ; + double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); + // LOGF(info, " with value %.2f", eff); + sumPtWeightPr += track.pt() / effPr; + sumPtPtWeightPr += (track.pt() * track.pt()) / (effPr * effPr); + sumWeightPr += 1. / effPr; histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); @@ -1163,8 +1166,8 @@ struct EventMeanPtId { //------------------ Efficiency corrected histograms --------------- - var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); - var2Eff = (sumPtWeight / sumWeight); + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); histos.fill(HIST("Rec/hVar1"), sample, cent, var1); histos.fill(HIST("Rec/hVar2"), sample, cent, var2); @@ -1231,7 +1234,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptx"), nchAll, var2Eff); - + histos.fill(HIST("hEffVar1pix"), sample, nchAll, var1EffPi); histos.fill(HIST("hEffVar2pix"), sample, nchAll, var2EffPi); histos.fill(HIST("hEffVarpix"), sample, nchAll); @@ -1247,7 +1250,6 @@ struct EventMeanPtId { histos.fill(HIST("hEffVarpx"), sample, nchAll); histos.fill(HIST("hEffVar2Meanptpx"), nchAll, var2EffPr); - //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); From 4cc2ea6ca731d63346e042d254b486d7e7f9528a Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 12:15:06 +0530 Subject: [PATCH 05/23] MeanpTfluct --- PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 693a150deb1..e55f372e9e0 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -667,7 +667,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; - double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; + double q1 = 0., q2 = 0.; double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; double var1 = 0., var2 = 0., twoParAllCharge = 0.; double var1Pi = 0., var2Pi = 0.; @@ -718,8 +718,6 @@ struct EventMeanPtId { if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) { nch += 1.; - q1Old += track.pt(); - q2Old += (track.pt() * track.pt()); histos.fill(HIST("Data/hnch"), nch); } @@ -891,7 +889,7 @@ struct EventMeanPtId { SliceCache cache; Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { + { (void)mcCollisions; if (!coll.has_mcCollision()) { return; } From 9d752cc8697dc9d8741e6594132ff0c702f2b094 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 12:16:11 +0530 Subject: [PATCH 06/23] MeanpTfluct --- PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index e55f372e9e0..e5c1494d2dd 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -889,7 +889,8 @@ struct EventMeanPtId { SliceCache cache; Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { (void)mcCollisions; + { + (void)mcCollisions; if (!coll.has_mcCollision()) { return; } From 9f521101403d7cec9b1b34bd77b383cc356cea03 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 12:26:26 +0530 Subject: [PATCH 07/23] MeanpTfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index ee21f820c35..5bdc496b812 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -34,7 +34,7 @@ o2physics_add_dpl_workflow(antiproton-cumulants-mc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(event-meanpt-id +o2physics_add_dpl_workflow(event-mean-pt-id SOURCES eventMeanPtId.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) From f5059f42353bb1b25da14a514a5e66848d380e70 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 19 Jun 2025 12:36:24 +0530 Subject: [PATCH 08/23] MeanpTfluct --- PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index e5c1494d2dd..182876d39d1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -926,7 +926,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; - double q1 = 0., q2 = 0., q1Old = 0., q2Old = 0.; + double q1 = 0., q2 = 0.; double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; double var1 = 0., var2 = 0., twoParAllCharge = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; @@ -986,8 +986,6 @@ struct EventMeanPtId { if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) { nch += 1.; - q1Old += track.pt(); - q2Old += (track.pt() * track.pt()); histos.fill(HIST("Rec/hnch"), nch); } q1 += track.pt(); From 57c4cb16a201a9b74fa23538e8ed3915a470d2b2 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 7 Aug 2025 14:15:17 +0530 Subject: [PATCH 09/23] meanpT --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 470 ++++++++---------- 1 file changed, 201 insertions(+), 269 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 182876d39d1..8598d18e2cd 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -86,21 +86,12 @@ struct EventMeanPtId { Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; - Configurable cfgPathCCDB{"cfgPathCCDB", "Users/s/swsingh/My/Object/eff_Pb", "Path for ccdb-object"}; + Configurable cfgPathCCDB{"cfgPathCCDB", "Users/s/swsingh/My/Object/test", "Path for ccdb-object"}; Configurable cfgLoadEff{"cfgLoadEff", true, "Load efficiency"}; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - TH1D* ptHistogramAllchargeRec = nullptr; - TH1D* ptHistogramPionrec = nullptr; - TH1D* ptHistogramKaonrec = nullptr; - TH1D* ptHistogramProtonrec = nullptr; - TH1D* hRecoPi = nullptr; - TH1D* hRecoKa = nullptr; - TH1D* hRecoPr = nullptr; - TH2D* hPtyPion = nullptr; - TH2D* hPtyKaon = nullptr; - TH2D* hPtyProton = nullptr; - + TH2D* ptHistogramAllchargeRec = nullptr; + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; @@ -117,21 +108,8 @@ struct EventMeanPtId { // LOGF(info, "Getting object %s", ccdbPath.value.data()); TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); - ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("ptHistogramAllchargeRec")); - ptHistogramPionrec = reinterpret_cast(lst->FindObject("ptHistogramPionrec")); - ptHistogramKaonrec = reinterpret_cast(lst->FindObject("ptHistogramKaonrec")); - ptHistogramProtonrec = reinterpret_cast(lst->FindObject("ptHistogramProtonrec")); - hRecoPi = reinterpret_cast(lst->FindObject("hRecoPi")); - hRecoKa = reinterpret_cast(lst->FindObject("hRecoKa")); - hRecoPr = reinterpret_cast(lst->FindObject("hRecoPr")); - hPtyPion = reinterpret_cast(lst->FindObject("hPtyPion")); - hPtyKaon = reinterpret_cast(lst->FindObject("hPtyKaon")); - hPtyProton = reinterpret_cast(lst->FindObject("hPtyProton")); - - if (!ptHistogramAllchargeRec || !ptHistogramPionrec || !ptHistogramKaonrec || !ptHistogramProtonrec || !hRecoPi || !hRecoKa || !hRecoPr || !hPtyPion || !hPtyKaon || !hPtyProton) { - LOGF(info, "FATAL!! Could not find required histograms in CCDB"); - } - } + ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -148,7 +126,8 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + //AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; AxisSpec chi2Axis = {100, 0., 100., "Chi2"}; @@ -157,7 +136,7 @@ struct EventMeanPtId { // QA Plots histos.add("hEventcounter", "event counts", kTH1D, {counter}); - auto h = histos.add("tracksel", "tracksel", HistType::kTH1D, {{10, 0.5, 10.5}}); + auto h = histos.add("tracksel", "tracksel", HistType::kTH1D, {{15, 0.5, 15.5}}); h->GetXaxis()->SetBinLabel(1, "Tracks read"); h->GetXaxis()->SetBinLabel(2, "Global track passed"); h->GetXaxis()->SetBinLabel(3, "DCAxy passed"); @@ -167,8 +146,9 @@ struct EventMeanPtId { h->GetXaxis()->SetBinLabel(7, "TPC crossed rows passed"); h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); + h->GetXaxis()->SetBinLabel(10, "No. of ITS cluster 5 passed"); + h->GetXaxis()->SetBinLabel(11, "No. of TPC cluster 80 passed"); - histos.add("hEventcounter_recMC", "event counts rec MC", kTH1D, {counter}); auto hRec = histos.add("trackSelRec", "trackSelRec", HistType::kTH1D, {{10, 0.5, 10.5}}); hRec->GetXaxis()->SetBinLabel(1, "has_mcCollision() read"); hRec->GetXaxis()->SetBinLabel(2, "Vertex Z > 10cm passed"); @@ -179,7 +159,6 @@ struct EventMeanPtId { hRec->GetXaxis()->SetBinLabel(7, "klsVertexITSTPC passed"); histos.add("Data/hZvtx_before_sel", "hZvtx_before_sel", kTH1D, {vtxZAxis}); - histos.add("Data/hZvtx_after_sel", "hZvtx_after_sel", kTH1D, {vtxZAxis}); histos.add("Data/hZvtx_after_sel8", "hZvtx_after_sel8", kTH1D, {vtxZAxis}); histos.add("Data/hP", "hP", kTH1D, {pAxis}); histos.add("Data/hEta", ";hEta", kTH1D, {etaAxis}); @@ -207,29 +186,16 @@ struct EventMeanPtId { histos.add("Data/hyPion", ";hyPion", kTH1D, {etaAxis}); histos.add("Data/hyKaon", ";hyKaon", kTH1D, {etaAxis}); histos.add("Data/hyProton", ";hyProton", kTH1D, {etaAxis}); - histos.add("Data/hPtCh", "hPtCh", kTH2D, {nchAxis, ptAxis}); - histos.add("Data/hPtChPion", "hPtChPion", kTH2D, {nchAxis, ptAxis}); - histos.add("Data/hPtChKaon", "hPtChKaon", kTH2D, {nchAxis, ptAxis}); - histos.add("Data/hPtChProton", "hPtChProton", kTH2D, {nchAxis, ptAxis}); - histos.add("Data/hPtCent", "hPtCent", kTH2D, {centAxis, ptAxis}); - histos.add("Data/hPtCentPion", "hPtCentPion", kTH2D, {centAxis, ptAxis}); - histos.add("Data/hPtCentKaon", "hPtCentKaon", kTH2D, {centAxis, ptAxis}); - histos.add("Data/hPtCentProton", "hPtCentProton", kTH2D, {centAxis, ptAxis}); - histos.add("Data/hMeanPtCh", "hMeanPtCh", kTH2D, {nchAxis, ptAxis}); - histos.add("Data/hCent", "hCent", kTH2D, {nchAxis, centAxis}); histos.add("Data/hVar1", "hVar1", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2", "hVar2", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2meanpt", "hVar2meanpt", kTH2D, {centAxis, varAxis2}); - histos.add("Data/hVar", "hVar", kTH2D, {subAxis, centAxis}); histos.add("Data/hVarc", "hVarc", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar1pi", "hVar1pi", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2pi", "hVar2pi", kTH2D, {subAxis, centAxis}); - histos.add("Data/hVarpi", "hVarpi", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2meanptpi", "hVar2meanptpi", kTH2D, {centAxis, varAxis2}); histos.add("Data/hVar1k", "hVar1k", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2k", "hVar2k", kTH2D, {subAxis, centAxis}); - histos.add("Data/hVark", "hVark", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2meanptk", "hVar2meanptk", kTH2D, {centAxis, varAxis2}); histos.add("Data/hVar1p", "hVar1p", kTH2D, {subAxis, centAxis}); histos.add("Data/hVar2p", "hVar2p", kTH2D, {subAxis, centAxis}); @@ -258,12 +224,9 @@ struct EventMeanPtId { histos.add("Data/hVar2px", "hVar2px", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVarpx", "hVarpx", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); - histos.add("Data/ht", "ht", kTH1D, {centAxis}); histos.add("Data/hCentrality", "hCentrality", kTH1D, {centAxis}); histos.add("Data/hPEta", "hPEta", kTH2D, {pAxis, etaAxis}); histos.add("Data/hPtEta", "hPtEta", kTH2D, {ptAxis, etaAxis}); - histos.add("Data/hPy", "hPy", kTH2D, {pAxis, etaAxis}); - histos.add("Data/hPty", "hPty", kTH2D, {ptAxis, etaAxis}); histos.add("Data/hPtyPion", "hPtyPion", kTH2D, {ptAxis, etaAxis}); histos.add("Data/hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); histos.add("Data/hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); @@ -279,11 +242,11 @@ struct EventMeanPtId { histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); - histos.add("Data/hdEdx_rec_bf_anycut", "hdEdx_rec_bf_anycut", kTH2D, {pAxis, dEdxAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -293,56 +256,15 @@ struct EventMeanPtId { histos.add("NSigamaTPCTOFpion_rec", "NSigamaTPCTOFpion_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); histos.add("NSigamaTPCTOFkaon_rec", "NSigamaTPCTOFkaon_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); histos.add("NSigamaTPCTOFproton_rec", "NSigamaTPCTOFproton_rec", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCpion_rec_bf_sel", "NSigamaTPCpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon_rec_bf_sel", "NSigamaTPCkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton_rec_bf_sel", "NSigamaTPCproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTOFpion_rec_bf_sel", "NSigamaTOFpion_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon_rec_bf_sel", "NSigamaTOFkaon_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton_rec_bf_sel", "NSigamaTOFproton_rec_bf_sel", kTH2D, {pAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFpion_rec_bf_sel", "NSigamaTPCTOFpion_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon_rec_bf_sel", "NSigamaTPCTOFkaon_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton_rec_bf_sel", "NSigamaTPCTOFproton_rec_bf_sel", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); histos.add("hPtyPion_rec", "hPtyPion_rec", kTH2D, {ptAxis, etaAxis}); histos.add("hPtyKaon_rec", "hPtyKaon_rec", kTH2D, {ptAxis, etaAxis}); histos.add("hPtyProton_rec", "hPtyProton_rec", kTH2D, {ptAxis, etaAxis}); histos.add("hPyPion_rec", "hPyPion_rec", kTH2D, {pAxis, etaAxis}); histos.add("hPyKaon_rec", "hPyKaon_rec", kTH2D, {pAxis, etaAxis}); histos.add("hPyProton_rec", "hPyProton_rec", kTH2D, {pAxis, etaAxis}); - histos.add("hTOFbeta_afterselection_rec_afterpidcut", "hTOFbeta_afterselection_rec_afterpidcut", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_afterselection_rec_afterpidcut", "hdEdx_afterselection_rec_afterpidcut", kTH2D, {pAxis, dEdxAxis}); histos.add("hTOFbeta_afterselection_rec_beforepidcut", "hTOFbeta_afterselection_rec_beforepidcut", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx_afterselection_rec_beforepidcut", "hdEdx_afterselection_rec_beforepidcut", kTH2D, {pAxis, dEdxAxis}); - histos.add("heffVar1x", "heffVar1x", kTH2D, {subAxis, nchAxis}); - histos.add("heffVar2x", "heffVar2x", kTH2D, {subAxis, nchAxis}); - histos.add("heffVarx", "heffVarx", kTH2D, {subAxis, nchAxis}); - histos.add("heffVar2meanptx", "heffVar2meanptx", kTH2D, {nchAxis, varAxis2}); - histos.add("hnchRec_all", ";hnchRec_all", kTH1D, {nchAxis}); - histos.add("hnchRec", ";hnchRec", kTH1D, {nchAxis}); - histos.add("hnchRec_true", ";hnchRec_true", kTH1D, {nchAxis}); - histos.add("hVar1x_rec_old", "hVar1x_rec_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x_rec_old", "hVar2x_rec_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_rec_old", "hVarx_rec_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVar1x_rec", "hVar1x_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x_rec", "hVar2x_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_rec", "hVarx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptx_rec", "hVar2meanptx_rec", kTH2D, {nchAxis, varAxis2}); - histos.add("hVar1pix_rec", "hVar1pix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2pix_rec", "hVar2pix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpix_rec", "hVarpix_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpix_rec", "hVar2meanptpix_rec", kTH2D, {nchAxis, varAxis2}); - histos.add("hVar1kx_rec", "hVar1kx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2kx_rec", "hVar2kx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarkx_rec", "hVarkx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptkx_rec", "hVar2meanptkx_rec", kTH2D, {nchAxis, varAxis2}); - histos.add("hVar1px_rec", "hVar1px_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2px_rec", "hVar2px_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVarpx_rec", "hVarpx_rec", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2meanptpx_rec", "hVar2meanptpx_rec", kTH2D, {nchAxis, varAxis2}); - histos.add("hZvtx_after_sel_rec", "hZvtx_after_sel_rec", kTH1D, {vtxZAxis}); - histos.add("hZvtx_after_sel8_rec", "hZvtx_after_sel8_rec", kTH1D, {vtxZAxis}); - histos.add("etaHistogram_allcharge_rec", "etaHistogram_allcharge_rec", kTH1D, {etaAxis}); - histos.add("ptHistogram_allcharge_bfptcut_rec", "ptHistogram_allcharge_bfptcut_rec", kTH1D, {ptAxis}); histos.add("ptHistogramAllchargeRec", "ptHistogramAllchargeRec", kTH1D, {ptAxis}); histos.add("ptHistogramPionrec", "ptHistogramPionrec", kTH1D, {ptAxis}); histos.add("ptHistogramKaonrec", "ptHistogramKaonrec", kTH1D, {ptAxis}); @@ -353,11 +275,9 @@ struct EventMeanPtId { histos.add("ptHistogramPionrec_pdg", "ptHistogramPionrec_pdg", kTH1D, {ptAxis}); histos.add("ptHistogramKaonrec_pdg", "ptHistogramKaonrec_pdg", kTH1D, {ptAxis}); histos.add("ptHistogramProtonrec_pdg", "ptHistogramProtonrec_pdg", kTH1D, {ptAxis}); - histos.add("Histogram_mass2_p_rec_beforesel", "Histogram_mass2_p_rec_beforesel", kTH1D, {ptAxis}); - histos.add("Histogram_mass2_p_rec_aftersel", "Histogram_mass2_p_rec_aftersel", kTH1D, {ptAxis}); - histos.add("hEffVar1x", "hEffVar1x", kTH2D, {subAxis, nchAxis}); - histos.add("hEffVar2x", "hEffVar2x", kTH2D, {subAxis, nchAxis}); - histos.add("hEffVarx", "hEffVarx", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1x_rec", "hEffVar1x_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_rec", "hEffVar2x_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_rec", "hEffVarx_rec", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar1pix", "hEffVar1pix", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2pix", "hEffVar2pix", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarpix", "hEffVarpix", kTH2D, {subAxis, nchAxis}); @@ -367,7 +287,7 @@ struct EventMeanPtId { histos.add("hEffVar1px", "hEffVar1px", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2px", "hEffVar2px", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarpx", "hEffVarpx", kTH2D, {subAxis, nchAxis}); - histos.add("hEffVar2Meanptx", "hEffVar2Meanptx", kTH2D, {nchAxis, varAxis2}); + histos.add("hEffVar2Meanptx_rec", "hEffVar2Meanptx_rec", kTH2D, {nchAxis, varAxis2}); histos.add("hEffVar2Meanptpix", "hEffVar2Meanptpix", kTH2D, {nchAxis, varAxis2}); histos.add("hEffVar2Meanptkx", "hEffVar2Meanptkx", kTH2D, {nchAxis, varAxis2}); histos.add("hEffVar2Meanptpx", "hEffVar2Meanptpx", kTH2D, {nchAxis, varAxis2}); @@ -376,14 +296,8 @@ struct EventMeanPtId { histos.add("ptHistogramPion", "ptHistogramPion", kTH1D, {ptAxis}); histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); - histos.add("hMC_Pt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - histos.add("MC_hZvtx_after_sel", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {vtxZAxis}); - histos.add("hTOFbeta_gen_pion", "hTOFbeta_gen_pion", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_gen_pion", "hdEdx_gen_pion", kTH2D, {pAxis, dEdxAxis}); histos.add("hnch_gen_all", ";hnch_gen_all", kTH1D, {nchAxis}); - histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); histos.add("hnch_gen_true", ";hnch_gen_true", kTH1D, {nchAxis}); - histos.add("hnch_gen_eta", ";hnch_gen_eta", kTH1D, {etaAxis}); histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); @@ -391,9 +305,6 @@ struct EventMeanPtId { histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); - histos.add("hVar1x_gen_old", "hVar1x_gen_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVar2x_gen_old", "hVar2x_gen_old", kTH2D, {subAxis, nchAxis}); - histos.add("hVarx_gen_old", "hVarx_gen_old", kTH2D, {subAxis, nchAxis}); histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); @@ -410,28 +321,63 @@ struct EventMeanPtId { histos.add("hVar2px_gen", "hVar2px_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarpx_gen", "hVarpx_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); - histos.add("hcent_nacc_rec", "hcent_nacc_rec", kTH2D, {centAxis, nchAxis}); histos.add("hcent_nacc_gen", "hcent_nacc_gen", kTH2D, {centAxis, nchAxis}); - histos.add("hGenCentrality", "hGenCentrality", kTH1D, {centAxis}); histos.add("hVtxZ_before_gen", "", kTH1F, {vtxZAxis}); - histos.add("hVtxZ_after_gen", "", kTH1F, {vtxZAxis}); + histos.add("hVtxZ_after_gensim", "", kTH1F, {vtxZAxis}); histos.add("hEta_gen", "", kTH1F, {etaAxis}); histos.add("hEta_rec", "", kTH1F, {etaAxis}); histos.add("hPt_gen", "", kTH1F, {ptAxis}); histos.add("hPt_rec", "", kTH1F, {ptAxis}); - } + histos.add("hEta_rec_corr", "", kTH1F, {etaAxis}); + histos.add("hPt_rec_corr", "", kTH1F, {ptAxis}); + histos.add("hPtEta_rec", "hPtEta_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_pi_rec", "hPtEta_pi_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_ka_rec", "hPtEta_ka_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_pr_rec", "hPtEta_pr_rec", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_gen", "hPtEta_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_pi_gen", "hPtEta_pi_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_ka_gen", "hPtEta_ka_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtEta_pr_gen", "hPtEta_pr_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPty_pi_gen", "hPty_pi_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPty_ka_gen", "hPty_ka_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hPty_pr_gen", "hPty_pr_gen", kTH2D, {ptAxis, etaAxis}); + histos.add("hNch_vs_corr", "hNch_vs_corr", kTH1D, {nchAxis}); + histos.add("hVar1_gen", "hVar1_gen", kTH2D, {subAxis, centAxis}); + histos.add("hVar2_gen", "hVar2_gen", kTH2D, {subAxis, centAxis}); + histos.add("hVarc_gen", "hVarc_gen", kTH2D, {subAxis, centAxis}); + histos.add("hEffVar1x_Naccorr_rec", "hEffVar1x_Naccorr_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_Naccorr_rec", "hEffVar2x_Naccorr_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_Naccorr_rec", "hEffVarx_Naccorr_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1x_Naccorr_xaxis_rec", "hEffVar1x_Naccorr_xaxis_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_Naccorr_xaxis_rec", "hEffVar2x_Naccorr_xaxis_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_Naccorr_xaxis_rec", "hEffVarx_Naccorr_xaxis_rec", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1x_Naccorr_data", "hEffVar1x_Naccorr_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_Naccorr_data", "hEffVar2x_Naccorr_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_Naccorr_data", "hEffVarx_Naccorr_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1x_Naccorr_xaxis_data", "hEffVar1x_Naccorr_xaxis_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_Naccorr_xaxis_data", "hEffVar2x_Naccorr_xaxis_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_Naccorr_xaxis_data", "hEffVarx_Naccorr_xaxis_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar1x_data", "hEffVar1x_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); + histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); + } + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 0.3, "DCA Z cut"}; + Configurable cDcaZcut{"cDcaZcut", 2.0, "DCA Z cut"}; Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; - Configurable cItsChiCut{"cItsChiCut", 70, "ITS chi2 cluster cut"}; - Configurable cTpcChiCut{"cTpcChiCut", 70, "TPC chi2 cluster cut"}; + Configurable cItsChiCut{"cItsChiCut", 36, "ITS chi2 cluster cut"}; + Configurable cTpcChiCut{"cTpcChiCut", 4, "TPC chi2 cluster cut"}; + Configurable cnITSClustersCut{"cnITSClustersCut", 5, "Number of ITS clusters cut"}; + Configurable ctpcNClsCut{"ctpcNClsCut", 80, "No. of TPC clusters cut"}; + Configurable threshold{"threshold", 1e-6, "Delta eta bin count"}; // Event selections Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; @@ -443,7 +389,10 @@ struct EventMeanPtId { Configurable cIsGoodITSLayers{"cIsGoodITSLayers", true, "Good ITS Layers All"}; Configurable cItslayerall{"cItslayerall", true, "dead staves of ITS removed"}; Configurable cvtxtofmatched{"cvtxtofmatched", true, "TOF vertex matched"}; - Configurable cfgRejEl{"cfgRejEl", true, "Rejected electrons"}; + Configurable cfgRejEl{"cfgRejEl", false, "Rejected electrons"}; + Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; + Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; + Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; // PID selection configurables Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; @@ -461,6 +410,9 @@ struct EventMeanPtId { Configurable cElMaxCut{"cElMaxCut", 5.0, "electron max cut"}; Configurable cTwoPtlCut2{"cTwoPtlCut2", 2.0, "n2ptl cut"}; Configurable cRapidityCut05{"cRapidityCut05", 0.5, "rapidity cut"}; + Configurable nchBins{"nchBins", 4000, "Number of bins for nch axis"}; + Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; + Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; template bool selCollision(C const& coll) @@ -522,7 +474,7 @@ struct EventMeanPtId { // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - // if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { @@ -538,18 +490,28 @@ struct EventMeanPtId { } histos.fill(HIST("tracksel"), 6); - // if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 7); - // if (track.itsChi2NCl() > cItsChiCut) {return false;} + if (track.itsChi2NCl() > cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - // if (track.tpcChi2NCl() > cTpcChiCut) {return false;} + if (track.tpcChi2NCl() > cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 9); if (track.sign() == 0) return false; + if (citsNCluster) { + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); + } + + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); + } + return true; // if all checks pass, accept the collision } @@ -643,16 +605,21 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, TH1D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int bin = ptHistogramAllchargeRec->FindBin(pt); - double eff = ptHistogramAllchargeRec->GetBinContent(bin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero - } + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); + return 1e-6; + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); @@ -666,13 +633,12 @@ struct EventMeanPtId { const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; - double q1 = 0., q2 = 0.; - double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; - double var1 = 0., var2 = 0., twoParAllCharge = 0.; - double var1Pi = 0., var2Pi = 0.; - double var1Ka = 0., var2Ka = 0.; - double var1Pr = 0., var2Pr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; + double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; + double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; // subsample error estimation @@ -684,7 +650,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -693,37 +659,44 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (track.sign() == 0) continue; if (!selTrack(track)) - continue; - + continue; + nchAll += 1.; + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + histos.fill(HIST("Data/hnchAll"), nchAll); + histos.fill(HIST("Data/hPt"), track.pt()); + histos.fill(HIST("Data/hEta"), track.eta()); histos.fill(HIST("Data/hDCAxy"), track.dcaXY()); histos.fill(HIST("Data/hDCAz"), track.dcaZ()); histos.fill(HIST("Data/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("Data/hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("Data/hP"), track.p()); - histos.fill(HIST("Data/hPt"), track.pt()); - histos.fill(HIST("Data/hEta"), track.eta()); histos.fill(HIST("Data/hPtDCAxy"), track.pt(), track.dcaXY()); histos.fill(HIST("Data/hPtDCAz"), track.pt(), track.dcaZ()); histos.fill(HIST("Data/hPtEta"), track.pt(), track.eta()); histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + if (eff < threshold) + continue; + double weight = 1./eff; + sumPtWeight += track.pt() / eff; + sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); + sumWeight += weight; + if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) { nch += 1.; histos.fill(HIST("Data/hnch"), nch); } - q1 += track.pt(); - q2 += (track.pt() * track.pt()); - // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); @@ -753,7 +726,6 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - if (selPion(track)) { histos.fill(HIST("Data/hPtPion"), track.pt()); histos.fill(HIST("Data/hEtaPion"), track.eta()); @@ -762,7 +734,6 @@ struct EventMeanPtId { nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - if (track.beta() > 1) continue; histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); @@ -775,7 +746,6 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - if (selKaon(track)) { histos.fill(HIST("Data/hPtKaon"), track.pt()); histos.fill(HIST("Data/hEtaKaon"), track.eta()); @@ -784,7 +754,6 @@ struct EventMeanPtId { nchKa += 1.; q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - if (track.beta() > 1) continue; histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); @@ -797,7 +766,6 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection"), track.p(), track.beta()); } - if (selProton(track)) { histos.fill(HIST("Data/hPtProton"), track.pt()); histos.fill(HIST("Data/hEtaProton"), track.eta()); @@ -806,64 +774,74 @@ struct EventMeanPtId { nchPr += 1.; q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - if (track.beta() > 1) continue; histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } + } // Track loop ends! histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ all charges------------------------------------- - histos.fill(HIST("Data/hVar1"), sample, cent, var1); - histos.fill(HIST("Data/hVar2"), sample, cent, var2); - histos.fill(HIST("Data/hVarc"), sample, cent); - histos.fill(HIST("Data/hVar2meanpt"), cent, var2); - twoParAllCharge = (var1 - var2); - histos.fill(HIST("Data/hVar"), nchAll, twoParAllCharge); - + + //------------------ Efficiency corrected histograms --------------- + var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); + var2Eff = (sumPtWeight / sumWeight); + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); var2Pi = (q1Pi / nchPi); } - //----------------------- kaons --------------------------------------- if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); } - //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //========================centrality========================================== + + //------------------ all charges------------------------------------- + histos.fill(HIST("Data/hVar1"), sample, cent, var1); + histos.fill(HIST("Data/hVar2"), sample, cent, var2); + histos.fill(HIST("Data/hVarc"), sample, cent); + histos.fill(HIST("Data/hVar2meanpt"), cent, var2); histos.fill(HIST("Data/hVar1pi"), sample, cent, var1Pi); histos.fill(HIST("Data/hVar2pi"), sample, cent, var2Pi); histos.fill(HIST("Data/hVar2meanptpi"), cent, var2Pi); - histos.fill(HIST("Data/hVar1k"), sample, cent, var1Ka); histos.fill(HIST("Data/hVar2k"), sample, cent, var2Ka); histos.fill(HIST("Data/hVar2meanptk"), cent, var2Ka); - histos.fill(HIST("Data/hVar1p"), sample, cent, var1Pr); histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - //-----------------------nch------------------------------------- + //-----------------------nch------------------------------------- histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); + + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx_data"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptx_data"), nchAll, var2Eff); + histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, sumWeight, var1Eff); + histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, sumWeight, var2Eff); + histos.fill(HIST("hEffVarx_Naccorr_data"), sample, sumWeight); + histos.fill(HIST("hEffVar1x_Naccorr_data"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x_Naccorr_data"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx_Naccorr_data"), sample, nchAll, sumWeight); + histos.fill(HIST("hEffVar1x_Naccorr_xaxis_data"), sample, sumWeight, var1); + histos.fill(HIST("hEffVar2x_Naccorr_xaxis_data"), sample, sumWeight, var2); + histos.fill(HIST("hEffVarx_Naccorr_xaxis_data"), sample, sumWeight); histos.fill(HIST("Data/hVar1pix"), sample, nchAll, var1Pi); histos.fill(HIST("Data/hVar2pix"), sample, nchAll, var2Pi); @@ -879,11 +857,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2px"), sample, nchAll, var2Pr); histos.fill(HIST("Data/hVarpx"), sample, nchPr); histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); - } // event loop ends! - PROCESS_SWITCH(EventMeanPtId, process, "process real data information", false); - + PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// SliceCache cache; @@ -897,44 +874,20 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - if (cTFBorder && !coll.selection_bit(aod::evsel::kNoTimeFrameBorder)) { - return; - } - if (cNoItsROBorder && !coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) { - return; - } - if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { - return; - } - if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { - return; - } - if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { - return; - } - if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + if (!selCollision(coll))//add return; - } - if (std::abs(coll.posZ()) > cVtxZcut) { - return; - } - if (!coll.sel8()) { - return; - } float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); + histos.fill(HIST("Rec/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; - double var1 = 0., var2 = 0., twoParAllCharge = 0.; + double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - double sumPtWeightPi = 0., sumWeightPi = 0., sumPtPtWeightPi = 0., var1EffPi = 0., var2EffPi = 0.; - double sumPtWeightKa = 0., sumWeightKa = 0., sumPtPtWeightKa = 0., var1EffKa = 0., var2EffKa = 0.; - double sumPtWeightPr = 0., sumWeightPr = 0., sumPtPtWeightPr = 0., var1EffPr = 0., var2EffPr = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -953,17 +906,22 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - if (!track.isGlobalTrack()) - continue; - if (std::fabs(track.eta()) > cEtacut) - continue; - if ((track.pt() <= cPtmincut) || (track.pt() >= cPtmaxcut)) - continue; - if (track.sign() == 0) - continue; + if (!selTrack(track)) + continue; // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); + + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + if (eff < threshold) + continue; + double weight = 1.0 / eff; + sumPtWeight += track.pt() * weight; + sumPtPtWeight += (track.pt() * track.pt() * weight * weight); + sumWeight += weight; + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -982,6 +940,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPtEta"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); + histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) { @@ -991,12 +950,6 @@ struct EventMeanPtId { q1 += track.pt(); q2 += (track.pt() * track.pt()); - double eff = getEfficiency(track.pt(), ptHistogramAllchargeRec); - // LOGF(info, " with value %.2f", eff); - sumPtWeight += track.pt() / eff; - sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += 1. / eff; - if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1004,10 +957,6 @@ struct EventMeanPtId { if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton) histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); - if (cfgRejEl == false && rejEl(track)) { - return; - } - // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) histos.fill(HIST("Rec/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); @@ -1047,6 +996,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1063,14 +1013,8 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - double effPi = getEfficiency(track.pt(), ptHistogramPionrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPi += track.pt() / effPi; - sumPtPtWeightPi += (track.pt() * track.pt()) / (effPi * effPi); - sumWeightPi += 1. / effPi; - - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1087,6 +1031,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1103,12 +1048,6 @@ struct EventMeanPtId { q1Ka += track.pt(); q2Ka += (track.pt() * track.pt()); - double effKa = getEfficiency(track.pt(), ptHistogramKaonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightKa += track.pt() / effKa; - sumPtPtWeightKa += (track.pt() * track.pt()) / (effKa * effKa); - sumWeightKa += 1. / effKa; - histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); } @@ -1127,6 +1066,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1143,18 +1083,14 @@ struct EventMeanPtId { q1Pr += track.pt(); q2Pr += (track.pt() * track.pt()); - double effPr = getEfficiency(track.pt(), ptHistogramProtonrec); - // LOGF(info, " with value %.2f", eff); - sumPtWeightPr += track.pt() / effPr; - sumPtPtWeightPr += (track.pt() * track.pt()) / (effPr * effPr); - sumWeightPr += 1. / effPr; - histos.fill(HIST("hPyProton_rec"), track.p(), track.rapidity(massPr)); histos.fill(HIST("hPtyProton_rec"), track.pt(), track.rapidity(massPr)); } } // loop over tracks histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); + histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); + histos.fill(HIST("hNch_vs_corr"), nchAll, sumWeight); if (nchAll < cTwoPtlCut2) return; @@ -1170,32 +1106,22 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - twoParAllCharge = (var1 - var2); - histos.fill(HIST("Rec/hVar"), nchAll, twoParAllCharge); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); var2Pi = (q1Pi / nchPi); - - var1EffPi = (sumPtWeightPi * sumPtWeightPi - sumPtPtWeightPi) / (sumWeightPi * (sumWeightPi - 1)); - var2EffPi = (sumPtWeightPi / sumWeightPi); } //----------------------- kaons --------------------------------------- if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - var1EffKa = (sumPtWeightKa * sumPtWeightKa - sumPtPtWeightKa) / (sumWeightKa * (sumWeightKa - 1)); - var2EffKa = (sumPtWeightKa / sumWeightKa); - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); - - var1EffPr = (sumPtWeightPr * sumPtWeightPr - sumPtPtWeightPr) / (sumWeightPr * (sumWeightPr - 1)); - var2EffPr = (sumPtWeightPr / sumWeightPr); } //========================centrality========================================== @@ -1227,26 +1153,18 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVarpx"), sample, nchPr); histos.fill(HIST("Rec/hVar2meanptpx"), nchAll, var2Pr); - histos.fill(HIST("hEffVar1x"), sample, nchAll, var1Eff); - histos.fill(HIST("hEffVar2x"), sample, nchAll, var2Eff); - histos.fill(HIST("hEffVarx"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptx"), nchAll, var2Eff); - - histos.fill(HIST("hEffVar1pix"), sample, nchAll, var1EffPi); - histos.fill(HIST("hEffVar2pix"), sample, nchAll, var2EffPi); - histos.fill(HIST("hEffVarpix"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptpix"), nchAll, var2EffPi); - - histos.fill(HIST("hEffVar1kx"), sample, nchAll, var1EffKa); - histos.fill(HIST("hEffVar2kx"), sample, nchAll, var2EffKa); - histos.fill(HIST("hEffVarkx"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptkx"), nchAll, var2EffKa); - - histos.fill(HIST("hEffVar1px"), sample, nchAll, var1EffPr); - histos.fill(HIST("hEffVar2px"), sample, nchAll, var2EffPr); - histos.fill(HIST("hEffVarpx"), sample, nchAll); - histos.fill(HIST("hEffVar2Meanptpx"), nchAll, var2EffPr); - + histos.fill(HIST("hEffVar1x_rec"), sample, nchAll, var1Eff); + histos.fill(HIST("hEffVar2x_rec"), sample, nchAll, var2Eff); + histos.fill(HIST("hEffVarx_rec"), sample, nchAll); + histos.fill(HIST("hEffVar2Meanptx_rec"), nchAll, var2Eff); + histos.fill(HIST("hEffVar1x_Naccorr_rec"), sample, sumWeight, var1Eff); + histos.fill(HIST("hEffVar2x_Naccorr_rec"), sample, sumWeight, var2Eff); + histos.fill(HIST("hEffVarx_Naccorr_rec"), sample, sumWeight); + histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); + histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); + histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); + + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1254,7 +1172,7 @@ struct EventMeanPtId { return; } const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); - histos.fill(HIST("hVtxZ_after_gen"), mccolgen.posZ()); + histos.fill(HIST("hVtxZ_after_gensim"), mccolgen.posZ()); double nchGen = 0., nchGenAll = 0., nchGenTrue = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; @@ -1264,7 +1182,7 @@ struct EventMeanPtId { double var1AllGen = 0, var2AllGen = 0.; double var1PiGen = 0, var2PiGen = 0, var1KaGen = 0, var2KaGen = 0, var1PrGen = 0, var2PrGen = 0; - int sampleGen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); + int sampleGen = histos.get(HIST("hVtxZ_after_gensim"))->GetEntries(); sampleGen = sampleGen % 30; for (const auto& mcpart : mcpartgen) { @@ -1302,10 +1220,14 @@ struct EventMeanPtId { q1AllGen += mcpart.pt(); q2AllGen += (mcpart.pt() * mcpart.pt()); histos.fill(HIST("hnch_gen_all"), nchGenAll); + histos.fill(HIST("hPtEta_gen"), mcpart.pt(), mcpart.eta()); + if (std::fabs(mcpart.y()) < cRapidityCut05) { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); q2PiGen += (mcpart.pt() * mcpart.pt()); @@ -1314,6 +1236,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1322,6 +1246,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1331,18 +1257,23 @@ struct EventMeanPtId { } //|y| < 0.5 cut ends! } // particle - histos.fill(HIST("hcent_nacc_gen"), cent, nchGen); + histos.fill(HIST("hcent_nacc_gen"), cent, nchGenAll); if (nchGenAll < cTwoPtlCut2) return; var1AllGen = (q1AllGen * q1AllGen - q2AllGen) / (nchGenAll * (nchGenAll - 1)); var2AllGen = (q1AllGen / nchGenAll); + histos.fill(HIST("hVar1_gen"), sampleGen, cent, var1AllGen); + histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); + histos.fill(HIST("hVarc_gen"), sampleGen, cent); + + +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); } - //----------------------- kaons --------------------------------------- if (nchKaGen >= cTwoPtlCut2) { var1KaGen = (q1KaGen * q1KaGen - q2KaGen) / (nchKaGen * (nchKaGen - 1)); @@ -1373,7 +1304,8 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 52119664dc596f47bfbbab5a251f38be1808c791 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 7 Aug 2025 14:33:29 +0530 Subject: [PATCH 10/23] meanpT --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 146 +++++++++--------- 1 file changed, 77 insertions(+), 69 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 8598d18e2cd..84ecd85c015 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -91,7 +91,7 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH2D* ptHistogramAllchargeRec = nullptr; - + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; @@ -109,7 +109,7 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -126,7 +126,7 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - //AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; @@ -243,10 +243,10 @@ struct EventMeanPtId { histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -361,7 +361,7 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); - } + } // Configurables Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; @@ -474,7 +474,9 @@ struct EventMeanPtId { // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { @@ -490,26 +492,36 @@ struct EventMeanPtId { } histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + if (track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) {return false;} + if (track.itsChi2NCl() > cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) {return false;} + if (track.tpcChi2NCl() > cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 9); if (track.sign() == 0) return false; if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -605,21 +617,21 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); @@ -633,11 +645,11 @@ struct EventMeanPtId { const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); @@ -650,7 +662,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -662,8 +674,8 @@ struct EventMeanPtId { if (track.sign() == 0) continue; if (!selTrack(track)) - continue; - + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -683,10 +695,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); sumWeight += weight; @@ -779,19 +791,19 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -807,8 +819,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -823,12 +835,12 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - //-----------------------nch------------------------------------- + //-----------------------nch------------------------------------- histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -860,7 +872,7 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// SliceCache cache; @@ -874,12 +886,12 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - if (!selCollision(coll))//add + if (!selCollision(coll)) // add return; float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -887,7 +899,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -907,21 +919,21 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } if (!selTrack(track)) - continue; + continue; // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); - + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -996,7 +1008,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1013,8 +1025,8 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1031,7 +1043,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1066,7 +1078,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1106,7 +1118,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1116,8 +1128,7 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1164,7 +1175,6 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1226,7 +1236,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1236,8 +1246,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1246,8 +1256,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1268,8 +1278,7 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); - -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1304,8 +1313,7 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From f860d932104bbaabae347e8ef88b4321323b8b79 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Mon, 11 Aug 2025 13:41:16 +0530 Subject: [PATCH 11/23] MeanpT allcharge --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 148 +++++++++--------- 1 file changed, 70 insertions(+), 78 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index b32791feab1..8598d18e2cd 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -91,7 +91,7 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH2D* ptHistogramAllchargeRec = nullptr; - + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; @@ -109,7 +109,7 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -126,7 +126,7 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + //AxisSpec nchAxis = {4000, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; @@ -243,10 +243,10 @@ struct EventMeanPtId { histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -361,7 +361,7 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); - } + } // Configurables Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; @@ -474,9 +474,7 @@ struct EventMeanPtId { // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { @@ -492,36 +490,26 @@ struct EventMeanPtId { } histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) { - return false; - } + if (track.itsChi2NCl() > cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) { - return false; - } + if (track.tpcChi2NCl() > cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 9); if (track.sign() == 0) return false; if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -617,21 +605,21 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); @@ -645,11 +633,11 @@ struct EventMeanPtId { const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); @@ -662,7 +650,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -674,8 +662,8 @@ struct EventMeanPtId { if (track.sign() == 0) continue; if (!selTrack(track)) - continue; - + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -695,10 +683,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); sumWeight += weight; @@ -791,19 +779,19 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -819,8 +807,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -835,12 +823,12 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - //-----------------------nch------------------------------------- + //-----------------------nch------------------------------------- histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -872,7 +860,7 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// SliceCache cache; @@ -886,12 +874,12 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - if (!selCollision(coll)) // add + if (!selCollision(coll))//add return; float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -899,7 +887,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -919,21 +907,21 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } if (!selTrack(track)) - continue; + continue; // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); - + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1008,7 +996,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1025,8 +1013,8 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1043,7 +1031,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1078,7 +1066,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1118,7 +1106,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1128,7 +1116,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1175,6 +1164,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1236,7 +1226,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1246,8 +1236,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1256,8 +1246,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1278,7 +1268,8 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); - //--------------------------Pions------------------------------------------- + +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1313,10 +1304,11 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; -} \ No newline at end of file +} From 1779e6114c91f43b64695e5e7f4a452db4179ed1 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Mon, 11 Aug 2025 13:45:50 +0530 Subject: [PATCH 12/23] MeanpT allcharge --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 146 +++++++++--------- 1 file changed, 77 insertions(+), 69 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 8598d18e2cd..84ecd85c015 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -91,7 +91,7 @@ struct EventMeanPtId { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; TH2D* ptHistogramAllchargeRec = nullptr; - + Configurable ptMax{"ptMax", 2.0, "maximum pT"}; Configurable ptMin{"ptMin", 0.15, "minimum pT"}; Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; @@ -109,7 +109,7 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; @@ -126,7 +126,7 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - //AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; @@ -243,10 +243,10 @@ struct EventMeanPtId { histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -361,7 +361,7 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); - } + } // Configurables Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; @@ -474,7 +474,9 @@ struct EventMeanPtId { // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { @@ -490,26 +492,36 @@ struct EventMeanPtId { } histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + if (track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) {return false;} + if (track.itsChi2NCl() > cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) {return false;} + if (track.tpcChi2NCl() > cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 9); if (track.sign() == 0) return false; if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -605,21 +617,21 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); @@ -633,11 +645,11 @@ struct EventMeanPtId { const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); @@ -650,7 +662,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -662,8 +674,8 @@ struct EventMeanPtId { if (track.sign() == 0) continue; if (!selTrack(track)) - continue; - + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -683,10 +695,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); sumWeight += weight; @@ -779,19 +791,19 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -807,8 +819,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -823,12 +835,12 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2p"), sample, cent, var2Pr); histos.fill(HIST("Data/hVar2meanptp"), cent, var2Pr); - //-----------------------nch------------------------------------- + //-----------------------nch------------------------------------- histos.fill(HIST("Data/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -860,7 +872,7 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// SliceCache cache; @@ -874,12 +886,12 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - if (!selCollision(coll))//add + if (!selCollision(coll)) // add return; float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -887,7 +899,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -907,21 +919,21 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } if (!selTrack(track)) - continue; + continue; // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); - + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -996,7 +1008,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1013,8 +1025,8 @@ struct EventMeanPtId { q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1031,7 +1043,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1066,7 +1078,7 @@ struct EventMeanPtId { if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1106,7 +1118,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1116,8 +1128,7 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1164,7 +1175,6 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1226,7 +1236,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1236,8 +1246,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1246,8 +1256,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1268,8 +1278,7 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); - -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1304,8 +1313,7 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 678966c982cef6e72be1538b99d0fbf86a5f299e Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Mon, 11 Aug 2025 16:50:38 +0530 Subject: [PATCH 13/23] MeanpT allcharge --- PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 84ecd85c015..7ef12c2b69f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -1184,7 +1184,7 @@ struct EventMeanPtId { const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); histos.fill(HIST("hVtxZ_after_gensim"), mccolgen.posZ()); - double nchGen = 0., nchGenAll = 0., nchGenTrue = 0.; + double nchGenAll = 0., nchGenTrue = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; double nch1 = 0., nch2 = 0., nch3 = 0.; double q1AllGen = 0, q2AllGen = 0.; From f3cb0c3bc9e157e03e78ccb333d34697e7255432 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 7 Oct 2025 11:37:16 +0530 Subject: [PATCH 14/23] mean pT fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 589 ++++++++++++------ 1 file changed, 387 insertions(+), 202 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 7ef12c2b69f..f36087eed7c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -39,6 +39,7 @@ #include "Framework/runDataProcessing.h" #include +#include "TF1.h" #include #include @@ -56,33 +57,72 @@ using namespace o2::framework::expressions; using namespace std; using o2::constants::physics::Pdg; -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join NAME{#NAME, DEFAULT, HELP}; + + O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") + struct : ConfigurableGroup { + + O2_DEFINE_CONFIGURABLE(cfgMultPVFT0CCutEnabled, bool, true, "Enable PV multiplicity vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalFT0CCutEnabled, bool, true, "Enable globalTracks vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") + + Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; + + Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", + std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, + "globalTracks vs FT0C cut parameter values"}; + + Configurable> cfgMultGlobalPVCutPars{"cfgMultGlobalPVCutPars", + std::vector{65.0322, 0.557725, -0.772828, 0.059224, -1.96379e-05, 4.46295e-09}, + "globalTracks vs PV cut parameter values"}; + + std::vector multPVFT0CCutPars; + std::vector multGlobalFT0CPars; + std::vector multGlobalPVCutPars; + + TF1* fMultPVFT0CCutLow = nullptr; + TF1* fMultPVFT0CCutHigh = nullptr; + TF1* fMultGlobalFT0CCutLow = nullptr; + TF1* fMultGlobalFT0CCutHigh = nullptr; + TF1* fMultGlobalPVCutLow = nullptr; + TF1* fMultGlobalPVCutHigh = nullptr; + + } cfgFunCoeff; + + + Service ccdb; + Service pdg; + + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; + +using MyTracks = soa::Filtered; + aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFbeta, aod::TOFSignal, aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection>>; +using MyTrack = MyTracks::iterator; -using MyMCRecoCollisions = soa::Join; + +using MyMCRecoCollisions = soa::Filtered>; using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using MyMCRecoTracks = soa::Join; + aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFbeta, aod::TOFSignal, aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>>; using MyMCRecoTrack = MyMCRecoTracks::iterator; using EventCandidatesMC = soa::Join; -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod -struct EventMeanPtId { - Service ccdb; - Service pdg; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -97,6 +137,7 @@ struct EventMeanPtId { Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -109,14 +150,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -126,12 +167,13 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + AxisSpec tnchAxis = {40, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; - AxisSpec chi2Axis = {100, 0., 100., "Chi2"}; - AxisSpec crossedRowTpcAxis = {600, 0., 600., "TPC Crossed rows"}; + AxisSpec tpcchi2Axis = {700, 0., 7., "tpc Chi2"}; + AxisSpec itschi2Axis = {400, 0., 40., "its Chi2"}; + AxisSpec crossedRowTpcAxis = {1600, 0., 160., "TPC Crossed rows"}; AxisSpec counter = {10, 0., 10., "events"}; // QA Plots @@ -163,6 +205,7 @@ struct EventMeanPtId { histos.add("Data/hP", "hP", kTH1D, {pAxis}); histos.add("Data/hEta", ";hEta", kTH1D, {etaAxis}); histos.add("Data/hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hPtvar", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); histos.add("Data/hNsigmaTPC", "hNsigmaTPC", kTH2D, {pAxis, nSigmaTPCAxis}); histos.add("Data/hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); histos.add("Data/hDCAz", "hDCAz", kTH1D, {dcazAxis}); @@ -211,6 +254,9 @@ struct EventMeanPtId { histos.add("Data/hVar1x", "hVar1x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2x", "hVar2x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVarx", "hVarx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar1x", "hdiffVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar2x", "hdiffVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVarx", "hdiffVarx", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2meanptx", "hVar2meanptx", kTH2D, {nchAxis, varAxis2}); histos.add("Data/hVar1pix", "hVar1pix", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2pix", "hVar2pix", kTH2D, {subAxis, nchAxis}); @@ -236,17 +282,29 @@ struct EventMeanPtId { histos.add("Data/hdEdx_afterselection", "hdEdx_afterselection", kTH2D, {pAxis, dEdxAxis}); histos.add("Data/hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); histos.add("Data/hdEdx_afterselection1", "hdEdx_afterselection1", kTH2D, {pAxis, dEdxAxis}); - histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_before", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); - histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); - + histos.add("Data/hcentFT0A_nacc", "hcentFT0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0M_nacc", "hcentFT0M_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFV0A_nacc", "hcentFV0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_before", "hNchPV_NchGlobal_before", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_before", "hcentFT0C_GlobalNch_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_before", "hcentFT0C_NchPV_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after", "hNchPV_NchGlobal_after", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_after", "hcentFT0C_GlobalNch_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_after", "hcentFT0C_NchPV_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -297,17 +355,21 @@ struct EventMeanPtId { histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); histos.add("hnch_gen_all", ";hnch_gen_all", kTH1D, {nchAxis}); - histos.add("hnch_gen_true", ";hnch_gen_true", kTH1D, {nchAxis}); - histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); - histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); - histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); + histos.add("hnch_gen_after_etacut", ";hnch_gen_after_etacut", kTH1D, {nchAxis}); + histos.add("hnch_afterPhysPrimary", ";hnch_afterPhysPrimary", kTH1D, {nchAxis}); histos.add("hnch_pi", ";hnch_pi", kTH1D, {nchAxis}); histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); - + histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); + histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar1x_gen", "hdiffVar1x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar2x_gen", "hdiffVar2x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVarx_gen", "hdiffVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptx_gen", "hVar2meanptx_gen", kTH2D, {nchAxis, varAxis2}); histos.add("hVar1pix_gen", "hVar1pix_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2pix_gen", "hVar2pix_gen", kTH2D, {subAxis, nchAxis}); @@ -341,7 +403,8 @@ struct EventMeanPtId { histos.add("hPty_pi_gen", "hPty_pi_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_ka_gen", "hPty_ka_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_pr_gen", "hPty_pr_gen", kTH2D, {ptAxis, etaAxis}); - histos.add("hNch_vs_corr", "hNch_vs_corr", kTH1D, {nchAxis}); + histos.add("hNch_vs_corr", "hNch_vs_corr", kTH2D, {subAxis, nchAxis}); + histos.add("hNch_vs_Nch", "hNch_vs_Nch", kTH2D, {subAxis, nchAxis}); histos.add("hVar1_gen", "hVar1_gen", kTH2D, {subAxis, centAxis}); histos.add("hVar2_gen", "hVar2_gen", kTH2D, {subAxis, centAxis}); histos.add("hVarc_gen", "hVarc_gen", kTH2D, {subAxis, centAxis}); @@ -361,15 +424,67 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); - } - - // Configurables - Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; - Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; - Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; - Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; - Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 2.0, "DCA Z cut"}; + histos.add("hterm1", "hterm1", kTProfile, {tnchAxis}); + histos.add("hterm2", "hterm2", kTProfile, {tnchAxis}); + histos.add("hterm1_gen", "hterm1_gen", kTProfile, {tnchAxis}); + histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); + histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); + histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); + + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; + cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; + cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; + + Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + + + cfgFunCoeff.fMultPVFT0CCutLow = + new TF1("fMultPVFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutLow->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultPVFT0CCutHigh = + new TF1("fMultPVFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutHigh->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutLow = + new TF1("fMultGlobalFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutLow->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutHigh = + new TF1("fMultGlobalFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutHigh->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalPVCutLow = + new TF1("fMultGlobalPVCutLow", + "[0] + [1]*x - 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutLow->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + + cfgFunCoeff.fMultGlobalPVCutHigh = + new TF1("fMultGlobalPVCutHigh", + "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + + } + + // Configurables + Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0f, "Pt max cut"}; + Configurable cPtmincut1{"cPtmincut1", 0.15f, " Pt min cut"}; + Configurable cPtmaxcut1{"cPtmaxcut1", 2.0f, " Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.3f, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 2.0f, "DCA Z cut"}; Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; @@ -393,11 +508,18 @@ struct EventMeanPtId { Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; + Configurable cPVContributor{"cPVContributor", false, "Enable Primary Vertex Contributor"}; + Configurable cDCAxy{"cDCAxy", true, "DCAxy cut"}; + Configurable cDCAz{"cDCAz", true, "DCAz cut"}; + Configurable cTPCcr{"cTPCcr", true, "tpc crossed rows"}; + Configurable cITSchi{"cITSchi", true, "ITS chi2"}; + Configurable cTPCchi{"cTPCchi", true, "TPC chi2"}; + Configurable ccentFT0C{"ccentFT0C", true, "Use FT0C centraity"}; // PID selection configurables - Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; - Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; - Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; + Configurable cPionPmincut{"cPionPmincut", 0.15, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.15, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.15, "proton min cut of proton"}; Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; @@ -414,16 +536,50 @@ struct EventMeanPtId { Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + { + if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { + + if (pvTrack < cfgFunCoeff.fMultPVFT0CCutLow->Eval(centrality)) + return false; + if (pvTrack > cfgFunCoeff.fMultPVFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalFT0CCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalFT0CCutLow->Eval(centrality)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalPVCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalPVCutLow->Eval(pvTrack)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalPVCutHigh->Eval(pvTrack)) + return false; + } + + return true; + } + template - bool selCollision(C const& coll) + bool selCollision(C const& coll, float& cent) { - if (std::abs(coll.posZ()) > cVtxZcut) { + if (std::abs(coll.posZ()) >= cVtxZcut) { return false; } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - // cent = coll.centFT0M(); //centrality for run3 + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C + } else { + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -451,8 +607,8 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - - // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { @@ -471,57 +627,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (track.pt() < cPtmincut) { - return false; - } - if (track.pt() > cPtmaxcut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if (track.sign() == 0) {return false;} - if (track.sign() == 0) - return false; + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); + } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -617,43 +757,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - { + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) + + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } - const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; // subsample error estimation + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -662,7 +819,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -671,11 +828,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (track.sign() == 0) - continue; - if (!selTrack(track)) - continue; - + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; + histos.fill(HIST("Data/hnch"), nch); + histos.fill(HIST("Data/hPtvar"), track.pt()); + } + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -695,19 +857,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Data/hnch"), nch); - } + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -791,19 +947,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! + histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); + histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); + histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -819,8 +978,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -840,7 +999,10 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); - + histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Data/hdiffVarx"), sample, nch); + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -871,27 +1033,39 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); } // event loop ends! - PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); - + PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll)) // add - return; + if (!selCollision(coll,cent)) return; - float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); + + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -899,7 +1073,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -910,33 +1084,43 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - // if (std::fabs(track.y()) > 0.5) continue; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; + histos.fill(HIST("Rec/hnch"), nch); + histos.fill(HIST("Rec/hPtvar"), track.pt()); + } + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + histos.fill(HIST("Rec/hnchAll"), nchAll); histos.fill(HIST("ptHistogramAllchargeRec"), track.pt()); histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); @@ -953,15 +1137,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Rec/hnch"), nch); - } - q1 += track.pt(); - q2 += (track.pt() * track.pt()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1003,12 +1179,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1019,14 +1193,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1038,12 +1212,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1054,7 +1226,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1073,12 +1245,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1089,7 +1259,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1102,7 +1272,8 @@ struct EventMeanPtId { } // loop over tracks histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); - histos.fill(HIST("hNch_vs_corr"), nchAll, sumWeight); + histos.fill(HIST("hNch_vs_corr"), sample, nchAll, sumWeight); + histos.fill(HIST("hNch_vs_Nch"), sample, nchAll, nchAll); if (nchAll < cTwoPtlCut2) return; @@ -1110,6 +1281,8 @@ struct EventMeanPtId { var2 = (q1 / nchAll); //------------------ Efficiency corrected histograms --------------- + histos.fill(HIST("hterm1"), nchAll, var1); + histos.fill(HIST("hterm2"), nchAll, var2); var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); @@ -1118,7 +1291,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1128,7 +1301,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1150,6 +1324,10 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Rec/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Rec/hVarx"), sample, nchAll); + histos.fill(HIST("Rec/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Rec/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Rec/hdiffVarx"), sample, nch); + histos.fill(HIST("Rec/hVar2meanptx"), nchAll, var2); histos.fill(HIST("Rec/hVar1pix"), sample, nchAll, var1Pi); histos.fill(HIST("Rec/hVar2pix"), sample, nchAll, var2Pi); @@ -1174,7 +1352,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1184,9 +1362,8 @@ struct EventMeanPtId { const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); histos.fill(HIST("hVtxZ_after_gensim"), mccolgen.posZ()); - double nchGenAll = 0., nchGenTrue = 0.; + double nchGenAll = 0., nchGenTrue = 0., nch1 = 0., nchgen = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; - double nch1 = 0., nch2 = 0., nch3 = 0.; double q1AllGen = 0, q2AllGen = 0.; double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0; double var1AllGen = 0, var2AllGen = 0.; @@ -1201,12 +1378,8 @@ struct EventMeanPtId { continue; } nch1++; - histos.fill(HIST("hnch1"), nch1); - nch2++; - histos.fill(HIST("hnch2"), nch2); - nch3++; - histos.fill(HIST("hnch3"), nch3); - + histos.fill(HIST("hnch_afterPhysPrimary"), nch1); + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1217,12 +1390,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; - histos.fill(HIST("hnch_gen_true"), nchGenTrue); - if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) - continue; + histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); + + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; + histos.fill(HIST("hnch_gen"), nchgen); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + } + + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1236,7 +1414,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1246,8 +1424,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1256,8 +1434,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1266,7 +1444,7 @@ struct EventMeanPtId { } //|y| < 0.5 cut ends! - } // particle + } // track loop ends! histos.fill(HIST("hcent_nacc_gen"), cent, nchGenAll); if (nchGenAll < cTwoPtlCut2) @@ -1278,7 +1456,9 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); - //--------------------------Pions------------------------------------------- + histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); + histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1297,6 +1477,10 @@ struct EventMeanPtId { histos.fill(HIST("hVar1x_gen"), sampleGen, nchGenAll, var1AllGen); histos.fill(HIST("hVar2x_gen"), sampleGen, nchGenAll, var2AllGen); histos.fill(HIST("hVarx_gen"), sampleGen, nchGenAll); + histos.fill(HIST("hdiffVar1x_gen"), sampleGen, nchgen, var1AllGen); + histos.fill(HIST("hdiffVar2x_gen"), sampleGen, nchgen, var2AllGen); + histos.fill(HIST("hdiffVarx_gen"), sampleGen, nchgen); + histos.fill(HIST("hVar2meanptx_gen"), nchGenAll, var2AllGen); histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); @@ -1312,8 +1496,9 @@ struct EventMeanPtId { histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); } // void process - PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); -}; + PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From f022f13afa0b271157a288f2db74ee62c81c4111 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Mon, 9 Jun 2025 16:44:35 +0530 Subject: [PATCH 15/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 14dc66b22f0..54ff11c6ce8 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -10,7 +10,7 @@ # or submit itself to any jurisdiction. o2physics_add_dpl_workflow(meanpt-fluctuations - SOURCES MeanptFluctuations.cxx + SOURCES meanptFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -20,7 +20,7 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(netproton-cumulants - SOURCES NetProtonCumulants.cxx + SOURCES netprotonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -40,17 +40,17 @@ o2physics_add_dpl_workflow(event-mean-pt-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(robust-fluctuation-observables - SOURCES RobustFluctuationObservables.cxx + SOURCES robustFluctuationObservables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(v0pt-pp-task - SOURCES Diff_pT_fluct_PID.cxx + SOURCES v0ptPpTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(factorial-moments - SOURCES FactorialMomentsTask.cxx + SOURCES factorialMoments.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) From e15ffdc4ce4a9d6667e25a78a70263c8f0939dbb Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 10 Jun 2025 13:01:41 +0530 Subject: [PATCH 16/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 13 +- .../Tasks/Diff_pT_fluct_PID.cxx | 760 ------------------ 2 files changed, 4 insertions(+), 769 deletions(-) delete mode 100644 PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 54ff11c6ce8..db3b87fd22f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -10,7 +10,7 @@ # or submit itself to any jurisdiction. o2physics_add_dpl_workflow(meanpt-fluctuations - SOURCES meanptFluctuations.cxx + SOURCES MeanptFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -20,7 +20,7 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(netproton-cumulants - SOURCES netprotonCumulants.cxx + SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -40,17 +40,12 @@ o2physics_add_dpl_workflow(event-mean-pt-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(robust-fluctuation-observables - SOURCES robustFluctuationObservables.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(v0pt-pp-task - SOURCES v0ptPpTask.cxx + SOURCES RobustFluctuationObservables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(factorial-moments - SOURCES factorialMoments.cxx + SOURCES FactorialMomentsTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx b/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx deleted file mode 100644 index 5710ab1e864..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx +++ /dev/null @@ -1,760 +0,0 @@ -// 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. -/// -/// \brief This task provides the parameters required to calculate the observable -/// v0(pT) along with its statistical uncertainity using subsampling technique. -/// \author Anna Binoy (anna.binoy@niser.ac.in) - -#include -#include -#include -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/StaticFor.h" - -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "TList.h" -#include "TProfile.h" -#include "TProfile2D.h" -#include "TH2D.h" -#include "TH1D.h" -#include "TRandom3.h" -#include "TMath.h" -#include "TF1.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace std; - -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; - -double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); -double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); -double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); - -struct Diff_pT_fluct_PID { - // Histogram registry: an object to hold your histograms - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - std::vector>> Subsample; - TRandom3* fRndm = new TRandom3(0); - - Configurable nPtBins_qa{"nBinsPt_qa", 280, "N bins in pT histo qualitative analysis"}; - - Configurable nPtBins{"nBinsPt", 14, "N bins in pT histo"}; - Configurable nEtaBins{"nEtaBins", 100, ""}; - - Configurable ptMax{"ptMax", 3.0, "maximum pT"}; - Configurable ptMin{"ptMin", 0.2, "minimum pT"}; - - Configurable etaMin{"etaMin", 0.4, "Eta min"}; - Configurable etaCut{"etaCut", 0.8, "Eta cut"}; - Configurable rapCut{"rapCut", 0.5, "Rapidity Cut"}; - - Configurable cfgCutPtUpperTPC{"cfgCutPtUpperTPC", 0.6f, "Upper pT cut for PID using TPC only"}; - Configurable cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"}; - Configurable cfgnSigmaCut{"cfgnSigmaCut", 2.0f, "PID nSigma cut"}; - - Configurable cfgnSigmaCut_TPC_pi{"cfgnSigmaCut_TPC_pi", 2.0f, "PID nSigma cut for TPC for pion"}; - Configurable cfgnSigmaCut_TOF_pi{"cfgnSigmaCut_TOF_pi", 3.0f, "PID nSigma cut for TOF for pion"}; - Configurable cfgnSigmaCut_TPC_ka{"cfgnSigmaCut_TPC_ka", 2.0f, "PID nSigma cut for TPC for kaon"}; - Configurable cfgnSigmaCut_TOF_ka{"cfgnSigmaCut_TOF_ka", 3.0f, "PID nSigma cut for TOF for kaon"}; - Configurable cfgnSigmaCut_TPC_pr{"cfgnSigmaCut_TPC_pr", 2.0f, "PID nSigma cut for TPC for proton"}; - Configurable cfgnSigmaCut_TOF_pr{"cfgnSigmaCut_TOF_pr", 3.0f, "PID nSigma cut for TOF for proton"}; - - // QualityCuts - - Configurable dcaXYCut{"dcaXYCut", 0.2, "DCAxy cut"}; - Configurable dcaZCut{"dcaZCut", 2.0, "DCAz cut"}; - Configurable posZCut{"posZCut", 10.0, "cut for vertex Z"}; - - Configurable TPCNCrossedRowsCut{"TPCNCrossedRowsCut", 2.5, "n_TPC crossed rows Cut"}; - Configurable chi2TPCperClstrCut{"chi2TPCperClstrCut", 4, "Chi2 TPC per Cluster Cut"}; - Configurable chi2ITSperClstrCut{"chi2ITSperClstrCut", 36, "Chi2 ITS per Cluster Cut"}; - - ConfigurableAxis dcaXYBins{"dcaXYBins", {100, -0.15, 0.15}, "dcaXY bins"}; - ConfigurableAxis dcaZBins{"dcaZBins", {100, -1.2, 1.2}, "dcaZ bins"}; - - O2_DEFINE_CONFIGURABLE(cfgUse22sEventCut, bool, true, "Use 22s event cut on mult correlations") - - // Connect to ccdb - Service ccdb; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; - - // for the sub-sampling - Configurable cfgNSubsample{"cfgNSubsample", 10, "Number of subsamples"}; - - // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - - // This is an example of a convenient declaration of "using" - using MyAllTracks = soa::Join; - using MyRun2Collisions = soa::Join; - using MyRun3Collisions = soa::Join; - - void init(InitContext const&) - { - - const AxisSpec axisEvents{5, 0, 5, "Counts"}; - const AxisSpec axisEta{nEtaBins, -1., +1., "#eta"}; - const AxisSpec axisY{nEtaBins, -1., +1., "Rapidity"}; - const AxisSpec axisPt{nPtBins, 0.2, 3., "p_{T} (GeV/c)"}; - const AxisSpec axisPt_qa{nPtBins_qa, 0.2, 3., "p_{T} (GeV/c)"}; - const AxisSpec axisP{nPtBins, 0.2, 3., "p (GeV/c)"}; - const AxisSpec axisCent{100, 0., 100, ""}; - const AxisSpec axis1Bin{1, 0., 1, ""}; - - const AxisSpec axisNumberOfHadronEtaLess0{3000, 0, 3000, "Number of proton eta less than 0"}; - const AxisSpec axisNumberOfProtonEtaLess0{3000, 0, 3000, "Number of proton eta less than 0"}; - const AxisSpec axisNumberOfPionEtaLess0{3000, 0, 3000, "Number of pion eta less than 0"}; - const AxisSpec axisNumberOfKaonEtaLess0{3000, 0, 3000, "Number of kaon eta less than 0"}; - - const AxisSpec axisVtxZ{80, -20., 20., "V_{Z} (cm)"}; - const AxisSpec axisDCAz{dcaZBins, "DCA_{Z} (cm)"}; - const AxisSpec axisDCAxy{dcaXYBins, "DCA_{XY} (cm)"}; - const AxisSpec axisTPCNsigma{500, -5., 5., "n #sigma_{TPC}"}; - const AxisSpec axisTOFNsigma{500, -5., 5., "n #sigma_{TOF}"}; - const AxisSpec axisTPCTOFNsigma{800, -8., 8., "n #sigma_{TOF+TPC}"}; - const AxisSpec axisTPCSignal{720, 20., 200., "#frac{dE}{dx}"}; - const AxisSpec axisTOFSignal{400, 0.2, 1.2, "TOF #beta"}; - const AxisSpec axisChi2{50, 0., 50., "Chi2"}; - const AxisSpec axisCrossedTPC{500, 0, 500, "Crossed TPC"}; - - HistogramConfigSpec TOFnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTOFNsigma}}); - HistogramConfigSpec TOFSignalHist({HistType::kTH2D, {axisPt_qa, axisTOFSignal}}); - HistogramConfigSpec TPCnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTPCNsigma}}); - HistogramConfigSpec TPCSignalHist({HistType::kTH2D, {axisPt_qa, axisTPCSignal}}); - HistogramConfigSpec TPCTOFHist({HistType::kTH2D, {axisTPCNsigma, axisTOFNsigma}}); - HistogramConfigSpec TPCTOFnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTPCTOFNsigma}}); - - histos.add("fA_hadron", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_pion", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_kaon", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_proton", "", kTProfile2D, {axisCent, axisPt}); - - histos.add("fB1_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - histos.add("fB2_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - histos.add("fC_hadron", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_pion", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_kaon", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_proton", "", kTProfile2D, {axisCent, axisPt}); - - histos.add("fD_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - // QA Plots: - histos.add("QA/before/h_VtxZ", "V_{Z}", kTH1D, {axisVtxZ}); - histos.add("QA/before/h_TPCChi2perCluster", "TPC #Chi^{2}/Cluster", kTH1D, {axisChi2}); - histos.add("QA/before/h_ITSChi2perCluster", "ITS #Chi^{2}/Cluster", kTH1D, {axisChi2}); - histos.add("QA/before/h_crossedTPC", "Crossed TPC", kTH1D, {axisCrossedTPC}); - histos.add("QA/before/h2_DcaZ", "DCA_{Z}", kTH1D, {axisDCAz}); - histos.add("QA/before/h2_DcaXY", "DCA_{XY}", kTH1D, {axisDCAxy}); - histos.add("QA/before/h2_TPCSignal", "TPC Signal", TPCSignalHist); - histos.add("QA/before/h2_TOFSignal", "TOF Signal", TOFSignalHist); - - histos.addClone("QA/before/", "QA/after/"); - - histos.add("QA/Pion/h_Pt", "p_{T} (TPC & TPC+TOF)", kTH1D, {axisPt_qa}); - histos.add("QA/Pion/h_rap", "y (TPC & TPC+TOF)", kTH1D, {axisY}); - histos.add("QA/Pion/h2_Pt_rap", "p_{T} vs y", kTH2D, {{axisY}, {axisPt_qa}}); - histos.add("QA/Pion/h2_DcaZ", "DCA_{z}", kTH2D, {{axisPt_qa}, {axisDCAz}}); - histos.add("QA/Pion/h2_DcaXY", "DCA_{xy}", kTH2D, {{axisPt_qa}, {axisDCAxy}}); - - histos.add("QA/Pion/before/h2_TPCNsigma", "n #sigma_{TPC}", TPCnSigmaHist); - histos.add("QA/Pion/before/h2_TOFNsigma", "n #sigma_{TOF}", TOFnSigmaHist); - histos.add("QA/Pion/before/h2_TpcTofNsigma", "n #sigma_{TPC} vs n #sigma_{TOF}", TPCTOFHist); - histos.add("QA/Pion/before/h2_TpcTofNsigma1", "n #sigma_{TPC+TOF}", TPCTOFnSigmaHist); - - histos.add("QA/Pion/h2_TPCNsigma", "n #sigma_{TPC}", TPCnSigmaHist); - histos.add("QA/Pion/h2_TOFNsigma", "n #sigma_{TOF}", TOFnSigmaHist); - histos.add("QA/Pion/h2_TpcTofNsigma", "n #sigma_{TPC} vs n #sigma_{TOF}", TPCTOFHist); - histos.add("QA/Pion/h2_TpcTofNsigma1", "n #sigma_{TPC+TOF}", TPCTOFnSigmaHist); - - histos.add("QA/Pion/h2_TPCSignal", "TPC Signal vs pT", TPCSignalHist); - histos.add("QA/Pion/h2_TOFSignal", "TOF Signal vs pT", TOFSignalHist); - histos.add("QA/Pion/h2_ExpTPCSignal", "Expected TPC Signal vs pT", TPCSignalHist); - - histos.addClone("QA/Pion/", "QA/Kaon/"); - histos.addClone("QA/Pion/", "QA/Proton/"); - - // Define Subsamples - Subsample.resize(cfgNSubsample); - for (int i = 0; i < cfgNSubsample; i++) { - Subsample[i].resize(20); - } - for (int i = 0; i < cfgNSubsample; i++) { - Subsample[i][0] = std::get>(histos.add(Form("Subsample_%d/fA_hadron", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][1] = std::get>(histos.add(Form("Subsample_%d/fA_pion", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][2] = std::get>(histos.add(Form("Subsample_%d/fA_kaon", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][3] = std::get>(histos.add(Form("Subsample_%d/fA_proton", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - - Subsample[i][4] = std::get>(histos.add(Form("Subsample_%d/fB1_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][5] = std::get>(histos.add(Form("Subsample_%d/fB1_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][6] = std::get>(histos.add(Form("Subsample_%d/fB1_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][7] = std::get>(histos.add(Form("Subsample_%d/fB1_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - - Subsample[i][8] = std::get>(histos.add(Form("Subsample_%d/fB2_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][9] = std::get>(histos.add(Form("Subsample_%d/fB2_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][10] = std::get>(histos.add(Form("Subsample_%d/fB2_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][11] = std::get>(histos.add(Form("Subsample_%d/fB2_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - - Subsample[i][12] = std::get>(histos.add(Form("Subsample_%d/fC_hadron", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][13] = std::get>(histos.add(Form("Subsample_%d/fC_pion", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][14] = std::get>(histos.add(Form("Subsample_%d/fC_kaon", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][15] = std::get>(histos.add(Form("Subsample_%d/fC_proton", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - - Subsample[i][16] = std::get>(histos.add(Form("Subsample_%d/fD_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][17] = std::get>(histos.add(Form("Subsample_%d/fD_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][18] = std::get>(histos.add(Form("Subsample_%d/fD_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][19] = std::get>(histos.add(Form("Subsample_%d/fD_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - } - } - - template - bool selRun2Col(T const& col) - { - if (std::abs(col.posZ()) > posZCut) - return false; - - if (!col.sel7()) - return false; - - if (!col.alias_bit(kINT7)) - return false; - - return true; - } - - template - bool selRun3Col(T const& col) - { - if (std::abs(col.posZ()) > posZCut) - return false; - - if (!col.sel8()) - return false; - - return true; - } - - template - bool selTrack(T const& track) - { - - // kinematic cuts - - if (track.pt() < ptMin) - return false; - - if (track.pt() > ptMax) - return false; - - if (std::abs(track.eta()) > etaCut) - return false; - - if (std::abs(track.dcaZ()) > dcaZCut) - return false; - - if (std::abs(track.dcaXY()) > dcaXYCut) - return false; - - if (track.tpcChi2NCl() > chi2TPCperClstrCut) - return false; - - if (track.itsChi2NCl() > chi2ITSperClstrCut) - return false; - - if (track.tpcNClsCrossedRows() > TPCNCrossedRowsCut) - return false; - - if (!track.isGlobalTrack()) - return false; - - return true; - } - - template - bool selPions(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - if (track.pt() <= cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pi) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_pi) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_pi) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_pi) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaPi < cfgnSigmaCut_TOF_pi) - return true; - } - - return false; - } - - template - bool selKaons(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - if (track.pt() <= cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_ka) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_ka) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_ka) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_ka) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaKa < cfgnSigmaCut_TOF_ka) - return true; - } - - return false; - } - - template - bool selProtons(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - // if (abs(track.rapidity(massPr)) < 0.5) - // return true; - if (track.pt() <= cfgCutPtUpperTPC && track.pt() > 0.4) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pr) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_pr) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_pr) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_pr) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaPr < cfgnSigmaCut_TOF_pr) - return true; - } - - return false; - } - - void process(MyRun3Collisions::iterator const& col, MyAllTracks const& tracks) - { - double Cent_FT0M = 0; - - if (selRun3Col(col)) { - - Cent_FT0M = col.centFT0M(); - - Double_t pT_bin[14] = {0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9}; - - Double_t N_Pi_eta_less_0 = 0; - Double_t N_Ka_eta_less_0 = 0; - Double_t N_Pr_eta_less_0 = 0; - Double_t Nch_eta_less_0 = 0; - - Double_t pT_sum_etaLess0 = 0; - Double_t pT_sum_etaGreaterEtamin = 0; - Double_t N_sum_etaGreaterEtamin = 0; - - Double_t pt_Ch = 0, pt_Pi = 0, pt_Ka = 0, pt_Pr = 0; - - Double_t fA_hadron[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_pion[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_kaon[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_proton[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - Double_t fB1_hadron = 0; - Double_t fB1_pion = 0; - Double_t fB1_kaon = 0; - Double_t fB1_proton = 0; - - Double_t fB2_hadron = 0; - Double_t fB2_pion = 0; - Double_t fB2_kaon = 0; - Double_t fB2_proton = 0; - - Double_t fC_hadron[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_pion[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_kaon[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_proton[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - Double_t fD_hadron = 0; - Double_t fD_pion = 0; - Double_t fD_kaon = 0; - Double_t fD_proton = 0; - - // normal creation of a histogram - TH1D* fPt_profile = new TH1D("fPt_profile", "fPt_profile", 14, 0.2, 3); - TH1D* fPt_profile_pion = new TH1D("fPt_profile_pion", "fPt_profile_pion", 14, 0.2, 3); - TH1D* fPt_profile_kaon = new TH1D("fPt_profile_kaon", "fPt_profile_kaon", 14, 0.2, 3); - TH1D* fPt_profile_proton = new TH1D("fPt_profile_proton", "fPt_profile_proton", 14, 0.2, 3); - - for (auto& track : tracks) { - - histos.fill(HIST("QA/before/h2_DcaXY"), track.dcaXY()); - histos.fill(HIST("QA/before/h2_DcaZ"), track.dcaZ()); - histos.fill(HIST("QA/before/h_VtxZ"), col.posZ()); - - histos.fill(HIST("QA/before/h_TPCChi2perCluster"), track.tpcChi2NCl()); - histos.fill(HIST("QA/before/h_ITSChi2perCluster"), track.itsChi2NCl()); - histos.fill(HIST("QA/before/h_crossedTPC"), track.tpcNClsCrossedRows()); - - if (selTrack(track)) - continue; - - histos.fill(HIST("QA/after/h2_DcaXY"), track.dcaXY()); - histos.fill(HIST("QA/after/h2_DcaZ"), track.dcaZ()); - - histos.fill(HIST("QA/after/h_TPCChi2perCluster"), track.tpcChi2NCl()); - histos.fill(HIST("QA/after/h_ITSChi2perCluster"), track.itsChi2NCl()); - histos.fill(HIST("QA/after/h_crossedTPC"), track.tpcNClsCrossedRows()); - - histos.fill(HIST("QA/before/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/before/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - histos.fill(HIST("QA/Pion/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST("QA/Pion/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/before/h2_TpcTofNsigma"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - - histos.fill(HIST("QA/Proton/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST("QA/Proton/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/before/h2_TpcTofNsigma"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - histos.fill(HIST("QA/Kaon/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST("QA/Kaon/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/before/h2_TpcTofNsigma"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - - const float combNSigmaPi1 = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa1 = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr1 = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - histos.fill(HIST("QA/Pion/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaPi1); - histos.fill(HIST("QA/Kaon/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaKa1); - histos.fill(HIST("QA/Proton/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaPr1); - - if (track.eta() < 0) { - Nch_eta_less_0++; - pt_Ch = track.pt(); - - pT_sum_etaLess0 += pt_Ch; - fPt_profile->Fill(pt_Ch); - - // For Pions: - if (selPions(track)) { - N_Pi_eta_less_0++; - pt_Pi = track.pt(); - - fPt_profile_pion->Fill(pt_Pi); - - // QA - histos.fill(HIST("QA/Pion/h_Pt"), track.pt()); - histos.fill(HIST("QA/Pion/h_rap"), track.rapidity(massPi)); - histos.fill(HIST("QA/Pion/h2_Pt_rap"), track.rapidity(massPi), track.pt()); - histos.fill(HIST("QA/Pion/h2_DcaXY"), track.pt(), track.dcaXY()); - histos.fill(HIST("QA/Pion/h2_DcaZ"), track.pt(), track.dcaZ()); - - histos.fill(HIST("QA/Pion/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TOFNsigma"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TpcTofNsigma"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Pion/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Pion/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalPi(track.tpcSignal())); - - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - const float combNSigmaPi2 = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - - histos.fill(HIST("QA/Pion/h2_TpcTofNsigma1"), track.pt(), combNSigmaPi2); - } - - // For Kaons: - if (selKaons(track)) { - N_Ka_eta_less_0++; - pt_Ka = track.pt(); - - fPt_profile_kaon->Fill(pt_Ka); - - // QA - - histos.fill(HIST("QA/Kaon/h_Pt"), track.pt()); - histos.fill(HIST("QA/Kaon/h_rap"), track.rapidity(massKa)); - histos.fill(HIST("QA/Kaon/h2_Pt_rap"), track.rapidity(massKa), track.pt()); - histos.fill(HIST("QA/Kaon/h2_DcaXY"), track.pt(), track.dcaXY()); - histos.fill(HIST("QA/Kaon/h2_DcaZ"), track.pt(), track.dcaZ()); - - histos.fill(HIST("QA/Kaon/h2_TPCNsigma"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TOFNsigma"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TpcTofNsigma"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Kaon/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Kaon/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalKa(track.tpcSignal())); - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - const float combNSigmaKa2 = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - - histos.fill(HIST("QA/Kaon/h2_TpcTofNsigma1"), track.pt(), combNSigmaKa2); - } - - // For Protons: - if (selProtons(track)) { - N_Pr_eta_less_0++; - pt_Pr = track.pt(); - - fPt_profile_proton->Fill(pt_Pr); - - // QA - - histos.fill(HIST("QA/Proton/h_Pt"), track.pt()); - histos.fill(HIST("QA/Proton/h_rap"), track.rapidity(massPr)); - histos.fill(HIST("QA/Proton/h2_Pt_rap"), track.rapidity(massPr), track.pt()); - histos.fill(HIST("QA/Proton/h2_DcaZ"), track.pt(), track.dcaZ()); - histos.fill(HIST("QA/Proton/h2_DcaXY"), track.pt(), track.dcaXY()); - - histos.fill(HIST("QA/Proton/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TOFNsigma"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TpcTofNsigma"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Proton/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Proton/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalPr(track.tpcSignal())); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - - const float combNSigmaPr2 = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - histos.fill(HIST("QA/Proton/h2_TpcTofNsigma1"), track.pt(), combNSigmaPr2); - } - - } else if (track.eta() > etaMin) { - pT_sum_etaGreaterEtamin += pt_Ch; - N_sum_etaGreaterEtamin++; - } - } - - // selecting subsample and filling profiles - float l_Random = fRndm->Rndm(); - int SampleIndex = static_cast(cfgNSubsample * l_Random); - - // B1, B2, and D Calculation for hadrons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0) { - fB1_hadron = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_hadron"), Cent_FT0M, 0.5, fB1_hadron); - Subsample[SampleIndex][4]->Fill(Cent_FT0M, 0.5, fB1_hadron); - - fB2_hadron = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_hadron"), Cent_FT0M, 0.5, fB2_hadron); - Subsample[SampleIndex][8]->Fill(Cent_FT0M, 0.5, fB2_hadron); - - fD_hadron = fB1_hadron * fB2_hadron; - histos.fill(HIST("fD_hadron"), Cent_FT0M, 0.5, fD_hadron); - Subsample[SampleIndex][16]->Fill(Cent_FT0M, 0.5, fD_hadron); - } - - // B1, B2, and D Calculation for pions - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Pi_eta_less_0 != 0) { - fB1_pion = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_pion"), Cent_FT0M, 0.5, fB1_pion); - Subsample[SampleIndex][5]->Fill(Cent_FT0M, 0.5, fB1_pion); - - fB2_pion = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_pion"), Cent_FT0M, 0.5, fB2_pion); - Subsample[SampleIndex][9]->Fill(Cent_FT0M, 0.5, fB2_pion); - - fD_pion = fB1_pion * fB2_pion; - histos.fill(HIST("fD_pion"), Cent_FT0M, 0.5, fD_pion); - Subsample[SampleIndex][17]->Fill(Cent_FT0M, 0.5, fD_pion); - } - - // B1, B2, and D Calculation for kaons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Ka_eta_less_0 != 0) { - fB1_kaon = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_kaon"), Cent_FT0M, 0.5, fB1_kaon); - Subsample[SampleIndex][6]->Fill(Cent_FT0M, 0.5, fB1_kaon); - - fB2_kaon = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_kaon"), Cent_FT0M, 0.5, fB2_kaon); - Subsample[SampleIndex][10]->Fill(Cent_FT0M, 0.5, fB2_kaon); - - fD_kaon = fB1_kaon * fB2_kaon; - histos.fill(HIST("fD_kaon"), Cent_FT0M, 0.5, fD_kaon); - Subsample[SampleIndex][18]->Fill(Cent_FT0M, 0.5, fD_kaon); - } - - // B1, B2, and D Calculation for protons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Pr_eta_less_0 != 0) { - fB1_proton = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_proton"), Cent_FT0M, 0.5, fB1_proton); - Subsample[SampleIndex][7]->Fill(Cent_FT0M, 0.5, fB1_proton); - - fB2_proton = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_proton"), Cent_FT0M, 0.5, fB2_proton); - Subsample[SampleIndex][11]->Fill(Cent_FT0M, 0.5, fB2_proton); - - fD_proton = fB1_proton * fB2_proton; - histos.fill(HIST("fD_proton"), Cent_FT0M, 0.5, fD_proton); - Subsample[SampleIndex][19]->Fill(Cent_FT0M, 0.5, fD_proton); - } - - for (int i = 0; i < 14; i++) { - // A_hadrone Calculation - if (Nch_eta_less_0 != 0) { - fA_hadron[i] = fPt_profile->GetBinContent(i + 1) / Nch_eta_less_0; - histos.fill(HIST("fA_hadron"), Cent_FT0M, pT_bin[i], fA_hadron[i]); - Subsample[SampleIndex][0]->Fill(Cent_FT0M, pT_bin[i], fA_hadron[i]); - } - - // A_pion Calculation - if (N_Pi_eta_less_0 != 0) { - fA_pion[i] = fPt_profile_pion->GetBinContent(i + 1) / N_Pi_eta_less_0; - histos.fill(HIST("fA_pion"), Cent_FT0M, pT_bin[i], fA_pion[i]); - Subsample[SampleIndex][1]->Fill(Cent_FT0M, pT_bin[i], fA_pion[i]); - } - - // A_kaon Calculation - if (N_Ka_eta_less_0 != 0) { - fA_kaon[i] = fPt_profile_kaon->GetBinContent(i + 1) / N_Ka_eta_less_0; - histos.fill(HIST("fA_kaon"), Cent_FT0M, pT_bin[i], fA_kaon[i]); - Subsample[SampleIndex][2]->Fill(Cent_FT0M, pT_bin[i], fA_kaon[i]); - } - - // A_proton Calculation - if (N_Pr_eta_less_0 != 0) { - fA_proton[i] = fPt_profile_proton->GetBinContent(i + 1) / N_Pr_eta_less_0; - histos.fill(HIST("fA_proton"), Cent_FT0M, pT_bin[i], fA_proton[i]); - Subsample[SampleIndex][3]->Fill(Cent_FT0M, pT_bin[i], fA_proton[i]); - } - - // C_hadron Calculation - if (Nch_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_hadron[i] = fA_hadron[i] * fB2_hadron; - histos.fill(HIST("fC_hadron"), Cent_FT0M, pT_bin[i], fC_hadron[i]); - Subsample[SampleIndex][12]->Fill(Cent_FT0M, pT_bin[i], fC_hadron[i]); - } - - // C_pion Calculation - if (N_Pi_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_pion[i] = fA_pion[i] * fB2_pion; - histos.fill(HIST("fC_pion"), Cent_FT0M, pT_bin[i], fC_pion[i]); - Subsample[SampleIndex][13]->Fill(Cent_FT0M, pT_bin[i], fC_pion[i]); - } - - // A_kaon Calculation - if (N_Ka_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_kaon[i] = fA_kaon[i] * fB2_kaon; - histos.fill(HIST("fC_kaon"), Cent_FT0M, pT_bin[i], fC_kaon[i]); - Subsample[SampleIndex][14]->Fill(Cent_FT0M, pT_bin[i], fC_kaon[i]); - } - - // A_proton Calculation - if (N_Pr_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_proton[i] = fA_proton[i] * fB2_proton; - histos.fill(HIST("fC_proton"), Cent_FT0M, pT_bin[i], fC_proton[i]); - Subsample[SampleIndex][15]->Fill(Cent_FT0M, pT_bin[i], fC_proton[i]); - } - } - - fPt_profile->Delete(); - fPt_profile_pion->Delete(); - fPt_profile_kaon->Delete(); - fPt_profile_proton->Delete(); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -} From a5bd0ba3951c5e9c32a7c212839ec19d22b98b85 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 10 Jun 2025 13:55:10 +0530 Subject: [PATCH 17/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index db3b87fd22f..b19bf75a03f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -49,6 +49,11 @@ o2physics_add_dpl_workflow(factorial-moments PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(v0pt-pp-task + SOURCES Diff_pT_fluct_PID.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(kaon-isospin-fluctuations SOURCES kaonIsospinFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From 4103a84c0521e15f168b4e2e6835ba868b6057c1 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 10 Jun 2025 14:19:08 +0530 Subject: [PATCH 18/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index b19bf75a03f..557481bd9e1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -9,7 +9,7 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(meanpt-fluctuations +o2physics_add_dpl_workflow(meanptFluctuations SOURCES MeanptFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -19,7 +19,7 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(netproton-cumulants +o2physics_add_dpl_workflow(netprotonCumulants SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -39,17 +39,17 @@ o2physics_add_dpl_workflow(event-mean-pt-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(robust-fluctuation-observables +o2physics_add_dpl_workflow(robustFluctuationObservables SOURCES RobustFluctuationObservables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(factorial-moments +o2physics_add_dpl_workflow(factorialMoments SOURCES FactorialMomentsTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(v0pt-pp-task +o2physics_add_dpl_workflow(v0ptPpTask SOURCES Diff_pT_fluct_PID.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) From 5095120d09d59677d2a42490a9f2f7579dc2b177 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 10 Jun 2025 14:33:11 +0530 Subject: [PATCH 19/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 557481bd9e1..c57469c6c6d 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -9,8 +9,8 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(meanptFluctuations - SOURCES MeanptFluctuations.cxx +o2physics_add_dpl_workflow(meanpt-fluctuations + SOURCES meanptFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -19,8 +19,8 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(netprotonCumulants - SOURCES NetProtonCumulants.cxx +o2physics_add_dpl_workflow(netproton-cumulants + SOURCES netprotonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -39,17 +39,17 @@ o2physics_add_dpl_workflow(event-mean-pt-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(robustFluctuationObservables - SOURCES RobustFluctuationObservables.cxx +o2physics_add_dpl_workflow(robust-fluctuation-observables + SOURCES robustFluctuationObservables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(factorialMoments - SOURCES FactorialMomentsTask.cxx +o2physics_add_dpl_workflow(factorial-moments + SOURCES factorialMoments.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(v0ptPpTask +o2physics_add_dpl_workflow(v0pt-pp-task SOURCES Diff_pT_fluct_PID.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) From d7ce4173681dd01fdd8f76fbb2bd901f745f3135 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Tue, 10 Jun 2025 14:37:06 +0530 Subject: [PATCH 20/23] meanptfluct --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index c57469c6c6d..14dc66b22f0 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -10,7 +10,7 @@ # or submit itself to any jurisdiction. o2physics_add_dpl_workflow(meanpt-fluctuations - SOURCES meanptFluctuations.cxx + SOURCES MeanptFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -20,7 +20,7 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(netproton-cumulants - SOURCES netprotonCumulants.cxx + SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) @@ -40,17 +40,17 @@ o2physics_add_dpl_workflow(event-mean-pt-id COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(robust-fluctuation-observables - SOURCES robustFluctuationObservables.cxx + SOURCES RobustFluctuationObservables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(factorial-moments - SOURCES factorialMoments.cxx +o2physics_add_dpl_workflow(v0pt-pp-task + SOURCES Diff_pT_fluct_PID.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(v0pt-pp-task - SOURCES Diff_pT_fluct_PID.cxx +o2physics_add_dpl_workflow(factorial-moments + SOURCES FactorialMomentsTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) From 5c28b16b2ab758ce9c6af28e74b40baa66ff536d Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 12:40:35 +0530 Subject: [PATCH 21/23] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++++-------- 1 file changed, 204 insertions(+), 177 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index f36087eed7c..bf93bf8bc89 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,37 +92,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; - -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -137,7 +134,6 @@ using EventCandidatesMC = soa::Join> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -150,14 +146,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -301,10 +297,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -473,10 +468,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - - // Configurables + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -536,7 +530,7 @@ using EventCandidatesMC = soa::Join nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -574,12 +568,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -607,7 +601,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -627,41 +621,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -757,60 +769,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -819,7 +831,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -828,16 +840,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -857,13 +871,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -947,22 +961,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -978,8 +992,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1002,7 +1016,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1034,38 +1048,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1073,7 +1091,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1084,37 +1102,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1137,7 +1158,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1179,10 +1200,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1193,14 +1216,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1212,10 +1235,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1226,7 +1251,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1245,10 +1270,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1259,7 +1286,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1291,7 +1318,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1301,8 +1328,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1352,7 +1378,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1379,7 +1405,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1390,17 +1416,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1414,7 +1442,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1424,8 +1452,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1434,8 +1462,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1458,7 +1486,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1497,8 +1525,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 3f2bff66363d882737512fa39e39d9cb01d6a0a3 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 8 Oct 2025 13:14:45 +0530 Subject: [PATCH 22/23] Mean pT Fluctuations --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++---------- 1 file changed, 177 insertions(+), 204 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index bf93bf8bc89..f36087eed7c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include "TF1.h" #include +#include "TF1.h" #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,34 +92,37 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; + Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + +using MyCollisions = soa::Filtered>; +using MyCollision = MyCollisions::iterator; + +using MyTracks = soa::Filtered>; +using MyTrack = MyTracks::iterator; - using MyCollisions = soa::Filtered>; - using MyCollision = MyCollisions::iterator; - using MyTracks = soa::Filtered>; - using MyTrack = MyTracks::iterator; +using MyMCRecoCollisions = soa::Filtered>; +using MyMCRecoCollision = MyMCRecoCollisions::iterator; - using MyMCRecoCollisions = soa::Filtered>; - using MyMCRecoCollision = MyMCRecoCollisions::iterator; +using MyMCRecoTracks = soa::Filtered>; +using MyMCRecoTrack = MyMCRecoTracks::iterator; - using MyMCRecoTracks = soa::Filtered>; - using MyMCRecoTrack = MyMCRecoTracks::iterator; +using EventCandidatesMC = soa::Join; - using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -134,6 +137,7 @@ struct EventMeanPtId { Configurable> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -146,14 +150,14 @@ struct EventMeanPtId { TList* lst = ccdb->getForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -297,10 +301,10 @@ struct EventMeanPtId { histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); - + histos.addClone("Data/", "Rec/"); // rec histograms - histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); + histos.add("hcent_nacc_corr", "hcent_nacc_corr", kTH2D, {centAxis, nchAxis}); histos.add("NSigamaTPCpion_rec", "NSigamaTPCpion_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCkaon_rec", "NSigamaTPCkaon_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); histos.add("NSigamaTPCproton_rec", "NSigamaTPCproton_rec", kTH2D, {pAxis, nSigmaTPCAxispid}); @@ -358,7 +362,7 @@ struct EventMeanPtId { histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); - + histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); @@ -426,12 +430,13 @@ struct EventMeanPtId { histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); - + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -468,9 +473,10 @@ struct EventMeanPtId { "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", 0, 100); cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); - } - // Configurables + } + + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -530,7 +536,7 @@ struct EventMeanPtId { Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; - bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) +bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -568,12 +574,12 @@ struct EventMeanPtId { } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if (ccentFT0C) { - cent = coll.centFT0C(); // centrality from FT0C + if(ccentFT0C) { + cent = coll.centFT0C(); //centrality from FT0C } else { - cent = coll.centFT0M(); // centrality from FT0M - } - + cent = coll.centFT0M(); //centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -601,7 +607,7 @@ struct EventMeanPtId { return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -621,59 +627,41 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { - return false; - } + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { - return false; - } + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { - return false; - } + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { - return false; - } + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { - return false; - } + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) { - return false; - } + if (track.sign() == 0) {return false;} - if (cPVContributor) { - if (!(track.isPVContributor())) { - return false; - } - histos.fill(HIST("tracksel"), 9); + if(cPVContributor) + { if (!(track.isPVContributor())) {return false;} + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { - return false; - } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { return false; } + histos.fill(HIST("tracksel"), 10); } - if (ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) { - return false; - } - histos.fill(HIST("tracksel"), 11); + if(ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) {return false;} + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -769,60 +757,60 @@ struct EventMeanPtId { return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { - float cent = -1; + { float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll, cent)) + if (!selCollision(coll,cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } - - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + } - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -831,7 +819,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -840,18 +828,16 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -871,13 +857,13 @@ struct EventMeanPtId { histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1. / eff; + continue; + double weight = 1./eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -961,22 +947,22 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -992,8 +978,8 @@ struct EventMeanPtId { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1016,7 +1002,7 @@ struct EventMeanPtId { histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1048,42 +1034,38 @@ struct EventMeanPtId { } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { - float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) { - return; - } - + if (!coll.has_mcCollision()) {return;} + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll, cent)) - return; + if (!selCollision(coll,cent)) return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1091,7 +1073,7 @@ struct EventMeanPtId { double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1102,40 +1084,37 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) { - nchEta++; + if (std::fabs(track.eta()) <= cEtacut) + { nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { - nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) - continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { - nch += 1.; + + if (!selTrack(track)) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) + { nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) - continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) - continue; + if (eff < threshold) continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); - histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); + histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1158,7 +1137,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1200,12 +1179,10 @@ struct EventMeanPtId { } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1216,14 +1193,14 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1235,12 +1212,10 @@ struct EventMeanPtId { } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1251,7 +1226,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1270,12 +1245,10 @@ struct EventMeanPtId { } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) - continue; - if (track.beta() > 1) - continue; + if (std::fabs(track.y()) > cRapidityCut05) continue; + if (track.beta() > 1) continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1286,7 +1259,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1318,7 +1291,7 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1328,7 +1301,8 @@ struct EventMeanPtId { if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - } + + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1378,7 +1352,7 @@ struct EventMeanPtId { histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1405,7 +1379,7 @@ struct EventMeanPtId { } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1416,19 +1390,17 @@ struct EventMeanPtId { continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) - continue; + if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { - nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) + { nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) - continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1442,7 +1414,7 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1452,8 +1424,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1462,8 +1434,8 @@ struct EventMeanPtId { if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1486,7 +1458,7 @@ struct EventMeanPtId { histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); - //--------------------------Pions------------------------------------------- +//--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1525,7 +1497,8 @@ struct EventMeanPtId { } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); -}; + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 6d2732b66501a0bd292e64827f44b15fcf9b6b23 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 8 Oct 2025 07:45:43 +0000 Subject: [PATCH 23/23] Please consider the following formatting changes --- .../EbyEFluctuations/Tasks/eventMeanPtId.cxx | 381 ++++++++++-------- 1 file changed, 204 insertions(+), 177 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index f36087eed7c..bf93bf8bc89 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,8 +38,8 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" -#include #include "TF1.h" +#include #include #include @@ -69,8 +69,8 @@ struct EventMeanPtId { O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", - std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, - "PV multiplicity vs T0C centrality cut parameter values"}; + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, @@ -92,37 +92,34 @@ struct EventMeanPtId { TF1* fMultGlobalPVCutHigh = nullptr; } cfgFunCoeff; - Service ccdb; Service pdg; - Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; - Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); - -using MyCollisions = soa::Filtered>; -using MyCollision = MyCollisions::iterator; - -using MyTracks = soa::Filtered>; -using MyTrack = MyTracks::iterator; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; -using MyMCRecoCollisions = soa::Filtered>; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; -using MyMCRecoTracks = soa::Filtered>; -using MyMCRecoTrack = MyMCRecoTracks::iterator; + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; -using EventCandidatesMC = soa::Join; + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + using EventCandidatesMC = soa::Join; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; @@ -137,7 +134,6 @@ using EventCandidatesMC = soa::Join> ptBins{"ptBins", {0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00}, "p_{T} bins"}; Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - void init(o2::framework::InitContext&) { if (cfgLoadEff) { @@ -150,14 +146,14 @@ using EventCandidatesMC = soa::JoingetForTimeStamp(cfgPathCCDB.value, -1); ptHistogramAllchargeRec = reinterpret_cast(lst->FindObject("hPtEta_rec")); - } + } std::vector ptBinning = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"};// 600,0,6 + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -301,10 +297,10 @@ using EventCandidatesMC = soa::Join cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; - cfgFunCoeff.fMultPVFT0CCutLow = new TF1("fMultPVFT0CCutLow", @@ -473,10 +468,9 @@ using EventCandidatesMC = soa::JoinSetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + } - } - - // Configurables + // Configurables Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; @@ -536,7 +530,7 @@ using EventCandidatesMC = soa::Join nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; -bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) { if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { @@ -574,12 +568,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - if(ccentFT0C) { - cent = coll.centFT0C(); //centrality from FT0C + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C } else { - cent = coll.centFT0M(); //centrality from FT0M - } - + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -607,7 +601,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } histos.fill(HIST("trackSelRec"), 7); - + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); @@ -627,41 +621,59 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // accept only global tracks histos.fill(HIST("tracksel"), 2); - if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { + return false; + } histos.fill(HIST("tracksel"), 4); if (std::fabs(track.eta()) >= cEtacut) { return false; } histos.fill(HIST("tracksel"), 5); - - if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { + return false; + } histos.fill(HIST("tracksel"), 6); - if (cITSchi && track.itsChi2NCl() >= cItsChiCut) {return false;} + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { + return false; + } histos.fill(HIST("tracksel"), 7); - if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) {return false;} + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { + return false; + } histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) {return false;} + if (track.sign() == 0) { + return false; + } - if(cPVContributor) - { if (!(track.isPVContributor())) {return false;} - histos.fill(HIST("tracksel"), 9); + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); } if (citsNCluster) { - if (track.itsNCls() < cnITSClustersCut) { return false; } - histos.fill(HIST("tracksel"), 10); + if (track.itsNCls() < cnITSClustersCut) { + return false; + } + histos.fill(HIST("tracksel"), 10); } - if(ctpcNClusterFound) { - if (track.tpcNClsFound() < ctpcNClsCut) {return false;} - histos.fill(HIST("tracksel"), 11); + if (ctpcNClusterFound) { + if (track.tpcNClsFound() < ctpcNClsCut) { + return false; + } + histos.fill(HIST("tracksel"), 11); } return true; // if all checks pass, accept the collision @@ -757,60 +769,60 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce return false; } - double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) + double getEfficiency(double pt, double eta, TH2D* ptHistogramAllchargeRec) { - int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); - int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); + int xbin = ptHistogramAllchargeRec->GetXaxis()->FindBin(pt); + int ybin = ptHistogramAllchargeRec->GetYaxis()->FindBin(eta); - if(xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { + if (xbin < 1 || xbin > ptHistogramAllchargeRec->GetNbinsX() || ybin < 1 || ybin > ptHistogramAllchargeRec->GetNbinsY()) { LOGF(warn, "pt or eta out of histograms bounds : %f, eta = %f", pt, eta); return 1e-6; - } - double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); - return (eff > 0) ? eff : 1e-6; // Avoid division by zero + } + double eff = ptHistogramAllchargeRec->GetBinContent(xbin, ybin); + return (eff > 0) ? eff : 1e-6; // Avoid division by zero } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(MyCollision const& coll, MyTracks const& inputTracks) + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + void processData(MyCollision const& coll, MyTracks const& inputTracks) - { float cent = -1; + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll,cent)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); - } + } histos.fill(HIST("Data/hCentrality"), cent); - float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); - - double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; double q1Pi = 0., q2Pi = 0., var1Pi = 0., var2Pi = 0.; - double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; + double q1Ka = 0., q2Ka = 0., var1Ka = 0., var2Ka = 0.; double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -819,7 +831,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hTPCchi2perCluster_before"), track.tpcChi2NCl()); histos.fill(HIST("Data/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Data/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - + if (std::fabs(track.eta()) <= cEtacut) { nchEta++; histos.fill(HIST("Data/hnchTrue"), nchEta); @@ -828,16 +840,18 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Data/hnch"), nch); - histos.fill(HIST("Data/hPtvar"), track.pt()); + histos.fill(HIST("Data/hPtvar"), track.pt()); } - - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -857,13 +871,13 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hPEta"), track.p(), track.eta()); histos.fill(HIST("Data/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); - double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); + double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); if (eff < threshold) - continue; - double weight = 1./eff; + continue; + double weight = 1. / eff; sumPtWeight += track.pt() / eff; sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); - sumWeight += weight; + sumWeight += weight; // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) @@ -947,22 +961,22 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - + } // Track loop ends! histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); - if (nchAll < cTwoPtlCut2) + if (nchAll < cTwoPtlCut2) return; var1 = (q1 * q1 - q2) / (nchAll * (nchAll - 1)); var2 = (q1 / nchAll); - - //------------------ Efficiency corrected histograms --------------- + + //------------------ Efficiency corrected histograms --------------- var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -978,8 +992,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); var2Pr = (q1Pr / nchPr); } - - //------------------ all charges------------------------------------- + + //------------------ all charges------------------------------------- histos.fill(HIST("Data/hVar1"), sample, cent, var1); histos.fill(HIST("Data/hVar2"), sample, cent, var2); histos.fill(HIST("Data/hVarc"), sample, cent); @@ -1002,7 +1016,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); histos.fill(HIST("Data/hdiffVarx"), sample, nch); - + histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); histos.fill(HIST("hEffVarx_data"), sample, nchAll); @@ -1034,38 +1048,42 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // event loop ends! PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; - Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) - { float cent = -1; + SliceCache cache; + Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + float cent = -1; (void)mcCollisions; - if (!coll.has_mcCollision()) {return;} - + if (!coll.has_mcCollision()) { + return; + } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); - histos.fill(HIST("hCentrality_rec_before"), cent); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll,cent)) return; + if (!selCollision(coll, cent)) + return; histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); - histos.fill(HIST("Rec/hCentrality"), cent); + histos.fill(HIST("Rec/hCentrality"), cent); float globalNch = inputTracks.size(); - float pvTrack = coll.multNTracksPV(); + float pvTrack = coll.multNTracksPV(); - histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); - - if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { return; - } + } - histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); - histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"),coll.centFT0C(), globalNch); - histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; @@ -1073,7 +1091,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce double var1 = 0., var2 = 0.; double var1Pi = 0., var2Pi = 0., var1Ka = 0., var2Ka = 0., var1Pr = 0., var2Pr = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; - + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; @@ -1084,37 +1102,40 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - if (std::fabs(track.eta()) <= cEtacut) - { nchEta++; + if (std::fabs(track.eta()) <= cEtacut) { + nchEta++; histos.fill(HIST("Rec/hnchTrue"), nchEta); } - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nchPt += 1.; + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } - - if (!selTrack(track)) continue; - - if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) - { nch += 1.; + + if (!selTrack(track)) + continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; histos.fill(HIST("Rec/hnch"), nch); - histos.fill(HIST("Rec/hPtvar"), track.pt()); + histos.fill(HIST("Rec/hPtvar"), track.pt()); } - if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) continue; - + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); double eff = getEfficiency(track.pt(), track.eta(), ptHistogramAllchargeRec); - if (eff < threshold) continue; + if (eff < threshold) + continue; double weight = 1.0 / eff; sumPtWeight += track.pt() * weight; sumPtPtWeight += (track.pt() * track.pt() * weight * weight); sumWeight += weight; - - histos.fill(HIST("hPt_rec_corr"), track.pt() , weight); - histos.fill(HIST("hEta_rec_corr"), track.eta() , weight); + + histos.fill(HIST("hPt_rec_corr"), track.pt(), weight); + histos.fill(HIST("hEta_rec_corr"), track.eta(), weight); auto mcParticle = track.mcParticle(); nchAll += 1.; @@ -1137,7 +1158,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hPEta"), track.p(), track.eta()); histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - + if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1179,10 +1200,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selPion(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); - histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pi_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtPion"), track.pt()); histos.fill(HIST("Rec/hEtaPion"), track.eta()); histos.fill(HIST("Rec/hyPion"), track.rapidity(massPi)); @@ -1193,14 +1216,14 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kPiPlus) { - histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } nchPi += 1.; q1Pi += track.pt(); q2Pi += (track.pt() * track.pt()); - histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); + histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); } //===========================kaon=============================================================== @@ -1212,10 +1235,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selKaon(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); - histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_ka_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); histos.fill(HIST("Rec/hEtaKaon"), track.eta()); histos.fill(HIST("Rec/hyKaon"), track.rapidity(massKa)); @@ -1226,7 +1251,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kKPlus) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } nchKa += 1.; q1Ka += track.pt(); @@ -1245,10 +1270,12 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } if (selProton(track)) { - if (std::fabs(track.y()) > cRapidityCut05) continue; - if (track.beta() > 1) continue; + if (std::fabs(track.y()) > cRapidityCut05) + continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); - histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); + histos.fill(HIST("hPtEta_pr_rec"), track.pt(), track.eta()); histos.fill(HIST("Rec/hPtProton"), track.pt()); histos.fill(HIST("Rec/hEtaProton"), track.eta()); histos.fill(HIST("Rec/hyProton"), track.rapidity(massPr)); @@ -1259,7 +1286,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); if (std::abs(track.mcParticle().pdgCode()) == PDG_t::kProton) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } nchPr += 1.; q1Pr += track.pt(); @@ -1291,7 +1318,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("Rec/hVar2"), sample, cent, var2); histos.fill(HIST("Rec/hVarc"), sample, cent); histos.fill(HIST("Rec/hVar2meanpt"), cent, var2); - + //---------------------- pions ---------------------------------------- if (nchPi >= cTwoPtlCut2) { var1Pi = (q1Pi * q1Pi - q2Pi) / (nchPi * (nchPi - 1)); @@ -1301,8 +1328,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (nchKa >= cTwoPtlCut2) { var1Ka = (q1Ka * q1Ka - q2Ka) / (nchKa * (nchKa - 1)); var2Ka = (q1Ka / nchKa); - - } + } //---------------------------- protons ---------------------------------- if (nchPr >= cTwoPtlCut2) { var1Pr = (q1Pr * q1Pr - q2Pr) / (nchPr * (nchPr - 1)); @@ -1352,7 +1378,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hEffVar1x_Naccorr_xaxis_rec"), sample, sumWeight, var1); histos.fill(HIST("hEffVar2x_Naccorr_xaxis_rec"), sample, sumWeight, var2); histos.fill(HIST("hEffVarx_Naccorr_xaxis_rec"), sample, sumWeight); - + //================= generated level============================== const auto& mccolgen = coll.mcCollision_as(); @@ -1379,7 +1405,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } nch1++; histos.fill(HIST("hnch_afterPhysPrimary"), nch1); - + int pid = mcpart.pdgCode(); auto sign = 0; auto* pd = pdg->GetParticle(pid); @@ -1390,17 +1416,19 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce continue; } // histos.fill(HIST("gen_hSign"), sign); - if (std::fabs(mcpart.eta()) > cEtacut) continue; + if (std::fabs(mcpart.eta()) > cEtacut) + continue; nchGenTrue++; histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); - if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) - { nchgen += 1.; + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; histos.fill(HIST("hnch_gen"), nchgen); - histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); } - if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) + continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); @@ -1414,7 +1442,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kPiPlus || mcpart.pdgCode() == PDG_t::kPiMinus) { histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPtEta_pi_gen"), mcpart.pt(), mcpart.eta()); histos.fill(HIST("hPty_pi_gen"), mcpart.pt(), mcpart.y()); nchPiGen += 1.; q1PiGen += mcpart.pt(); @@ -1424,8 +1452,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kKPlus || mcpart.pdgCode() == PDG_t::kKMinus) { histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_ka_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_ka_gen"), mcpart.pt(), mcpart.y()); nchKaGen += 1.; q1KaGen += mcpart.pt(); q2KaGen += (mcpart.pt() * mcpart.pt()); @@ -1434,8 +1462,8 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce if (mcpart.pdgCode() == PDG_t::kProton || mcpart.pdgCode() == PDG_t::kProtonBar) { histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); - histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); + histos.fill(HIST("hPtEta_pr_gen"), mcpart.pt(), mcpart.eta()); + histos.fill(HIST("hPty_pr_gen"), mcpart.pt(), mcpart.y()); nchPrGen += 1.; q1PrGen += mcpart.pt(); q2PrGen += (mcpart.pt() * mcpart.pt()); @@ -1458,7 +1486,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); -//--------------------------Pions------------------------------------------- + //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); var2PiGen = (q1PiGen / nchPiGen); @@ -1497,8 +1525,7 @@ bool eventSelected(const float& globalNch, const float& pvTrack, const float& ce } // void process PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); - - }; +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {