From 423598a558139b6f5a354a8e978cffd8ee12b887 Mon Sep 17 00:00:00 2001 From: sweta Date: Sun, 14 Jan 2024 11:21:50 +0100 Subject: [PATCH 01/47] CF:Identifiedparticles --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 8 + .../Tasks/MeanpTFlucPbPbIdentified.cxx | 451 ++++++++++++++++++ 2 files changed, 459 insertions(+) create mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 53fdf85a489..2a4d8c557de 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -19,3 +19,11 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(mean-pt-pbpb-fluc + SOURCES MeanpTFlucPbPbIdentified.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) + + + diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx new file mode 100644 index 00000000000..fa6a93cea57 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx @@ -0,0 +1,451 @@ +// 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) + +// O2 includes +#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 "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" // +#include "Framework/ASoAHelpers.h" // +#include "Framework/HistogramRegistry.h" // +#include "Framework/RunningWorkflowInfo.h" // +#include "CommonConstants/MathConstants.h" // +#include "PWGCF/Core/CorrelationContainer.h" // +#include "PWGCF/Core/PairCuts.h" // + +#include "Common/DataModel/FT0Corrected.h" // +//#include "Framework/ASoA.h" +//#include "TRandom.h"// +//#include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" +#include "PWGCF/FemtoUniverse/DataModel/FemtoUniverseDerived.h" +//#include "Core/include/Framework/AnalysisDataModel.h" + +//#include ; +using namespace std; + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// STEP 1 +// Example task illustrating how to acess information from different tables + +namespace o2::aod +{ +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + + + +using MyCollision = MyCollisions::iterator; +using MyTrack = MyTracks::iterator; +} // namespace o2::aod + +struct MeanpTFlucPbPbIdentified { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + //using myCompleteTracks = soa::Join; + + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20,"Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01,"DCA_{xy} (cm)"}; + // AxisSpec centAxis = {100,0,100,"FTOM (%)"} + // Variable bin width axis + // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; + // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {40, 0.0, 4.0,"#it{p}_{T} (GeV/#it{c})"}; + + AxisSpec pAxis = {40, 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 = {100, -5., 5.,"n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5,"n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5,"n#sigma_{TOF}"}; + AxisSpec nChAxis = {2500, -0.5, 2499.5,"nCh"}; + AxisSpec centAxis = {20, 0., 100.,"centrality"}; + AxisSpec subAxis = {30, 0., 30.,"sample"}; + AxisSpec nchAxis = {3200, 0., 3200.,"nch"}; + AxisSpec varAxis1 = {6000, 0., 6.,"var1"};//variable1 bin width 0.001 + AxisSpec varAxis2 = {600, 0., 6.,"var2"};//meanpt//variable2 bin width 0.01 + + + // Add histograms to histogram manager (as in the output object of in AliPhysics) + histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); + + histos.add("hP", "hP", kTH1F, {pAxis}); + histos.add("hEta", ";hEta", kTH1F, {etaAxis}); + histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, + {pAxis, nSigmaTPCAxis}); + histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); + histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); + histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis,nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis,nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis,nSigmaTPCAxispid}); + + + histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis,nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis,nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis,nSigmaTOFAxispid}); + + + histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); + + histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + + histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); + + histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis,ptAxis}); + histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis,ptAxis}); + histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis,ptAxis}); + histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis,ptAxis}); + + + + histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis,ptAxis}); +// histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); + histos.add("hCent","hCent",kTH1F,{centAxis}); + +///////////////////////////////cent////////////////////////////////// + histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); + histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); + histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); + histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); + histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); + +///////////////////////////////nch////////////////////////////////// + histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); +/////////////////////////////////////////////////////////////////////// + histos.add("ht", "ht", kTH1F, {centAxis}); + + histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); + + histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); + histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); + histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); + histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); + + histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); + histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); + + + + } + + // Equivalent of the AliRoot task UserExec + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + + { + + + // Performing the event selection + histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); + if (fabs(coll.posZ()) > 10.f ) { + return; + } + histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); + + + if (!coll.sel8()) + { return; + } + histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); + + const auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrality"), cent); + + + float nCh = 0.; + float nChpi = 0.; + float nChk = 0.; + float nChp = 0.; + std::vectorVMeanPt; + std::vectorVMeanPtPion; + std::vectorVMeanPtKaon; + std::vectorVMeanPtProton; + + //TRandom *randn; + + // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); + + + float Q1 = 0, Q2 = 0; + float Q1pi = 0, Q2pi = 0; + float Q1k = 0, Q2k = 0; + float Q1p = 0, Q2p = 0; + float var1, var2; + float var1pi, var2pi; + float var1k, var2k; + float var1p, var2p; + + int sample = histos.get(HIST("hZvtx_before_sel"))-> GetEntries() ; sample = sample % 30; + + + + // Perfroming the track selection============================================================================================================== + for (auto track : inputTracks) { // Loop over tracks + + +// if (!track.isGlobalTrack()) return; + + if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY())<0.12) && (fabs(track.dcaZ())<1.) && (track.pt()>0.15 && track.pt()<2.))) { + continue; + } + + 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("hPty"), track.pt(), track.rapidity()); + // histos.fill(HIST("hPy"), track.p(), track.rapidity()); + + + + VMeanPt.push_back(track.pt()); + + + 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()); + + + + + + //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()); + + if((track.hasTPC() && abs(track.tpcNSigmaPi())<2. && (track.pt()>0.2 && track.pt()<0.5))) histos.fill(HIST("hPtPion"), track.pt()); + + { + if((track.hasTPC() && (track.pt()>=0.5 && track.pt()<2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi())*(track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi()))<2.) ){ + + histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hEtaPion"), track.eta()); + + + VMeanPtPion.push_back(track.pt()); + + for(long unsigned int jPi=0; jPi0.2 && track.pt()<0.5))) histos.fill(HIST("hPtKaon"), track.pt()); + { + if((track.hasTPC() && (track.pt()>=0.5 && track.pt()<2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa())*(track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa()))<2.) ){ + + + histos.fill(HIST("hPtKaon"), track.pt()); + histos.fill(HIST("hEtaKaon"), track.eta()); + + VMeanPtKaon.push_back(track.pt()); + + for(long unsigned int jKa=0; jKa0.4 && track.pt()<0.6))) histos.fill(HIST("hPtProton"), track.pt()); + { + if((track.hasTPC() && (track.pt()>=0.6 && track.pt()<2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr())*(track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr()))<2.) ){ + + histos.fill(HIST("hPtProton"), track.pt()); + histos.fill(HIST("hEtaProton"), track.eta()); + + VMeanPtProton.push_back(track.pt()); + + for(long unsigned int jPr=0; jPr(cfgc)}; + return workflow; +} From 6dc036ce30387c3b619bd67f94e30ca6e50700cc Mon Sep 17 00:00:00 2001 From: sweta Date: Sun, 14 Jan 2024 11:31:43 +0100 Subject: [PATCH 02/47] CFIdentified --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 2 - .../Tasks/MeanpTFlucPbPbIdentified.cxx | 436 +++++++++--------- 2 files changed, 209 insertions(+), 229 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 2a4d8c557de..79e786bf138 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -24,6 +24,4 @@ o2physics_add_dpl_workflow(mean-pt-pbpb-fluc SOURCES MeanpTFlucPbPbIdentified.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - - diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx index fa6a93cea57..587039e537e 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx @@ -12,36 +12,35 @@ /// \author Sweta Singh (sweta.singh@cern.ch) // O2 includes -#include "Framework/AnalysisTask.h" // -#include "Framework/runDataProcessing.h" // +#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/Core/TrackSelection.h" // #include "Common/DataModel/TrackSelectionTables.h" // -#include "Common/DataModel/Centrality.h" // +#include "Common/DataModel/Centrality.h" // #include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" // -#include "Framework/ASoAHelpers.h" // -#include "Framework/HistogramRegistry.h" // -#include "Framework/RunningWorkflowInfo.h" // -#include "CommonConstants/MathConstants.h" // +#include "Framework/AnalysisDataModel.h" // +#include "Framework/ASoAHelpers.h" // +#include "Framework/HistogramRegistry.h" // +#include "Framework/RunningWorkflowInfo.h" // +#include "CommonConstants/MathConstants.h" // #include "PWGCF/Core/CorrelationContainer.h" // -#include "PWGCF/Core/PairCuts.h" // +#include "PWGCF/Core/PairCuts.h" // #include "Common/DataModel/FT0Corrected.h" // -//#include "Framework/ASoA.h" -//#include "TRandom.h"// -//#include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" +// #include "Framework/ASoA.h" +// #include "TRandom.h"// +// #include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoUniverseDerived.h" -//#include "Core/include/Framework/AnalysisDataModel.h" +// #include "Core/include/Framework/AnalysisDataModel.h" -//#include ; +// #include ; using namespace std; using namespace o2; @@ -56,16 +55,14 @@ namespace o2::aod using MyCollisions = soa::Join; + // aod::CentRun2V0Ms, + aod::CentFT0Cs>; using MyTracks = soa::Join; - - + aod::pidTOFFullEl, aod::pidTOFFullMu, aod::pidTOFFullPi, aod::StoredTracks, + aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFbeta, aod::TOFSignal, + aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection>; using MyCollision = MyCollisions::iterator; using MyTrack = MyTracks::iterator; @@ -74,37 +71,35 @@ using MyTrack = MyTracks::iterator; struct MeanpTFlucPbPbIdentified { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - //using myCompleteTracks = soa::Join; - + // using myCompleteTracks = soa::Join; // Equivalent of the AliRoot task UserCreateOutputObjects void init(o2::framework::InitContext&) { - // Define your axes + // Define your axes // Constant bin width axis - AxisSpec vtxZAxis = {100, -20, 20,"Z (cm)"}; - AxisSpec dcaAxis = {1002, -5.01, 5.01,"DCA_{xy} (cm)"}; - // AxisSpec centAxis = {100,0,100,"FTOM (%)"} + AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; + // AxisSpec centAxis = {100,0,100,"FTOM (%)"} // Variable bin width axis - // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; - // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec ptAxis = {40, 0.0, 4.0,"#it{p}_{T} (GeV/#it{c})"}; - - AxisSpec pAxis = {40, 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 = {100, -5., 5.,"n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5,"n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5,"n#sigma_{TOF}"}; - AxisSpec nChAxis = {2500, -0.5, 2499.5,"nCh"}; - AxisSpec centAxis = {20, 0., 100.,"centrality"}; - AxisSpec subAxis = {30, 0., 30.,"sample"}; - AxisSpec nchAxis = {3200, 0., 3200.,"nch"}; - AxisSpec varAxis1 = {6000, 0., 6.,"var1"};//variable1 bin width 0.001 - AxisSpec varAxis2 = {600, 0., 6.,"var2"};//meanpt//variable2 bin width 0.01 - + // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; + // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; + + AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; + AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + AxisSpec centAxis = {20, 0., 100., "centrality"}; + AxisSpec subAxis = {30, 0., 30., "sample"}; + AxisSpec nchAxis = {3200, 0., 3200., "nch"}; + AxisSpec varAxis1 = {6000, 0., 6., "var1"}; // variable1 bin width 0.001 + AxisSpec varAxis2 = {600, 0., 6., "var2"}; // meanpt//variable2 bin width 0.01 // Add histograms to histogram manager (as in the output object of in AliPhysics) histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); @@ -118,19 +113,17 @@ struct MeanpTFlucPbPbIdentified { {pAxis, nSigmaTPCAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis,nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis,nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis,nSigmaTPCAxispid}); - - - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis,nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis,nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis,nSigmaTOFAxispid}); + histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid,nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); @@ -140,18 +133,16 @@ struct MeanpTFlucPbPbIdentified { histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); - histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis,ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis,ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis,ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis,ptAxis}); + histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); + histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); + // histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); + histos.add("hCent", "hCent", kTH1F, {centAxis}); - - histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis,ptAxis}); -// histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); - histos.add("hCent","hCent",kTH1F,{centAxis}); - -///////////////////////////////cent////////////////////////////////// + ///////////////////////////////cent////////////////////////////////// histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); @@ -168,7 +159,7 @@ struct MeanpTFlucPbPbIdentified { histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); -///////////////////////////////nch////////////////////////////////// + ///////////////////////////////nch////////////////////////////////// histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); @@ -184,7 +175,7 @@ struct MeanpTFlucPbPbIdentified { histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); -/////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// histos.add("ht", "ht", kTH1F, {centAxis}); histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); @@ -196,76 +187,66 @@ struct MeanpTFlucPbPbIdentified { histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); - - - } // Equivalent of the AliRoot task UserExec - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - - { + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + { // Performing the event selection histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); - if (fabs(coll.posZ()) > 10.f ) { + if (fabs(coll.posZ()) > 10.f) { return; } histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - - if (!coll.sel8()) - { return; + if (!coll.sel8()) { + return; } histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); - float nCh = 0.; float nChpi = 0.; float nChk = 0.; float nChp = 0.; - std::vectorVMeanPt; - std::vectorVMeanPtPion; - std::vectorVMeanPtKaon; - std::vectorVMeanPtProton; - - //TRandom *randn; - - // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); + std::vector VMeanPt; + std::vector VMeanPtPion; + std::vector VMeanPtKaon; + std::vector VMeanPtProton; + // TRandom *randn; - float Q1 = 0, Q2 = 0; - float Q1pi = 0, Q2pi = 0; - float Q1k = 0, Q2k = 0; - float Q1p = 0, Q2p = 0; - float var1, var2; - float var1pi, var2pi; - float var1k, var2k; - float var1p, var2p; - - int sample = histos.get(HIST("hZvtx_before_sel"))-> GetEntries() ; sample = sample % 30; + // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); + float Q1 = 0, Q2 = 0; + float Q1pi = 0, Q2pi = 0; + float Q1k = 0, Q2k = 0; + float Q1p = 0, Q2p = 0; + float var1, var2; + float var1pi, var2pi; + float var1k, var2k; + float var1p, var2p; + int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); + sample = sample % 30; // Perfroming the track selection============================================================================================================== for (auto track : inputTracks) { // Loop over tracks + // if (!track.isGlobalTrack()) return; -// if (!track.isGlobalTrack()) return; - - if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY())<0.12) && (fabs(track.dcaZ())<1.) && (track.pt()>0.15 && track.pt()<2.))) { + if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { continue; } - nCh+=1.; - - Q1 += track.pt(); - Q2 += (track.pt() * track.pt()); + nCh += 1.; + Q1 += track.pt(); + Q2 += (track.pt() * track.pt()); histos.fill(HIST("hP"), track.p()); histos.fill(HIST("hPt"), track.pt()); @@ -275,172 +256,173 @@ struct MeanpTFlucPbPbIdentified { histos.fill(HIST("hPtEta"), track.pt(), track.eta()); histos.fill(HIST("hPEta"), track.p(), track.eta()); - - // histos.fill(HIST("hPty"), track.pt(), track.rapidity()); - // histos.fill(HIST("hPy"), track.p(), track.rapidity()); - + // histos.fill(HIST("hPty"), track.pt(), track.rapidity()); + // histos.fill(HIST("hPy"), track.p(), track.rapidity()); VMeanPt.push_back(track.pt()); - 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 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()); + // 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()); - - + if (track.hasTPC()) + histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - + // 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()); - //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()); - - if((track.hasTPC() && abs(track.tpcNSigmaPi())<2. && (track.pt()>0.2 && track.pt()<0.5))) histos.fill(HIST("hPtPion"), track.pt()); + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtPion"), track.pt()); - { - if((track.hasTPC() && (track.pt()>=0.5 && track.pt()<2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi())*(track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi()))<2.) ){ + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - - - VMeanPtPion.push_back(track.pt()); + histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hEtaPion"), track.eta()); - for(long unsigned int jPi=0; jPi 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtKaon"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - if((track.hasTPC() && abs(track.tpcNSigmaKa())<2. && (track.pt()>0.2 && track.pt()<0.5))) histos.fill(HIST("hPtKaon"), track.pt()); - { - if((track.hasTPC() && (track.pt()>=0.5 && track.pt()<2.0)) && (track.hasTOF() && 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("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - - VMeanPtKaon.push_back(track.pt()); + VMeanPtKaon.push_back(track.pt()); - for(long unsigned int jKa=0; jKa0.4 && track.pt()<0.6))) histos.fill(HIST("hPtProton"), track.pt()); - { - if((track.hasTPC() && (track.pt()>=0.6 && track.pt()<2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr())*(track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr()))<2.) ){ + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) + histos.fill(HIST("hPtProton"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && 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("hPtProton"), track.pt()); + histos.fill(HIST("hEtaProton"), track.eta()); - VMeanPtProton.push_back(track.pt()); + VMeanPtProton.push_back(track.pt()); - for(long unsigned int jPr=0; jPr Date: Sun, 14 Jan 2024 11:40:43 +0100 Subject: [PATCH 03/47] CF:MeanpT --- .../Tasks/MeanpTFlucPbPbIdentified.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx index 587039e537e..b795b06a53b 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx @@ -24,7 +24,7 @@ #include "Common/DataModel/TrackSelectionTables.h" // #include "Common/DataModel/Centrality.h" // -#include "Framework/runDataProcessing.h" + #include "Framework/AnalysisDataModel.h" // #include "Framework/ASoAHelpers.h" // #include "Framework/HistogramRegistry.h" // @@ -300,7 +300,7 @@ struct MeanpTFlucPbPbIdentified { VMeanPtPion.push_back(track.pt()); - for (long unsigned int jPi = 0; jPi < VMeanPtPion.size(); jPi++) { + for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); } @@ -325,7 +325,7 @@ struct MeanpTFlucPbPbIdentified { VMeanPtKaon.push_back(track.pt()); - for (long unsigned int jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { + for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); } @@ -350,7 +350,7 @@ struct MeanpTFlucPbPbIdentified { VMeanPtProton.push_back(track.pt()); - for (long unsigned int jPr = 0; jPr < VMeanPtProton.size(); jPr++) { + for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); } @@ -416,7 +416,7 @@ struct MeanpTFlucPbPbIdentified { histos.fill(HIST("hVarpx"), sample, nChp); // for(int j=0; j Date: Sun, 14 Jan 2024 11:42:42 +0100 Subject: [PATCH 04/47] CF:MeanpT --- PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx index b795b06a53b..e1bfd227b72 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx @@ -24,7 +24,6 @@ #include "Common/DataModel/TrackSelectionTables.h" // #include "Common/DataModel/Centrality.h" // - #include "Framework/AnalysisDataModel.h" // #include "Framework/ASoAHelpers.h" // #include "Framework/HistogramRegistry.h" // From 727bd3a646ea5de26d52407ff11cebb4aa3573f0 Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 07:13:24 +0100 Subject: [PATCH 05/47] CF:MeanpTnew --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 4 +- .../Tasks/MeanpTFlucIdentified.cxx | 419 ++++++++++++++++++ 2 files changed, 421 insertions(+), 2 deletions(-) create mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 79e786bf138..24952f0f84c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -20,8 +20,8 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(mean-pt-pbpb-fluc - SOURCES MeanpTFlucPbPbIdentified.cxx +o2physics_add_dpl_workflow(meanpt-fluct-identified + SOURCES MeanpTFlucIdentified.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx new file mode 100644 index 00000000000..dd8bae9d517 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx @@ -0,0 +1,419 @@ +// 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) + +// O2 includes +#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 "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "CommonConstants/MathConstants.h" +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" +#include "Common/DataModel/FT0Corrected.h" + + + +using namespace std; + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// STEP 1 +// Example task illustrating how to acess information from different tables + +namespace o2::aod +{ +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + +using MyCollision = MyCollisions::iterator; +using MyTrack = MyTracks::iterator; +} // namespace o2::aod + +struct MeanpTFlucIdentified { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; + + AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; + + AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; + AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + AxisSpec centAxis = {20, 0., 100., "centrality"}; + AxisSpec subAxis = {30, 0., 30., "sample"}; + AxisSpec nchAxis = {3200, 0., 3200., "nch"}; + AxisSpec varAxis1 = {6000, 0., 6., "var1"}; + AxisSpec varAxis2 = {600, 0., 6., "var2"}; + + // Add histograms to histogram manager (as in the output object of in AliPhysics) + histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); + + histos.add("hP", "hP", kTH1F, {pAxis}); + histos.add("hEta", ";hEta", kTH1F, {etaAxis}); + histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, + {pAxis, nSigmaTPCAxis}); + histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); + histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); + histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); + + histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); + + histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + + histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + + histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); + + histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); + + histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); + histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); + + + + histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); + histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); + histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); + histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); + histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); + + //--------------------------------nch---------------------------------- + histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); + + histos.add("ht", "ht", kTH1F, {centAxis}); + + histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); + + histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); + histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); + histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); + histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); + + histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); + histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); + } + + // Equivalent of the AliRoot task UserExec + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + + { + + // Performing the event selection + histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); + if (fabs(coll.posZ()) > 10.f) { + return; + } + histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); + + if (!coll.sel8()) { + return; + } + histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); + + const auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrality"), cent); + + float nCh = 0.; + float nChpi = 0.; + float nChk = 0.; + float nChp = 0.; + std::vector VMeanPt; + std::vector VMeanPtPion; + std::vector VMeanPtKaon; + std::vector VMeanPtProton; + + + + float Q1 = 0, Q2 = 0; + float Q1pi = 0, Q2pi = 0; + float Q1k = 0, Q2k = 0; + float Q1p = 0, Q2p = 0; + float var1, var2; + float var1pi, var2pi; + float var1k, var2k; + float var1p, var2p; + + int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); + sample = sample % 30; + + // Perfroming the track selection============================================================================================================== + for (auto track : inputTracks) { // Loop over tracks + + if (!track.isGlobalTrack()) return; + + if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { + continue; + } + + 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()); + + VMeanPt.push_back(track.pt()); + + 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()); + + // 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()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtPion"), track.pt()); + + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { + + histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hEtaPion"), track.eta()); + + VMeanPtPion.push_back(track.pt()); + + for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { + histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); + } + + + + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtKaon"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { + + histos.fill(HIST("hPtKaon"), track.pt()); + histos.fill(HIST("hEtaKaon"), track.eta()); + + VMeanPtKaon.push_back(track.pt()); + + for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { + histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); + } + + + + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) + histos.fill(HIST("hPtProton"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { + + histos.fill(HIST("hPtProton"), track.pt()); + histos.fill(HIST("hEtaProton"), track.eta()); + + VMeanPtProton.push_back(track.pt()); + + for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { + histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); + } + + + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); + } + } + + } // Track loop ends! + VMeanPtPion.clear(); + VMeanPtKaon.clear(); + VMeanPtProton.clear(); + + if (nCh < 2) + return; + + //------------------ all charges------------------------------------- + var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); + histos.fill(HIST("hVar1"), cent, var1); + var2 = (Q1 / nCh); + histos.fill(HIST("hVar2"), cent, var2); + histos.fill(HIST("hVar"), sample, cent); + + //---------------------- pions ---------------------------------------- + + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + histos.fill(HIST("hVar1pi"), cent, var1pi); + var2pi = (Q1pi / nChpi); + histos.fill(HIST("hVar2pi"), cent, var2pi); + // histos.fill(HIST("hVar"), sample, cent); + + //----------------------- kaons --------------------------------------- + + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + histos.fill(HIST("hVar1k"), cent, var1k); + var2k = (Q1k / nChk); + histos.fill(HIST("hVar2k"), cent, var2k); + // histos.fill(HIST("hVar"), sample, cent); + + //---------------------------- protons ---------------------------------- + + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + histos.fill(HIST("hVar1p"), cent, var1p); + var2p = (Q1p / nChp); + histos.fill(HIST("hVar2p"), cent, var2p); + // histos.fill(HIST("hVar"), sample, cent); + + //-----------------------nch------------------------------------- + histos.fill(HIST("hVar1x"), nCh, var1); + histos.fill(HIST("hVar2x"), nCh, var2); + histos.fill(HIST("hVarx"), sample, nCh); + + histos.fill(HIST("hVar1pix"), nCh, var1pi); + histos.fill(HIST("hVar2pix"), nCh, var2pi); + histos.fill(HIST("hVarpix"), sample, nChpi); + + histos.fill(HIST("hVar1kx"), nCh, var1k); + histos.fill(HIST("hVar2kx"), nCh, var2k); + histos.fill(HIST("hVarkx"), sample, nChk); + + histos.fill(HIST("hVar1px"), nCh, var1p); + histos.fill(HIST("hVar2px"), nCh, var2p); + histos.fill(HIST("hVarpx"), sample, nChp); + + + for (ULong64_t j = 0; j < VMeanPt.size(); j++) { + histos.fill(HIST("hPtCh"), nCh, VMeanPt[j]); + } + + VMeanPt.clear(); + + } // event loop ends! + + +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + // Equivalent to the AddTask in AliPhysics + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From cf55bb749f95d8c517975ab26c20899b130a974b Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 07:21:28 +0100 Subject: [PATCH 06/47] CF:MeanpTnew --- .../Tasks/MeanpTFlucIdentified.cxx | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx index dd8bae9d517..67a94351855 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx @@ -12,26 +12,24 @@ /// \author Sweta Singh (sweta.singh@cern.ch) // O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/EventSelection.h" +#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/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 "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "CommonConstants/MathConstants.h" -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" -#include "Common/DataModel/FT0Corrected.h" - - +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "CommonConstants/MathConstants.h" +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" +#include "Common/DataModel/FT0Corrected.h" using namespace std; @@ -62,7 +60,6 @@ using MyTrack = MyTracks::iterator; struct MeanpTFlucIdentified { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // Equivalent of the AliRoot task UserCreateOutputObjects void init(o2::framework::InitContext&) { @@ -85,8 +82,8 @@ struct MeanpTFlucIdentified { AxisSpec centAxis = {20, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; AxisSpec nchAxis = {3200, 0., 3200., "nch"}; - AxisSpec varAxis1 = {6000, 0., 6., "var1"}; - AxisSpec varAxis2 = {600, 0., 6., "var2"}; + AxisSpec varAxis1 = {6000, 0., 6., "var1"}; + AxisSpec varAxis2 = {600, 0., 6., "var2"}; // Add histograms to histogram manager (as in the output object of in AliPhysics) histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); @@ -126,9 +123,7 @@ struct MeanpTFlucIdentified { histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); - histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); - - + histos.add("hCent", "hCent", kTH2F, {nChAxis, centAxis}); histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); @@ -205,8 +200,6 @@ struct MeanpTFlucIdentified { std::vector VMeanPtKaon; std::vector VMeanPtProton; - - float Q1 = 0, Q2 = 0; float Q1pi = 0, Q2pi = 0; float Q1k = 0, Q2k = 0; @@ -222,7 +215,8 @@ struct MeanpTFlucIdentified { // Perfroming the track selection============================================================================================================== for (auto track : inputTracks) { // Loop over tracks - if (!track.isGlobalTrack()) return; + if (!track.isGlobalTrack()) + return; if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { continue; @@ -286,8 +280,6 @@ struct MeanpTFlucIdentified { histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); } - - nChpi += 1.; Q1pi += track.pt(); Q2pi += (track.pt() * track.pt()); @@ -311,8 +303,6 @@ struct MeanpTFlucIdentified { histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); } - - nChk += 1.; Q1k += track.pt(); Q2k += (track.pt() * track.pt()); @@ -336,7 +326,6 @@ struct MeanpTFlucIdentified { histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); } - nChp += 1.; Q1p += track.pt(); Q2p += (track.pt() * track.pt()); @@ -344,9 +333,9 @@ struct MeanpTFlucIdentified { } } // Track loop ends! - VMeanPtPion.clear(); - VMeanPtKaon.clear(); - VMeanPtProton.clear(); + VMeanPtPion.clear(); + VMeanPtKaon.clear(); + VMeanPtProton.clear(); if (nCh < 2) return; @@ -399,7 +388,6 @@ struct MeanpTFlucIdentified { histos.fill(HIST("hVar2px"), nCh, var2p); histos.fill(HIST("hVarpx"), sample, nChp); - for (ULong64_t j = 0; j < VMeanPt.size(); j++) { histos.fill(HIST("hPtCh"), nCh, VMeanPt[j]); } @@ -407,8 +395,6 @@ struct MeanpTFlucIdentified { VMeanPt.clear(); } // event loop ends! - - }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 2399c42887f244892bc22ea9e7a74d148790b61b Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 08:07:10 +0100 Subject: [PATCH 07/47] CF:MeanpTnew --- .../Tasks/MeanpTFlucPbPbIdentified.cxx | 432 ------------------ 1 file changed, 432 deletions(-) delete mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx deleted file mode 100644 index e1bfd227b72..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentified.cxx +++ /dev/null @@ -1,432 +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) - -// O2 includes -#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 "Framework/AnalysisDataModel.h" // -#include "Framework/ASoAHelpers.h" // -#include "Framework/HistogramRegistry.h" // -#include "Framework/RunningWorkflowInfo.h" // -#include "CommonConstants/MathConstants.h" // -#include "PWGCF/Core/CorrelationContainer.h" // -#include "PWGCF/Core/PairCuts.h" // - -#include "Common/DataModel/FT0Corrected.h" // -// #include "Framework/ASoA.h" -// #include "TRandom.h"// -// #include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" -#include "PWGCF/FemtoUniverse/DataModel/FemtoUniverseDerived.h" -// #include "Core/include/Framework/AnalysisDataModel.h" - -// #include ; -using namespace std; - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -// STEP 1 -// Example task illustrating how to acess information from different tables - -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join; - -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod - -struct MeanpTFlucPbPbIdentified { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // using myCompleteTracks = soa::Join; - - // Equivalent of the AliRoot task UserCreateOutputObjects - void init(o2::framework::InitContext&) - { - // Define your axes - // Constant bin width axis - AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; - AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; - // AxisSpec centAxis = {100,0,100,"FTOM (%)"} - // Variable bin width axis - // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; - // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; - - AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; - AxisSpec centAxis = {20, 0., 100., "centrality"}; - AxisSpec subAxis = {30, 0., 30., "sample"}; - AxisSpec nchAxis = {3200, 0., 3200., "nch"}; - AxisSpec varAxis1 = {6000, 0., 6., "var1"}; // variable1 bin width 0.001 - AxisSpec varAxis2 = {600, 0., 6., "var2"}; // meanpt//variable2 bin width 0.01 - - // Add histograms to histogram manager (as in the output object of in AliPhysics) - histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); - - histos.add("hP", "hP", kTH1F, {pAxis}); - histos.add("hEta", ";hEta", kTH1F, {etaAxis}); - histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, - {pAxis, nSigmaTPCAxis}); - histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); - histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - - histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); - - histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); - - histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); - // histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); - histos.add("hCent", "hCent", kTH1F, {centAxis}); - - ///////////////////////////////cent////////////////////////////////// - histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); - histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); - histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); - histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); - histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); - - ///////////////////////////////nch////////////////////////////////// - histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); - /////////////////////////////////////////////////////////////////////// - histos.add("ht", "ht", kTH1F, {centAxis}); - - histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); - - histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); - histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); - histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); - histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); - - histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); - histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); - } - - // Equivalent of the AliRoot task UserExec - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - - { - - // Performing the event selection - histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); - if (fabs(coll.posZ()) > 10.f) { - return; - } - histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - - if (!coll.sel8()) { - return; - } - histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); - - const auto cent = coll.centFT0C(); - histos.fill(HIST("hCentrality"), cent); - - float nCh = 0.; - float nChpi = 0.; - float nChk = 0.; - float nChp = 0.; - std::vector VMeanPt; - std::vector VMeanPtPion; - std::vector VMeanPtKaon; - std::vector VMeanPtProton; - - // TRandom *randn; - - // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); - - float Q1 = 0, Q2 = 0; - float Q1pi = 0, Q2pi = 0; - float Q1k = 0, Q2k = 0; - float Q1p = 0, Q2p = 0; - float var1, var2; - float var1pi, var2pi; - float var1k, var2k; - float var1p, var2p; - - int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); - sample = sample % 30; - - // Perfroming the track selection============================================================================================================== - for (auto track : inputTracks) { // Loop over tracks - - // if (!track.isGlobalTrack()) return; - - if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { - continue; - } - - 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("hPty"), track.pt(), track.rapidity()); - // histos.fill(HIST("hPy"), track.p(), track.rapidity()); - - VMeanPt.push_back(track.pt()); - - 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()); - - // 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()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtPion"), track.pt()); - - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { - - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - - VMeanPtPion.push_back(track.pt()); - - for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { - histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); - } - - VMeanPtPion.clear(); - - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtKaon"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - - histos.fill(HIST("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - - VMeanPtKaon.push_back(track.pt()); - - for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { - histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); - } - - VMeanPtKaon.clear(); - - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) - histos.fill(HIST("hPtProton"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { - - histos.fill(HIST("hPtProton"), track.pt()); - histos.fill(HIST("hEtaProton"), track.eta()); - - VMeanPtProton.push_back(track.pt()); - - for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { - histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); - } - - VMeanPtProton.clear(); - - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); - } - } - - } // Track loop ends! - - if (nCh < 2) - return; - - // all charges - var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), cent, var1); - var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"), cent, var2); - histos.fill(HIST("hVar"), sample, cent); - - // pions - - var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); - histos.fill(HIST("hVar1pi"), cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"), cent, var2pi); - // histos.fill(HIST("hVar"), sample, cent); - - // kaons - - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"), cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"), cent, var2k); - // histos.fill(HIST("hVar"), sample, cent); - - // protons - - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"), cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"), cent, var2p); - // histos.fill(HIST("hVar"), sample, cent); - - ///////nch///////////////////////// - histos.fill(HIST("hVar1x"), nCh, var1); - histos.fill(HIST("hVar2x"), nCh, var2); - histos.fill(HIST("hVarx"), sample, nCh); - - histos.fill(HIST("hVar1pix"), nCh, var1pi); - histos.fill(HIST("hVar2pix"), nCh, var2pi); - histos.fill(HIST("hVarpix"), sample, nChpi); - - histos.fill(HIST("hVar1kx"), nCh, var1k); - histos.fill(HIST("hVar2kx"), nCh, var2k); - histos.fill(HIST("hVarkx"), sample, nChk); - - histos.fill(HIST("hVar1px"), nCh, var1p); - histos.fill(HIST("hVar2px"), nCh, var2p); - histos.fill(HIST("hVarpx"), sample, nChp); - - // for(int j=0; j(cfgc)}; - return workflow; -} From 810508c9da223c0cf2b4ecc43eb570594af9fcee Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 08:28:30 +0100 Subject: [PATCH 08/47] CF:MeanPT --- .../Tasks/MeanpTFlucPbPbIdentifiedorg.cxx | 432 ++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx new file mode 100644 index 00000000000..bac35a58632 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx @@ -0,0 +1,432 @@ +// 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) + +// O2 includes +#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 "Framework/AnalysisDataModel.h" // +#include "Framework/ASoAHelpers.h" // +#include "Framework/HistogramRegistry.h" // +#include "Framework/RunningWorkflowInfo.h" // +#include "CommonConstants/MathConstants.h" // +#include "PWGCF/Core/CorrelationContainer.h" // +#include "PWGCF/Core/PairCuts.h" // + +#include "Common/DataModel/FT0Corrected.h" // +// #include "Framework/ASoA.h" +// #include "TRandom.h"// +// #include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" +#include "PWGCF/FemtoUniverse/DataModel/FemtoUniverseDerived.h" +// #include "Core/include/Framework/AnalysisDataModel.h" + +// #include ; +using namespace std; + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// STEP 1 +// Example task illustrating how to acess information from different tables + +namespace o2::aod +{ +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + +using MyCollision = MyCollisions::iterator; +using MyTrack = MyTracks::iterator; +} // namespace o2::aod + +struct MeanpTFlucPbPbIdentifiedorg { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // using myCompleteTracks = soa::Join; + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; + // AxisSpec centAxis = {100,0,100,"FTOM (%)"} + // Variable bin width axis + // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; + // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; + + AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; + AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + AxisSpec centAxis = {20, 0., 100., "centrality"}; + AxisSpec subAxis = {30, 0., 30., "sample"}; + AxisSpec nchAxis = {3200, 0., 3200., "nch"}; + AxisSpec varAxis1 = {6000, 0., 6., "var1"}; // variable1 bin width 0.001 + AxisSpec varAxis2 = {600, 0., 6., "var2"}; // meanpt//variable2 bin width 0.01 + + // Add histograms to histogram manager (as in the output object of in AliPhysics) + histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); + + histos.add("hP", "hP", kTH1F, {pAxis}); + histos.add("hEta", ";hEta", kTH1F, {etaAxis}); + histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, + {pAxis, nSigmaTPCAxis}); + histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); + histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); + histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); + + histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); + + histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + + histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + + histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); + + histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); + + histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); + // histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); + histos.add("hCent", "hCent", kTH1F, {centAxis}); + + ///////////////////////////////cent////////////////////////////////// + histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); + histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); + histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); + histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); + histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); + + ///////////////////////////////nch////////////////////////////////// + histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); + /////////////////////////////////////////////////////////////////////// + histos.add("ht", "ht", kTH1F, {centAxis}); + + histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); + + histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); + histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); + histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); + histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); + + histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); + histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); + } + + // Equivalent of the AliRoot task UserExec + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + + { + + // Performing the event selection + histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); + if (fabs(coll.posZ()) > 10.f) { + return; + } + histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); + + if (!coll.sel8()) { + return; + } + histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); + + const auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrality"), cent); + + float nCh = 0.; + float nChpi = 0.; + float nChk = 0.; + float nChp = 0.; + std::vector VMeanPt; + std::vector VMeanPtPion; + std::vector VMeanPtKaon; + std::vector VMeanPtProton; + + // TRandom *randn; + + // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); + + float Q1 = 0, Q2 = 0; + float Q1pi = 0, Q2pi = 0; + float Q1k = 0, Q2k = 0; + float Q1p = 0, Q2p = 0; + float var1, var2; + float var1pi, var2pi; + float var1k, var2k; + float var1p, var2p; + + int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); + sample = sample % 30; + + // Perfroming the track selection============================================================================================================== + for (auto track : inputTracks) { // Loop over tracks + + // if (!track.isGlobalTrack()) return; + + if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { + continue; + } + + 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("hPty"), track.pt(), track.rapidity()); + // histos.fill(HIST("hPy"), track.p(), track.rapidity()); + + VMeanPt.push_back(track.pt()); + + 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()); + + // 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()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtPion"), track.pt()); + + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { + + histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hEtaPion"), track.eta()); + + VMeanPtPion.push_back(track.pt()); + + for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { + histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); + } + + VMeanPtPion.clear(); + + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtKaon"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { + + histos.fill(HIST("hPtKaon"), track.pt()); + histos.fill(HIST("hEtaKaon"), track.eta()); + + VMeanPtKaon.push_back(track.pt()); + + for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { + histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); + } + + VMeanPtKaon.clear(); + + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) + histos.fill(HIST("hPtProton"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { + + histos.fill(HIST("hPtProton"), track.pt()); + histos.fill(HIST("hEtaProton"), track.eta()); + + VMeanPtProton.push_back(track.pt()); + + for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { + histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); + } + + VMeanPtProton.clear(); + + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); + } + } + + } // Track loop ends! + + if (nCh < 2) + return; + + // all charges + var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); + histos.fill(HIST("hVar1"), cent, var1); + var2 = (Q1 / nCh); + histos.fill(HIST("hVar2"), cent, var2); + histos.fill(HIST("hVar"), sample, cent); + + // pions + + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + histos.fill(HIST("hVar1pi"), cent, var1pi); + var2pi = (Q1pi / nChpi); + histos.fill(HIST("hVar2pi"), cent, var2pi); + // histos.fill(HIST("hVar"), sample, cent); + + // kaons + + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + histos.fill(HIST("hVar1k"), cent, var1k); + var2k = (Q1k / nChk); + histos.fill(HIST("hVar2k"), cent, var2k); + // histos.fill(HIST("hVar"), sample, cent); + + // protons + + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + histos.fill(HIST("hVar1p"), cent, var1p); + var2p = (Q1p / nChp); + histos.fill(HIST("hVar2p"), cent, var2p); + // histos.fill(HIST("hVar"), sample, cent); + + ///////nch///////////////////////// + histos.fill(HIST("hVar1x"), nCh, var1); + histos.fill(HIST("hVar2x"), nCh, var2); + histos.fill(HIST("hVarx"), sample, nCh); + + histos.fill(HIST("hVar1pix"), nCh, var1pi); + histos.fill(HIST("hVar2pix"), nCh, var2pi); + histos.fill(HIST("hVarpix"), sample, nChpi); + + histos.fill(HIST("hVar1kx"), nCh, var1k); + histos.fill(HIST("hVar2kx"), nCh, var2k); + histos.fill(HIST("hVarkx"), sample, nChk); + + histos.fill(HIST("hVar1px"), nCh, var1p); + histos.fill(HIST("hVar2px"), nCh, var2p); + histos.fill(HIST("hVarpx"), sample, nChp); + + // for(int j=0; j(cfgc)}; + return workflow; +} From 854c0395961f137d1f9ac38dc15e22c3df02822a Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 08:41:03 +0100 Subject: [PATCH 09/47] CF:MeanPT --- .../Tasks/MeanpTFlucPbPbIdentifiedorg.cxx | 432 ------------------ 1 file changed, 432 deletions(-) delete mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx deleted file mode 100644 index bac35a58632..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucPbPbIdentifiedorg.cxx +++ /dev/null @@ -1,432 +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) - -// O2 includes -#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 "Framework/AnalysisDataModel.h" // -#include "Framework/ASoAHelpers.h" // -#include "Framework/HistogramRegistry.h" // -#include "Framework/RunningWorkflowInfo.h" // -#include "CommonConstants/MathConstants.h" // -#include "PWGCF/Core/CorrelationContainer.h" // -#include "PWGCF/Core/PairCuts.h" // - -#include "Common/DataModel/FT0Corrected.h" // -// #include "Framework/ASoA.h" -// #include "TRandom.h"// -// #include "/home/sweta/alice/sw/ubuntu2004_x86-64/O2Physics/master-local5/include/TrackSelectionTables.h" -#include "PWGCF/FemtoUniverse/DataModel/FemtoUniverseDerived.h" -// #include "Core/include/Framework/AnalysisDataModel.h" - -// #include ; -using namespace std; - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -// STEP 1 -// Example task illustrating how to acess information from different tables - -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join; - -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod - -struct MeanpTFlucPbPbIdentifiedorg { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // using myCompleteTracks = soa::Join; - - // Equivalent of the AliRoot task UserCreateOutputObjects - void init(o2::framework::InitContext&) - { - // Define your axes - // Constant bin width axis - AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; - AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; - // AxisSpec centAxis = {100,0,100,"FTOM (%)"} - // Variable bin width axis - // std::vector ptBinning = {0.0,0.1,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.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4.}; - // AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; - - AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; - AxisSpec centAxis = {20, 0., 100., "centrality"}; - AxisSpec subAxis = {30, 0., 30., "sample"}; - AxisSpec nchAxis = {3200, 0., 3200., "nch"}; - AxisSpec varAxis1 = {6000, 0., 6., "var1"}; // variable1 bin width 0.001 - AxisSpec varAxis2 = {600, 0., 6., "var2"}; // meanpt//variable2 bin width 0.01 - - // Add histograms to histogram manager (as in the output object of in AliPhysics) - histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); - - histos.add("hP", "hP", kTH1F, {pAxis}); - histos.add("hEta", ";hEta", kTH1F, {etaAxis}); - histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, - {pAxis, nSigmaTPCAxis}); - histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); - histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - - histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); - - histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); - - histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); - // histos.add("hCent","hCent",kTH2F,{nChAxis, centAxis}); - histos.add("hCent", "hCent", kTH1F, {centAxis}); - - ///////////////////////////////cent////////////////////////////////// - histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); - histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); - histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); - histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); - histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); - - ///////////////////////////////nch////////////////////////////////// - histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); - /////////////////////////////////////////////////////////////////////// - histos.add("ht", "ht", kTH1F, {centAxis}); - - histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); - - histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); - histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); - histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); - histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); - - histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); - histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); - } - - // Equivalent of the AliRoot task UserExec - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - - { - - // Performing the event selection - histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); - if (fabs(coll.posZ()) > 10.f) { - return; - } - histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - - if (!coll.sel8()) { - return; - } - histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); - - const auto cent = coll.centFT0C(); - histos.fill(HIST("hCentrality"), cent); - - float nCh = 0.; - float nChpi = 0.; - float nChk = 0.; - float nChp = 0.; - std::vector VMeanPt; - std::vector VMeanPtPion; - std::vector VMeanPtKaon; - std::vector VMeanPtProton; - - // TRandom *randn; - - // histos.fill(HIST("ht"), randn->Uniform(0.,1.)); - - float Q1 = 0, Q2 = 0; - float Q1pi = 0, Q2pi = 0; - float Q1k = 0, Q2k = 0; - float Q1p = 0, Q2p = 0; - float var1, var2; - float var1pi, var2pi; - float var1k, var2k; - float var1p, var2p; - - int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); - sample = sample % 30; - - // Perfroming the track selection============================================================================================================== - for (auto track : inputTracks) { // Loop over tracks - - // if (!track.isGlobalTrack()) return; - - if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { - continue; - } - - 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("hPty"), track.pt(), track.rapidity()); - // histos.fill(HIST("hPy"), track.p(), track.rapidity()); - - VMeanPt.push_back(track.pt()); - - 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()); - - // 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()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtPion"), track.pt()); - - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { - - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - - VMeanPtPion.push_back(track.pt()); - - for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { - histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); - } - - VMeanPtPion.clear(); - - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtKaon"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - - histos.fill(HIST("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - - VMeanPtKaon.push_back(track.pt()); - - for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { - histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); - } - - VMeanPtKaon.clear(); - - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) - histos.fill(HIST("hPtProton"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { - - histos.fill(HIST("hPtProton"), track.pt()); - histos.fill(HIST("hEtaProton"), track.eta()); - - VMeanPtProton.push_back(track.pt()); - - for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { - histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); - } - - VMeanPtProton.clear(); - - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); - } - } - - } // Track loop ends! - - if (nCh < 2) - return; - - // all charges - var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), cent, var1); - var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"), cent, var2); - histos.fill(HIST("hVar"), sample, cent); - - // pions - - var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); - histos.fill(HIST("hVar1pi"), cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"), cent, var2pi); - // histos.fill(HIST("hVar"), sample, cent); - - // kaons - - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"), cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"), cent, var2k); - // histos.fill(HIST("hVar"), sample, cent); - - // protons - - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"), cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"), cent, var2p); - // histos.fill(HIST("hVar"), sample, cent); - - ///////nch///////////////////////// - histos.fill(HIST("hVar1x"), nCh, var1); - histos.fill(HIST("hVar2x"), nCh, var2); - histos.fill(HIST("hVarx"), sample, nCh); - - histos.fill(HIST("hVar1pix"), nCh, var1pi); - histos.fill(HIST("hVar2pix"), nCh, var2pi); - histos.fill(HIST("hVarpix"), sample, nChpi); - - histos.fill(HIST("hVar1kx"), nCh, var1k); - histos.fill(HIST("hVar2kx"), nCh, var2k); - histos.fill(HIST("hVarkx"), sample, nChk); - - histos.fill(HIST("hVar1px"), nCh, var1p); - histos.fill(HIST("hVar2px"), nCh, var2p); - histos.fill(HIST("hVarpx"), sample, nChp); - - // for(int j=0; j(cfgc)}; - return workflow; -} From 70be8f9d036217f847022d0264fb82551d343853 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 17 Jan 2024 15:50:57 +0100 Subject: [PATCH 10/47] MeanpTnew1 --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 4 +- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 405 ++++++++++++++++++ 2 files changed, 407 insertions(+), 2 deletions(-) create mode 100644 PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 24952f0f84c..23c631553b7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -20,8 +20,8 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(meanpt-fluct-identified - SOURCES MeanpTFlucIdentified.cxx +o2physics_add_dpl_workflow(identified-meanpt-fluct + SOURCES IdentifiedMeanPtFluctuations.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 new file mode 100644 index 00000000000..7a01aa0d87e --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -0,0 +1,405 @@ +// 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) + +// O2 includes +#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 "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "CommonConstants/MathConstants.h" +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" +#include "Common/DataModel/FT0Corrected.h" + +using namespace std; + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// STEP 1 +// Example task illustrating how to acess information from different tables + +namespace o2::aod +{ +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + +using MyCollision = MyCollisions::iterator; +using MyTrack = MyTracks::iterator; +} // namespace o2::aod + +struct IdentifiedMeanPtFluctuations { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; + AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; + + AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; + + AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; + AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; + AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; + AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + AxisSpec centAxis = {20, 0., 100., "centrality"}; + AxisSpec subAxis = {30, 0., 30., "sample"}; + AxisSpec nchAxis = {3200, 0., 3200., "nch"}; + AxisSpec varAxis1 = {6000, 0., 6., "var1"}; + AxisSpec varAxis2 = {600, 0., 6., "var2"}; + + // Add histograms to histogram manager (as in the output object of in AliPhysics) + histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); + histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); + + histos.add("hP", "hP", kTH1F, {pAxis}); + histos.add("hEta", ";hEta", kTH1F, {etaAxis}); + histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, + {pAxis, nSigmaTPCAxis}); + histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); + histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); + histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); + histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); + + histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); + histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); + + histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + + histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + + histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); + histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); + + histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); + histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); + + histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); + histos.add("hCent", "hCent", kTH2F, {nChAxis, centAxis}); + + histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); + histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); + histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); + histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); + + histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); + histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); + histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); + + //--------------------------------nch---------------------------------- + histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); + + histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); + histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); + histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); + + histos.add("ht", "ht", kTH1F, {centAxis}); + + histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); + + histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); + histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); + histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); + histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); + + histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); + histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); + } + + // Equivalent of the AliRoot task UserExec + void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + + { + + // Performing the event selection + histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); + if (fabs(coll.posZ()) > 10.f) { + return; + } + histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); + + if (!coll.sel8()) { + return; + } + histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); + + const auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrality"), cent); + + float nCh = 0.; + float nChpi = 0.; + float nChk = 0.; + float nChp = 0.; + std::vector VMeanPt; + std::vector VMeanPtPion; + std::vector VMeanPtKaon; + std::vector VMeanPtProton; + + float Q1 = 0, Q2 = 0; + float Q1pi = 0, Q2pi = 0; + float Q1k = 0, Q2k = 0; + float Q1p = 0, Q2p = 0; + float var1, var2; + float var1pi, var2pi; + float var1k, var2k; + float var1p, var2p; + + int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); + sample = sample % 30; + + // Perfroming the track selection============================================================================================================== + for (auto track : inputTracks) { // Loop over tracks + + if (!track.isGlobalTrack()) + return; + + if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { + continue; + } + + 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()); + + VMeanPt.push_back(track.pt()); + + 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()); + + // 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()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtPion"), track.pt()); + + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { + + histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hEtaPion"), track.eta()); + + VMeanPtPion.push_back(track.pt()); + + for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { + histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); + } + + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) + histos.fill(HIST("hPtKaon"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { + + histos.fill(HIST("hPtKaon"), track.pt()); + histos.fill(HIST("hEtaKaon"), track.eta()); + + VMeanPtKaon.push_back(track.pt()); + + for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { + histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); + } + + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + } + } + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) + histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) + histos.fill(HIST("hPtProton"), track.pt()); + { + if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { + + histos.fill(HIST("hPtProton"), track.pt()); + histos.fill(HIST("hEtaProton"), track.eta()); + + VMeanPtProton.push_back(track.pt()); + + for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { + histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); + } + + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); + } + } + + } // Track loop ends! + VMeanPtPion.clear(); + VMeanPtKaon.clear(); + VMeanPtProton.clear(); + + if (nCh < 2) + return; + + //------------------ all charges------------------------------------- + var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); + histos.fill(HIST("hVar1"), cent, var1); + var2 = (Q1 / nCh); + histos.fill(HIST("hVar2"), cent, var2); + histos.fill(HIST("hVar"), sample, cent); + + //---------------------- pions ---------------------------------------- + + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + histos.fill(HIST("hVar1pi"), cent, var1pi); + var2pi = (Q1pi / nChpi); + histos.fill(HIST("hVar2pi"), cent, var2pi); + // histos.fill(HIST("hVar"), sample, cent); + + //----------------------- kaons --------------------------------------- + + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + histos.fill(HIST("hVar1k"), cent, var1k); + var2k = (Q1k / nChk); + histos.fill(HIST("hVar2k"), cent, var2k); + // histos.fill(HIST("hVar"), sample, cent); + + //---------------------------- protons ---------------------------------- + + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + histos.fill(HIST("hVar1p"), cent, var1p); + var2p = (Q1p / nChp); + histos.fill(HIST("hVar2p"), cent, var2p); + // histos.fill(HIST("hVar"), sample, cent); + + //-----------------------nch------------------------------------- + histos.fill(HIST("hVar1x"), nCh, var1); + histos.fill(HIST("hVar2x"), nCh, var2); + histos.fill(HIST("hVarx"), sample, nCh); + + histos.fill(HIST("hVar1pix"), nCh, var1pi); + histos.fill(HIST("hVar2pix"), nCh, var2pi); + histos.fill(HIST("hVarpix"), sample, nChpi); + + histos.fill(HIST("hVar1kx"), nCh, var1k); + histos.fill(HIST("hVar2kx"), nCh, var2k); + histos.fill(HIST("hVarkx"), sample, nChk); + + histos.fill(HIST("hVar1px"), nCh, var1p); + histos.fill(HIST("hVar2px"), nCh, var2p); + histos.fill(HIST("hVarpx"), sample, nChp); + + for (ULong64_t j = 0; j < VMeanPt.size(); j++) { + histos.fill(HIST("hPtCh"), nCh, VMeanPt[j]); + } + + VMeanPt.clear(); + + } // event loop ends! +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + // Equivalent to the AddTask in AliPhysics + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From b225ef7c6f7065918380efcee72259a4e2286b95 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 17 Jan 2024 16:35:19 +0100 Subject: [PATCH 11/47] MeanpTnew2 --- .../Tasks/MeanpTFlucIdentified.cxx | 405 ------------------ 1 file changed, 405 deletions(-) delete mode 100644 PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx deleted file mode 100644 index 67a94351855..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/MeanpTFlucIdentified.cxx +++ /dev/null @@ -1,405 +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) - -// O2 includes -#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 "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "CommonConstants/MathConstants.h" -#include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" -#include "Common/DataModel/FT0Corrected.h" - -using namespace std; - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -// STEP 1 -// Example task illustrating how to acess information from different tables - -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join; - -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod - -struct MeanpTFlucIdentified { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // Equivalent of the AliRoot task UserCreateOutputObjects - void init(o2::framework::InitContext&) - { - // Define your axes - // Constant bin width axis - AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; - AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; - - AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; - - AxisSpec pAxis = {40, 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; - AxisSpec centAxis = {20, 0., 100., "centrality"}; - AxisSpec subAxis = {30, 0., 30., "sample"}; - AxisSpec nchAxis = {3200, 0., 3200., "nch"}; - AxisSpec varAxis1 = {6000, 0., 6., "var1"}; - AxisSpec varAxis2 = {600, 0., 6., "var2"}; - - // Add histograms to histogram manager (as in the output object of in AliPhysics) - histos.add("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); - - histos.add("hP", "hP", kTH1F, {pAxis}); - histos.add("hEta", ";hEta", kTH1F, {etaAxis}); - histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, - {pAxis, nSigmaTPCAxis}); - histos.add("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); - histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); - - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); - - histos.add("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - - histos.add("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - - histos.add("hEtaPion", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); - - histos.add("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); - - histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); - histos.add("hCent", "hCent", kTH2F, {nChAxis, centAxis}); - - histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); - histos.add("hVar", "hVar", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); - histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); - histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); - - histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); - histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); - - //--------------------------------nch---------------------------------- - histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); - - histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); - - histos.add("ht", "ht", kTH1F, {centAxis}); - - histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); - - histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); - histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); - histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); - histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); - - histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); - histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); - } - - // Equivalent of the AliRoot task UserExec - void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) - - { - - // Performing the event selection - histos.fill(HIST("hZvtx_before_sel"), coll.posZ()); - if (fabs(coll.posZ()) > 10.f) { - return; - } - histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); - - if (!coll.sel8()) { - return; - } - histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); - - const auto cent = coll.centFT0C(); - histos.fill(HIST("hCentrality"), cent); - - float nCh = 0.; - float nChpi = 0.; - float nChk = 0.; - float nChp = 0.; - std::vector VMeanPt; - std::vector VMeanPtPion; - std::vector VMeanPtKaon; - std::vector VMeanPtProton; - - float Q1 = 0, Q2 = 0; - float Q1pi = 0, Q2pi = 0; - float Q1k = 0, Q2k = 0; - float Q1p = 0, Q2p = 0; - float var1, var2; - float var1pi, var2pi; - float var1k, var2k; - float var1p, var2p; - - int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); - sample = sample % 30; - - // Perfroming the track selection============================================================================================================== - for (auto track : inputTracks) { // Loop over tracks - - if (!track.isGlobalTrack()) - return; - - if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { - continue; - } - - 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()); - - VMeanPt.push_back(track.pt()); - - 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()); - - // 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()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtPion"), track.pt()); - - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { - - histos.fill(HIST("hPtPion"), track.pt()); - histos.fill(HIST("hEtaPion"), track.eta()); - - VMeanPtPion.push_back(track.pt()); - - for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { - histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); - } - - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtKaon"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - - histos.fill(HIST("hPtKaon"), track.pt()); - histos.fill(HIST("hEtaKaon"), track.eta()); - - VMeanPtKaon.push_back(track.pt()); - - for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { - histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); - } - - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - } - } - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) - histos.fill(HIST("hPtProton"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { - - histos.fill(HIST("hPtProton"), track.pt()); - histos.fill(HIST("hEtaProton"), track.eta()); - - VMeanPtProton.push_back(track.pt()); - - for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { - histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); - } - - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); - } - } - - } // Track loop ends! - VMeanPtPion.clear(); - VMeanPtKaon.clear(); - VMeanPtProton.clear(); - - if (nCh < 2) - return; - - //------------------ all charges------------------------------------- - var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), cent, var1); - var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"), cent, var2); - histos.fill(HIST("hVar"), sample, cent); - - //---------------------- pions ---------------------------------------- - - var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); - histos.fill(HIST("hVar1pi"), cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"), cent, var2pi); - // histos.fill(HIST("hVar"), sample, cent); - - //----------------------- kaons --------------------------------------- - - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"), cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"), cent, var2k); - // histos.fill(HIST("hVar"), sample, cent); - - //---------------------------- protons ---------------------------------- - - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"), cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"), cent, var2p); - // histos.fill(HIST("hVar"), sample, cent); - - //-----------------------nch------------------------------------- - histos.fill(HIST("hVar1x"), nCh, var1); - histos.fill(HIST("hVar2x"), nCh, var2); - histos.fill(HIST("hVarx"), sample, nCh); - - histos.fill(HIST("hVar1pix"), nCh, var1pi); - histos.fill(HIST("hVar2pix"), nCh, var2pi); - histos.fill(HIST("hVarpix"), sample, nChpi); - - histos.fill(HIST("hVar1kx"), nCh, var1k); - histos.fill(HIST("hVar2kx"), nCh, var2k); - histos.fill(HIST("hVarkx"), sample, nChk); - - histos.fill(HIST("hVar1px"), nCh, var1p); - histos.fill(HIST("hVar2px"), nCh, var2p); - histos.fill(HIST("hVarpx"), sample, nChp); - - for (ULong64_t j = 0; j < VMeanPt.size(); j++) { - histos.fill(HIST("hPtCh"), nCh, VMeanPt[j]); - } - - VMeanPt.clear(); - - } // event loop ends! -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - // Equivalent to the AddTask in AliPhysics - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; - return workflow; -} From 093f5d7c98086cca0388cf031300975353f5a4c8 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 17 Jan 2024 16:56:09 +0100 Subject: [PATCH 12/47] MeanpTnew4 --- .../EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 7a01aa0d87e..84c19c74dde 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -22,14 +22,15 @@ #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 "CommonConstants/MathConstants.h" #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" -#include "Common/DataModel/FT0Corrected.h" + using namespace std; From 34b7ee6dcff346365381aba47380e0cc32b77c19 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Wed, 17 Jan 2024 17:08:27 +0100 Subject: [PATCH 13/47] MeanPtnew5 --- PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 84c19c74dde..4192f42023b 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -31,7 +31,6 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" - using namespace std; using namespace o2; From db7159515db72006603ca846a1a9caec69ea4505 Mon Sep 17 00:00:00 2001 From: sweta Date: Wed, 17 Jan 2024 18:25:04 +0100 Subject: [PATCH 14/47] MeanpT-identified-fluctuations --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 2 +- PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 23c631553b7..81ffffcd8bb 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -20,7 +20,7 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(identified-meanpt-fluct +o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.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 index 4192f42023b..74721b5b771 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -39,7 +39,6 @@ using namespace o2::framework::expressions; // STEP 1 // Example task illustrating how to acess information from different tables - namespace o2::aod { using MyCollisions = soa::Join Date: Thu, 18 Jan 2024 12:04:13 +0100 Subject: [PATCH 15/47] MeanpT-Identified-particles --- 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 81ffffcd8bb..cae271475cd 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -24,4 +24,9 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(netproton-cumulants + SOURCES NetProtonCumulants.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) From 3d5b8bfa98f4aa357e0016ece52252e43183df6c Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 18 Jan 2024 12:10:01 +0100 Subject: [PATCH 16/47] MeanpT-Identified-particles1 --- 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 cae271475cd..d91af4be8b8 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -24,7 +24,7 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - + o2physics_add_dpl_workflow(netproton-cumulants SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From 24702549667275a69043d6967999fb9c5e46f075 Mon Sep 17 00:00:00 2001 From: sweta Date: Thu, 18 Jan 2024 15:49:41 +0100 Subject: [PATCH 17/47] Mean-pT-fluctuation-identified --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 4 ---- PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index d91af4be8b8..4e52a69bbc7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -25,8 +25,4 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(netproton-cumulants - SOURCES NetProtonCumulants.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 index 74721b5b771..f2ccd271377 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -59,7 +59,7 @@ using MyTrack = MyTracks::iterator; struct IdentifiedMeanPtFluctuations { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) { // Define your axes From 3b684a917a0acf66fc04605301a27aa1bfb1e895 Mon Sep 17 00:00:00 2001 From: sweta Date: Thu, 18 Jan 2024 16:58:12 +0100 Subject: [PATCH 18/47] Mean-pT-fluctuation-identified1 --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index f2ccd271377..2727876e236 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -11,7 +11,6 @@ /// \author Sweta Singh (sweta.singh@cern.ch) -// O2 includes #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" @@ -31,14 +30,11 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" -using namespace std; - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace std; -// STEP 1 -// Example task illustrating how to acess information from different tables namespace o2::aod { using MyCollisions = soa::Join 10.f) { return; @@ -211,8 +198,9 @@ struct IdentifiedMeanPtFluctuations { int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); sample = sample % 30; - // Perfroming the track selection============================================================================================================== - for (auto track : inputTracks) { // Loop over tracks + // Perfroming the track selection============================================================================================================== + for (auto track : inputTracks) { + // Loop over tracks if (!track.isGlobalTrack()) return; @@ -330,8 +318,8 @@ struct IdentifiedMeanPtFluctuations { Q2p += (track.pt() * track.pt()); } } - - } // Track loop ends! + } + // Track loop ends! VMeanPtPion.clear(); VMeanPtKaon.clear(); VMeanPtProton.clear(); @@ -352,7 +340,6 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hVar1pi"), cent, var1pi); var2pi = (Q1pi / nChpi); histos.fill(HIST("hVar2pi"), cent, var2pi); - // histos.fill(HIST("hVar"), sample, cent); //----------------------- kaons --------------------------------------- @@ -360,7 +347,6 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hVar1k"), cent, var1k); var2k = (Q1k / nChk); histos.fill(HIST("hVar2k"), cent, var2k); - // histos.fill(HIST("hVar"), sample, cent); //---------------------------- protons ---------------------------------- @@ -368,7 +354,6 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hVar1p"), cent, var1p); var2p = (Q1p / nChp); histos.fill(HIST("hVar2p"), cent, var2p); - // histos.fill(HIST("hVar"), sample, cent); //-----------------------nch------------------------------------- histos.fill(HIST("hVar1x"), nCh, var1); @@ -398,7 +383,6 @@ struct IdentifiedMeanPtFluctuations { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - // Equivalent to the AddTask in AliPhysics WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } From e626acc0eb1b2c7baa682a534620b87308916ffd Mon Sep 17 00:00:00 2001 From: sweta Date: Thu, 18 Jan 2024 17:34:13 +0100 Subject: [PATCH 19/47] MeanPt-fluctuations-in-identified-particles --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 4e52a69bbc7..a98380e8e8a 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -19,7 +19,6 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From a76d58b00eec63f2a1dd6669cc20dc28dc0a8b61 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 03:47:59 +0100 Subject: [PATCH 20/47] mean-pT-fluctuations-identified-particles --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index a98380e8e8a..a7364b59b9d 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,5 +23,4 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - - + From b42524fad8c5f318a312d8387a3330bf5778e799 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 03:52:14 +0100 Subject: [PATCH 21/47] mean-pT-fluctuations@identified-particles --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index a7364b59b9d..d6a1b6e1802 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,4 +23,3 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - From 278a0623753db3c8badda4762e0aa6f5097703b8 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 08:14:59 +0100 Subject: [PATCH 22/47] Identified-MeanpT-Fluctuations --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index d6a1b6e1802..5229c157ac3 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -19,6 +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(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From 148a68ae1b835d4e46da5bd370de00458bf90f76 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 11:34:49 +0100 Subject: [PATCH 23/47] new-changes-in mean pT --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 5229c157ac3..d6a1b6e1802 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -19,7 +19,6 @@ o2physics_add_dpl_workflow(mean-pt-fluc-id PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From 7a384a0307542b4b702843301b9e77b4a542b418 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 12:56:57 +0100 Subject: [PATCH 24/47] CF:MeanpT-fluctuations-in-identifiedparticles --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index d6a1b6e1802..a7364b59b9d 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,3 +23,4 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + From b187e6acf3be785850b812334694908a8b7fff62 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 13:03:47 +0100 Subject: [PATCH 25/47] CF:MeanpT-fluctuations-in-identifiedparticles1 --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index a7364b59b9d..d6a1b6e1802 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,4 +23,3 @@ o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - From 0ebb82c255fcbaaf970f819b15ceb76d44e29158 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 18:05:47 +0100 Subject: [PATCH 26/47] Identified-MeanpT-Fluctuations-final --- 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 96b7d0e7e69..9d84b0d9b1f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,7 +23,7 @@ o2physics_add_dpl_workflow(netproton-cumulants SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - + o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From 9aecb7d1c1ac97b52fd1ebc8f1770f34e7be3f6d Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 19 Jan 2024 18:10:11 +0100 Subject: [PATCH 27/47] Identified-MeanpT-Fluctuations-final --- 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 9d84b0d9b1f..03cdbab35f8 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -23,7 +23,7 @@ o2physics_add_dpl_workflow(netproton-cumulants SOURCES NetProtonCumulants.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - + o2physics_add_dpl_workflow(identified-meanpt-fluctuations SOURCES IdentifiedMeanPtFluctuations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore From acc6cd25856a7dc64b83f759d3005c3744935daa Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 26 Feb 2024 08:59:27 +0100 Subject: [PATCH 28/47] CF:identified_Particles --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 541 +++++++++++++----- 1 file changed, 382 insertions(+), 159 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 2727876e236..28c6656309f 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -29,6 +29,7 @@ #include "Framework/RunningWorkflowInfo.h" #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" +#include "TDatabasePDG.h" using namespace o2; using namespace o2::framework; @@ -52,121 +53,205 @@ 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}; void init(o2::framework::InitContext&) { AxisSpec vtxZAxis = {100, -20, 20, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; - AxisSpec ptAxis = {40, 0.0, 4.0, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec pAxis = {40, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; + 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; - AxisSpec centAxis = {20, 0., 100., "centrality"}; + //AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; AxisSpec nchAxis = {3200, 0., 3200., "nch"}; - AxisSpec varAxis1 = {6000, 0., 6., "var1"}; - AxisSpec varAxis2 = {600, 0., 6., "var2"}; + 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("hZvtx_before_sel", "hZvtx_before_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel", "hZvtx_after_sel", kTH1F, {vtxZAxis}); - histos.add("hZvtx_after_sel8", "hZvtx_after_sel8", kTH1F, {vtxZAxis}); - histos.add("hP", "hP", kTH1F, {pAxis}); - histos.add("hEta", ";hEta", kTH1F, {etaAxis}); - histos.add("hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hNsigmaTPC", "hNsigmaTPC", kTH2F, + 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("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("hPtDCAxy", "hPtDCAxy", kTH2F, {ptAxis, dcaAxis}); - histos.add("hPtDCAz", "hPtDCAz", kTH2F, {ptAxis, dcaAxis}); - histos.add("NSigamaTPCpion", "NSigamaTPCpion", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCkaon", "NSigamaTPCkaon", kTH2F, {ptAxis, nSigmaTPCAxispid}); - histos.add("NSigamaTPCproton", "NSigamaTPCproton", kTH2F, {ptAxis, nSigmaTPCAxispid}); + 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("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2D, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", 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}); + - histos.add("NSigamaTOFpion", "NSigamaTOFpion", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFkaon", "NSigamaTOFkaon", kTH2F, {ptAxis, nSigmaTOFAxispid}); - histos.add("NSigamaTOFproton", "NSigamaTOFproton", kTH2F, {ptAxis, nSigmaTOFAxispid}); + //--------------------------------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("NSigamaTPCTOFpion", "NSigamaTPCTOFpion", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFkaon", "NSigamaTPCTOFkaon", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); - histos.add("NSigamaTPCTOFproton", "NSigamaTPCTOFproton", kTH2F, {nSigmaTPCAxispid, nSigmaTOFAxispid}); + 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("hPtPion", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtKaon", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); - histos.add("hPtProton", ";#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + 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("hEtaPion", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaKaon", ";hEta", kTH1F, {etaAxis}); - histos.add("hEtaProton", ";hEta", kTH1F, {etaAxis}); + 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("hPtCh", "hPtCh", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChPion", "hPtChPion", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChKaon", "hPtChKaon", kTH2F, {nchAxis, ptAxis}); - histos.add("hPtChProton", "hPtChProton", kTH2F, {nchAxis, ptAxis}); + histos.add("ht", "ht", kTH1D, {centAxis}); - histos.add("hMeanPtCh", "hMeanPtCh", kTH2F, {nChAxis, ptAxis}); - histos.add("hCent", "hCent", kTH2F, {nChAxis, centAxis}); + histos.add("hCentrality", "hCentrality", kTH1D, {centAxis}); - histos.add("hVar1", "hVar1", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2", "hVar2", kTH2F, {centAxis, varAxis2}); - histos.add("hVar", "hVar", kTH2F, {subAxis, 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("hVar1pi", "hVar1pi", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2pi", "hVar2pi", kTH2F, {centAxis, varAxis2}); - histos.add("hVarpi", "hVarpi", kTH2F, {subAxis, centAxis}); + histos.add("hPtyPion", "hPtyPion", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); + histos.add("hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); - histos.add("hVar1k", "hVar1k", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2k", "hVar2k", kTH2F, {centAxis, varAxis2}); - histos.add("hVark", "hVark", kTH2F, {subAxis, centAxis}); - histos.add("hVar1p", "hVar1p", kTH2F, {centAxis, varAxis1}); - histos.add("hVar2p", "hVar2p", kTH2F, {centAxis, varAxis2}); - histos.add("hVarp", "hVarp", kTH2F, {subAxis, centAxis}); + histos.add("hTOFbeta", "hTOFbeta", kTH2D, {pAxis, betaAxis}); + histos.add("hdEdx", "hdEdx", kTH2D, {pAxis, dEdxAxis}); - //--------------------------------nch---------------------------------- - histos.add("hVar1x", "hVar1x", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2x", "hVar2x", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarx", "hVarx", kTH2F, {subAxis, nchAxis}); + 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("hVar1pix", "hVar1pix", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2pix", "hVar2pix", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpix", "hVarpix", kTH2F, {subAxis, nchAxis}); - histos.add("hVar1kx", "hVar1kx", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2kx", "hVar2kx", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarkx", "hVarkx", kTH2F, {subAxis, nchAxis}); - histos.add("hVar1px", "hVar1px", kTH2F, {nchAxis, varAxis1}); - histos.add("hVar2px", "hVar2px", kTH2F, {nchAxis, varAxis2}); - histos.add("hVarpx", "hVarpx", kTH2F, {subAxis, nchAxis}); + 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("ht", "ht", kTH1F, {centAxis}); + 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}); - histos.add("hCentrality", "hCentrality", kTH1F, {centAxis}); - histos.add("hPEta", "hPEta", kTH2F, {pAxis, etaAxis}); - histos.add("hPtEta", "hPtEta", kTH2F, {ptAxis, etaAxis}); - histos.add("hPy", "hPy", kTH2F, {pAxis, etaAxis}); - histos.add("hPty", "hPty", kTH2F, {ptAxis, etaAxis}); - histos.add("hTOFbeta", "hTOFbeta", kTH2F, {pAxis, betaAxis}); - histos.add("hdEdx", "hdEdx", kTH2F, {pAxis, dEdxAxis}); } 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()) { @@ -174,41 +259,86 @@ struct IdentifiedMeanPtFluctuations { } histos.fill(HIST("hZvtx_after_sel8"), coll.posZ()); + histos.fill(HIST("hEventCounter"), 3.); + + const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); - float nCh = 0.; - float nChpi = 0.; - float nChk = 0.; - float nChp = 0.; - std::vector VMeanPt; - std::vector VMeanPtPion; - std::vector VMeanPtKaon; - std::vector VMeanPtProton; - - float Q1 = 0, Q2 = 0; - float Q1pi = 0, Q2pi = 0; - float Q1k = 0, Q2k = 0; - float Q1p = 0, Q2p = 0; - float var1, var2; - float var1pi, var2pi; - float var1k, var2k; - float var1p, var2p; - - int sample = histos.get(HIST("hZvtx_before_sel"))->GetEntries(); + 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, var2, twopar_allcharge; + double var1pi, var2pi; + double var1k, var2k; + double var1p, var2p; + // cent = 0; + + // sampling + int sample = histos.get(HIST("hZvtx_after_sel8"))->GetEntries(); sample = sample % 30; + - // Perfroming the track selection============================================================================================================== + // Perfroming the track selection========================================== for (auto track : inputTracks) { // Loop over tracks - if (!track.isGlobalTrack()) - return; + // inital tracks + histos.fill(HIST("tracksel"), 1); - if (!((fabs(track.eta()) < 0.8) && (fabs(track.dcaXY()) < 0.12) && (fabs(track.dcaZ()) < 1.) && (track.pt() > 0.15 && track.pt() < 2.))) { - continue; - } + 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.0 && 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(); @@ -223,7 +353,6 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hPtEta"), track.pt(), track.eta()); histos.fill(HIST("hPEta"), track.p(), track.eta()); - VMeanPt.push_back(track.pt()); histos.fill(HIST("hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); @@ -243,140 +372,234 @@ struct IdentifiedMeanPtFluctuations { 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()); + 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("NSigamaTPCTOFpion"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() > 0.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtPion"), track.pt()); + histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); + } - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.)) { + //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.tofNSigmaEl()) > 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)); - VMeanPtPion.push_back(track.pt()); + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); + + 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.tofNSigmaEl()) > 1.0 && 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)); - for (ULong64_t jPi = 0; jPi < VMeanPtPion.size(); jPi++) { - histos.fill(HIST("hPtChPion"), nCh, VMeanPtPion[jPi]); - } nChpi += 1.; Q1pi += track.pt(); Q2pi += (track.pt() * track.pt()); + + 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("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.2 && track.pt() < 0.5))) - histos.fill(HIST("hPtKaon"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.5 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { - histos.fill(HIST("hPtKaon"), track.pt()); + } + + + if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massKa)) < 0.5) && (std::abs(track.tofNSigmaEl()) > 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()); - VMeanPtKaon.push_back(track.pt()); + 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.tofNSigmaEl()) > 1.0 && 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)); - for (ULong64_t jKa = 0; jKa < VMeanPtKaon.size(); jKa++) { - histos.fill(HIST("hPtChKaon"), nCh, VMeanPtKaon[jKa]); - } nChk += 1.; Q1k += track.pt(); Q2k += (track.pt() * track.pt()); + + 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("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2. && (track.pt() > 0.4 && track.pt() < 0.6))) - histos.fill(HIST("hPtProton"), track.pt()); - { - if ((track.hasTPC() && (track.pt() >= 0.6 && track.pt() < 2.0)) && (track.hasTOF() && abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.)) { + 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.tofNSigmaEl()) > 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()); + + + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + + } + - VMeanPtProton.push_back(track.pt()); - for (ULong64_t jPr = 0; jPr < VMeanPtProton.size(); jPr++) { - histos.fill(HIST("hPtChProton"), nCh, VMeanPtProton[jPr]); - } + if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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()); + + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - } + + +//================================================================================================= + + } // Track loop ends! - VMeanPtPion.clear(); - VMeanPtKaon.clear(); - VMeanPtProton.clear(); - if (nCh < 2) + + if (nCh < 2) return; //------------------ all charges------------------------------------- var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), cent, var1); + histos.fill(HIST("hVar1"),sample ,cent, var1); var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"), cent, var2); - histos.fill(HIST("hVar"), sample, cent); + 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)); - histos.fill(HIST("hVar1pi"), cent, var1pi); + histos.fill(HIST("hVar1pi"),sample ,cent, var1pi); var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"), cent, var2pi); + histos.fill(HIST("hVar2pi"),sample ,cent, var2pi); + histos.fill(HIST("hVar2meanptpi"), cent, var2pi); + } //----------------------- kaons --------------------------------------- - + if(nChk > 2){ var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"), cent, var1k); + histos.fill(HIST("hVar1k"),sample ,cent, var1k); var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"), cent, var2k); + histos.fill(HIST("hVar2k"),sample ,cent, var2k); + histos.fill(HIST("hVar2meanptk"), cent, var2k); + } //---------------------------- protons ---------------------------------- - + if(nChp > 2){ var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"), cent, var1p); + histos.fill(HIST("hVar1p"),sample ,cent, var1p); var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"), cent, var2p); + histos.fill(HIST("hVar2p"),sample ,cent, var2p); + histos.fill(HIST("hVar2meanptp"), cent, var2p); + } //-----------------------nch------------------------------------- - histos.fill(HIST("hVar1x"), nCh, var1); - histos.fill(HIST("hVar2x"), nCh, var2); + 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"), nCh, var1pi); - histos.fill(HIST("hVar2pix"), nCh, var2pi); + 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"), nCh, var1k); - histos.fill(HIST("hVar2kx"), nCh, var2k); + 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"), nCh, var1p); - histos.fill(HIST("hVar2px"), nCh, var2p); + histos.fill(HIST("hVar1px"),sample ,nCh, var1p); + histos.fill(HIST("hVar2px"),sample ,nCh, var2p); histos.fill(HIST("hVarpx"), sample, nChp); - - for (ULong64_t j = 0; j < VMeanPt.size(); j++) { - histos.fill(HIST("hPtCh"), nCh, VMeanPt[j]); - } - - VMeanPt.clear(); + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); + } // event loop ends! }; From 457e321ef97562cb43374ed72649349caeacb466 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 26 Feb 2024 09:09:56 +0100 Subject: [PATCH 29/47] CF:identified_Particles --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 392 ++++++++---------- 1 file changed, 164 insertions(+), 228 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 28c6656309f..6853b58c0ad 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -59,14 +59,13 @@ double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; 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 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})"}; @@ -75,7 +74,7 @@ struct IdentifiedMeanPtFluctuations { AxisSpec nSigmaTPCAxis = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - //AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + // AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; AxisSpec nchAxis = {3200, 0., 3200., "nch"}; @@ -85,9 +84,8 @@ struct IdentifiedMeanPtFluctuations { AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; AxisSpec Counter = {10, 0., 10., "events"}; - // QA Plots - histos.add("hEventCounter","event counts",kTH1D,{Counter}); + 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"); @@ -100,7 +98,6 @@ struct IdentifiedMeanPtFluctuations { h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster 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}); @@ -109,8 +106,8 @@ struct IdentifiedMeanPtFluctuations { 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("hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz", "hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -133,75 +130,65 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); -//=====================rapidity===================================== + //=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", 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("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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); histos.add("ht", "ht", kTH1D, {centAxis}); @@ -216,7 +203,6 @@ struct IdentifiedMeanPtFluctuations { histos.add("hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); histos.add("hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); - histos.add("hTOFbeta", "hTOFbeta", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx", "hdEdx", kTH2D, {pAxis, dEdxAxis}); @@ -226,8 +212,6 @@ struct IdentifiedMeanPtFluctuations { histos.add("hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx_afterselection1", "hdEdx_afterselection1", 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}); @@ -235,22 +219,19 @@ struct IdentifiedMeanPtFluctuations { 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}); - - - } void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -261,7 +242,6 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hEventCounter"), 3.); - const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -269,7 +249,7 @@ struct IdentifiedMeanPtFluctuations { double nChpi = 0.; double nChk = 0.; double nChp = 0.; - + double Q1 = 0, Q2 = 0; double Q1pi = 0, Q2pi = 0; double Q1k = 0, Q2k = 0; @@ -278,67 +258,62 @@ struct IdentifiedMeanPtFluctuations { double var1pi, var2pi; double var1k, var2k; double var1p, var2p; - // cent = 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 + // 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()); - + 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 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 DCAxy + // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes + histos.fill(HIST("tracksel"), 3); - //tracks passed after DCAz + // tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + // 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.0 && track.pt() < 2.)) continue;//pt = 0.15 + // tracks passed after pT-cut + if (!(track.pt() > 0.0 && track.pt() < 2.)) + continue; // pt = 0.15 histos.fill(HIST("tracksel"), 6); - - // if (track.tpcNClsCrossedRows() < 70.0) continue; + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - -// if (track.tpcChi2NCl() > 4.0) continue; + // if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - -// if (track.itsChi2NCl() > 36.0) continue; + // if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); - - nCh += 1.; Q1 += track.pt(); @@ -353,7 +328,6 @@ struct IdentifiedMeanPtFluctuations { 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 @@ -372,234 +346,196 @@ struct IdentifiedMeanPtFluctuations { 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()); - - - - + if (track.hasTPC()) + histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - -//=============================pion============================================================== + //=============================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()); + 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()); + 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.tofNSigmaEl()) > 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()); - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), 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.tofNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaKa()) > 2.0 && std::abs(track.tpcNSigmaPr()) > 2.0))) { - //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.tofNSigmaEl()) > 1.0 && 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)); - 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()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - - - - } - - -//===========================kaon=============================================================== + // 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.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0) && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.) { - 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()); + 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()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), 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.tofNSigmaEl()) > 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)); + //===========================kaon=============================================================== - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - - - } + 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.tofNSigmaEl()) > 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)); - if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massKa)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaPi()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0 ) && (abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.) ) { + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - 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)); + if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massKa)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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()); + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - - } - + //============================proton=========================================================== -//============================proton=========================================================== - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - { histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + 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("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.tofNSigmaEl()) > 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()); - - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), 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.tofNSigmaEl()) > 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)); - if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPi()) > 2.0 ) && (abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.) ) { + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); - 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)); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); + if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + 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()); -//================================================================================================= + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - + //================================================================================================= } // Track loop ends! - - if (nCh < 2) + if (nCh < 2) return; //------------------ all charges------------------------------------- var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"),sample ,cent, var1); + 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("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)); - histos.fill(HIST("hVar1pi"),sample ,cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"),sample ,cent, var2pi); - histos.fill(HIST("hVar2meanptpi"), cent, var2pi); + if (nChpi > 2) { + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + histos.fill(HIST("hVar1pi"), sample, cent, var1pi); + var2pi = (Q1pi / nChpi); + histos.fill(HIST("hVar2pi"), sample, cent, var2pi); + histos.fill(HIST("hVar2meanptpi"), cent, var2pi); } //----------------------- kaons --------------------------------------- - if(nChk > 2){ - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"),sample ,cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"),sample ,cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); - } + if (nChk > 2) { + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + histos.fill(HIST("hVar1k"), sample, cent, var1k); + var2k = (Q1k / nChk); + histos.fill(HIST("hVar2k"), sample, cent, var2k); + histos.fill(HIST("hVar2meanptk"), cent, var2k); + } //---------------------------- protons ---------------------------------- - if(nChp > 2){ - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"),sample ,cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"),sample ,cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); - } + if (nChp > 2) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + histos.fill(HIST("hVar1p"), sample, cent, var1p); + var2p = (Q1p / nChp); + 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("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("hVar2meanptx"), nCh, var2); - histos.fill(HIST("hVar1pix"),sample ,nCh, var1pi); - histos.fill(HIST("hVar2pix"),sample ,nCh, var2pi); + 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("hVar2meanptpix"), nCh, var2pi); - histos.fill(HIST("hVar1kx"),sample ,nCh, var1k); - histos.fill(HIST("hVar2kx"),sample ,nCh, var2k); + 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("hVar2meanptkx"), nCh, var2k); - histos.fill(HIST("hVar1px"),sample ,nCh, var1p); - histos.fill(HIST("hVar2px"),sample ,nCh, var2p); + 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); - + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); } // event loop ends! }; From e61db437e81e78167380b3bc6af06671f2f699ad Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 26 Feb 2024 11:22:38 +0100 Subject: [PATCH 30/47] CF:identified_Particles --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 395 ++++++++---------- 1 file changed, 166 insertions(+), 229 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 028f877f17f..c8d6970720c 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -57,16 +57,16 @@ double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); -//struct IdentifiedMeanPtFluctuations { +// struct IdentifiedMeanPtFluctuations { struct MeanpTFluct { - + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; 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 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})"}; @@ -75,7 +75,7 @@ struct MeanpTFluct { AxisSpec nSigmaTPCAxis = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - //AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + // AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; AxisSpec nchAxis = {3200, 0., 3200., "nch"}; @@ -85,9 +85,8 @@ struct MeanpTFluct { AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; AxisSpec Counter = {10, 0., 10., "events"}; - // QA Plots - histos.add("hEventCounter","event counts",kTH1D,{Counter}); + 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"); @@ -100,7 +99,6 @@ struct MeanpTFluct { h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster 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}); @@ -109,8 +107,8 @@ struct MeanpTFluct { 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("hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz", "hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -133,75 +131,65 @@ struct MeanpTFluct { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); -//=====================rapidity===================================== + //=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", 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("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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); histos.add("ht", "ht", kTH1D, {centAxis}); @@ -216,7 +204,6 @@ struct MeanpTFluct { histos.add("hPtyKaon", "hPtyKaon", kTH2D, {ptAxis, etaAxis}); histos.add("hPtyProton", "hPtyProton", kTH2D, {ptAxis, etaAxis}); - histos.add("hTOFbeta", "hTOFbeta", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx", "hdEdx", kTH2D, {pAxis, dEdxAxis}); @@ -226,8 +213,6 @@ struct MeanpTFluct { histos.add("hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); histos.add("hdEdx_afterselection1", "hdEdx_afterselection1", 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}); @@ -235,22 +220,19 @@ struct MeanpTFluct { 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}); - - - } void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -261,7 +243,6 @@ struct MeanpTFluct { histos.fill(HIST("hEventCounter"), 3.); - const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -269,7 +250,7 @@ struct MeanpTFluct { double nChpi = 0.; double nChk = 0.; double nChp = 0.; - + double Q1 = 0, Q2 = 0; double Q1pi = 0, Q2pi = 0; double Q1k = 0, Q2k = 0; @@ -278,67 +259,62 @@ struct MeanpTFluct { double var1pi, var2pi; double var1k, var2k; double var1p, var2p; - // cent = 0; + // cent = 0; // sampling int sample = histos.get(HIST("hZvtx_after_sel8"))->GetEntries(); sample = sample % 15; - // Perfroming the track selection========================================== for (auto track : inputTracks) { // Loop over tracks - // inital 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()); - + 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 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 DCAxy + // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes + histos.fill(HIST("tracksel"), 3); - //tracks passed after DCAz + // tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + // 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.0 && track.pt() < 2.)) continue;//pt = 0.15 + // tracks passed after pT-cut + if (!(track.pt() > 0.0 && track.pt() < 2.)) + continue; // pt = 0.15 histos.fill(HIST("tracksel"), 6); - - // if (track.tpcNClsCrossedRows() < 70.0) continue; + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - -// if (track.tpcChi2NCl() > 4.0) continue; + // if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - -// if (track.itsChi2NCl() > 36.0) continue; + // if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); - - nCh += 1.; Q1 += track.pt(); @@ -353,7 +329,6 @@ struct MeanpTFluct { 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 @@ -372,234 +347,196 @@ struct MeanpTFluct { 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()); - - + if (track.hasTPC()) + histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - - - -//=============================pion============================================================== + //=============================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()); + 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()); + 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.tofNSigmaEl()) > 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()); + // pion-TPC----------------------------------------------------------------------------------- - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massPi)) < 0.5) && (std::abs(track.tofNSigmaEl()) > 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)); - //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.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0 ) && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2. ) { + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); - 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()); - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - - - - } - + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } -//===========================kaon=============================================================== + // 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.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0) && abs(sqrt(track.tpcNSigmaPi()) * (track.tpcNSigmaPi()) + (track.tofNSigmaPi()) * (track.tofNSigmaPi())) < 2.) { - 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()); + 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()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), 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.tofNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaPi()) > 2.0 && std::abs(track.tpcNSigmaPr()) > 2.0)) { + //===========================kaon=============================================================== - 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()); - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - - - } + 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.tofNSigmaEl()) > 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)); - if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massKa)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaPi()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0 ) && (abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.) ) { + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - 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)); + if ((track.pt() >= 0.65 && track.pt() < 2.0) && (abs(track.rapidity(massKa)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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()); + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - - } - + //============================proton=========================================================== -//============================proton=========================================================== - - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - { histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + 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("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.tofNSigmaEl()) > 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()); - - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), 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.tofNSigmaEl()) > 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)); - if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaKa()) > 2.0 && std::abs(track.tofNSigmaPi()) > 2.0 ) && (abs(sqrt(track.tpcNSigmaPr()) * (track.tpcNSigmaPr()) + (track.tofNSigmaPr()) * (track.tofNSigmaPr())) < 2.) ) { + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); - 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)); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - nChp += 1.; - Q1p += track.pt(); - Q2p += (track.pt() * track.pt()); + if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + 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()); -//================================================================================================= + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - + //================================================================================================= } // Track loop ends! - - if (nCh < 2) + if (nCh < 2) return; //------------------ all charges------------------------------------- var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"),sample ,cent, var1); + 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("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)); - histos.fill(HIST("hVar1pi"),sample ,cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"),sample ,cent, var2pi); - histos.fill(HIST("hVar2meanptpi"), cent, var2pi); + if (nChpi > 2) { + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + histos.fill(HIST("hVar1pi"), sample, cent, var1pi); + var2pi = (Q1pi / nChpi); + histos.fill(HIST("hVar2pi"), sample, cent, var2pi); + histos.fill(HIST("hVar2meanptpi"), cent, var2pi); } //----------------------- kaons --------------------------------------- - if(nChk > 2){ - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"),sample ,cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"),sample ,cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); - } + if (nChk > 2) { + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + histos.fill(HIST("hVar1k"), sample, cent, var1k); + var2k = (Q1k / nChk); + histos.fill(HIST("hVar2k"), sample, cent, var2k); + histos.fill(HIST("hVar2meanptk"), cent, var2k); + } //---------------------------- protons ---------------------------------- - if(nChp > 2){ - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"),sample ,cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"),sample ,cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); - } + if (nChp > 2) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + histos.fill(HIST("hVar1p"), sample, cent, var1p); + var2p = (Q1p / nChp); + 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("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("hVar2meanptx"), nCh, var2); - histos.fill(HIST("hVar1pix"),sample ,nCh, var1pi); - histos.fill(HIST("hVar2pix"),sample ,nCh, var2pi); + 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("hVar2meanptpix"), nCh, var2pi); - histos.fill(HIST("hVar1kx"),sample ,nCh, var1k); - histos.fill(HIST("hVar2kx"),sample ,nCh, var2k); + 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("hVar2meanptkx"), nCh, var2k); - histos.fill(HIST("hVar1px"),sample ,nCh, var1p); - histos.fill(HIST("hVar2px"),sample ,nCh, var2p); + 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); - + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); } // event loop ends! }; From d49b71767a8c5c16b27f626b5ed17d9f9739ba60 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 26 Feb 2024 12:10:20 +0100 Subject: [PATCH 31/47] CF:identified_Particles --- .../EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index c8d6970720c..88ee13f1c61 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -57,8 +57,8 @@ double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); -// struct IdentifiedMeanPtFluctuations { -struct MeanpTFluct { + +struct IdentifiedMeanPtFluctuations { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -543,6 +543,6 @@ struct MeanpTFluct { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } From 3193c6c57cb0f349843fca204f92a092a12f1594 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 26 Feb 2024 12:13:59 +0100 Subject: [PATCH 32/47] CF:identified_Particles --- PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 88ee13f1c61..223592b1eb6 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -57,7 +57,6 @@ 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}; From bccf00dcf8e7ae0a0402c65350fbce4353939760 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:05:56 +0200 Subject: [PATCH 33/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 1310 ++++++++++++++--- 1 file changed, 1125 insertions(+), 185 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index b1e89622b8d..e82e739d282 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -30,6 +30,10 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" #include "TDatabasePDG.h" +#include +#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" + using namespace o2; using namespace o2::framework; @@ -38,6 +42,7 @@ using namespace std; namespace o2::aod { + using MyCollisions = soa::Join; + +using MCCollisions = soa::Join; + +using MCTracks =soa::Join;//, aod::StoredMcParticles_000>; + + using MyCollision = MyCollisions::iterator; using MyTrack = MyTracks::iterator; } // namespace o2::aod @@ -59,33 +75,39 @@ double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; + 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 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 = {100, -5., 5., "n#sigma_{TPC}^{proton}"}; - AxisSpec nSigmaTPCAxispid = {110, -5.5, 5.5, "n#sigma_{TPC}"}; - AxisSpec nSigmaTOFAxispid = {110, -5.5, 5.5, "n#sigma_{TOF}"}; - // AxisSpec nChAxis = {2500, -0.5, 2499.5, "nCh"}; + 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 = {3200, 0., 3200., "nch"}; + 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}); + 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"); @@ -98,6 +120,21 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -106,8 +143,8 @@ struct IdentifiedMeanPtFluctuations { 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("hDCAxy","hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz","hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -119,10 +156,40 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -130,65 +197,75 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); - //=====================rapidity===================================== +//=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", 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("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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); + histos.add("ht", "ht", kTH1D, {centAxis}); @@ -203,6 +280,17 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -212,6 +300,15 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -219,19 +316,790 @@ struct IdentifiedMeanPtFluctuations { 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 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks const& mcrectrack, aod::McParticles const& mcParticles, aod::McCollisions const& mcCollisions) + { + 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()) { // min bias + return; + } + + histos.fill(HIST("hZvtx_after_sel8_rec"), mccoll.posZ()); + + histos.fill(HIST("tracksel_rec"), 3); + + +if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ // no pileup according to SPD vertexer + return; + } + histos.fill(HIST("tracksel_rec"), 4); + + +if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 5); + + +if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 6); + + +if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 7); + + + + int count_rec_pi =0, count_rec_k =0, count_rec_p =0; + int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; + 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;//, twopar_allcharge_rec; + 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;// *confirm* + if(!(track1.mcParticle().isPhysicalPrimary())) continue; +// auto mctrack1 = track1.mcParticle(); + 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) +{count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); +} +if(abs(track1.mcParticle().pdgCode())==321) +{count_rec_k_pdg++; + + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); +} +if(abs(track1.mcParticle().pdgCode())==2212) +{count_rec_p_pdg++; + + 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; // electron rejection + +//=============================pion============================================================== + // only TPC+TOF tracks: Pion, Kaon, Proton + + + + 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()); + + } + + + //pion-TPC----------------------------------------------------------------------------------- + + if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3.&& (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) + + { + + + count_rec_pi++; + 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)); + + } + + + } + + //pion->(TPC+TOF)------------------------------------------------------------------------------------ + + if (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.) //elipsoidal cut + + +{ + + + count_rec_pi++; + + 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)); + + } + + + } +//============================KAON Reconstructed ==================================================== + + + + + 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()); + + } + + + +//Kaon_TPC_only + + + if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) + + + + { count_rec_k++; + + 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)); + + } + + + } + +//KAON_TPC+TOF (both) + + + + + +if ( 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.)// ellipsoidal cut + + +{ count_rec_k++; + + 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)); + + } + + + } + + +//============================proton=========================================================== + + + + 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()); + + } + + +//PROTON _ TPC only + + if (( track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) + + +{ count_rec_p++; + + 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)); + + } + + + + } + +//PROTON_ TPC + TOF (both) + + +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.)//elliposidal cut + +{ + count_rec_p++; + + 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)//, const soa::SmallGroups& collisions) + + { + + if (fabs(mcCollision.posZ()) > 10.f) { + return; + } + histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); + + + // INITALIZE VARIABLE FOR ADDING IDENTIFIED PT // + + int count_gen_pi =0, count_gen_k =0, count_gen_p =0; + 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;//pt cut // or and check + if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) continue;//eta cut // or and check + + + nCh_gen += 1.; + + Q1_gen += mcgentrack.pt(); + Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); + + + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); + + + if(pdgcode == 211){ + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + + } + + + if(pdgcode == 321){ + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); + + + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); + + } + + + + if(pdgcode == 2212){ + count_gen_p++; + 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("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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -242,6 +1110,7 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hEventCounter"), 3.); + const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -249,78 +1118,76 @@ struct IdentifiedMeanPtFluctuations { 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; -<<<<<<< HEAD - double var1, var2, twopar_allcharge; - double var1pi, var2pi; - double var1k, var2k; - double var1p, var2p; -======= - double var1 = 0, var2 = 0, twopar_allcharge = 0; - double var1pi = 0, var2pi = 0; - double var1k = 0, var2k = 0; - double var1p = 0, var2p = 0; ->>>>>>> upstream/master - // cent = 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 % 15; + sample = sample % 30; + // Perfroming the track selection========================================== for (auto track : inputTracks) { // Loop over tracks - // inital 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()); + 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 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 DCAxy + // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes + histos.fill(HIST("tracksel"), 3); - // tracks passed after DCAz + //tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + //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.0 && track.pt() < 2.)) - continue; // pt = 0.15 + //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; + + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - // if (track.tpcChi2NCl() > 4.0) continue; + +// if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - // if (track.itsChi2NCl() > 36.0) continue; + +// if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); + + nCh += 1.; Q1 += track.pt(); @@ -335,6 +1202,7 @@ struct IdentifiedMeanPtFluctuations { 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 @@ -353,198 +1221,270 @@ struct IdentifiedMeanPtFluctuations { 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()); + if (track.hasTPC()) histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); + + + + - //=============================pion============================================================== + +//=============================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()); + 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()); + histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); } - // pion-TPC----------------------------------------------------------------------------------- + //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))) + { - if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massPi)) < 0.5) && (std::abs(track.tofNSigmaEl()) > 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)); - 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()); - 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()); - } + 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.tofNSigmaEl()) > 1.0 && 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)); + //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. ) { - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); + 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)); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - //===========================kaon=============================================================== + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); - 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.beta()>1) continue; + - if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 2. && (track.pt() >= 0.15 && track.pt() < 0.65) && (abs(track.rapidity(massKa)) < 0.5) && (std::abs(track.tofNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaPi()) > 2.0 && std::abs(track.tpcNSigmaPr()) > 2.0)) { + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - 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()); + + } + + +//===========================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()); + - 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.tofNSigmaEl()) > 1.0 && std::abs(track.tofNSigmaPi()) > 2.0 && std::abs(track.tofNSigmaPr()) > 2.0) && (abs(sqrt(track.tpcNSigmaKa()) * (track.tpcNSigmaKa()) + (track.tofNSigmaKa()) * (track.tofNSigmaKa())) < 2.)) { + + 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)); + 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()); + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } + 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()); + 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.tofNSigmaEl()) > 1.0 && std::abs(track.tpcNSigmaKa()) > 2.0 && std::abs(track.tpcNSigmaPi()) > 2.0)) { + + 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)); + 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()); + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } + if(track.beta()>1) continue; + - if ((track.pt() >= 0.85 && track.pt() < 2.0) && (abs(track.rapidity(massPr)) < 0.5) && track.hasTPC() && track.hasTOF() && (std::abs(track.tofNSigmaEl()) > 1.0 && 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - 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()); - 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) + + if (nCh < 2) return; //------------------ all charges------------------------------------- var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), sample, cent, var1); + 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("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)); - histos.fill(HIST("hVar1pi"), sample, cent, var1pi); - var2pi = (Q1pi / nChpi); - histos.fill(HIST("hVar2pi"), sample, cent, var2pi); - histos.fill(HIST("hVar2meanptpi"), cent, var2pi); - } + if(nChpi > 2){ + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + var2pi = (Q1pi / nChpi); + + } //----------------------- kaons --------------------------------------- - if (nChk > 2) { - var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); - histos.fill(HIST("hVar1k"), sample, cent, var1k); - var2k = (Q1k / nChk); - histos.fill(HIST("hVar2k"), sample, cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); - } + if(nChk > 2){ + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + var2k = (Q1k / nChk); + } //---------------------------- protons ---------------------------------- - if (nChp > 2) { - var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); - histos.fill(HIST("hVar1p"), sample, cent, var1p); - var2p = (Q1p / nChp); - histos.fill(HIST("hVar2p"), sample, cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); - } + 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("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("hVar2meanptx"), nCh, var2); + - histos.fill(HIST("hVar1pix"), sample, nCh, var1pi); - histos.fill(HIST("hVar2pix"), sample, nCh, var2pi); + 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("hVar2meanptpix"), nCh, var2pi); + - histos.fill(HIST("hVar1kx"), sample, nCh, var1k); - histos.fill(HIST("hVar2kx"), sample, nCh, var2k); + 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("hVar2meanptkx"), nCh, var2k); + - histos.fill(HIST("hVar1px"), sample, nCh, var1p); - histos.fill(HIST("hVar2px"), sample, nCh, var2p); + 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); + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); + } // event loop ends! + +//PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", true); + + + + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 38ce7db9c5716c86e4d280aeb0800d115e806297 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:12:09 +0200 Subject: [PATCH 34/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 474 +++++++++--------- 1 file changed, 237 insertions(+), 237 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index e82e739d282..5c4cd422566 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -75,11 +75,11 @@ double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { - + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; void init(o2::framework::InitContext&) @@ -350,17 +350,17 @@ struct IdentifiedMeanPtFluctuations { //=======================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("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("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}); @@ -392,24 +392,24 @@ struct IdentifiedMeanPtFluctuations { 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("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_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("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("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}); @@ -448,48 +448,48 @@ void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks cons if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ // no pileup according to SPD vertexer - return; + return; } histos.fill(HIST("tracksel_rec"), 4); if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 5); if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 6); if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 7); int count_rec_pi =0, count_rec_k =0, count_rec_p =0; - int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; - double nCh_rec = 0.; - double nChpi_rec = 0.; - double nChk_rec = 0.; - double nChp_rec = 0.; + int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; + 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;//, twopar_allcharge_rec; - double var1pi_rec= 0, var2pi_rec= 0; - double var1k_rec= 0, var2k_rec= 0; - double var1p_rec= 0, var2p_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;//, twopar_allcharge_rec; + 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; + int sample_rec = histos.get(HIST("hZvtx_after_sel8_rec"))->GetEntries(); + sample_rec = sample_rec % 30; @@ -503,37 +503,37 @@ if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing i 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.; + nCh_rec += 1.; Q1_rec += track1.pt(); Q2_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); - + histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); + if (track1.hasTPC()) - histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); + histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); //======================================================================== if(abs(track1.mcParticle().pdgCode())==211) {count_rec_pi_pdg++; - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); } if(abs(track1.mcParticle().pdgCode())==321) {count_rec_k_pdg++; - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); } if(abs(track1.mcParticle().pdgCode())==2212) {count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); } - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// + //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; // electron rejection + if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; // electron rejection //=============================pion============================================================== // only TPC+TOF tracks: Pion, Kaon, Proton @@ -541,19 +541,19 @@ if(abs(track1.mcParticle().pdgCode())==2212) if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) + { - histos.fill(HIST("NSigamaTPCpion_rec_bf_sel"), track1.p(), track1.tpcNSigmaPi()); + 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()); + histos.fill(HIST("NSigamaTPCTOFpion_rec_bf_sel"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - } + } //pion-TPC----------------------------------------------------------------------------------- @@ -563,8 +563,8 @@ if(abs(track1.mcParticle().pdgCode())==2212) { - count_rec_pi++; - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); + count_rec_pi++; + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); nChpi_rec += 1.; @@ -572,13 +572,13 @@ if(abs(track1.mcParticle().pdgCode())==2212) Q2pi_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("NSigamaTPCpion_rec"), track1.p(), track1.tpcNSigmaPi()); + 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()); + 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()); @@ -587,16 +587,16 @@ if(abs(track1.mcParticle().pdgCode())==2212) if(abs(track1.mcParticle().pdgCode())==211) { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } } @@ -605,13 +605,13 @@ if(abs(track1.mcParticle().pdgCode())==2212) if (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.) //elipsoidal cut - + { - - count_rec_pi++; + + count_rec_pi++; - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); nChpi_rec += 1.; @@ -619,30 +619,30 @@ if(abs(track1.mcParticle().pdgCode())==2212) Q2pi_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("NSigamaTPCpion_rec"), track1.p(), track1.tpcNSigmaPi()); + 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==211) { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } } @@ -652,18 +652,18 @@ if(abs(track1.mcParticle().pdgCode())==2212) if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) + { - histos.fill(HIST("NSigamaTPCkaon_rec_bf_sel"), track1.p(), track1.tpcNSigmaKa()); + 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()); + histos.fill(HIST("NSigamaTPCTOFkaon_rec_bf_sel"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); - } + } @@ -672,11 +672,11 @@ if(abs(track1.mcParticle().pdgCode())==2212) if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - - - { count_rec_k++; + + + { count_rec_k++; - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); nChk_rec += 1.; @@ -684,30 +684,30 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==321) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } } @@ -721,9 +721,9 @@ if(abs(track1.mcParticle().pdgCode())==2212) if ( 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.)// ellipsoidal cut -{ count_rec_k++; +{ count_rec_k++; - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); @@ -733,31 +733,31 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==321) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } - + } @@ -765,29 +765,29 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) + { - histos.fill(HIST("NSigamaTPCproton_rec_bf_sel"), track1.p(), track1.tpcNSigmaPr()); + 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()); + histos.fill(HIST("NSigamaTPCTOFproton_rec_bf_sel"), track1.tpcNSigmaPr(), track1.tofNSigmaPr()); - } + } //PROTON _ TPC only - if (( track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) + if (( track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) -{ count_rec_p++; +{ count_rec_p++; - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); nChp_rec += 1.; @@ -795,31 +795,31 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==2212) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } @@ -831,38 +831,38 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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.)//elliposidal cut { - count_rec_p++; + count_rec_p++; - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); + 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==2212) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); + 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)); - - } + 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)); + + } } @@ -938,7 +938,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCReco, "process reconstruct //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles)//, const soa::SmallGroups& collisions) - + { if (fabs(mcCollision.posZ()) > 10.f) { @@ -971,57 +971,57 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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;//pt cut // or and check + if(!(mcgentrack.isPhysicalPrimary())) continue; + if (!(mcgentrack.pt() > 0.15) || !(mcgentrack.pt() < 2.)) continue;//pt cut // or and check if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) continue;//eta cut // or and check - - nCh_gen += 1.; + + nCh_gen += 1.; Q1_gen += mcgentrack.pt(); Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); - histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); if(pdgcode == 211){ - count_gen_pi++; - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - } + } - if(pdgcode == 321){ - count_gen_k++; - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); + if(pdgcode == 321){ + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - - + } + + - if(pdgcode == 2212){ - count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + if(pdgcode == 2212){ + count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); + nChp_gen += 1.; + Q1p_gen += mcgentrack.pt(); + Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); - } + } //================================= Pion Generated Calculation ==================================== @@ -1092,14 +1092,14 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -1138,11 +1138,11 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in for (auto track : inputTracks) { // Loop over tracks - // inital 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("hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); @@ -1151,7 +1151,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in histos.fill(HIST("tracksel"), 2); - //tracks passed after DCAxy + //tracks passed after DCAxy // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes histos.fill(HIST("tracksel"), 3); @@ -1221,7 +1221,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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.hasTPC()) histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); if (track.hasTOF()) histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); @@ -1234,7 +1234,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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("hdEdx_afterselection"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); } @@ -1246,14 +1246,14 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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)); + 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()); @@ -1267,7 +1267,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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)); + histos.fill(HIST("hPtyPion"),track.pt(),track.rapidity(massPi)); nChpi += 1.; @@ -1275,9 +1275,9 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in Q2pi += (track.pt() * track.pt()); if(track.beta()>1) continue; - + - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); @@ -1289,28 +1289,28 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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("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)) { + 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("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)); + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); @@ -1318,13 +1318,13 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in - 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.) ) { + 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("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)); + histos.fill(HIST("hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("hPtyKaon"),track.pt(),track.rapidity(massKa)); nChk += 1.; @@ -1332,12 +1332,12 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in Q2k += (track.pt() * track.pt()); if(track.beta()>1) continue; - + - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - + } @@ -1346,27 +1346,27 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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("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)) { + 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)); + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); } @@ -1377,17 +1377,17 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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)); + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); } From 19e02cc308a774cad05d5d31a9a79001ed36f749 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:19:47 +0200 Subject: [PATCH 35/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 340 +++++++++--------- 1 file changed, 170 insertions(+), 170 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 5c4cd422566..7f59fb36032 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -75,7 +75,7 @@ double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { - + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; @@ -86,7 +86,7 @@ struct IdentifiedMeanPtFluctuations { { 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 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})"}; @@ -132,7 +132,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -199,7 +199,7 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); //=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", kTH1D, {etaAxis}); + histos.add("hyKaon", ";hyKaon", kTH1D, {etaAxis}); histos.add("hyProton", ";hyProton", kTH1D, {etaAxis}); @@ -220,52 +220,52 @@ struct IdentifiedMeanPtFluctuations { histos.add("hVar1", "hVar1", kTH2D, {subAxis, centAxis}); histos.add("hVar2", "hVar2", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanpt", "hVar2meanpt", kTH2D, {centAxis, varAxis2}); + 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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); + histos.add("ht", "ht", kTH1D, {centAxis}); @@ -307,7 +307,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -324,25 +324,25 @@ struct IdentifiedMeanPtFluctuations { 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("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("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("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("hVar2meanptpx_rec", "hVar2meanptpx_rec", kTH2D, {nchAxis, varAxis2}); @@ -354,7 +354,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -366,25 +366,25 @@ struct IdentifiedMeanPtFluctuations { 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("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("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("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("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); //========================MC Histograms Reconstructed================================================= @@ -392,7 +392,7 @@ struct IdentifiedMeanPtFluctuations { 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("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}); @@ -429,14 +429,14 @@ void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks cons } 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()) { // min bias return; @@ -448,25 +448,25 @@ void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks cons if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ // no pileup according to SPD vertexer - return; - } + return; + } histos.fill(HIST("tracksel_rec"), 4); if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 5); if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 6); if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing is far from ITS RO Frame border - return; + return; } histos.fill(HIST("tracksel_rec"), 7); @@ -509,18 +509,18 @@ if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing i 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) -{count_rec_pi_pdg++; +if(abs(track1.mcParticle().pdgCode())==211) +{count_rec_pi_pdg++; histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); } -if(abs(track1.mcParticle().pdgCode())==321) +if(abs(track1.mcParticle().pdgCode())==321) {count_rec_k_pdg++; histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); @@ -528,16 +528,16 @@ if(abs(track1.mcParticle().pdgCode())==321) if(abs(track1.mcParticle().pdgCode())==2212) {count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); + 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; // electron rejection + if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; // electron rejection //=============================pion============================================================== // only TPC+TOF tracks: Pion, Kaon, Proton - + if (track1.hasTPC()) @@ -557,8 +557,8 @@ if(abs(track1.mcParticle().pdgCode())==2212) //pion-TPC----------------------------------------------------------------------------------- - - if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3.&& (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) + + if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3.&& (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) { @@ -566,7 +566,7 @@ if(abs(track1.mcParticle().pdgCode())==2212) count_rec_pi++; histos.fill(HIST("ptHistogramPionrec"), track1.pt()); - + nChpi_rec += 1.; Q1pi_rec += track1.pt(); Q2pi_rec += (track1.pt() * track1.pt()); @@ -578,12 +578,12 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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) { @@ -592,23 +592,23 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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)); - + } - + } //pion->(TPC+TOF)------------------------------------------------------------------------------------ - - if (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.) //elipsoidal cut - + if (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.) //elipsoidal cut + + { - + count_rec_pi++; histos.fill(HIST("ptHistogramPionrec"), track1.pt()); @@ -625,7 +625,7 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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()); @@ -638,13 +638,13 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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)); - + } - + } //============================KAON Reconstructed ==================================================== @@ -655,7 +655,7 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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()) { @@ -672,8 +672,8 @@ if(abs(track1.mcParticle().pdgCode())==2212) if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - - + + { count_rec_k++; histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); @@ -690,7 +690,7 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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()); @@ -703,13 +703,13 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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)); - + } - + } //KAON_TPC+TOF (both) @@ -718,7 +718,7 @@ if(abs(track1.mcParticle().pdgCode())==2212) -if ( 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.)// ellipsoidal cut +if ( 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.)// ellipsoidal cut { count_rec_k++; @@ -739,7 +739,7 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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()); @@ -751,18 +751,18 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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)); - + } - + } - + //============================proton=========================================================== - + if (track1.hasTPC()) @@ -787,7 +787,7 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t { count_rec_p++; - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); nChp_rec += 1.; @@ -801,9 +801,9 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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()); @@ -815,10 +815,10 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 0.7 && TMath::Hypot((t 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)); - + } @@ -833,7 +833,7 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t { count_rec_p++; - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); nChp_rec += 1.; @@ -846,7 +846,7 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t 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()); @@ -858,10 +858,10 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t 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)); - + } @@ -874,7 +874,7 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t }// track loop ends - if (nCh_rec < 2) + if (nCh_rec < 2) return; //------------------ all charges------------------------------------- @@ -886,20 +886,20 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t 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); + 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); - } + } @@ -907,38 +907,38 @@ if ( track1.hasTPC() && track1.hasTOF() && track1.p() >= 1.1 && TMath::Hypot((t 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("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("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("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); + 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)//, const soa::SmallGroups& collisions) - + { if (fabs(mcCollision.posZ()) > 10.f) { @@ -946,7 +946,7 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - + // INITALIZE VARIABLE FOR ADDING IDENTIFIED PT // int count_gen_pi =0, count_gen_k =0, count_gen_p =0; @@ -954,7 +954,7 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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; @@ -970,16 +970,16 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti sample_gen = sample_gen % 30; - for (auto& mcgentrack : mcParticles) - + 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;//pt cut // or and check if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) continue;//eta cut // or and check - + nCh_gen += 1.; Q1_gen += mcgentrack.pt(); @@ -987,9 +987,9 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - - if(pdgcode == 211){ + + if(pdgcode == 211){ count_gen_pi++; histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); @@ -1010,12 +1010,12 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); } - - + + if(pdgcode == 2212){ count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); nChp_gen += 1.; Q1p_gen += mcgentrack.pt(); @@ -1027,8 +1027,8 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti }//track loop ends! - - if (nCh_gen < 2) + + if (nCh_gen < 2) return; //------------------ all charges------------------------------------- @@ -1040,20 +1040,20 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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); + 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); - } + } @@ -1061,25 +1061,25 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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("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("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("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); + histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen, var2p_gen); } @@ -1118,7 +1118,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in double nChpi = 0.; double nChk = 0.; double nChp = 0.; - + double Q1 = 0., Q2 = 0.; double Q1pi = 0., Q2pi = 0.; double Q1k = 0., Q2k = 0.; @@ -1132,13 +1132,13 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in // 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 + // inital tracks histos.fill(HIST("tracksel"), 1); histos.fill(HIST("hTPCchi2perCluster_before"), track.tpcChi2NCl()); @@ -1150,7 +1150,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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); @@ -1171,12 +1171,12 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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); @@ -1187,7 +1187,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in histos.fill(HIST("tracksel"), 9); - + nCh += 1.; Q1 += track.pt(); @@ -1223,10 +1223,10 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in if (track.hasTPC()) histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); if (track.hasTOF()) histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - - - + + + //=============================pion============================================================== @@ -1239,7 +1239,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in } //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))) { @@ -1253,12 +1253,12 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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)------------------------------------------------------------------------------------ @@ -1275,17 +1275,17 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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=============================================================== + +//===========================kaon=============================================================== if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 2.)) { histos.fill(HIST("NSigamaTPCTOFkaon"), track.tpcNSigmaKa(), track.tofNSigmaKa()); @@ -1295,7 +1295,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in } - + 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()); @@ -1308,12 +1308,12 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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()); - + } @@ -1332,17 +1332,17 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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()); @@ -1350,7 +1350,7 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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()); @@ -1363,9 +1363,9 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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()); @@ -1385,22 +1385,22 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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) + if (nCh < 2) return; //------------------ all charges------------------------------------- @@ -1408,9 +1408,9 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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("hVarc"), sample, cent); histos.fill(HIST("hVar2meanpt"), cent, var2); - + twopar_allcharge = (var1 - var2); histos.fill(HIST("hVar"), nCh, twopar_allcharge); @@ -1420,20 +1420,20 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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); + var2k = (Q1k / nChk); } //---------------------------- protons ---------------------------------- if(nChp > 2){ var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); var2p = (Q1p / nChp); - } + } //========================centrality========================================== @@ -1457,26 +1457,26 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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("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("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("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); - + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); + } // event loop ends! From 56e741e19e652e745b40cfe9a7cb7828c7978539 Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:30:31 +0200 Subject: [PATCH 36/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 1279 +++++++---------- 1 file changed, 522 insertions(+), 757 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 7f59fb36032..d8ce2a1ccf7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -34,7 +34,6 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/CCDB/EventSelectionParams.h" - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -54,16 +53,14 @@ using MyTracks = soa::Join; +using MCCollisions = soa::Join; -using MCCollisions = soa::Join; - -using MCTracks =soa::Join;//, aod::StoredMcParticles_000>; - + aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>; //, aod::StoredMcParticles_000>; using MyCollision = MyCollisions::iterator; using MyTrack = MyTracks::iterator; @@ -75,12 +72,10 @@ double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; void init(o2::framework::InitContext&) { @@ -95,7 +90,7 @@ struct IdentifiedMeanPtFluctuations { 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 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"}; @@ -105,9 +100,8 @@ struct IdentifiedMeanPtFluctuations { AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; AxisSpec Counter = {10, 0., 10., "events"}; - // QA Plots - histos.add("hEventCounter","event counts",kTH1D,{Counter}); + 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"); @@ -120,9 +114,7 @@ struct IdentifiedMeanPtFluctuations { h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); - - - histos.add("hEventCounter_recMC","event counts rec MC",kTH1D,{Counter}); + 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"); @@ -133,8 +125,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -143,8 +133,8 @@ struct IdentifiedMeanPtFluctuations { 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("hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz", "hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -156,7 +146,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -165,17 +154,14 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -188,8 +174,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -197,24 +181,21 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); -//=====================rapidity===================================== + //=====================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}); @@ -229,44 +210,37 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -284,13 +258,10 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -303,11 +274,10 @@ struct IdentifiedMeanPtFluctuations { 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("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("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}); @@ -317,126 +287,96 @@ struct IdentifiedMeanPtFluctuations { histos.add("hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); histos.add("hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {CrossedrowTPCAxis}); - - - - //--------------------------------nch---------------------------------- + //--------------------------------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 ================================================ + //=======================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("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); + histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); - histos.add("hTOFbeta_gen_pion", "hTOFbeta_gen_pion", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_gen_pion", "hdEdx_gen_pion", kTH2D, {pAxis, dEdxAxis}); + 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================================================= + //========================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}); - - - - - + 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 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //++++++++++++++++++++++++Monte Carlo Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks const& mcrectrack, aod::McParticles const& mcParticles, aod::McCollisions const& mcCollisions) + void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks const& mcrectrack, aod::McParticles const& mcParticles, aod::McCollisions const& mcCollisions) { if (!mccoll.has_mcCollision()) { return; - } - histos.fill(HIST("tracksel_rec"), 1); - + } + histos.fill(HIST("tracksel_rec"), 1); - if (fabs(mccoll.posZ()) > 10.f) { + if (fabs(mccoll.posZ()) > 10.f) { return; } histos.fill(HIST("hZvtx_after_sel_rec"), mccoll.posZ()); - histos.fill(HIST("tracksel_rec"), 2); - + histos.fill(HIST("tracksel_rec"), 2); if (!mccoll.sel8()) { // min bias return; @@ -444,512 +384,410 @@ void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks cons histos.fill(HIST("hZvtx_after_sel8_rec"), mccoll.posZ()); - histos.fill(HIST("tracksel_rec"), 3); - - -if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ // no pileup according to SPD vertexer - return; - } - histos.fill(HIST("tracksel_rec"), 4); - - -if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 5); - - -if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 6); - - -if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 7); - - - - int count_rec_pi =0, count_rec_k =0, count_rec_p =0; - int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; - 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;//, twopar_allcharge_rec; - 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; - + histos.fill(HIST("tracksel_rec"), 3); + if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { // no pileup according to SPD vertexer + return; + } + histos.fill(HIST("tracksel_rec"), 4); - for ( auto track1 : mcrectrack) { - if(!(track1.has_collision())) continue; - if(!(track1.has_mcParticle())) continue;// *confirm* - if(!(track1.mcParticle().isPhysicalPrimary())) continue; -// auto mctrack1 = track1.mcParticle(); - if (!track1.isGlobalTrack()) continue; + if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 5); - 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 + if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 6); - nCh_rec += 1.; + if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { // bunch crossing is far from ITS RO Frame border + return; + } + histos.fill(HIST("tracksel_rec"), 7); + + int count_rec_pi = 0, count_rec_k = 0, count_rec_p = 0; + int count_rec_pi_pdg = 0, count_rec_k_pdg = 0, count_rec_p_pdg = 0; + 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; //, twopar_allcharge_rec; + 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; // *confirm* + if (!(track1.mcParticle().isPhysicalPrimary())) + continue; + // auto mctrack1 = track1.mcParticle(); + 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()); + 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) -{count_rec_pi_pdg++; - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); -} -if(abs(track1.mcParticle().pdgCode())==321) -{count_rec_k_pdg++; + if (abs(track1.mcParticle().pdgCode()) == 211) { + count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); + } + if (abs(track1.mcParticle().pdgCode()) == 321) { + count_rec_k_pdg++; - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); -} -if(abs(track1.mcParticle().pdgCode())==2212) -{count_rec_p_pdg++; + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); + } + if (abs(track1.mcParticle().pdgCode()) == 2212) { + count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); -} + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); + } - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// + //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; // electron rejection + if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) + continue; // electron rejection -//=============================pion============================================================== + //=============================pion============================================================== // only TPC+TOF tracks: Pion, Kaon, Proton - - - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) + 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()) { - if (track1.hasTPC() && track1.hasTOF()) - { - - histos.fill(HIST("NSigamaTPCpion_rec_bf_sel"), track1.p(), track1.tpcNSigmaPi()); + 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()); - - } - - - //pion-TPC----------------------------------------------------------------------------------- - - if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3.&& (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - - { - - - count_rec_pi++; - 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("NSigamaTPCTOFpion_rec_bf_sel"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); + } - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + // pion-TPC----------------------------------------------------------------------------------- + if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) + { - if(abs(track1.mcParticle().pdgCode())==211) - { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); - } + count_rec_pi++; + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); - if (abs(track1.rapidity(massPi)) < 0.5) - { + nChpi_rec += 1.; + Q1pi_rec += track1.pt(); + Q2pi_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("hPyPion_rec"),track1.p(),track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"),track1.pt(),track1.rapidity(massPi)); + 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()); } - //pion->(TPC+TOF)------------------------------------------------------------------------------------ - - if (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.) //elipsoidal cut - + 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)); + } + } + // pion->(TPC+TOF)------------------------------------------------------------------------------------ - count_rec_pi++; + if (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.) // elipsoidal cut - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); + { + count_rec_pi++; - nChpi_rec += 1.; - Q1pi_rec += track1.pt(); - Q2pi_rec += (track1.pt() * track1.pt()); + 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("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("NSigamaTPCTOFpion_rec"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - histos.fill(HIST("hPyPion_rec"),track1.p(),track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"),track1.pt(),track1.rapidity(massPi)); - - } + 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()); } -//============================KAON Reconstructed ==================================================== - + 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)); + } + } + //============================KAON Reconstructed ==================================================== - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); + 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()); + histos.fill(HIST("hTOFbeta_afterselection_rec_beforepidcut"), track1.p(), track1.beta()); - if (track1.hasTPC() && track1.hasTOF()) - { + if (track1.hasTPC() && track1.hasTOF()) { - histos.fill(HIST("NSigamaTPCkaon_rec_bf_sel"), track1.p(), track1.tpcNSigmaKa()); + 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()); - - } - - - -//Kaon_TPC_only - - - if (( track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - - - - { count_rec_k++; - - 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("NSigamaTPCTOFkaon_rec_bf_sel"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); + } + // Kaon_TPC_only - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - if (abs(track1.mcParticle().pdgCode())==321) - { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); - } + { + count_rec_k++; + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); - if (abs(track1.rapidity(massKa)) < 0.5) - { + nChk_rec += 1.; + Q1k_rec += track1.pt(); + Q2k_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("hPyKaon_rec"),track1.p(),track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"),track1.pt(),track1.rapidity(massKa)); + 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()); } -//KAON_TPC+TOF (both) - - - - - -if ( 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.)// ellipsoidal cut - - -{ count_rec_k++; - - 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 (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)); + } + } - if(track1.beta()>1) continue; + // KAON_TPC+TOF (both) + if (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.) // ellipsoidal cut - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + { + count_rec_k++; - if (abs(track1.mcParticle().pdgCode())==321) - { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); - } + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); - if (abs(track1.rapidity(massKa)) < 0.5) - { + nChk_rec += 1.; + Q1k_rec += track1.pt(); + Q2k_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("hPyKaon_rec"),track1.p(),track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"),track1.pt(),track1.rapidity(massKa)); + 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) { -//============================proton=========================================================== - + histos.fill(HIST("hPyKaon_rec"), track1.p(), track1.rapidity(massKa)); + histos.fill(HIST("hPtyKaon_rec"), track1.pt(), track1.rapidity(massKa)); + } + } + //============================proton=========================================================== - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) { - histos.fill(HIST("NSigamaTPCproton_rec_bf_sel"), track1.p(), track1.tpcNSigmaPr()); + 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()); - - } - - -//PROTON _ TPC only - - if (( track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) - - -{ count_rec_p++; - - 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("NSigamaTPCTOFproton_rec_bf_sel"), track1.tpcNSigmaPr(), track1.tofNSigmaPr()); + } - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + // PROTON _ TPC only + if ((track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) - if (abs(track1.mcParticle().pdgCode())==2212) - { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); - } + { + count_rec_p++; - if (abs(track1.rapidity(massPr)) < 0.5) - { + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); - histos.fill(HIST("hPyProton_rec"),track1.p(),track1.rapidity(massPr)); - histos.fill(HIST("hPtyProton_rec"),track1.pt(),track1.rapidity(massPr)); + 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()); } -//PROTON_ TPC + TOF (both) - - -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.)//elliposidal cut - -{ - count_rec_p++; - - 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 (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)); + } + } - if(track1.beta()>1) continue; + // PROTON_ TPC + TOF (both) + 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.) // elliposidal cut - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + { + count_rec_p++; - if (abs(track1.mcParticle().pdgCode())==2212) - { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); - } + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); - if (abs(track1.rapidity(massPr)) < 0.5) - { + nChp_rec += 1.; + Q1p_rec += track1.pt(); + Q2p_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("hPyProton_rec"),track1.p(),track1.rapidity(massPr)); - histos.fill(HIST("hPtyProton_rec"),track1.pt(),track1.rapidity(massPr)); + 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 + //============================================================================ + } // track loop ends - if (nCh_rec < 2) + 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); + //---------------------- 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); - } + 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); - } - - + 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); + //-----------------------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("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("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("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); - - - }// ends - -PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCReco, "process reconstructed information", true); - - -//++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles)//, const soa::SmallGroups& collisions) + //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) //, const soa::SmallGroups& collisions) { - if (fabs(mcCollision.posZ()) > 10.f) { + if (fabs(mcCollision.posZ()) > 10.f) { return; } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); + // INITALIZE VARIABLE FOR ADDING IDENTIFIED PT // - // INITALIZE VARIABLE FOR ADDING IDENTIFIED PT // - - int count_gen_pi =0, count_gen_k =0, count_gen_p =0; + int count_gen_pi = 0, count_gen_k = 0, count_gen_p = 0; double nCh_gen = 0.; double nChpi_gen = 0.; double nChk_gen = 0.; @@ -960,75 +798,67 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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; - 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(); + int sample_gen = histos.get(HIST("hZvtx_after_sel"))->GetEntries(); sample_gen = sample_gen % 30; + for (auto& mcgentrack : mcParticles) - 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;//pt cut // or and check - if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) continue;//eta cut // or and check + { + auto pdgcode = std::abs(mcgentrack.pdgCode()); + if (!(mcgentrack.has_mcCollision())) + continue; //???? + if (!(mcgentrack.isPhysicalPrimary())) + continue; + if (!(mcgentrack.pt() > 0.15) || !(mcgentrack.pt() < 2.)) + continue; // pt cut // or and check + if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) + continue; // eta cut // or and check - nCh_gen += 1.; + nCh_gen += 1.; Q1_gen += mcgentrack.pt(); Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - - - if(pdgcode == 211){ - count_gen_pi++; - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - - } - - - if(pdgcode == 321){ - count_gen_k++; - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - - - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - - } - + if (pdgcode == 211) { + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - if(pdgcode == 2212){ - count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + if (pdgcode == 321) { + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - } + if (pdgcode == 2212) { + count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); -//================================= Pion Generated Calculation ==================================== + nChp_gen += 1.; + Q1p_gen += mcgentrack.pt(); + Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - }//track loop ends! + //================================= Pion Generated Calculation ==================================== + } // track loop ends! - if (nCh_gen < 2) + if (nCh_gen < 2) return; //------------------ all charges------------------------------------- @@ -1037,69 +867,58 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti //---------------------- pions ---------------------------------------- - if(nChpi_gen > 2){ - var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); - var2pi_gen = (Q1pi_gen / nChpi_gen); - - } + 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); - } + 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); - } - - + 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); + //-----------------------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("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("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("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); - - - + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated information", true); -//+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -1110,7 +929,6 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in histos.fill(HIST("hEventCounter"), 3.); - const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -1123,71 +941,66 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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 var1 = 0., var2 = 0., twopar_allcharge = 0.; + double var1pi = 0., var2pi = 0.; double var1k = 0., var2k = 0.; double var1p = 0., var2p = 0.; - // cent = 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 + // 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()); - + 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 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 DCAxy - // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes - histos.fill(HIST("tracksel"), 3); - - //tracks passed after DCAz + // tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + // 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 + // 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; + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - -// if (track.tpcChi2NCl() > 4.0) continue; + // if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - -// if (track.itsChi2NCl() > 36.0) continue; + // if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); - - nCh += 1.; Q1 += track.pt(); @@ -1202,7 +1015,6 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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 @@ -1221,270 +1033,223 @@ PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated in 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()); - + if (track.hasTPC()) + histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - - - - -//=============================pion============================================================== + //=============================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()); + 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()); + histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); } - //pion-TPC----------------------------------------------------------------------------------- + // 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))) - { + 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)); + 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()); + 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.) { - 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("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)); - 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)); + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); - 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.beta() > 1) + continue; + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } + //===========================kaon=============================================================== - 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.) ) { + 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)); + 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()); - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); + if (track.beta() > 1) + continue; - 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + 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=========================================================== + //============================proton=========================================================== - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - { histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + 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("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)) { - 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("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()); + } - 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); + histos.fill(HIST("hVar1"), sample, cent, var1); var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"),sample ,cent, var2); + 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); - - } + 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); - } + 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); + if (nChp > 2) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + var2p = (Q1p / nChp); + } - histos.fill(HIST("hVar1k"),sample ,cent, var1k); - histos.fill(HIST("hVar2k"),sample ,cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); + //========================centrality========================================== - histos.fill(HIST("hVar1p"),sample ,cent, var1p); - histos.fill(HIST("hVar2p"),sample ,cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); + 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("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("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("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("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); - - - - + // PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From ba2b2932de55f2d98493fc4b2fc9aa8eed4e4aad Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:39:46 +0200 Subject: [PATCH 37/47] MeanpT-Fluctuations --- .../EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index d8ce2a1ccf7..7363e287362 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -32,7 +32,7 @@ #include "TDatabasePDG.h" #include #include "Common/CCDB/TriggerAliases.h" -#include "Common/CCDB/EventSelectionParams.h" + using namespace o2; using namespace o2::framework; @@ -491,7 +491,6 @@ struct IdentifiedMeanPtFluctuations { // pion-TPC----------------------------------------------------------------------------------- if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - { count_rec_pi++; @@ -505,8 +504,7 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("NSigamaTOFpion_rec"), track1.p(), track1.tofNSigmaPi()); histos.fill(HIST("NSigamaTPCTOFpion_rec"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - if (track1.beta() > 1) - continue; + 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()); From c59cab1b4621c9f1d47b099892a6e9fd58ae04cd Mon Sep 17 00:00:00 2001 From: sweta Date: Mon, 20 May 2024 13:40:59 +0200 Subject: [PATCH 38/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 7363e287362..7af67e58764 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -33,7 +33,6 @@ #include #include "Common/CCDB/TriggerAliases.h" - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -490,8 +489,7 @@ struct IdentifiedMeanPtFluctuations { // pion-TPC----------------------------------------------------------------------------------- - if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) - { + if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) { count_rec_pi++; histos.fill(HIST("ptHistogramPionrec"), track1.pt()); @@ -504,7 +502,8 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("NSigamaTOFpion_rec"), track1.p(), track1.tofNSigmaPi()); histos.fill(HIST("NSigamaTPCTOFpion_rec"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); - if (track1.beta() > 1) continue; + 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()); From 35ccf244259a8fe4ed632b683b1e9ba4d778cae1 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 24 May 2024 13:37:29 +0200 Subject: [PATCH 39/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 1268 +++++++++-------- 1 file changed, 689 insertions(+), 579 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 7af67e58764..3053e3dee51 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -32,6 +32,8 @@ #include "TDatabasePDG.h" #include #include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" + using namespace o2; using namespace o2::framework; @@ -52,14 +54,16 @@ using MyTracks = soa::Join; -using MCCollisions = soa::Join; -using MCTracks = soa::Join; + +using MyMCRecoTracks =soa::Join; //, aod::StoredMcParticles_000>; + aod::TracksExtra, aod::TracksIU, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>; + using MyCollision = MyCollisions::iterator; using MyTrack = MyTracks::iterator; @@ -70,17 +74,17 @@ double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); struct IdentifiedMeanPtFluctuations { - + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + 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 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})"}; @@ -89,7 +93,7 @@ struct IdentifiedMeanPtFluctuations { 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 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"}; @@ -99,8 +103,9 @@ struct IdentifiedMeanPtFluctuations { AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; AxisSpec Counter = {10, 0., 10., "events"}; + // QA Plots - histos.add("hEventCounter", "event counts", kTH1D, {Counter}); + 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"); @@ -113,7 +118,9 @@ struct IdentifiedMeanPtFluctuations { h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); - histos.add("hEventCounter_recMC", "event counts rec MC", kTH1D, {Counter}); + + + 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"); @@ -123,6 +130,8 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -132,8 +141,8 @@ struct IdentifiedMeanPtFluctuations { 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("hDCAxy","hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz","hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -145,6 +154,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -153,14 +163,17 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -173,6 +186,8 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -180,65 +195,75 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); - //=====================rapidity===================================== +//=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", 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("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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); + histos.add("ht", "ht", kTH1D, {centAxis}); @@ -257,10 +282,13 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -273,10 +301,11 @@ struct IdentifiedMeanPtFluctuations { 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("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("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}); @@ -286,576 +315,595 @@ struct IdentifiedMeanPtFluctuations { histos.add("hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); histos.add("hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {CrossedrowTPCAxis}); - //--------------------------------nch---------------------------------- + + + + //--------------------------------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("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("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("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("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}); + //=======================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("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("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("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("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("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); + - //========================MC Histograms Reconstructed================================================= +//========================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("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}); + + + + + + + + + } - histos.add("ptHistogramPionrec_purity", "ptHistogramPionrec_purity", kTH1D, {ptAxis}); - histos.add("ptHistogramKaonrec_purity", "ptHistogramKaonrec_purity", kTH1D, {ptAxis}); - histos.add("ptHistogramProtonrec_purity", "ptHistogramProtonrec_purity", 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)); + } - 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}); + 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.); } - //++++++++++++++++++++++++Monte Carlo Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - void processMCReco(aod::MCCollisions::iterator const& mccoll, aod::MCTracks const& mcrectrack, aod::McParticles const& mcParticles, aod::McCollisions const& mcCollisions) +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); + } + histos.fill(HIST("tracksel_rec"), 1); - if (fabs(mccoll.posZ()) > 10.f) { + + if (fabs(mccoll.posZ()) > 10.f) { return; } histos.fill(HIST("hZvtx_after_sel_rec"), mccoll.posZ()); - histos.fill(HIST("tracksel_rec"), 2); + histos.fill(HIST("tracksel_rec"), 2); + - if (!mccoll.sel8()) { // min bias + if (!mccoll.sel8()) { return; } histos.fill(HIST("hZvtx_after_sel8_rec"), mccoll.posZ()); - histos.fill(HIST("tracksel_rec"), 3); + histos.fill(HIST("tracksel_rec"), 3); - if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { // no pileup according to SPD vertexer - return; - } - histos.fill(HIST("tracksel_rec"), 4); - if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 5); +if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ + return; + } + histos.fill(HIST("tracksel_rec"), 4); - if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 6); - if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { // bunch crossing is far from ITS RO Frame border - return; - } - histos.fill(HIST("tracksel_rec"), 7); - - int count_rec_pi = 0, count_rec_k = 0, count_rec_p = 0; - int count_rec_pi_pdg = 0, count_rec_k_pdg = 0, count_rec_p_pdg = 0; - 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; //, twopar_allcharge_rec; - 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; // *confirm* - if (!(track1.mcParticle().isPhysicalPrimary())) - continue; - // auto mctrack1 = track1.mcParticle(); - 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.; +if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ + return; + } + histos.fill(HIST("tracksel_rec"), 5); - Q1_rec += track1.pt(); - Q2_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); +if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ + return; + } + histos.fill(HIST("tracksel_rec"), 6); - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); - //======================================================================== +if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ + return; + } + histos.fill(HIST("tracksel_rec"), 7); - if (abs(track1.mcParticle().pdgCode()) == 211) { - count_rec_pi_pdg++; - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); - } - if (abs(track1.mcParticle().pdgCode()) == 321) { - count_rec_k_pdg++; - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); - } - if (abs(track1.mcParticle().pdgCode()) == 2212) { - count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); - } + int count_rec_pi =0, count_rec_k =0, count_rec_p =0; + int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; + double nCh_rec = 0.; + double nChpi_rec = 0.; + double nChk_rec = 0.; + double nChp_rec = 0.; - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// + 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; - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) - continue; // electron rejection + int sample_rec = histos.get(HIST("hZvtx_after_sel8_rec"))->GetEntries(); + sample_rec = sample_rec % 30; - //=============================pion============================================================== - // only TPC+TOF tracks: Pion, Kaon, Proton - 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()) { + 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 - 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()); - } + nCh_rec += 1.; - // pion-TPC----------------------------------------------------------------------------------- + Q1_rec += track1.pt(); + Q2_rec += (track1.pt() * track1.pt()); - if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) { + histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); + + if (track1.hasTPC()) + histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); - count_rec_pi++; - 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(abs(track1.mcParticle().pdgCode())==211) +{count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); +} +if(abs(track1.mcParticle().pdgCode())==321) +{count_rec_k_pdg++; - if (track1.beta() > 1) - continue; + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); +} +if(abs(track1.mcParticle().pdgCode())==2212) +{count_rec_p_pdg++; - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); +} - if (abs(track1.mcParticle().pdgCode()) == 211) { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); - } + //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - if (abs(track1.rapidity(massPi)) < 0.5) { + if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; - histos.fill(HIST("hPyPion_rec"), track1.p(), track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track1.pt(), track1.rapidity(massPi)); - } - } +//============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()); - // pion->(TPC+TOF)------------------------------------------------------------------------------------ - if (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.) // elipsoidal cut + 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()); - count_rec_pi++; + } - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); + + SelTPConlyPions(track1);//Pion (TPC only) + SelTPCTOFPions(track1);//Pion passes TPC and TOF both! - 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; + count_rec_pi++; + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + nChpi_rec += 1.; + Q1pi_rec += track1.pt(); + Q2pi_rec += (track1.pt() * track1.pt()); - if (abs(track1.mcParticle().pdgCode()) == 211) { - histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); - } - if (abs(track1.rapidity(massPi)) < 0.5) { + 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()); - histos.fill(HIST("hPyPion_rec"), track1.p(), track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"), track1.pt(), track1.rapidity(massPi)); - } - } - //============================KAON Reconstructed ==================================================== - 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.beta()>1) continue; + - if (track1.hasTPC() && track1.hasTOF()) { + histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); - 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()); - } + if(abs(track1.mcParticle().pdgCode())==211) + { + histos.fill(HIST("ptHistogramPionrec_purity"), track1.pt()); + } - // Kaon_TPC_only + 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)); + + } - if ((track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0))) + +} - { - count_rec_k++; - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); +//============Reconstructed MC=================KAONS selection==============================================================// - 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.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()) + { - if (track1.beta() > 1) - continue; + 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()); - 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()); - } + SelTPConlyKaons(track1); // Kaons passes from TPC only! + SelTPCTOFKaons(track1); //Kaons passes from TPC and TOF both! - if (abs(track1.rapidity(massKa)) < 0.5) { +{ count_rec_k++; - histos.fill(HIST("hPyKaon_rec"), track1.p(), track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"), track1.pt(), track1.rapidity(massKa)); - } - } + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); - // KAON_TPC+TOF (both) - if (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.) // ellipsoidal cut + nChk_rec += 1.; + Q1k_rec += track1.pt(); + Q2k_rec += (track1.pt() * track1.pt()); - { - count_rec_k++; - histos.fill(HIST("ptHistogramKaonrec"), 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()); - 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; + - 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()); - 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.mcParticle().pdgCode()) == 321) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); - } - if (abs(track1.rapidity(massKa)) < 0.5) { + 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)); + + } - histos.fill(HIST("hPyKaon_rec"), track1.p(), track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"), track1.pt(), track1.rapidity(massKa)); - } - } + +} - //============================proton=========================================================== - 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()); +//============Reconstructed MC=================PROTONS selection==============================================================// - 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()); - } - // PROTON _ TPC only + 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.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0))) + if (track1.hasTPC() && track1.hasTOF()) + { - { - count_rec_p++; + 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()); - 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()); + SelTPConlyProtons(track1);//Protons passes from TPC only! + SelTPCTOFProtons(track1);//Protons passes from TPC and TOF both! - if (track1.beta() > 1) - continue; +{ count_rec_p++; - histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); - if (abs(track1.mcParticle().pdgCode()) == 2212) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); - } + nChp_rec += 1.; + Q1p_rec += track1.pt(); + Q2p_rec += (track1.pt() * 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)); - } - } + 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()); - // PROTON_ TPC + TOF (both) - 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.) // elliposidal cut + if(track1.beta()>1) continue; + - { - count_rec_p++; + + histos.fill(HIST("hdEdx_afterselection_rec_afterpidcut"), track1.p(), track1.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection_rec_afterpidcut"), track1.p(), track1.beta()); - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); - nChp_rec += 1.; - Q1p_rec += track1.pt(); - Q2p_rec += (track1.pt() * track1.pt()); + if (abs(track1.mcParticle().pdgCode())==2212) + { + histos.fill(HIST("ptHistogramProtonrec_purity"), 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 (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)); + + } - 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 - } // track loop ends - if (nCh_rec < 2) + 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 ---------------------------------------- + //---------------------- pions ---------------------------------------- - if (nChpi_rec > 2) { - var1pi_rec = (Q1pi_rec * Q1pi_rec - Q2pi_rec) / (nChpi_rec * (nChpi_rec - 1)); - var2pi_rec = (Q1pi_rec / nChpi_rec); - } + 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); - } + 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); - } + 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); + + + //-----------------------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("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("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("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("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("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("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); + 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) //, const soa::SmallGroups& collisions) + + }// ends + +PROCESS_SWITCH(MCMeanpTFluct, processMCReco, "process reconstructed information", true); + + +//++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) + { - if (fabs(mcCollision.posZ()) > 10.f) { + if (fabs(mcCollision.posZ()) > 10.f) { return; } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - // INITALIZE VARIABLE FOR ADDING IDENTIFIED PT // - - int count_gen_pi = 0, count_gen_k = 0, count_gen_p = 0; + + int count_gen_pi =0, count_gen_k =0, count_gen_p =0; 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; + + 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; // pt cut // or and check - if (!(mcgentrack.eta() > -0.8) || !(mcgentrack.eta() < 0.8)) - continue; // eta cut // or and check - - nCh_gen += 1.; + 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) { - count_gen_pi++; - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); + + if(pdgcode == 211){ + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - } + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - if (pdgcode == 321) { - count_gen_k++; - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); + } - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - if (pdgcode == 2212) { - count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + if(pdgcode == 321){ + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); - } - //================================= Pion Generated Calculation ==================================== + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); + + } + + if(pdgcode == 2212){ + count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); - } // track loop ends! + nChp_gen += 1.; + Q1p_gen += mcgentrack.pt(); + Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); - if (nCh_gen < 2) + } + +//================================= Pion Generated Calculation ==================================== + + }//track loop ends! + + + if (nCh_gen < 2) return; //------------------ all charges------------------------------------- @@ -864,58 +912,69 @@ struct IdentifiedMeanPtFluctuations { //---------------------- pions ---------------------------------------- - if (nChpi_gen > 2) { - var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); - var2pi_gen = (Q1pi_gen / nChpi_gen); - } + 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); - } + 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); - } + 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); + + + //-----------------------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("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("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("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("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("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("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); + histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen, var2p_gen); + + } - PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated information", true); +PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", true); + - //+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ + + +//+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -926,6 +985,7 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hEventCounter"), 3.); + const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -933,71 +993,76 @@ struct IdentifiedMeanPtFluctuations { 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 var1= 0., var2= 0., twopar_allcharge= 0.; + double var1pi= 0., var2pi = 0.; double var1k = 0., var2k = 0.; double var1p = 0., var2p = 0.; - // cent = 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 + // 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()); + 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 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 DCAxy + // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes + histos.fill(HIST("tracksel"), 3); - // tracks passed after DCAz + //tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + //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 + //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; + + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - // if (track.tpcChi2NCl() > 4.0) continue; + +// if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - // if (track.itsChi2NCl() > 36.0) continue; + +// if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); + + nCh += 1.; Q1 += track.pt(); @@ -1012,6 +1077,7 @@ struct IdentifiedMeanPtFluctuations { 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 @@ -1030,223 +1096,267 @@ struct IdentifiedMeanPtFluctuations { 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()); + if (track.hasTPC()) histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); + + + + - //=============================pion============================================================== + +//=============================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()); + 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()); + histos.fill(HIST("hdEdx_afterselection"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection"), track.p(), track.beta()); } - // pion-TPC----------------------------------------------------------------------------------- + //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))) + { - 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)); - 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()); - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); + if(track.beta()>1) continue; + - if (track.beta() > 1) - continue; + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - 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.) { + //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)); + 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; + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } + if(track.beta()>1) continue; + - //===========================kaon=============================================================== + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - 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)); +//===========================kaon=============================================================== - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); + 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.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.)) { + + 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)); + 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()); + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); - if (track.beta() > 1) - continue; + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } - //============================proton=========================================================== + 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)); - 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()); + 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)) { + + 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)); + 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()); + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); - if (track.beta() > 1) - continue; + if(track.beta()>1) continue; + - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } + + 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; + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - } + 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) + + if (nCh < 2) return; //------------------ all charges------------------------------------- var1 = (Q1 * Q1 - Q2) / (nCh * (nCh - 1)); - histos.fill(HIST("hVar1"), sample, cent, var1); + 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("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); - } + 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); - } + 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); - } + if(nChp > 2){ + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + var2p = (Q1p / nChp); + } + +//========================centrality========================================== + - //========================centrality========================================== - histos.fill(HIST("hVar1pi"), sample, cent, var1pi); - histos.fill(HIST("hVar2pi"), sample, cent, var2pi); - histos.fill(HIST("hVar2meanptpi"), cent, var2pi); + 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); - 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("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("hVar2meanptx"), nCh, var2); + - histos.fill(HIST("hVar1pix"), sample, nCh, var1pi); - histos.fill(HIST("hVar2pix"), sample, nCh, var2pi); + 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("hVar2meanptpix"), nCh, var2pi); + - histos.fill(HIST("hVar1kx"), sample, nCh, var1k); - histos.fill(HIST("hVar2kx"), sample, nCh, var2k); + 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("hVar2meanptkx"), nCh, var2k); + - histos.fill(HIST("hVar1px"), sample, nCh, var1p); - histos.fill(HIST("hVar2px"), sample, nCh, var2p); + 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); + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); + } // event loop ends! - // PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", true); +PROCESS_SWITCH(MCMeanpTFluct, process, "process real data information", true); + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 62923a2f58f786b0f823a95ae4fb5a269256652a Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 24 May 2024 13:42:08 +0200 Subject: [PATCH 40/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 606 +++++++++--------- 1 file changed, 303 insertions(+), 303 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 3053e3dee51..630065f196e 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -74,17 +74,17 @@ 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"}; + 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 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})"}; @@ -130,7 +130,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -197,7 +197,7 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); //=====================rapidity===================================== histos.add("hyPion", ";hyPion", kTH1D, {etaAxis}); - histos.add("hyKaon", ";hyKaon", kTH1D, {etaAxis}); + histos.add("hyKaon", ";hyKaon", kTH1D, {etaAxis}); histos.add("hyProton", ";hyProton", kTH1D, {etaAxis}); @@ -218,52 +218,52 @@ struct IdentifiedMeanPtFluctuations { histos.add("hVar1", "hVar1", kTH2D, {subAxis, centAxis}); histos.add("hVar2", "hVar2", kTH2D, {subAxis, centAxis}); - histos.add("hVar2meanpt", "hVar2meanpt", kTH2D, {centAxis, varAxis2}); + 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("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("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("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("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("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("hVar2meanptpx", "hVar2meanptpx", kTH2D, {nchAxis, varAxis2}); + histos.add("ht", "ht", kTH1D, {centAxis}); @@ -305,7 +305,7 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -322,25 +322,25 @@ struct IdentifiedMeanPtFluctuations { 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("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("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("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("hVar2meanptpx_rec", "hVar2meanptpx_rec", kTH2D, {nchAxis, varAxis2}); @@ -348,41 +348,41 @@ struct IdentifiedMeanPtFluctuations { //=======================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("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("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("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("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("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("hVar2meanptpx_gen", "hVar2meanptpx_gen", kTH2D, {nchAxis, varAxis2}); //========================MC Histograms Reconstructed================================================= @@ -390,24 +390,24 @@ struct IdentifiedMeanPtFluctuations { 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("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_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("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("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}); @@ -428,7 +428,7 @@ 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) @@ -440,7 +440,7 @@ template 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.); + (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.); } @@ -463,16 +463,16 @@ void processMCReco(aod::MyMCRecoCollisions::iterator const& mccoll, aod::MyMCRec } 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()) { + + if (!mccoll.sel8()) { return; } @@ -481,49 +481,49 @@ void processMCReco(aod::MyMCRecoCollisions::iterator const& mccoll, aod::MyMCRec histos.fill(HIST("tracksel_rec"), 3); -if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ - return; - } +if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)){ + return; + } histos.fill(HIST("tracksel_rec"), 4); -if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ - return; +if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)){ + return; } histos.fill(HIST("tracksel_rec"), 5); -if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ - return; +if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)){ + return; } histos.fill(HIST("tracksel_rec"), 6); -if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ - return; +if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ + return; } histos.fill(HIST("tracksel_rec"), 7); int count_rec_pi =0, count_rec_k =0, count_rec_p =0; - int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; - double nCh_rec = 0.; - double nChpi_rec = 0.; - double nChk_rec = 0.; - double nChp_rec = 0.; + int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; + 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; + 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; + int sample_rec = histos.get(HIST("hZvtx_after_sel8_rec"))->GetEntries(); + sample_rec = sample_rec % 30; @@ -532,125 +532,125 @@ if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)){ 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.; + nCh_rec += 1.; Q1_rec += track1.pt(); Q2_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); - + histos.fill(HIST("ptHistogram_allcharge_rec"), track1.pt()); + if (track1.hasTPC()) - histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); + histos.fill(HIST("hdEdx_rec_bf_anycut"), track1.p(), track1.tpcSignal()); //======================================================================== -if(abs(track1.mcParticle().pdgCode())==211) -{count_rec_pi_pdg++; - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); +if(abs(track1.mcParticle().pdgCode())==211) +{count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); } -if(abs(track1.mcParticle().pdgCode())==321) +if(abs(track1.mcParticle().pdgCode())==321) {count_rec_k_pdg++; - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); } if(abs(track1.mcParticle().pdgCode())==2212) {count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); } - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// + //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; + 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()); + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) + { - histos.fill(HIST("NSigamaTPCpion_rec_bf_sel"), track1.p(), track1.tpcNSigmaPi()); + 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()); + histos.fill(HIST("NSigamaTPCTOFpion_rec_bf_sel"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); + + } - } - SelTPConlyPions(track1);//Pion (TPC only) SelTPCTOFPions(track1);//Pion passes TPC and TOF both! { - count_rec_pi++; - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); + count_rec_pi++; + 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("NSigamaTPCpion_rec"), track1.p(), track1.tpcNSigmaPi()); histos.fill(HIST("NSigamaTOFpion_rec"), track1.p(), track1.tofNSigmaPi()); - histos.fill(HIST("NSigamaTPCTOFpion_rec"), track1.tpcNSigmaPi(), 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()); + 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)); - - } + 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.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()); + 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()); + 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! -{ count_rec_k++; +{ count_rec_k++; - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); nChk_rec += 1.; @@ -658,105 +658,105 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==321) { - histos.fill(HIST("ptHistogramKaonrec_purity"), track1.pt()); + 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)); - - } + 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()) + + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) + { - histos.fill(HIST("NSigamaTPCproton_rec_bf_sel"), track1.p(), track1.tpcNSigmaPr()); + 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()); + 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! -{ count_rec_p++; +{ count_rec_p++; - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); + 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()); + 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("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) + if (abs(track1.mcParticle().pdgCode())==2212) { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); + 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)); - - } + 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) + if (nCh_rec < 2) return; //------------------ all charges------------------------------------- @@ -768,20 +768,20 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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); + 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); - } + } @@ -789,38 +789,38 @@ if(abs(track1.mcParticle().pdgCode())==2212) 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("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("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("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); + histos.fill(HIST("hVar2meanptpx_rec"), nCh_rec, var2p_rec); + - }// ends - + PROCESS_SWITCH(MCMeanpTFluct, processMCReco, "process reconstructed information", true); //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) - + { if (fabs(mcCollision.posZ()) > 10.f) { @@ -828,20 +828,20 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - + int count_gen_pi =0, count_gen_k =0, count_gen_p =0; 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 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; @@ -850,60 +850,60 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti sample_gen = sample_gen % 30; - for (auto& mcgentrack : mcParticles) - + 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.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.; + + nCh_gen += 1.; Q1_gen += mcgentrack.pt(); Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); - histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - - if(pdgcode == 211){ - count_gen_pi++; - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + if(pdgcode == 211){ + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - } + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - if(pdgcode == 321){ - count_gen_k++; - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); + if(pdgcode == 321){ + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - } + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - if(pdgcode == 2212){ - count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + } + + if(pdgcode == 2212){ + count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * 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) + + if (nCh_gen < 2) return; //------------------ all charges------------------------------------- @@ -915,20 +915,20 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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); + 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); - } + } @@ -936,25 +936,25 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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("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("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("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); + histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen, var2p_gen); } @@ -967,14 +967,14 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -993,7 +993,7 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru double nChpi = 0.; double nChk = 0.; double nChp = 0.; - + double Q1 = 0., Q2 = 0.; double Q1pi = 0., Q2pi = 0.; double Q1k = 0., Q2k = 0.; @@ -1007,17 +1007,17 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru // 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 + // inital tracks histos.fill(HIST("tracksel"), 1); histos.fill(HIST("hTPCchi2perCluster_before"), track.tpcChi2NCl()); - histos.fill(HIST("hITSchi2perCluster_before"), track.itsChi2NCl()); + histos.fill(HIST("hITSchi2perCluster_before"), track.itsChi2NCl()); histos.fill(HIST("hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); @@ -1025,8 +1025,8 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru if (!track.isGlobalTrack()) continue; histos.fill(HIST("tracksel"), 2); - - //tracks passed after DCAxy + + //tracks passed after DCAxy // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes histos.fill(HIST("tracksel"), 3); @@ -1046,12 +1046,12 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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); @@ -1062,7 +1062,7 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru histos.fill(HIST("tracksel"), 9); - + nCh += 1.; Q1 += track.pt(); @@ -1096,12 +1096,12 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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.hasTPC()) histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); if (track.hasTOF()) histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - - - + + + //=============================pion============================================================== @@ -1109,31 +1109,31 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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("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)); + 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)------------------------------------------------------------------------------------ @@ -1142,7 +1142,7 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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)); + histos.fill(HIST("hPtyPion"),track.pt(),track.rapidity(massPi)); nChpi += 1.; @@ -1150,56 +1150,56 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru Q2pi += (track.pt() * track.pt()); if(track.beta()>1) continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); - + } - -//===========================kaon=============================================================== + +//===========================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("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()); + 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)); + 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("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.) ) { + 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("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)); + histos.fill(HIST("hyKaon"), track.rapidity(massKa)); + histos.fill(HIST("hPtyKaon"),track.pt(),track.rapidity(massKa)); nChk += 1.; @@ -1207,41 +1207,41 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru Q2k += (track.pt() * track.pt()); if(track.beta()>1) continue; - - histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + + 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("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)) { + + 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)); + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); } @@ -1252,30 +1252,30 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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)); + 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); } - -//==================================================================================================== - +//==================================================================================================== + + } // Track loop ends! - if (nCh < 2) + if (nCh < 2) return; //------------------ all charges------------------------------------- @@ -1283,9 +1283,9 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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("hVarc"), sample, cent); histos.fill(HIST("hVar2meanpt"), cent, var2); - + twopar_allcharge = (var1 - var2); histos.fill(HIST("hVar"), nCh, twopar_allcharge); @@ -1295,20 +1295,20 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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); + var2k = (Q1k / nChk); } //---------------------------- protons ---------------------------------- if(nChp > 2){ var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); var2p = (Q1p / nChp); - } + } //========================centrality========================================== @@ -1332,26 +1332,26 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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("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("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("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); - + histos.fill(HIST("hVar2meanptpx"), nCh, var2p); + } // event loop ends! From ba5701698f685c2c0c1638c8c48cbef55373fd09 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 24 May 2024 14:28:58 +0200 Subject: [PATCH 41/47] MeanpT-Fluctuations --- PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 630065f196e..b169838508b 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -32,7 +32,6 @@ #include "TDatabasePDG.h" #include #include "Common/CCDB/TriggerAliases.h" -#include "Common/CCDB/EventSelectionParams.h" using namespace o2; From 7716cc219fb1844ed563707909c7ef5868cc74f7 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 24 May 2024 14:31:48 +0200 Subject: [PATCH 42/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 1138 +++++++---------- 1 file changed, 477 insertions(+), 661 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index b169838508b..adcd41356f9 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -33,7 +33,6 @@ #include #include "Common/CCDB/TriggerAliases.h" - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -53,16 +52,14 @@ using MyTracks = soa::Join; +using MyMCRecoCollisions = soa::Join; -using MyMCRecoCollisions = soa::Join; - -using MyMCRecoTracks =soa::Join; - +using MyMCRecoTracks = soa::Join; using MyCollision = MyCollisions::iterator; using MyTrack = MyTracks::iterator; @@ -76,8 +73,7 @@ struct IdentifiedMeanPtFluctuations { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - + Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; void init(o2::framework::InitContext&) { @@ -92,7 +88,7 @@ struct IdentifiedMeanPtFluctuations { 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 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"}; @@ -102,9 +98,8 @@ struct IdentifiedMeanPtFluctuations { AxisSpec CrossedrowTPCAxis = {600, 0., 600., "TPC Crossed rows"}; AxisSpec Counter = {10, 0., 10., "events"}; - // QA Plots - histos.add("hEventCounter","event counts",kTH1D,{Counter}); + 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"); @@ -117,9 +112,7 @@ struct IdentifiedMeanPtFluctuations { h->GetXaxis()->SetBinLabel(8, "TPC Chai2cluster passed"); h->GetXaxis()->SetBinLabel(9, "ITS Chai2cluster passed"); - - - histos.add("hEventCounter_recMC","event counts rec MC",kTH1D,{Counter}); + 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"); @@ -130,8 +123,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -140,8 +131,8 @@ struct IdentifiedMeanPtFluctuations { 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("hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); + histos.add("hDCAz", "hDCAz", kTH1D, {dcazAxis}); histos.add("hPtDCAxy", "hPtDCAxy", kTH2D, {ptAxis, dcaAxis}); histos.add("hPtDCAz", "hPtDCAz", kTH2D, {ptAxis, dcazAxis}); @@ -153,7 +144,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -162,17 +152,14 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -185,8 +172,6 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -194,24 +179,21 @@ struct IdentifiedMeanPtFluctuations { histos.add("hEtaPion", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaKaon", ";hEta", kTH1D, {etaAxis}); histos.add("hEtaProton", ";hEta", kTH1D, {etaAxis}); -//=====================rapidity===================================== + //=====================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}); @@ -226,44 +208,37 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -281,13 +256,10 @@ struct IdentifiedMeanPtFluctuations { 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}); @@ -300,12 +272,11 @@ struct IdentifiedMeanPtFluctuations { 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("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}); @@ -314,162 +285,130 @@ struct IdentifiedMeanPtFluctuations { histos.add("hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {Chi2Axis}); histos.add("hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {CrossedrowTPCAxis}); - - - - //--------------------------------nch---------------------------------- + //--------------------------------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 ================================================ + //=======================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("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); + histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); - histos.add("hTOFbeta_gen_pion", "hTOFbeta_gen_pion", kTH2D, {pAxis, betaAxis}); - histos.add("hdEdx_gen_pion", "hdEdx_gen_pion", kTH2D, {pAxis, dEdxAxis}); + 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================================================= + //========================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}); - - - - - + 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 + //++++++++++++++++++++++++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)); + (track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaPi()) < 3. && (std::abs(track1.tpcNSigmaKa()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0)); } -template + 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)); - + (track1.hasTPC() && (track1.p() < 0.7) && abs(track1.tpcNSigmaKa()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaPr()) > 3.0)); } -template + 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)); + (track1.hasTPC() && (track1.p() < 1.1) && abs(track1.tpcNSigmaPr()) < 3.0 && (std::abs(track1.tpcNSigmaPi()) > 3.0 && std::abs(track1.tpcNSigmaKa()) > 3.0)); } - - template + 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.); + (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 + 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.); - } + (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 + 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.); - } + 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) -{ + 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); - + } + histos.fill(HIST("tracksel_rec"), 1); - if (fabs(mccoll.posZ()) > 10.f) { + if (fabs(mccoll.posZ()) > 10.f) { return; } histos.fill(HIST("hZvtx_after_sel_rec"), mccoll.posZ()); - histos.fill(HIST("tracksel_rec"), 2); - + histos.fill(HIST("tracksel_rec"), 2); if (!mccoll.sel8()) { return; @@ -477,358 +416,301 @@ void processMCReco(aod::MyMCRecoCollisions::iterator const& mccoll, aod::MyMCRec 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); - - - - int count_rec_pi =0, count_rec_k =0, count_rec_p =0; - int count_rec_pi_pdg =0, count_rec_k_pdg =0, count_rec_p_pdg =0; - 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; - + histos.fill(HIST("tracksel_rec"), 3); + if (!mccoll.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return; + } + histos.fill(HIST("tracksel_rec"), 4); - for ( auto track1 : mcrectrack) { - if(!(track1.has_collision())) continue; - if(!(track1.has_mcParticle())) continue; - if(!(track1.mcParticle().isPhysicalPrimary())) continue; - if (!track1.isGlobalTrack()) continue; + if (!mccoll.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return; + } + histos.fill(HIST("tracksel_rec"), 5); - 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 + if (!mccoll.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return; + } + histos.fill(HIST("tracksel_rec"), 6); - nCh_rec += 1.; + if (!mccoll.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return; + } + histos.fill(HIST("tracksel_rec"), 7); + + int count_rec_pi = 0, count_rec_k = 0, count_rec_p = 0; + int count_rec_pi_pdg = 0, count_rec_k_pdg = 0, count_rec_p_pdg = 0; + 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()); + 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) -{count_rec_pi_pdg++; - histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); -} -if(abs(track1.mcParticle().pdgCode())==321) -{count_rec_k_pdg++; + if (abs(track1.mcParticle().pdgCode()) == 211) { + count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); + } + if (abs(track1.mcParticle().pdgCode()) == 321) { + count_rec_k_pdg++; - histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); -} -if(abs(track1.mcParticle().pdgCode())==2212) -{count_rec_p_pdg++; + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); + } + if (abs(track1.mcParticle().pdgCode()) == 2212) { + count_rec_p_pdg++; - histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); -} + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); + } - //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// + //+++++++++ electron rejection ++++++++++++++++++++++++++++++++// - if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) continue; + if (abs(track1.tpcNSigmaEl()) < 3.0 && abs(track1.tpcNSigmaPi()) > 3. && abs(track1.tpcNSigmaKa()) > 3. && abs(track1.tpcNSigmaPr()) > 3.) + continue; -//============Reconstructed MC=================PIONS selection==============================================================// + //============Reconstructed MC=================PIONS selection==============================================================// - if (track1.hasTPC()) - histos.fill(HIST("hdEdx_afterselection_rec_beforepidcut"), track1.p(), track1.tpcSignal()); - if (track1.hasTOF()) + 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()) { - if (track1.hasTPC() && track1.hasTOF()) - { - - histos.fill(HIST("NSigamaTPCpion_rec_bf_sel"), track1.p(), track1.tpcNSigmaPi()); + 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! - - { - - - count_rec_pi++; - 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("NSigamaTPCTOFpion_rec_bf_sel"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); + } + SelTPConlyPions(track1); // Pion (TPC only) + SelTPCTOFPions(track1); // Pion passes TPC and TOF both! - 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()); - } + count_rec_pi++; + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); - if (abs(track1.rapidity(massPi)) < 0.5) - { + nChpi_rec += 1.; + Q1pi_rec += track1.pt(); + Q2pi_rec += (track1.pt() * track1.pt()); - histos.fill(HIST("hPyPion_rec"),track1.p(),track1.rapidity(massPi)); - histos.fill(HIST("hPtyPion_rec"),track1.pt(),track1.rapidity(massPi)); + 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) { -//============Reconstructed MC=================KAONS selection==============================================================// + 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()) + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) { - histos.fill(HIST("NSigamaTPCkaon_rec_bf_sel"), track1.p(), track1.tpcNSigmaKa()); + 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! - -{ count_rec_k++; - - 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()); - } + 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! - if (abs(track1.rapidity(massKa)) < 0.5) - { + { + count_rec_k++; - histos.fill(HIST("hPyKaon_rec"),track1.p(),track1.rapidity(massKa)); - histos.fill(HIST("hPtyKaon_rec"),track1.pt(),track1.rapidity(massKa)); + 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()); -//============Reconstructed MC=================PROTONS selection==============================================================// + 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()) + 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()) - { + if (track1.hasTPC() && track1.hasTOF()) { - histos.fill(HIST("NSigamaTPCproton_rec_bf_sel"), track1.p(), track1.tpcNSigmaPr()); + 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! - -{ count_rec_p++; - - 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()); - + histos.fill(HIST("NSigamaTPCTOFproton_rec_bf_sel"), track1.tpcNSigmaPr(), track1.tofNSigmaPr()); + } - if (abs(track1.mcParticle().pdgCode())==2212) - { - histos.fill(HIST("ptHistogramProtonrec_purity"), track1.pt()); - } + SelTPConlyProtons(track1); // Protons passes from TPC only! + SelTPCTOFProtons(track1); // Protons passes from TPC and TOF both! - if (abs(track1.rapidity(massPr)) < 0.5) - { + { + count_rec_p++; - histos.fill(HIST("hPyProton_rec"),track1.p(),track1.rapidity(massPr)); - histos.fill(HIST("hPtyProton_rec"),track1.pt(),track1.rapidity(massPr)); + 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 + //============================================================================ + } // track loop ends - if (nCh_rec < 2) + 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); + //---------------------- 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); - } + 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); - } - - + 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); + //-----------------------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("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("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("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(MCMeanpTFluct, processMCReco, "process reconstructed information", true); - - - }// ends - -PROCESS_SWITCH(MCMeanpTFluct, processMCReco, "process reconstructed information", true); - - -//++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) + //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) { - if (fabs(mcCollision.posZ()) > 10.f) { + if (fabs(mcCollision.posZ()) > 10.f) { return; } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - - int count_gen_pi =0, count_gen_k =0, count_gen_p =0; + int count_gen_pi = 0, count_gen_k = 0, count_gen_p = 0; double nCh_gen = 0.; double nChpi_gen = 0.; double nChk_gen = 0.; @@ -839,70 +721,66 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti 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; + 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) - 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; - { 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.; + nCh_gen += 1.; Q1_gen += mcgentrack.pt(); Q2_gen += (mcgentrack.pt() * mcgentrack.pt()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); - - if(pdgcode == 211){ - count_gen_pi++; - histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); + if (pdgcode == 211) { + count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); - nChpi_gen += 1.; - Q1pi_gen += mcgentrack.pt(); - Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); - - } - - - if(pdgcode == 321){ - count_gen_k++; - histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - - - nChk_gen += 1.; - Q1k_gen += mcgentrack.pt(); - Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); - - } + nChpi_gen += 1.; + Q1pi_gen += mcgentrack.pt(); + Q2pi_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - if(pdgcode == 2212){ - count_gen_p++; - histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); + if (pdgcode == 321) { + count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); - nChp_gen += 1.; - Q1p_gen += mcgentrack.pt(); - Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); + nChk_gen += 1.; + Q1k_gen += mcgentrack.pt(); + Q2k_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - } + if (pdgcode == 2212) { + count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); -//================================= Pion Generated Calculation ==================================== + nChp_gen += 1.; + Q1p_gen += mcgentrack.pt(); + Q2p_gen += (mcgentrack.pt() * mcgentrack.pt()); + } - }//track loop ends! + //================================= Pion Generated Calculation ==================================== + } // track loop ends! - if (nCh_gen < 2) + if (nCh_gen < 2) return; //------------------ all charges------------------------------------- @@ -911,69 +789,58 @@ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParti //---------------------- pions ---------------------------------------- - if(nChpi_gen > 2){ - var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); - var2pi_gen = (Q1pi_gen / nChpi_gen); - - } + 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); - } + 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); - } - - + 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); + //-----------------------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("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("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("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(MCMeanpTFluct, processMCGen, "process generated information", true); + PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", true); - - - -//+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) { - histos.fill(HIST("hEventCounter"), 1.); + 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("hEventCounter"), 2.); histos.fill(HIST("hZvtx_after_sel"), coll.posZ()); @@ -984,7 +851,6 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru histos.fill(HIST("hEventCounter"), 3.); - const auto cent = coll.centFT0C(); histos.fill(HIST("hCentrality"), cent); @@ -997,71 +863,66 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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 var1 = 0., var2 = 0., twopar_allcharge = 0.; + double var1pi = 0., var2pi = 0.; double var1k = 0., var2k = 0.; double var1p = 0., var2p = 0.; - // cent = 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 + // 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()); - + 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 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 DCAxy - // if (!(fabs(track.dcaXY()) < 0.12)) continue;//global cut already includes - histos.fill(HIST("tracksel"), 3); - - //tracks passed after DCAz + // tracks passed after DCAz // histos.fill(HIST("hDCAxy"), track.dcaXY()); - histos.fill(HIST("hDCAz"), track.dcaZ()); + histos.fill(HIST("hDCAz"), track.dcaZ()); - // if (!(fabs(track.dcaZ()) < 1.)) continue;//global cut already includes (DCAz< 2.0) cm + // 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; + // 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 + // 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; + // if (track.tpcNClsCrossedRows() < 70.0) continue; histos.fill(HIST("hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); histos.fill(HIST("tracksel"), 7); - -// if (track.tpcChi2NCl() > 4.0) continue; + // if (track.tpcChi2NCl() > 4.0) continue; histos.fill(HIST("hTPCchi2perCluster_after"), track.tpcChi2NCl()); histos.fill(HIST("tracksel"), 8); - -// if (track.itsChi2NCl() > 36.0) continue; + // if (track.itsChi2NCl() > 36.0) continue; histos.fill(HIST("hITSchi2perCluster_after"), track.itsChi2NCl()); histos.fill(HIST("tracksel"), 9); - - nCh += 1.; Q1 += track.pt(); @@ -1076,7 +937,6 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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 @@ -1095,267 +955,223 @@ PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", tru 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()); - - - - + if (track.hasTPC()) + histos.fill(HIST("hdEdx"), track.p(), track.tpcSignal()); + if (track.hasTOF()) + histos.fill(HIST("hTOFbeta"), track.p(), track.beta()); - -//=============================pion============================================================== + //=============================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()); + 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()); + 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)); + // 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))) { - nChpi += 1.; - Q1pi += track.pt(); - Q2pi += (track.pt() * track.pt()); + 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)); - 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()); + 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.) { - 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("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)); - 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)); + nChpi += 1.; + Q1pi += track.pt(); + Q2pi += (track.pt() * track.pt()); - 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.beta() > 1) + continue; + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } + //===========================kaon=============================================================== - 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.) ) { + 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)); + 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()); - nChk += 1.; - Q1k += track.pt(); - Q2k += (track.pt() * track.pt()); + if (track.beta() > 1) + continue; - 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("hdEdx_afterselection1"), track.p(), track.tpcSignal()); - histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + 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=========================================================== + //============================proton=========================================================== - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 2.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 2.)) - { histos.fill(HIST("NSigamaTPCTOFproton"), track.tpcNSigmaPr(), track.tofNSigmaPr()); + 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("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)) { - 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)); + 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()); + 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; + if (track.beta() > 1) + continue; + histos.fill(HIST("hdEdx_afterselection1"), track.p(), track.tpcSignal()); + histos.fill(HIST("hTOFbeta_afterselection1"), track.p(), track.beta()); + } - 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); + histos.fill(HIST("hVar1"), sample, cent, var1); var2 = (Q1 / nCh); - histos.fill(HIST("hVar2"),sample ,cent, var2); + 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); - - } + 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); - } + 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); + if (nChp > 2) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + var2p = (Q1p / nChp); + } - histos.fill(HIST("hVar1k"),sample ,cent, var1k); - histos.fill(HIST("hVar2k"),sample ,cent, var2k); - histos.fill(HIST("hVar2meanptk"), cent, var2k); + //========================centrality========================================== - histos.fill(HIST("hVar1p"),sample ,cent, var1p); - histos.fill(HIST("hVar2p"),sample ,cent, var2p); - histos.fill(HIST("hVar2meanptp"), cent, var2p); + 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("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("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("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("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(MCMeanpTFluct, process, "process real data information", true); - + PROCESS_SWITCH(MCMeanpTFluct, process, "process real data information", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 6b1ae9153b41423bd6b53a89f0568a20f4dcf509 Mon Sep 17 00:00:00 2001 From: sweta Date: Fri, 24 May 2024 16:08:36 +0200 Subject: [PATCH 43/47] MeanpT-Fluctuations --- .../EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index adcd41356f9..073aadba3ab 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -698,7 +698,7 @@ struct IdentifiedMeanPtFluctuations { } // ends - PROCESS_SWITCH(MCMeanpTFluct, processMCReco, "process reconstructed information", true); + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCReco, "process reconstructed information", true); //++++++++++++++++++++++++++++Monte Carlo Generated ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void processMCGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles) @@ -827,7 +827,7 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("hVarpx_gen"), sample_gen, nChp_gen); histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen, var2p_gen); } - PROCESS_SWITCH(MCMeanpTFluct, processMCGen, "process generated information", true); + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMCGen, "process generated information", true); //+++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++ void process(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) @@ -1171,7 +1171,7 @@ struct IdentifiedMeanPtFluctuations { } // event loop ends! - PROCESS_SWITCH(MCMeanpTFluct, process, "process real data information", true); + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From da433ad6663c2fa47ace5172b6029762e4145b92 Mon Sep 17 00:00:00 2001 From: sweta Date: Tue, 28 May 2024 07:30:01 +0200 Subject: [PATCH 44/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 073aadba3ab..1ee5db7fcd4 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -438,8 +438,7 @@ struct IdentifiedMeanPtFluctuations { } histos.fill(HIST("tracksel_rec"), 7); - int count_rec_pi = 0, count_rec_k = 0, count_rec_p = 0; - int count_rec_pi_pdg = 0, count_rec_k_pdg = 0, count_rec_p_pdg = 0; + double nCh_rec = 0.; double nChpi_rec = 0.; double nChk_rec = 0.; @@ -485,16 +484,16 @@ struct IdentifiedMeanPtFluctuations { //======================================================================== if (abs(track1.mcParticle().pdgCode()) == 211) { - count_rec_pi_pdg++; + histos.fill(HIST("ptHistogramPionrec_pdg"), track1.pt()); } if (abs(track1.mcParticle().pdgCode()) == 321) { - count_rec_k_pdg++; + histos.fill(HIST("ptHistogramKaonrec_pdg"), track1.pt()); } if (abs(track1.mcParticle().pdgCode()) == 2212) { - count_rec_p_pdg++; + histos.fill(HIST("ptHistogramProtonrec_pdg"), track1.pt()); } @@ -523,7 +522,7 @@ struct IdentifiedMeanPtFluctuations { { - count_rec_pi++; + histos.fill(HIST("ptHistogramPionrec"), track1.pt()); nChpi_rec += 1.; @@ -569,7 +568,7 @@ struct IdentifiedMeanPtFluctuations { SelTPCTOFKaons(track1); // Kaons passes from TPC and TOF both! { - count_rec_k++; + histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); @@ -616,7 +615,7 @@ struct IdentifiedMeanPtFluctuations { SelTPCTOFProtons(track1); // Protons passes from TPC and TOF both! { - count_rec_p++; + histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); @@ -710,7 +709,7 @@ struct IdentifiedMeanPtFluctuations { } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - int count_gen_pi = 0, count_gen_k = 0, count_gen_p = 0; + double nCh_gen = 0.; double nChpi_gen = 0.; double nChk_gen = 0.; @@ -750,7 +749,7 @@ struct IdentifiedMeanPtFluctuations { histos.fill(HIST("ptHistogram_allcharge_gen"), mcgentrack.pt()); if (pdgcode == 211) { - count_gen_pi++; + histos.fill(HIST("ptHistogramPion"), mcgentrack.pt()); nChpi_gen += 1.; @@ -759,7 +758,7 @@ struct IdentifiedMeanPtFluctuations { } if (pdgcode == 321) { - count_gen_k++; + histos.fill(HIST("ptHistogramKaon"), mcgentrack.pt()); nChk_gen += 1.; @@ -768,7 +767,7 @@ struct IdentifiedMeanPtFluctuations { } if (pdgcode == 2212) { - count_gen_p++; + histos.fill(HIST("ptHistogramProton"), mcgentrack.pt()); nChp_gen += 1.; From 2451b213c676a0f2585f6a1b6b1f4174ac155f16 Mon Sep 17 00:00:00 2001 From: sweta Date: Tue, 28 May 2024 07:31:44 +0200 Subject: [PATCH 45/47] MeanpT-Fluctuations --- .../Tasks/IdentifiedMeanPtFluctuations.cxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx index 1ee5db7fcd4..320a4be8fcc 100644 --- a/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx @@ -438,7 +438,6 @@ struct IdentifiedMeanPtFluctuations { } histos.fill(HIST("tracksel_rec"), 7); - double nCh_rec = 0.; double nChpi_rec = 0.; double nChk_rec = 0.; @@ -489,12 +488,10 @@ struct IdentifiedMeanPtFluctuations { } 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()); } @@ -522,7 +519,6 @@ struct IdentifiedMeanPtFluctuations { { - histos.fill(HIST("ptHistogramPionrec"), track1.pt()); nChpi_rec += 1.; @@ -569,7 +565,6 @@ struct IdentifiedMeanPtFluctuations { { - histos.fill(HIST("ptHistogramKaonrec"), track1.pt()); nChk_rec += 1.; @@ -616,7 +611,6 @@ struct IdentifiedMeanPtFluctuations { { - histos.fill(HIST("ptHistogramProtonrec"), track1.pt()); nChp_rec += 1.; @@ -709,7 +703,6 @@ struct IdentifiedMeanPtFluctuations { } histos.fill(HIST("MC_hZvtx_after_sel"), mcCollision.posZ()); - double nCh_gen = 0.; double nChpi_gen = 0.; double nChk_gen = 0.; From 6e95cf122fd60f38518619ab29b06a6d4c652306 Mon Sep 17 00:00:00 2001 From: sweta29singh Date: Thu, 5 Jun 2025 13:19:22 +0530 Subject: [PATCH 46/47] meanptfluct --- PWGCF/Tutorial/CMakeLists.txt | 5 + .../Tutorial/IdentifiedMeanPtFluctuations.cxx | 1459 +++++++++++++++++ 2 files changed, 1464 insertions(+) create mode 100644 PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx diff --git a/PWGCF/Tutorial/CMakeLists.txt b/PWGCF/Tutorial/CMakeLists.txt index 41947b55063..a05689df441 100644 --- a/PWGCF/Tutorial/CMakeLists.txt +++ b/PWGCF/Tutorial/CMakeLists.txt @@ -37,4 +37,9 @@ o2physics_add_dpl_workflow(cf-tutorial-4 o2physics_add_dpl_workflow(cf-tutorial-5 SOURCES CFTutorialTask5.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysisi) + +o2physics_add_dpl_workflow(ident-meanpt-fluct + SOURCES IdentifiedMeanPtFluctuations.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx b/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx new file mode 100644 index 00000000000..32018f10d54 --- /dev/null +++ b/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx @@ -0,0 +1,1459 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for +// 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) +// Department of Physics, Aligarh Muslim University, India +// to study the two particle correaltor on Run 3data + + +// 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) +// Mean pT fluctautions usin + +#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" +#include "CCDB/BasicCCDBManager.h" +#include "Framework/O2DatabasePDGPlugin.h" + + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace std; + +#include +#include +#include +#include +#include + +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 + +double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); +double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); +double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); + +struct IdentifiedMeanPtFluctuations{ + Service ccdb; + Service pdg; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + + 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&) + { + + + 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 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("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}); + //=====================rapidity===================================== + 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}); + + //--------------------------------nch---------------------------------- + + histos.add("Data/hnch_all", ";hnch_all", kTH1D, {nchAxis}); + histos.add("Data/hnch_all_bf_cut", ";hnch_all_bf_cut", kTH1D, {nchAxis}); + histos.add("Data/hnch", ";hnch", kTH1D, {nchAxis}); + histos.add("Data/hnch_true", ";hnch_true", kTH1D, {nchAxis}); + histos.add("Data/hnch_true_pt", ";hnch_true_pt", kTH1D, {nchAxis}); + + + histos.add("Data/hVar1x_old", "hVar1x_old", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVar2x_old", "hVar2x_old", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hVarx_old", "hVarx_old", kTH2D, {subAxis, 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}); + + //--------------------------------nch---------------------------------- + histos.add("hnch_rec_all", ";hnch_rec_all", kTH1D, {nchAxis}); + histos.add("hnch_rec", ";hnch_rec", kTH1D, {nchAxis}); + histos.add("hnch_rec_true", ";hnch_rec_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("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}); + + + //=======================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}); + + //========================MC Histograms Reconstructed================================================= + + + 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{"cVtx", 10.f, "Vertex Z"}; + Configurable cEtacut{"cEta", 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{"cITSchi2clustercut", 70, "ITS chi2 cluster cut"}; + Configurable cTPCchicut{"cTPCchi2clustercut", 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)"}; + + + template < typename C> + 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("tracksel_rec"), 4); + + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) {return false;} + histos.fill(HIST("tracksel_rec"), 5); + + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {return false;} + histos.fill(HIST("tracksel_rec"), 6); + + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) {return false;} + histos.fill(HIST("tracksel_rec"), 7); + +// if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + histos.fill(HIST("tracksel_rec"), 8); + + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) {return false;} + histos.fill(HIST("tracksel_rec"), 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 rej_El(T const& track) + { + if ( track.tpcNSigmaEl() > -3. && track.tpcNSigmaEl() < 5. && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { return true; } + return false; + } + + + + + template + bool sel_proton(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 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 ) { return true; } + } + + return false; + + } + + template + bool sel_kaon(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 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + } + + return false; + + } + + template + bool sel_pion(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 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + } + + return false; + + } + + + //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// + // // + // // + // // + //++++++++++++++++++++++++++++++++++++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., nChk = 0., nChp = 0., nCh_all = 0., nCh_true = 0., nCh_all_bfcut = 0., nCh_eta = 0., nCh_pt = 0.; + double Q1 = 0., Q2 = 0., Q1_old = 0., Q2_old = 0.; + double Q1pi = 0., Q2pi = 0.; + double Q1k = 0., Q2k = 0.; + double Q1p = 0., Q2p = 0.; + double var1 = 0., var2 = 0., twopar_allcharge = 0., var1_old = 0., var2_old = 0.; + double var1pi = 0., var2pi = 0.; + double var1k = 0., var2k = 0.; + double var1p = 0., var2p = 0.; + // double sum_pt_weight = 0., sum_weight = 0., sum_pt_pt_weight = 0.; + + int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; //subsample error estimation + + // Perfroming the track selection========================================== + for (auto track : inputTracks) { + + nCh_all_bfcut += 1.; + histos.fill(HIST("Data/hnch_all_bf_cut"), nCh_all_bfcut); + + 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 ) + {nCh_eta++; + histos.fill(HIST("Data/hnch_true"), nCh_eta); + } + + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut){ + nCh_pt += 1.; + histos.fill(HIST("Data/hnch_true_pt"), nCh_pt);} + + + if(track.sign() == 0) continue; + if (!selTrack(track)) continue; + + nCh_all += 1.; + histos.fill(HIST("Data/hnch_all"), nCh_all); + + + 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() >= 0.15 || track.pt() <= 2.0) //do not change this (it is for different pt work) + {nCh += 1.; + Q1_old += track.pt(); + Q2_old += (track.pt() * track.pt()); + histos.fill(HIST("Data/hnch"), nCh); + + } + // histos.fill(HIST("hnch"), nCh); + + Q1 += track.pt(); + Q2 += (track.pt() * track.pt()); + + + + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && abs(track.tpcNSigmaPi()) < 3.) + histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) + histos.fill(HIST("Data/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) + histos.fill(HIST("Data/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.) + histos.fill(HIST("Data/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.) + histos.fill(HIST("Data/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.) + 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() && abs(track.tpcNSigmaPi()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.)) { + 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(sel_pion(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() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { + 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(sel_kaon(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)); + + nChk += 1.; + Q1k += track.pt(); + Q2k += (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() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { + 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(sel_proton(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)); + + nChp += 1.; + Q1p += track.pt(); + Q2p += (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, nCh_all); + + + if (nCh >= 2.0) + { + var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); + var2_old = (Q1_old / nCh); + } + + + + if (nCh_all < 2.0) return; + var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); + var2 = (Q1 / nCh_all); + + + //------------------ 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); + + twopar_allcharge = (var1 - var2); + histos.fill(HIST("Data/hVar"), nCh_all, twopar_allcharge); + + //---------------------- pions ---------------------------------------- + + if (nChpi >= 2.0) { + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + var2pi = (Q1pi / nChpi); + } + + //----------------------- kaons --------------------------------------- + if (nChk >= 2.0) { + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + var2k = (Q1k / nChk); + } + + //---------------------------- protons ---------------------------------- + if (nChp >= 2.0) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + var2p = (Q1p / nChp); + } + + //========================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, var1k); + histos.fill(HIST("Data/hVar2k"), sample, cent, var2k); + histos.fill(HIST("Data/hVar2meanptk"), cent, var2k); + + histos.fill(HIST("Data/hVar1p"), sample, cent, var1p); + histos.fill(HIST("Data/hVar2p"), sample, cent, var2p); + histos.fill(HIST("Data/hVar2meanptp"), cent, var2p); + + //-----------------------nch------------------------------------- + + + histos.fill(HIST("Data/hVar1x_old"), sample, nCh_all, var1_old); + histos.fill(HIST("Data/hVar2x_old"), sample, nCh_all, var2_old); + histos.fill(HIST("Data/hVarx_old"), sample, nCh_all); + + histos.fill(HIST("Data/hVar1x"), sample, nCh_all, var1); + histos.fill(HIST("Data/hVar2x"), sample, nCh_all, var2); + histos.fill(HIST("Data/hVarx"), sample, nCh_all); + histos.fill(HIST("Data/hVar2meanptx"), nCh_all, var2); + + histos.fill(HIST("Data/hVar1pix"), sample, nCh_all, var1pi); + histos.fill(HIST("Data/hVar2pix"), sample, nCh_all, var2pi); + histos.fill(HIST("Data/hVarpix"), sample, nChpi); + histos.fill(HIST("Data/hVar2meanptpix"), nCh_all, var2pi); + + histos.fill(HIST("Data/hVar1kx"), sample, nCh_all, var1k); + histos.fill(HIST("Data/hVar2kx"), sample, nCh_all, var2k); + histos.fill(HIST("Data/hVarkx"), sample, nChk); + histos.fill(HIST("Data/hVar2meanptkx"), nCh_all, var2k); + + histos.fill(HIST("Data/hVar1px"), sample, nCh_all, var1p); + histos.fill(HIST("Data/hVar2px"), sample, nCh_all, var2p); + histos.fill(HIST("Data/hVarpx"), sample, nChp); + histos.fill(HIST("Data/hVar2meanptpx"), nCh_all, var2p); + + + + } // event loop ends! + + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", false); + + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// + // // + // // + // // + //++++++++++++++++++++++++++++++++++++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., nChk = 0., nChp = 0., nCh_all = 0., nCh_all_bfcut = 0., nCh_eta = 0., nCh_pt = 0.; + double Q1 = 0., Q2 = 0., Q1_old = 0., Q2_old = 0.; + double Q1pi = 0., Q2pi = 0., Q1k = 0., Q2k = 0., Q1p = 0., Q2p = 0.; + double var1 = 0., var2 = 0., twopar_allcharge = 0., var1_old = 0., var2_old = 0.; + double var1pi = 0., var2pi = 0., var1k = 0., var2k = 0., var1p = 0., var2p = 0.; + double sum_pt_weight = 0., sum_weight = 0., sum_pt_pt_weight = 0., var1_eff = 0., var2_eff = 0.; + + + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; + + + + for (auto track : inputTracks) { + + nCh_all_bfcut += 1.; + histos.fill(HIST("Rec/hnch_all_bf_cut"), nCh_all_bfcut); + + // histos.fill(HIST("Rec/tracksel"), 1); + 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 ) + { nCh_eta++; + histos.fill(HIST("Rec/hnch_true"), nCh_eta); + } + + + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) + { nCh_pt += 1.; + histos.fill(HIST("Rec/hnch_true_pt"), nCh_pt); + } + + + 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(); + + nCh_all += 1.; + histos.fill(HIST("Rec/hnch_all"), nCh_all); + histos.fill(HIST("ptHistogram_allcharge_rec"), 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() >= 0.15 || track.pt() <= 2.0) //do not change this (it is for different pt work) + {nCh += 1.; + Q1_old += track.pt(); + Q2_old += (track.pt() * track.pt()); + histos.fill(HIST("Rec/hnch"), nCh); + } + + Q1 += track.pt(); + Q2 += (track.pt() * track.pt()); + + + if (abs(mcParticle.pdgCode()) == 211) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); + if (abs(mcParticle.pdgCode()) == 321) histos.fill(HIST("ptHistogramKaonrec_pdg"),track.pt()); + if (abs(mcParticle.pdgCode()) == 2212) histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); + + if (cfgRejEl == false && rej_El(track)) { return; } + + // only TPC tracks: Pion, Kaon, Proton + if (track.hasTPC() && abs(track.tpcNSigmaPi()) < 3.) + histos.fill(HIST("Rec/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); + if (track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) + histos.fill(HIST("Rec/NSigamaTPCkaon"), track.pt(), track.tpcNSigmaKa()); + if (track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) + histos.fill(HIST("Rec/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); + + + + // only TOF tracks: Pion, Kaon, Proton + if (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.) + histos.fill(HIST("Rec/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); + if (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.) + histos.fill(HIST("Rec/NSigamaTOFkaon"), track.pt(), track.tofNSigmaKa()); + if (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.) + 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() && abs(track.tpcNSigmaPi()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.)) { + 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(sel_pion(track)) + { + if (std::fabs(track.y()) > 0.5) 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 (abs(track.mcParticle().pdgCode()) == 211) + { 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)); + + + } + +//===========================kaon=============================================================== + + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { + 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(sel_kaon(track)) + { + if (std::fabs(track.y()) > 0.5) 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 (abs(track.mcParticle().pdgCode()) == 321) + { histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } + + nChk += 1.; + Q1k += track.pt(); + Q2k += (track.pt() * track.pt()); + + histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); + histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); + } + + //============================proton=========================================================== + + + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { + 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(sel_proton(track)) + { + if (std::fabs(track.y()) > 0.5) 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 (abs(track.mcParticle().pdgCode()) == 2212) + { histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } + + nChp += 1.; + Q1p += track.pt(); + Q2p += (track.pt() * track.pt()); + + 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, nCh_all); + + if (nCh >= 2.0) + { + var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); + var2_old = (Q1_old / nCh); + } + + + + if (nCh_all < 2.0) return; + var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); + var2 = (Q1 / nCh_all); + + + + 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); + + twopar_allcharge = (var1 - var2); + histos.fill(HIST("Rec/hVar"), nCh_all, twopar_allcharge); + + //---------------------- pions ---------------------------------------- + + if (nChpi >= 2.0) { + var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); + var2pi = (Q1pi / nChpi); + } + + //----------------------- kaons --------------------------------------- + if (nChk >= 2.0) { + var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); + var2k = (Q1k / nChk); + } + + //---------------------------- protons ---------------------------------- + if (nChp >= 2.0) { + var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); + var2p = (Q1p / nChp); + } + //========================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, var1k); + histos.fill(HIST("Rec/hVar2k"), sample, cent, var2k); + histos.fill(HIST("Rec/hVar2meanptk"), cent, var2k); + + histos.fill(HIST("Rec/hVar1p"), sample, cent, var1p); + histos.fill(HIST("Rec/hVar2p"), sample, cent, var2p); + histos.fill(HIST("Rec/hVar2meanptp"), cent, var2p); + + //-----------------------nch------------------------------------- + + + histos.fill(HIST("Rec/hVar1x"), sample, nCh_all, var1); + histos.fill(HIST("Rec/hVar2x"), sample, nCh_all, var2); + histos.fill(HIST("Rec/hVarx"), sample, nCh_all); + histos.fill(HIST("Rec/hVar2meanptx"), nCh_all, var2); + + histos.fill(HIST("Rec/hVar1pix"), sample, nCh_all, var1pi); + histos.fill(HIST("Rec/hVar2pix"), sample, nCh_all, var2pi); + histos.fill(HIST("Rec/hVarpix"), sample, nChpi); + histos.fill(HIST("Rec/hVar2meanptpix"), nCh_all, var2pi); + + histos.fill(HIST("Rec/hVar1kx"), sample, nCh_all, var1k); + histos.fill(HIST("Rec/hVar2kx"), sample, nCh_all, var2k); + histos.fill(HIST("Rec/hVarkx"), sample, nChk); + histos.fill(HIST("Rec/hVar2meanptkx"), nCh_all, var2k); + + histos.fill(HIST("Rec/hVar1px"), sample, nCh_all, var1p); + histos.fill(HIST("Rec/hVar2px"), sample, nCh_all, var2p); + histos.fill(HIST("Rec/hVarpx"), sample, nChp); + histos.fill(HIST("Rec/hVar2meanptpx"), nCh_all, var2p); + + +//================= generated levels============================== + 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 nCh_gen = 0., nCh_gen_all = 0., nCh_gen_true = 0.; + double nChpi_gen = 0., nChk_gen = 0., nChp_gen = 0.; + double nCh1 = 0., nCh2 = 0., nCh3 = 0., nCh4 = 0.; + + double Q1_gen = 0, Q2_gen = 0., Q1_gen_old = 0., Q2_gen_old = 0.; + double Q1pi_gen = 0, Q2pi_gen = 0, Q1k_gen = 0, Q2k_gen = 0, Q1p_gen = 0, Q2p_gen = 0 ; + + double var1_gen = 0, var2_gen = 0., var1_gen_old = 0., var2_gen_old = 0.; + double var1pi_gen = 0, var2pi_gen = 0, var1k_gen = 0, var2k_gen = 0, var1p_gen = 0, var2p_gen = 0; + + int sample_gen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); + sample_gen = sample_gen % 30; + + + for (const auto& mcpart:mcpartgen){ + auto pdgcode = std::abs(mcpart.pdgCode()); + + if(!mcpart.isPhysicalPrimary()) {continue;} + nCh1++ ; + histos.fill(HIST("hnch1"), nCh1); +// if (!(pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == -211 || pdgcode == -321 || pdgcode == -2212 || pdgcode == 11 || pdgcode == 13)) continue; + 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; + nCh_gen_true++; + histos.fill(HIST("hnch_gen_true"), nCh_gen_true); + + 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()); + + + nCh_gen_all += 1.; + Q1_gen += mcpart.pt(); + Q2_gen += (mcpart.pt() * mcpart.pt()); + + histos.fill(HIST("hnch_gen_all"), nCh_gen_all); + + if (std::fabs(mcpart.y()) < 0.5) + { + if (mcpart.pdgCode() == 211 || mcpart.pdgCode() == -211 ) + { + histos.fill(HIST("ptHistogramPion"), mcpart.pt()); + nChpi_gen += 1.; + Q1pi_gen += mcpart.pt(); + Q2pi_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pi"), nChpi_gen); + + } + + if (mcpart.pdgCode() == 321 || mcpart.pdgCode() == -321) + { + histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); + nChk_gen += 1.; + Q1k_gen += mcpart.pt(); + Q2k_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_ka"), nChk_gen); + + + } + + if (mcpart.pdgCode() == 2212 || mcpart.pdgCode() == -2212) + { + histos.fill(HIST("ptHistogramProton"), mcpart.pt()); + nChp_gen += 1.; + Q1p_gen += mcpart.pt(); + Q2p_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pr"), nChp_gen); + + } + + }//|y| < 0.5 cut ends! + + }//particle + histos.fill(HIST("hcent_nacc_gen"), cent, nCh_gen); + + + if (nCh_gen_all < 2.0) return; + var1_gen = (Q1_gen * Q1_gen - Q2_gen) / (nCh_gen_all * (nCh_gen_all - 1)); + var2_gen = (Q1_gen / nCh_gen_all); + + if (nChpi_gen >= 2.0) + { + var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); + var2pi_gen = (Q1pi_gen / nChpi_gen); + } + + //----------------------- kaons --------------------------------------- + if (nChk_gen >= 2.0) + { + var1k_gen = (Q1k_gen * Q1k_gen - Q2k_gen) / (nChk_gen * (nChk_gen - 1)); + var2k_gen = (Q1k_gen / nChk_gen); + } + + //---------------------------- protons ---------------------------------- + if (nChp_gen >= 2.0) + { + 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_all, var1_gen); + histos.fill(HIST("hVar2x_gen"), sample_gen, nCh_gen_all, var2_gen); + histos.fill(HIST("hVarx_gen"), sample_gen, nCh_gen_all); + histos.fill(HIST("hVar2meanptx_gen"), nCh_gen_all, var2_gen); + + histos.fill(HIST("hVar1pix_gen"), sample_gen, nCh_gen_all, var1pi_gen); + histos.fill(HIST("hVar2pix_gen"), sample_gen, nCh_gen_all, var2pi_gen); + histos.fill(HIST("hVarpix_gen"), sample_gen, nChpi_gen); + histos.fill(HIST("hVar2meanptpix_gen"), nCh_gen_all, var2pi_gen); + + histos.fill(HIST("hVar1kx_gen"), sample_gen, nCh_gen_all, var1k_gen); + histos.fill(HIST("hVar2kx_gen"), sample_gen, nCh_gen_all, var2k_gen); + histos.fill(HIST("hVarkx_gen"), sample_gen, nChk_gen); + histos.fill(HIST("hVar2meanptkx_gen"), nCh_gen_all, var2k_gen); + + histos.fill(HIST("hVar1px_gen"), sample_gen, nCh_gen_all, var1p_gen); + histos.fill(HIST("hVar2px_gen"), sample_gen, nCh_gen_all, var2p_gen); + histos.fill(HIST("hVarpx_gen"), sample_gen, nChp_gen); + histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen_all, var2p_gen); + + + } //void process +PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMcReco, "Process reconstructed", true); + +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} + + From a165456516d56f61c4e50e60e3779e3cf63f64b1 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 5 Jun 2025 07:51:21 +0000 Subject: [PATCH 47/47] Please consider the following formatting changes --- .../Tutorial/IdentifiedMeanPtFluctuations.cxx | 980 +++++++++--------- 1 file changed, 486 insertions(+), 494 deletions(-) diff --git a/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx b/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx index 32018f10d54..40a19cc90a2 100644 --- a/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx +++ b/PWGCF/Tutorial/IdentifiedMeanPtFluctuations.cxx @@ -1,5 +1,5 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for +// See https://alice-o2.web.cern.ch/copyright for // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public @@ -11,8 +11,7 @@ // // author Sweta Singh (sweta.singh@cern.ch) // Department of Physics, Aligarh Muslim University, India -// to study the two particle correaltor on Run 3data - +// to study the two particle correaltor on Run 3data // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. @@ -52,7 +51,6 @@ #include "CCDB/BasicCCDBManager.h" #include "Framework/O2DatabasePDGPlugin.h" - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -66,8 +64,8 @@ using namespace std; namespace o2::aod { -using MyCollisions = soa::Join; -using MyTracks = soa::Join; +using MyTracks = soa::JoinGetParticle(211)->Mass(); double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); -struct IdentifiedMeanPtFluctuations{ - Service ccdb; - Service pdg; - +struct IdentifiedMeanPtFluctuations { + Service ccdb; + Service pdg; + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - 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&) { - - 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})"}; + 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)"}; @@ -119,7 +114,7 @@ struct IdentifiedMeanPtFluctuations{ 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 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}"}; @@ -236,12 +231,10 @@ struct IdentifiedMeanPtFluctuations{ histos.add("Data/hnch_true", ";hnch_true", kTH1D, {nchAxis}); histos.add("Data/hnch_true_pt", ";hnch_true_pt", kTH1D, {nchAxis}); - histos.add("Data/hVar1x_old", "hVar1x_old", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2x_old", "hVar2x_old", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVarx_old", "hVarx_old", kTH2D, {subAxis, 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}); @@ -293,11 +286,10 @@ struct IdentifiedMeanPtFluctuations{ 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.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); histos.addClone("Data/", "Rec/"); -//rec histograms + // 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}); @@ -306,7 +298,6 @@ struct IdentifiedMeanPtFluctuations{ 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}); @@ -323,7 +314,6 @@ struct IdentifiedMeanPtFluctuations{ 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}); @@ -332,14 +322,12 @@ struct IdentifiedMeanPtFluctuations{ 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}); @@ -349,11 +337,11 @@ struct IdentifiedMeanPtFluctuations{ histos.add("hnch_rec_all", ";hnch_rec_all", kTH1D, {nchAxis}); histos.add("hnch_rec", ";hnch_rec", kTH1D, {nchAxis}); histos.add("hnch_rec_true", ";hnch_rec_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("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}); @@ -397,7 +385,6 @@ struct IdentifiedMeanPtFluctuations{ 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}); - //=======================MC histograms Generated ================================================ histos.add("ptHistogram_allcharge_gen", "ptHistogram_allcharge_gen", kTH1D, {ptAxis}); histos.add("ptHistogramPion", "ptHistogramPion", kTH1D, {ptAxis}); @@ -414,23 +401,19 @@ struct IdentifiedMeanPtFluctuations{ 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("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("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}); @@ -453,168 +436,183 @@ struct IdentifiedMeanPtFluctuations{ //========================MC Histograms Reconstructed================================================= - 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}); - - + 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{"cVtx", 10.f, "Vertex Z"}; - Configurable cEtacut{"cEta", 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{"cITSchi2clustercut", 70, "ITS chi2 cluster cut"}; - Configurable cTPCchicut{"cTPCchi2clustercut", 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)"}; - - - template < typename C> - 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("tracksel_rec"), 4); - - if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) {return false;} - histos.fill(HIST("tracksel_rec"), 5); - - if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {return false;} - histos.fill(HIST("tracksel_rec"), 6); + // Configurables + Configurable cVtxZcut{"cVtx", 10.f, "Vertex Z"}; + Configurable cEtacut{"cEta", 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{"cITSchi2clustercut", 70, "ITS chi2 cluster cut"}; + Configurable cTPCchicut{"cTPCchi2clustercut", 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)"}; + + template + bool selCollision(C const& coll) + { - if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) {return false;} - histos.fill(HIST("tracksel_rec"), 7); + 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("tracksel_rec"), 4); -// if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} - histos.fill(HIST("tracksel_rec"), 8); + if (cPileupReject && !coll.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + histos.fill(HIST("tracksel_rec"), 5); - if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) {return false;} - histos.fill(HIST("tracksel_rec"), 9); + if (cZVtxTimeDiff && !coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + histos.fill(HIST("tracksel_rec"), 6); + if (cItsTpcVtx && !coll.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return false; + } + histos.fill(HIST("tracksel_rec"), 7); - return true; //if all checks pass, accept the collision + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + histos.fill(HIST("tracksel_rec"), 8); + if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + return false; } + histos.fill(HIST("tracksel_rec"), 9); + return true; // if all checks pass, accept the collision + } + template + bool selTrack(T const& track) + { - 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 (!track.isGlobalTrack()) { + return false; + } // accept only global tracks + histos.fill(HIST("tracksel"), 2); -// if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} - histos.fill(HIST("tracksel"), 4); + // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.eta()) >= cEtacut) {return false;} - histos.fill(HIST("tracksel"), 5); + // if (std::fabs(track.dcaZ()) > cDcaZcut) {return false;} + histos.fill(HIST("tracksel"), 4); - if (track.pt() < cPtmincut ) {return false;} - if (track.pt() > cPtmaxcut) {return false;} - histos.fill(HIST("tracksel"), 6); + if (std::fabs(track.eta()) >= cEtacut) { + return false; + } + histos.fill(HIST("tracksel"), 5); -// if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} - histos.fill(HIST("tracksel"), 7); + if (track.pt() < cPtmincut) { + return false; + } + if (track.pt() > cPtmaxcut) { + return false; + } + histos.fill(HIST("tracksel"), 6); -// if (track.itsChi2NCl() > cITSchicut) {return false;} - histos.fill(HIST("tracksel"), 8); + // if (track.tpcNClsCrossedRows() < cTPCcrosscut) {return false;} + histos.fill(HIST("tracksel"), 7); -// if (track.tpcChi2NCl() > cTPCchicut) {return false;} - histos.fill(HIST("tracksel"), 9); + // if (track.itsChi2NCl() > cITSchicut) {return false;} + histos.fill(HIST("tracksel"), 8); - if (track.sign() == 0) return false; + // if (track.tpcChi2NCl() > cTPCchicut) {return false;} + histos.fill(HIST("tracksel"), 9); - return true; //if all checks pass, accept the collision - } + if (track.sign() == 0) + return false; + return true; // if all checks pass, accept the collision + } template bool rej_El(T const& track) { - if ( track.tpcNSigmaEl() > -3. && track.tpcNSigmaEl() < 5. && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { return true; } + if (track.tpcNSigmaEl() > -3. && track.tpcNSigmaEl() < 5. && std::fabs(track.tpcNSigmaPi()) > cNSigCut3 && std::fabs(track.tpcNSigmaKa()) > cNSigCut3 && std::fabs(track.tpcNSigmaPr()) > cNSigCut3) { + return true; + } return false; } - - - template bool sel_proton(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 (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 (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 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 ) { return true; } + if (track.p() > cProtonPthcut && track.p() <= cProtonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPr()) < cNSigCut2 && std::fabs(track.tofNSigmaPr()) < cNSigCut2 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2) { + return true; + } } return false; - } template @@ -623,22 +621,26 @@ struct IdentifiedMeanPtFluctuations{ //! 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 (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 (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 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + if (track.p() > cKaonPthcut && track.p() <= cKaonPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaKa()) < cNSigCut2 && std::fabs(track.tofNSigmaKa()) < cNSigCut2 && TMath::Hypot(track.tofNSigmaPi(), track.tpcNSigmaPi()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } } - return false; - + return false; } template @@ -647,27 +649,31 @@ struct IdentifiedMeanPtFluctuations{ //! 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 (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 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 (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 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2 ) { return true; } + if (track.p() > cPionPthcut && track.p() <= cPionPmaxcut) { + if (track.hasTPC() && track.hasTOF() && std::fabs(track.tpcNSigmaPi()) < cNSigCut2 && std::fabs(track.tofNSigmaPi()) < cNSigCut2 && TMath::Hypot(track.tofNSigmaKa(), track.tpcNSigmaKa()) > cNSigCut2 && TMath::Hypot(track.tofNSigmaPr(), track.tpcNSigmaPr()) > cNSigCut2) { + return true; + } } return false; - } - //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// // // - // // + // // // // //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// @@ -676,13 +682,14 @@ struct IdentifiedMeanPtFluctuations{ 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()); + if (!selCollision(coll)) + return; + { + histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); } - - const auto cent = coll.centFT0C(); - histos.fill(HIST("Data/hCentrality"), cent); - + + const auto cent = coll.centFT0C(); + histos.fill(HIST("Data/hCentrality"), cent); double nCh = 0., nChpi = 0., nChk = 0., nChp = 0., nCh_all = 0., nCh_true = 0., nCh_all_bfcut = 0., nCh_eta = 0., nCh_pt = 0.; double Q1 = 0., Q2 = 0., Q1_old = 0., Q2_old = 0.; @@ -693,40 +700,40 @@ struct IdentifiedMeanPtFluctuations{ double var1pi = 0., var2pi = 0.; double var1k = 0., var2k = 0.; double var1p = 0., var2p = 0.; - // double sum_pt_weight = 0., sum_weight = 0., sum_pt_pt_weight = 0.; + // double sum_pt_weight = 0., sum_weight = 0., sum_pt_pt_weight = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; //subsample error estimation + sample = sample % 30; // subsample error estimation // Perfroming the track selection========================================== for (auto track : inputTracks) { - nCh_all_bfcut += 1.; - histos.fill(HIST("Data/hnch_all_bf_cut"), nCh_all_bfcut); - + nCh_all_bfcut += 1.; + histos.fill(HIST("Data/hnch_all_bf_cut"), nCh_all_bfcut); + 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) { + nCh_eta++; + histos.fill(HIST("Data/hnch_true"), nCh_eta); + } - if (std::fabs(track.eta()) <= cEtacut ) - {nCh_eta++; - histos.fill(HIST("Data/hnch_true"), nCh_eta); - } - - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut){ - nCh_pt += 1.; - histos.fill(HIST("Data/hnch_true_pt"), nCh_pt);} - + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nCh_pt += 1.; + histos.fill(HIST("Data/hnch_true_pt"), nCh_pt); + } - if(track.sign() == 0) continue; - if (!selTrack(track)) continue; + if (track.sign() == 0) + continue; + if (!selTrack(track)) + continue; - nCh_all += 1.; - histos.fill(HIST("Data/hnch_all"), nCh_all); + nCh_all += 1.; + histos.fill(HIST("Data/hnch_all"), nCh_all); - histos.fill(HIST("Data/hDCAxy"), track.dcaXY()); histos.fill(HIST("Data/hDCAz"), track.dcaZ()); histos.fill(HIST("Data/hTPCCrossedrows_after"), track.tpcNClsCrossedRows()); @@ -740,22 +747,19 @@ struct IdentifiedMeanPtFluctuations{ 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() >= 0.15 || track.pt() <= 2.0) //do not change this (it is for different pt work) - {nCh += 1.; + + if (track.pt() >= 0.15 || track.pt() <= 2.0) // do not change this (it is for different pt work) + { + nCh += 1.; Q1_old += track.pt(); - Q2_old += (track.pt() * track.pt()); - histos.fill(HIST("Data/hnch"), nCh); - - } - // histos.fill(HIST("hnch"), nCh); - + Q2_old += (track.pt() * track.pt()); + histos.fill(HIST("Data/hnch"), nCh); + } + // histos.fill(HIST("hnch"), nCh); + Q1 += track.pt(); Q2 += (track.pt() * track.pt()); - - // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && abs(track.tpcNSigmaPi()) < 3.) histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); @@ -772,20 +776,21 @@ struct IdentifiedMeanPtFluctuations{ if (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.) 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()); + 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() && abs(track.tpcNSigmaPi()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.)) { + if ((track.hasTPC() && abs(track.tpcNSigmaPi()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.)) { 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(sel_pion(track)){ + if (sel_pion(track)) { histos.fill(HIST("Data/hPtPion"), track.pt()); histos.fill(HIST("Data/hEtaPion"), track.eta()); histos.fill(HIST("Data/hyPion"), track.rapidity(massPi)); @@ -795,23 +800,22 @@ struct IdentifiedMeanPtFluctuations{ Q1pi += track.pt(); Q2pi += (track.pt() * track.pt()); - if (track.beta() > 1) continue; + 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() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { 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(sel_kaon(track)){ - + if (sel_kaon(track)) { histos.fill(HIST("Data/hPtKaon"), track.pt()); histos.fill(HIST("Data/hEtaKaon"), track.eta()); @@ -829,17 +833,16 @@ struct IdentifiedMeanPtFluctuations{ histos.fill(HIST("Data/hTOFbeta_afterselection1"), track.p(), track.beta()); } - //============================proton=========================================================== - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { 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(sel_proton(track)){ + if (sel_proton(track)) { histos.fill(HIST("Data/hPtProton"), track.pt()); histos.fill(HIST("Data/hEtaProton"), track.eta()); histos.fill(HIST("Data/hyProton"), track.rapidity(massPr)); @@ -855,29 +858,23 @@ struct IdentifiedMeanPtFluctuations{ 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, nCh_all); - - if (nCh >= 2.0) - { - var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); - var2_old = (Q1_old / nCh); - } + histos.fill(HIST("Data/hcent_nacc"), cent, nCh_all); + if (nCh >= 2.0) { + var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); + var2_old = (Q1_old / nCh); + } - - if (nCh_all < 2.0) return; - var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); - var2 = (Q1 / nCh_all); - + if (nCh_all < 2.0) + return; + var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); + var2 = (Q1 / nCh_all); //------------------ 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); @@ -888,22 +885,22 @@ struct IdentifiedMeanPtFluctuations{ //---------------------- pions ---------------------------------------- - if (nChpi >= 2.0) { + if (nChpi >= 2.0) { var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); var2pi = (Q1pi / nChpi); - } + } //----------------------- kaons --------------------------------------- - if (nChk >= 2.0) { + if (nChk >= 2.0) { var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); var2k = (Q1k / nChk); - } + } //---------------------------- protons ---------------------------------- - if (nChp >= 2.0) { + if (nChp >= 2.0) { var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); var2p = (Q1p / nChp); - } + } //========================centrality========================================== @@ -921,7 +918,6 @@ struct IdentifiedMeanPtFluctuations{ //-----------------------nch------------------------------------- - histos.fill(HIST("Data/hVar1x_old"), sample, nCh_all, var1_old); histos.fill(HIST("Data/hVar2x_old"), sample, nCh_all, var2_old); histos.fill(HIST("Data/hVarx_old"), sample, nCh_all); @@ -946,45 +942,58 @@ struct IdentifiedMeanPtFluctuations{ histos.fill(HIST("Data/hVarpx"), sample, nChp); histos.fill(HIST("Data/hVar2meanptpx"), nCh_all, var2p); - - } // event loop ends! PROCESS_SWITCH(IdentifiedMeanPtFluctuations, process, "process real data information", false); - + //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// // // - // // + // // // // //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// -SliceCache cache; -Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; + 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 processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { - 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()); - - 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 (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()); - - + if (!coll.sel8()) { + return; + } + float cent = coll.centFT0C(); + histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); + double nCh = 0., nChpi = 0., nChk = 0., nChp = 0., nCh_all = 0., nCh_all_bfcut = 0., nCh_eta = 0., nCh_pt = 0.; double Q1 = 0., Q2 = 0., Q1_old = 0., Q2_old = 0.; double Q1pi = 0., Q2pi = 0., Q1k = 0., Q2k = 0., Q1p = 0., Q2p = 0.; @@ -992,82 +1001,82 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; double var1pi = 0., var2pi = 0., var1k = 0., var2k = 0., var1p = 0., var2p = 0.; double sum_pt_weight = 0., sum_weight = 0., sum_pt_pt_weight = 0., var1_eff = 0., var2_eff = 0.; + int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); + sample = sample % 30; - int sample = histos.get(HIST("Rec/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; - - - - for (auto track : inputTracks) { - - nCh_all_bfcut += 1.; - histos.fill(HIST("Rec/hnch_all_bf_cut"), nCh_all_bfcut); - - // histos.fill(HIST("Rec/tracksel"), 1); - 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 ) - { nCh_eta++; - histos.fill(HIST("Rec/hnch_true"), nCh_eta); - } - - - if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) - { nCh_pt += 1.; - histos.fill(HIST("Rec/hnch_true_pt"), nCh_pt); - } - - - 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(); + for (auto track : inputTracks) { - nCh_all += 1.; - histos.fill(HIST("Rec/hnch_all"), nCh_all); - histos.fill(HIST("ptHistogram_allcharge_rec"), track.pt()); + nCh_all_bfcut += 1.; + histos.fill(HIST("Rec/hnch_all_bf_cut"), nCh_all_bfcut); + // histos.fill(HIST("Rec/tracksel"), 1); + histos.fill(HIST("Rec/hTPCchi2perCluster_before"), track.tpcChi2NCl()); + histos.fill(HIST("Rec/hITSchi2perCluster_before"), track.itsChi2NCl()); + histos.fill(HIST("Rec/hTPCCrossedrows_before"), track.tpcNClsCrossedRows()); - 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 (std::fabs(track.eta()) <= cEtacut) { + nCh_eta++; + histos.fill(HIST("Rec/hnch_true"), nCh_eta); + } + if (track.pt() >= cPtmincut && track.pt() <= cPtmaxcut) { + nCh_pt += 1.; + histos.fill(HIST("Rec/hnch_true_pt"), nCh_pt); + } - if (track.pt() >= 0.15 || track.pt() <= 2.0) //do not change this (it is for different pt work) - {nCh += 1.; + 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(); + + nCh_all += 1.; + histos.fill(HIST("Rec/hnch_all"), nCh_all); + histos.fill(HIST("ptHistogram_allcharge_rec"), 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() >= 0.15 || track.pt() <= 2.0) // do not change this (it is for different pt work) + { + nCh += 1.; Q1_old += track.pt(); Q2_old += (track.pt() * track.pt()); histos.fill(HIST("Rec/hnch"), nCh); - } - - Q1 += track.pt(); - Q2 += (track.pt() * track.pt()); + } + Q1 += track.pt(); + Q2 += (track.pt() * track.pt()); - if (abs(mcParticle.pdgCode()) == 211) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); - if (abs(mcParticle.pdgCode()) == 321) histos.fill(HIST("ptHistogramKaonrec_pdg"),track.pt()); - if (abs(mcParticle.pdgCode()) == 2212) histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); + if (abs(mcParticle.pdgCode()) == 211) + histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); + if (abs(mcParticle.pdgCode()) == 321) + histos.fill(HIST("ptHistogramKaonrec_pdg"), track.pt()); + if (abs(mcParticle.pdgCode()) == 2212) + histos.fill(HIST("ptHistogramProtonrec_pdg"), track.pt()); - if (cfgRejEl == false && rej_El(track)) { return; } + if (cfgRejEl == false && rej_El(track)) { + return; + } // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && abs(track.tpcNSigmaPi()) < 3.) @@ -1077,9 +1086,7 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; if (track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) histos.fill(HIST("Rec/NSigamaTPCproton"), track.pt(), track.tpcNSigmaPr()); - - - // only TOF tracks: Pion, Kaon, Proton + // only TOF tracks: Pion, Kaon, Proton if (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.) histos.fill(HIST("Rec/NSigamaTOFpion"), track.pt(), track.tofNSigmaPi()); if (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.) @@ -1087,13 +1094,15 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; if (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.) 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()); + 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() && abs(track.tpcNSigmaPi()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPi()) < 3.)) { @@ -1103,13 +1112,12 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hTOFbeta_afterselection"), track.p(), track.beta()); } - - - if(sel_pion(track)) - { - if (std::fabs(track.y()) > 0.5) continue; + if (sel_pion(track)) { + if (std::fabs(track.y()) > 0.5) + continue; - if (track.beta() > 1) continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramPionrec"), track.pt()); histos.fill(HIST("Rec/hPtPion"), track.pt()); @@ -1124,8 +1132,9 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (abs(track.mcParticle().pdgCode()) == 211) - { histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); } + if (abs(track.mcParticle().pdgCode()) == 211) { + histos.fill(HIST("ptHistogramPionrec_purity"), track.pt()); + } nChpi += 1.; Q1pi += track.pt(); @@ -1133,23 +1142,22 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("hPyPion_rec"), track.p(), track.rapidity(massPi)); histos.fill(HIST("hPtyPion_rec"), track.pt(), track.rapidity(massPi)); + } + //===========================kaon=============================================================== - } - -//===========================kaon=============================================================== - - if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { + if ((track.hasTPC() && abs(track.tpcNSigmaKa()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaKa()) < 3.)) { 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(sel_kaon(track)) - { - if (std::fabs(track.y()) > 0.5) continue; + if (sel_kaon(track)) { + if (std::fabs(track.y()) > 0.5) + continue; - if (track.beta() > 1) continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramKaonrec"), track.pt()); histos.fill(HIST("Rec/hPtKaon"), track.pt()); @@ -1164,8 +1172,9 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (abs(track.mcParticle().pdgCode()) == 321) - { histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); } + if (abs(track.mcParticle().pdgCode()) == 321) { + histos.fill(HIST("ptHistogramKaonrec_purity"), track.pt()); + } nChk += 1.; Q1k += track.pt(); @@ -1173,23 +1182,23 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("hPyKaon_rec"), track.p(), track.rapidity(massKa)); histos.fill(HIST("hPtyKaon_rec"), track.pt(), track.rapidity(massKa)); - } - - //============================proton=========================================================== + } + //============================proton=========================================================== - if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { + if ((track.hasTPC() && abs(track.tpcNSigmaPr()) < 3.) && (track.hasTOF() && abs(track.tofNSigmaPr()) < 3.)) { 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(sel_proton(track)) - { - if (std::fabs(track.y()) > 0.5) continue; + if (sel_proton(track)) { + if (std::fabs(track.y()) > 0.5) + continue; - if (track.beta() > 1) continue; + if (track.beta() > 1) + continue; histos.fill(HIST("ptHistogramProtonrec"), track.pt()); histos.fill(HIST("Rec/hPtProton"), track.pt()); @@ -1204,8 +1213,9 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hdEdx_afterselection1"), track.p(), track.tpcSignal()); histos.fill(HIST("Rec/hTOFbeta_afterselection1"), track.p(), track.beta()); - if (abs(track.mcParticle().pdgCode()) == 2212) - { histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); } + if (abs(track.mcParticle().pdgCode()) == 2212) { + histos.fill(HIST("ptHistogramProtonrec_purity"), track.pt()); + } nChp += 1.; Q1p += track.pt(); @@ -1213,69 +1223,63 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; 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, nCh_all); - - if (nCh >= 2.0) - { - var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); - var2_old = (Q1_old / nCh); - } - + } + } // loop over tracks + histos.fill(HIST("Rec/hcent_nacc"), cent, nCh_all); - if (nCh_all < 2.0) return; - var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); - var2 = (Q1 / nCh_all); + if (nCh >= 2.0) { + var1_old = (Q1_old * Q1_old - Q2_old) / (nCh * (nCh - 1)); + var2_old = (Q1_old / nCh); + } + if (nCh_all < 2.0) + return; + var1 = (Q1 * Q1 - Q2) / (nCh_all * (nCh_all - 1)); + var2 = (Q1 / nCh_all); - - 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); + 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); twopar_allcharge = (var1 - var2); histos.fill(HIST("Rec/hVar"), nCh_all, twopar_allcharge); //---------------------- pions ---------------------------------------- - if (nChpi >= 2.0) { + if (nChpi >= 2.0) { var1pi = (Q1pi * Q1pi - Q2pi) / (nChpi * (nChpi - 1)); var2pi = (Q1pi / nChpi); - } + } //----------------------- kaons --------------------------------------- - if (nChk >= 2.0) { + if (nChk >= 2.0) { var1k = (Q1k * Q1k - Q2k) / (nChk * (nChk - 1)); var2k = (Q1k / nChk); - } + } //---------------------------- protons ---------------------------------- - if (nChp >= 2.0) { + if (nChp >= 2.0) { var1p = (Q1p * Q1p - Q2p) / (nChp * (nChp - 1)); var2p = (Q1p / nChp); - } - //========================centrality========================================== + } + //========================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/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, var1k); - histos.fill(HIST("Rec/hVar2k"), sample, cent, var2k); - histos.fill(HIST("Rec/hVar2meanptk"), cent, var2k); + histos.fill(HIST("Rec/hVar1k"), sample, cent, var1k); + histos.fill(HIST("Rec/hVar2k"), sample, cent, var2k); + histos.fill(HIST("Rec/hVar2meanptk"), cent, var2k); - histos.fill(HIST("Rec/hVar1p"), sample, cent, var1p); - histos.fill(HIST("Rec/hVar2p"), sample, cent, var2p); - histos.fill(HIST("Rec/hVar2meanptp"), cent, var2p); + histos.fill(HIST("Rec/hVar1p"), sample, cent, var1p); + histos.fill(HIST("Rec/hVar2p"), sample, cent, var2p); + histos.fill(HIST("Rec/hVar2meanptp"), cent, var2p); //-----------------------nch------------------------------------- - histos.fill(HIST("Rec/hVar1x"), sample, nCh_all, var1); histos.fill(HIST("Rec/hVar2x"), sample, nCh_all, var2); histos.fill(HIST("Rec/hVarx"), sample, nCh_all); @@ -1294,130 +1298,122 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("Rec/hVar1px"), sample, nCh_all, var1p); histos.fill(HIST("Rec/hVar2px"), sample, nCh_all, var2p); histos.fill(HIST("Rec/hVarpx"), sample, nChp); - histos.fill(HIST("Rec/hVar2meanptpx"), nCh_all, var2p); - + histos.fill(HIST("Rec/hVar2meanptpx"), nCh_all, var2p); -//================= generated levels============================== - const auto& mccolgen = coll.mcCollision_as(); - if (std::abs(mccolgen.posZ()) > cVtxZcut) { return; } + //================= generated levels============================== + 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 nCh_gen = 0., nCh_gen_all = 0., nCh_gen_true = 0.; double nChpi_gen = 0., nChk_gen = 0., nChp_gen = 0.; double nCh1 = 0., nCh2 = 0., nCh3 = 0., nCh4 = 0.; - + double Q1_gen = 0, Q2_gen = 0., Q1_gen_old = 0., Q2_gen_old = 0.; - double Q1pi_gen = 0, Q2pi_gen = 0, Q1k_gen = 0, Q2k_gen = 0, Q1p_gen = 0, Q2p_gen = 0 ; - + double Q1pi_gen = 0, Q2pi_gen = 0, Q1k_gen = 0, Q2k_gen = 0, Q1p_gen = 0, Q2p_gen = 0; + double var1_gen = 0, var2_gen = 0., var1_gen_old = 0., var2_gen_old = 0.; double var1pi_gen = 0, var2pi_gen = 0, var1k_gen = 0, var2k_gen = 0, var1p_gen = 0, var2p_gen = 0; - - int sample_gen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); - sample_gen = sample_gen % 30; - - - for (const auto& mcpart:mcpartgen){ - auto pdgcode = std::abs(mcpart.pdgCode()); - if(!mcpart.isPhysicalPrimary()) {continue;} - nCh1++ ; - histos.fill(HIST("hnch1"), nCh1); -// if (!(pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == -211 || pdgcode == -321 || pdgcode == -2212 || pdgcode == 11 || pdgcode == 13)) continue; - nCh2++ ; + int sample_gen = histos.get(HIST("hVtxZ_after_gen"))->GetEntries(); + sample_gen = sample_gen % 30; - histos.fill(HIST("hnch2"), nCh2); + for (const auto& mcpart : mcpartgen) { + auto pdgcode = std::abs(mcpart.pdgCode()); - nCh3++ ; - histos.fill(HIST("hnch3"), nCh3); + if (!mcpart.isPhysicalPrimary()) { + continue; + } + nCh1++; + histos.fill(HIST("hnch1"), nCh1); + // if (!(pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == -211 || pdgcode == -321 || pdgcode == -2212 || pdgcode == 11 || pdgcode == 13)) continue; + 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; - nCh_gen_true++; - histos.fill(HIST("hnch_gen_true"), nCh_gen_true); + 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; + nCh_gen_true++; + histos.fill(HIST("hnch_gen_true"), nCh_gen_true); - 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()); + histos.fill(HIST("hPt_gen"), mcpart.pt()); + histos.fill(HIST("hEta_gen"), mcpart.eta()); + histos.fill(HIST("ptHistogram_allcharge_gen"), mcpart.pt()); - nCh_gen_all += 1.; - Q1_gen += mcpart.pt(); - Q2_gen += (mcpart.pt() * mcpart.pt()); - - histos.fill(HIST("hnch_gen_all"), nCh_gen_all); + nCh_gen_all += 1.; + Q1_gen += mcpart.pt(); + Q2_gen += (mcpart.pt() * mcpart.pt()); - if (std::fabs(mcpart.y()) < 0.5) - { - if (mcpart.pdgCode() == 211 || mcpart.pdgCode() == -211 ) - { - histos.fill(HIST("ptHistogramPion"), mcpart.pt()); - nChpi_gen += 1.; - Q1pi_gen += mcpart.pt(); - Q2pi_gen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pi"), nChpi_gen); + histos.fill(HIST("hnch_gen_all"), nCh_gen_all); + if (std::fabs(mcpart.y()) < 0.5) { + if (mcpart.pdgCode() == 211 || mcpart.pdgCode() == -211) { + histos.fill(HIST("ptHistogramPion"), mcpart.pt()); + nChpi_gen += 1.; + Q1pi_gen += mcpart.pt(); + Q2pi_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pi"), nChpi_gen); } - if (mcpart.pdgCode() == 321 || mcpart.pdgCode() == -321) - { - histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); - nChk_gen += 1.; - Q1k_gen += mcpart.pt(); - Q2k_gen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_ka"), nChk_gen); - - + if (mcpart.pdgCode() == 321 || mcpart.pdgCode() == -321) { + histos.fill(HIST("ptHistogramKaon"), mcpart.pt()); + nChk_gen += 1.; + Q1k_gen += mcpart.pt(); + Q2k_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_ka"), nChk_gen); } - if (mcpart.pdgCode() == 2212 || mcpart.pdgCode() == -2212) - { - histos.fill(HIST("ptHistogramProton"), mcpart.pt()); - nChp_gen += 1.; - Q1p_gen += mcpart.pt(); - Q2p_gen += (mcpart.pt() * mcpart.pt()); - histos.fill(HIST("hnch_pr"), nChp_gen); - + if (mcpart.pdgCode() == 2212 || mcpart.pdgCode() == -2212) { + histos.fill(HIST("ptHistogramProton"), mcpart.pt()); + nChp_gen += 1.; + Q1p_gen += mcpart.pt(); + Q2p_gen += (mcpart.pt() * mcpart.pt()); + histos.fill(HIST("hnch_pr"), nChp_gen); } - }//|y| < 0.5 cut ends! + } //|y| < 0.5 cut ends! - }//particle - histos.fill(HIST("hcent_nacc_gen"), cent, nCh_gen); - - - if (nCh_gen_all < 2.0) return; - var1_gen = (Q1_gen * Q1_gen - Q2_gen) / (nCh_gen_all * (nCh_gen_all - 1)); - var2_gen = (Q1_gen / nCh_gen_all); + } // particle + histos.fill(HIST("hcent_nacc_gen"), cent, nCh_gen); - if (nChpi_gen >= 2.0) - { + if (nCh_gen_all < 2.0) + return; + var1_gen = (Q1_gen * Q1_gen - Q2_gen) / (nCh_gen_all * (nCh_gen_all - 1)); + var2_gen = (Q1_gen / nCh_gen_all); + + if (nChpi_gen >= 2.0) { var1pi_gen = (Q1pi_gen * Q1pi_gen - Q2pi_gen) / (nChpi_gen * (nChpi_gen - 1)); var2pi_gen = (Q1pi_gen / nChpi_gen); } //----------------------- kaons --------------------------------------- - if (nChk_gen >= 2.0) - { + if (nChk_gen >= 2.0) { var1k_gen = (Q1k_gen * Q1k_gen - Q2k_gen) / (nChk_gen * (nChk_gen - 1)); var2k_gen = (Q1k_gen / nChk_gen); } //---------------------------- protons ---------------------------------- - if (nChp_gen >= 2.0) - { + if (nChp_gen >= 2.0) { var1p_gen = (Q1p_gen * Q1p_gen - Q2p_gen) / (nChp_gen * (nChp_gen - 1)); var2p_gen = (Q1p_gen / nChp_gen); } @@ -1444,10 +1440,8 @@ Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; histos.fill(HIST("hVarpx_gen"), sample_gen, nChp_gen); histos.fill(HIST("hVar2meanptpx_gen"), nCh_gen_all, var2p_gen); - - } //void process -PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMcReco, "Process reconstructed", true); - + } // void process + PROCESS_SWITCH(IdentifiedMeanPtFluctuations, processMcReco, "Process reconstructed", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) @@ -1455,5 +1449,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } - -