diff --git a/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx b/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx deleted file mode 100644 index 5710ab1e864..00000000000 --- a/PWGCF/EbyEFluctuations/Tasks/Diff_pT_fluct_PID.cxx +++ /dev/null @@ -1,760 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. -/// -/// \brief This task provides the parameters required to calculate the observable -/// v0(pT) along with its statistical uncertainity using subsampling technique. -/// \author Anna Binoy (anna.binoy@niser.ac.in) - -#include -#include -#include -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/StaticFor.h" - -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "TList.h" -#include "TProfile.h" -#include "TProfile2D.h" -#include "TH2D.h" -#include "TH1D.h" -#include "TRandom3.h" -#include "TMath.h" -#include "TF1.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace std; - -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; - -double massPi = TDatabasePDG::Instance()->GetParticle(211)->Mass(); -double massKa = TDatabasePDG::Instance()->GetParticle(321)->Mass(); -double massPr = TDatabasePDG::Instance()->GetParticle(2212)->Mass(); - -struct Diff_pT_fluct_PID { - // Histogram registry: an object to hold your histograms - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - std::vector>> Subsample; - TRandom3* fRndm = new TRandom3(0); - - Configurable nPtBins_qa{"nBinsPt_qa", 280, "N bins in pT histo qualitative analysis"}; - - Configurable nPtBins{"nBinsPt", 14, "N bins in pT histo"}; - Configurable nEtaBins{"nEtaBins", 100, ""}; - - Configurable ptMax{"ptMax", 3.0, "maximum pT"}; - Configurable ptMin{"ptMin", 0.2, "minimum pT"}; - - Configurable etaMin{"etaMin", 0.4, "Eta min"}; - Configurable etaCut{"etaCut", 0.8, "Eta cut"}; - Configurable rapCut{"rapCut", 0.5, "Rapidity Cut"}; - - Configurable cfgCutPtUpperTPC{"cfgCutPtUpperTPC", 0.6f, "Upper pT cut for PID using TPC only"}; - Configurable cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"}; - Configurable cfgnSigmaCut{"cfgnSigmaCut", 2.0f, "PID nSigma cut"}; - - Configurable cfgnSigmaCut_TPC_pi{"cfgnSigmaCut_TPC_pi", 2.0f, "PID nSigma cut for TPC for pion"}; - Configurable cfgnSigmaCut_TOF_pi{"cfgnSigmaCut_TOF_pi", 3.0f, "PID nSigma cut for TOF for pion"}; - Configurable cfgnSigmaCut_TPC_ka{"cfgnSigmaCut_TPC_ka", 2.0f, "PID nSigma cut for TPC for kaon"}; - Configurable cfgnSigmaCut_TOF_ka{"cfgnSigmaCut_TOF_ka", 3.0f, "PID nSigma cut for TOF for kaon"}; - Configurable cfgnSigmaCut_TPC_pr{"cfgnSigmaCut_TPC_pr", 2.0f, "PID nSigma cut for TPC for proton"}; - Configurable cfgnSigmaCut_TOF_pr{"cfgnSigmaCut_TOF_pr", 3.0f, "PID nSigma cut for TOF for proton"}; - - // QualityCuts - - Configurable dcaXYCut{"dcaXYCut", 0.2, "DCAxy cut"}; - Configurable dcaZCut{"dcaZCut", 2.0, "DCAz cut"}; - Configurable posZCut{"posZCut", 10.0, "cut for vertex Z"}; - - Configurable TPCNCrossedRowsCut{"TPCNCrossedRowsCut", 2.5, "n_TPC crossed rows Cut"}; - Configurable chi2TPCperClstrCut{"chi2TPCperClstrCut", 4, "Chi2 TPC per Cluster Cut"}; - Configurable chi2ITSperClstrCut{"chi2ITSperClstrCut", 36, "Chi2 ITS per Cluster Cut"}; - - ConfigurableAxis dcaXYBins{"dcaXYBins", {100, -0.15, 0.15}, "dcaXY bins"}; - ConfigurableAxis dcaZBins{"dcaZBins", {100, -1.2, 1.2}, "dcaZ bins"}; - - O2_DEFINE_CONFIGURABLE(cfgUse22sEventCut, bool, true, "Use 22s event cut on mult correlations") - - // Connect to ccdb - Service ccdb; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; - - // for the sub-sampling - Configurable cfgNSubsample{"cfgNSubsample", 10, "Number of subsamples"}; - - // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - - // This is an example of a convenient declaration of "using" - using MyAllTracks = soa::Join; - using MyRun2Collisions = soa::Join; - using MyRun3Collisions = soa::Join; - - void init(InitContext const&) - { - - const AxisSpec axisEvents{5, 0, 5, "Counts"}; - const AxisSpec axisEta{nEtaBins, -1., +1., "#eta"}; - const AxisSpec axisY{nEtaBins, -1., +1., "Rapidity"}; - const AxisSpec axisPt{nPtBins, 0.2, 3., "p_{T} (GeV/c)"}; - const AxisSpec axisPt_qa{nPtBins_qa, 0.2, 3., "p_{T} (GeV/c)"}; - const AxisSpec axisP{nPtBins, 0.2, 3., "p (GeV/c)"}; - const AxisSpec axisCent{100, 0., 100, ""}; - const AxisSpec axis1Bin{1, 0., 1, ""}; - - const AxisSpec axisNumberOfHadronEtaLess0{3000, 0, 3000, "Number of proton eta less than 0"}; - const AxisSpec axisNumberOfProtonEtaLess0{3000, 0, 3000, "Number of proton eta less than 0"}; - const AxisSpec axisNumberOfPionEtaLess0{3000, 0, 3000, "Number of pion eta less than 0"}; - const AxisSpec axisNumberOfKaonEtaLess0{3000, 0, 3000, "Number of kaon eta less than 0"}; - - const AxisSpec axisVtxZ{80, -20., 20., "V_{Z} (cm)"}; - const AxisSpec axisDCAz{dcaZBins, "DCA_{Z} (cm)"}; - const AxisSpec axisDCAxy{dcaXYBins, "DCA_{XY} (cm)"}; - const AxisSpec axisTPCNsigma{500, -5., 5., "n #sigma_{TPC}"}; - const AxisSpec axisTOFNsigma{500, -5., 5., "n #sigma_{TOF}"}; - const AxisSpec axisTPCTOFNsigma{800, -8., 8., "n #sigma_{TOF+TPC}"}; - const AxisSpec axisTPCSignal{720, 20., 200., "#frac{dE}{dx}"}; - const AxisSpec axisTOFSignal{400, 0.2, 1.2, "TOF #beta"}; - const AxisSpec axisChi2{50, 0., 50., "Chi2"}; - const AxisSpec axisCrossedTPC{500, 0, 500, "Crossed TPC"}; - - HistogramConfigSpec TOFnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTOFNsigma}}); - HistogramConfigSpec TOFSignalHist({HistType::kTH2D, {axisPt_qa, axisTOFSignal}}); - HistogramConfigSpec TPCnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTPCNsigma}}); - HistogramConfigSpec TPCSignalHist({HistType::kTH2D, {axisPt_qa, axisTPCSignal}}); - HistogramConfigSpec TPCTOFHist({HistType::kTH2D, {axisTPCNsigma, axisTOFNsigma}}); - HistogramConfigSpec TPCTOFnSigmaHist({HistType::kTH2D, {axisPt_qa, axisTPCTOFNsigma}}); - - histos.add("fA_hadron", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_pion", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_kaon", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fA_proton", "", kTProfile2D, {axisCent, axisPt}); - - histos.add("fB1_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB1_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - histos.add("fB2_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fB2_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - histos.add("fC_hadron", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_pion", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_kaon", "", kTProfile2D, {axisCent, axisPt}); - histos.add("fC_proton", "", kTProfile2D, {axisCent, axisPt}); - - histos.add("fD_hadron", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_pion", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_kaon", "", kTProfile2D, {axisCent, axis1Bin}); - histos.add("fD_proton", "", kTProfile2D, {axisCent, axis1Bin}); - - // QA Plots: - histos.add("QA/before/h_VtxZ", "V_{Z}", kTH1D, {axisVtxZ}); - histos.add("QA/before/h_TPCChi2perCluster", "TPC #Chi^{2}/Cluster", kTH1D, {axisChi2}); - histos.add("QA/before/h_ITSChi2perCluster", "ITS #Chi^{2}/Cluster", kTH1D, {axisChi2}); - histos.add("QA/before/h_crossedTPC", "Crossed TPC", kTH1D, {axisCrossedTPC}); - histos.add("QA/before/h2_DcaZ", "DCA_{Z}", kTH1D, {axisDCAz}); - histos.add("QA/before/h2_DcaXY", "DCA_{XY}", kTH1D, {axisDCAxy}); - histos.add("QA/before/h2_TPCSignal", "TPC Signal", TPCSignalHist); - histos.add("QA/before/h2_TOFSignal", "TOF Signal", TOFSignalHist); - - histos.addClone("QA/before/", "QA/after/"); - - histos.add("QA/Pion/h_Pt", "p_{T} (TPC & TPC+TOF)", kTH1D, {axisPt_qa}); - histos.add("QA/Pion/h_rap", "y (TPC & TPC+TOF)", kTH1D, {axisY}); - histos.add("QA/Pion/h2_Pt_rap", "p_{T} vs y", kTH2D, {{axisY}, {axisPt_qa}}); - histos.add("QA/Pion/h2_DcaZ", "DCA_{z}", kTH2D, {{axisPt_qa}, {axisDCAz}}); - histos.add("QA/Pion/h2_DcaXY", "DCA_{xy}", kTH2D, {{axisPt_qa}, {axisDCAxy}}); - - histos.add("QA/Pion/before/h2_TPCNsigma", "n #sigma_{TPC}", TPCnSigmaHist); - histos.add("QA/Pion/before/h2_TOFNsigma", "n #sigma_{TOF}", TOFnSigmaHist); - histos.add("QA/Pion/before/h2_TpcTofNsigma", "n #sigma_{TPC} vs n #sigma_{TOF}", TPCTOFHist); - histos.add("QA/Pion/before/h2_TpcTofNsigma1", "n #sigma_{TPC+TOF}", TPCTOFnSigmaHist); - - histos.add("QA/Pion/h2_TPCNsigma", "n #sigma_{TPC}", TPCnSigmaHist); - histos.add("QA/Pion/h2_TOFNsigma", "n #sigma_{TOF}", TOFnSigmaHist); - histos.add("QA/Pion/h2_TpcTofNsigma", "n #sigma_{TPC} vs n #sigma_{TOF}", TPCTOFHist); - histos.add("QA/Pion/h2_TpcTofNsigma1", "n #sigma_{TPC+TOF}", TPCTOFnSigmaHist); - - histos.add("QA/Pion/h2_TPCSignal", "TPC Signal vs pT", TPCSignalHist); - histos.add("QA/Pion/h2_TOFSignal", "TOF Signal vs pT", TOFSignalHist); - histos.add("QA/Pion/h2_ExpTPCSignal", "Expected TPC Signal vs pT", TPCSignalHist); - - histos.addClone("QA/Pion/", "QA/Kaon/"); - histos.addClone("QA/Pion/", "QA/Proton/"); - - // Define Subsamples - Subsample.resize(cfgNSubsample); - for (int i = 0; i < cfgNSubsample; i++) { - Subsample[i].resize(20); - } - for (int i = 0; i < cfgNSubsample; i++) { - Subsample[i][0] = std::get>(histos.add(Form("Subsample_%d/fA_hadron", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][1] = std::get>(histos.add(Form("Subsample_%d/fA_pion", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][2] = std::get>(histos.add(Form("Subsample_%d/fA_kaon", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][3] = std::get>(histos.add(Form("Subsample_%d/fA_proton", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - - Subsample[i][4] = std::get>(histos.add(Form("Subsample_%d/fB1_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][5] = std::get>(histos.add(Form("Subsample_%d/fB1_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][6] = std::get>(histos.add(Form("Subsample_%d/fB1_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][7] = std::get>(histos.add(Form("Subsample_%d/fB1_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - - Subsample[i][8] = std::get>(histos.add(Form("Subsample_%d/fB2_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][9] = std::get>(histos.add(Form("Subsample_%d/fB2_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][10] = std::get>(histos.add(Form("Subsample_%d/fB2_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][11] = std::get>(histos.add(Form("Subsample_%d/fB2_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - - Subsample[i][12] = std::get>(histos.add(Form("Subsample_%d/fC_hadron", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][13] = std::get>(histos.add(Form("Subsample_%d/fC_pion", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][14] = std::get>(histos.add(Form("Subsample_%d/fC_kaon", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - Subsample[i][15] = std::get>(histos.add(Form("Subsample_%d/fC_proton", i), "", {HistType::kTProfile2D, {axisCent, axisPt}})); - - Subsample[i][16] = std::get>(histos.add(Form("Subsample_%d/fD_hadron", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][17] = std::get>(histos.add(Form("Subsample_%d/fD_pion", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][18] = std::get>(histos.add(Form("Subsample_%d/fD_kaon", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - Subsample[i][19] = std::get>(histos.add(Form("Subsample_%d/fD_proton", i), "", {HistType::kTProfile2D, {axisCent, axis1Bin}})); - } - } - - template - bool selRun2Col(T const& col) - { - if (std::abs(col.posZ()) > posZCut) - return false; - - if (!col.sel7()) - return false; - - if (!col.alias_bit(kINT7)) - return false; - - return true; - } - - template - bool selRun3Col(T const& col) - { - if (std::abs(col.posZ()) > posZCut) - return false; - - if (!col.sel8()) - return false; - - return true; - } - - template - bool selTrack(T const& track) - { - - // kinematic cuts - - if (track.pt() < ptMin) - return false; - - if (track.pt() > ptMax) - return false; - - if (std::abs(track.eta()) > etaCut) - return false; - - if (std::abs(track.dcaZ()) > dcaZCut) - return false; - - if (std::abs(track.dcaXY()) > dcaXYCut) - return false; - - if (track.tpcChi2NCl() > chi2TPCperClstrCut) - return false; - - if (track.itsChi2NCl() > chi2ITSperClstrCut) - return false; - - if (track.tpcNClsCrossedRows() > TPCNCrossedRowsCut) - return false; - - if (!track.isGlobalTrack()) - return false; - - return true; - } - - template - bool selPions(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - if (track.pt() <= cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pi) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pi) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_pi) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_pi) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_pi) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaPi < cfgnSigmaCut_TOF_pi) - return true; - } - - return false; - } - - template - bool selKaons(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - if (track.pt() <= cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_ka) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_ka) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_ka) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_ka) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_ka) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaKa < cfgnSigmaCut_TOF_ka) - return true; - } - - return false; - } - - template - bool selProtons(T const& track) - { - const float combNSigmaPi = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - // if (abs(track.rapidity(massPr)) < 0.5) - // return true; - if (track.pt() <= cfgCutPtUpperTPC && track.pt() > 0.4) { - Int_t flag = 0; - if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaKa()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (track.hasTPC() && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pr) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && std::abs(track.tpcNSigmaPr()) < cfgnSigmaCut_TPC_pr) - return true; - - } else if (track.pt() > cfgCutPtUpperTPC) { - Int_t flag = 0; - if (track.hasTOF() && track.hasTPC() && combNSigmaPi < cfgnSigmaCut_TOF_pr) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaKa < cfgnSigmaCut_TOF_pr) - flag += 1; - if (track.hasTOF() && track.hasTPC() && combNSigmaPr < cfgnSigmaCut_TOF_pr) - flag += 1; - if (flag > 1) - return false; - else if (flag == 1 && combNSigmaPr < cfgnSigmaCut_TOF_pr) - return true; - } - - return false; - } - - void process(MyRun3Collisions::iterator const& col, MyAllTracks const& tracks) - { - double Cent_FT0M = 0; - - if (selRun3Col(col)) { - - Cent_FT0M = col.centFT0M(); - - Double_t pT_bin[14] = {0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9}; - - Double_t N_Pi_eta_less_0 = 0; - Double_t N_Ka_eta_less_0 = 0; - Double_t N_Pr_eta_less_0 = 0; - Double_t Nch_eta_less_0 = 0; - - Double_t pT_sum_etaLess0 = 0; - Double_t pT_sum_etaGreaterEtamin = 0; - Double_t N_sum_etaGreaterEtamin = 0; - - Double_t pt_Ch = 0, pt_Pi = 0, pt_Ka = 0, pt_Pr = 0; - - Double_t fA_hadron[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_pion[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_kaon[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fA_proton[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - Double_t fB1_hadron = 0; - Double_t fB1_pion = 0; - Double_t fB1_kaon = 0; - Double_t fB1_proton = 0; - - Double_t fB2_hadron = 0; - Double_t fB2_pion = 0; - Double_t fB2_kaon = 0; - Double_t fB2_proton = 0; - - Double_t fC_hadron[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_pion[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_kaon[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - Double_t fC_proton[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - Double_t fD_hadron = 0; - Double_t fD_pion = 0; - Double_t fD_kaon = 0; - Double_t fD_proton = 0; - - // normal creation of a histogram - TH1D* fPt_profile = new TH1D("fPt_profile", "fPt_profile", 14, 0.2, 3); - TH1D* fPt_profile_pion = new TH1D("fPt_profile_pion", "fPt_profile_pion", 14, 0.2, 3); - TH1D* fPt_profile_kaon = new TH1D("fPt_profile_kaon", "fPt_profile_kaon", 14, 0.2, 3); - TH1D* fPt_profile_proton = new TH1D("fPt_profile_proton", "fPt_profile_proton", 14, 0.2, 3); - - for (auto& track : tracks) { - - histos.fill(HIST("QA/before/h2_DcaXY"), track.dcaXY()); - histos.fill(HIST("QA/before/h2_DcaZ"), track.dcaZ()); - histos.fill(HIST("QA/before/h_VtxZ"), col.posZ()); - - histos.fill(HIST("QA/before/h_TPCChi2perCluster"), track.tpcChi2NCl()); - histos.fill(HIST("QA/before/h_ITSChi2perCluster"), track.itsChi2NCl()); - histos.fill(HIST("QA/before/h_crossedTPC"), track.tpcNClsCrossedRows()); - - if (selTrack(track)) - continue; - - histos.fill(HIST("QA/after/h2_DcaXY"), track.dcaXY()); - histos.fill(HIST("QA/after/h2_DcaZ"), track.dcaZ()); - - histos.fill(HIST("QA/after/h_TPCChi2perCluster"), track.tpcChi2NCl()); - histos.fill(HIST("QA/after/h_ITSChi2perCluster"), track.itsChi2NCl()); - histos.fill(HIST("QA/after/h_crossedTPC"), track.tpcNClsCrossedRows()); - - histos.fill(HIST("QA/before/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/before/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - histos.fill(HIST("QA/Pion/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST("QA/Pion/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/before/h2_TpcTofNsigma"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - - histos.fill(HIST("QA/Proton/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST("QA/Proton/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/before/h2_TpcTofNsigma"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - - histos.fill(HIST("QA/Kaon/before/h2_TPCNsigma"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST("QA/Kaon/before/h2_TOFNsigma"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/before/h2_TpcTofNsigma"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - - const float combNSigmaPi1 = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - const float combNSigmaKa1 = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - const float combNSigmaPr1 = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - histos.fill(HIST("QA/Pion/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaPi1); - histos.fill(HIST("QA/Kaon/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaKa1); - histos.fill(HIST("QA/Proton/before/h2_TpcTofNsigma1"), track.pt(), combNSigmaPr1); - - if (track.eta() < 0) { - Nch_eta_less_0++; - pt_Ch = track.pt(); - - pT_sum_etaLess0 += pt_Ch; - fPt_profile->Fill(pt_Ch); - - // For Pions: - if (selPions(track)) { - N_Pi_eta_less_0++; - pt_Pi = track.pt(); - - fPt_profile_pion->Fill(pt_Pi); - - // QA - histos.fill(HIST("QA/Pion/h_Pt"), track.pt()); - histos.fill(HIST("QA/Pion/h_rap"), track.rapidity(massPi)); - histos.fill(HIST("QA/Pion/h2_Pt_rap"), track.rapidity(massPi), track.pt()); - histos.fill(HIST("QA/Pion/h2_DcaXY"), track.pt(), track.dcaXY()); - histos.fill(HIST("QA/Pion/h2_DcaZ"), track.pt(), track.dcaZ()); - - histos.fill(HIST("QA/Pion/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TOFNsigma"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TpcTofNsigma"), track.tpcNSigmaPi(), track.tofNSigmaPi()); - histos.fill(HIST("QA/Pion/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Pion/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Pion/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalPi(track.tpcSignal())); - - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - const float combNSigmaPi2 = std::sqrt(pow(track.tpcNSigmaPi(), 2.0) + pow(track.tofNSigmaPi(), 2.0)); - - histos.fill(HIST("QA/Pion/h2_TpcTofNsigma1"), track.pt(), combNSigmaPi2); - } - - // For Kaons: - if (selKaons(track)) { - N_Ka_eta_less_0++; - pt_Ka = track.pt(); - - fPt_profile_kaon->Fill(pt_Ka); - - // QA - - histos.fill(HIST("QA/Kaon/h_Pt"), track.pt()); - histos.fill(HIST("QA/Kaon/h_rap"), track.rapidity(massKa)); - histos.fill(HIST("QA/Kaon/h2_Pt_rap"), track.rapidity(massKa), track.pt()); - histos.fill(HIST("QA/Kaon/h2_DcaXY"), track.pt(), track.dcaXY()); - histos.fill(HIST("QA/Kaon/h2_DcaZ"), track.pt(), track.dcaZ()); - - histos.fill(HIST("QA/Kaon/h2_TPCNsigma"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TOFNsigma"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TpcTofNsigma"), track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("QA/Kaon/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Kaon/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Kaon/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalKa(track.tpcSignal())); - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - - const float combNSigmaKa2 = std::sqrt(pow(track.tpcNSigmaKa(), 2.0) + pow(track.tofNSigmaKa(), 2.0)); - - histos.fill(HIST("QA/Kaon/h2_TpcTofNsigma1"), track.pt(), combNSigmaKa2); - } - - // For Protons: - if (selProtons(track)) { - N_Pr_eta_less_0++; - pt_Pr = track.pt(); - - fPt_profile_proton->Fill(pt_Pr); - - // QA - - histos.fill(HIST("QA/Proton/h_Pt"), track.pt()); - histos.fill(HIST("QA/Proton/h_rap"), track.rapidity(massPr)); - histos.fill(HIST("QA/Proton/h2_Pt_rap"), track.rapidity(massPr), track.pt()); - histos.fill(HIST("QA/Proton/h2_DcaZ"), track.pt(), track.dcaZ()); - histos.fill(HIST("QA/Proton/h2_DcaXY"), track.pt(), track.dcaXY()); - - histos.fill(HIST("QA/Proton/h2_TPCNsigma"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TOFNsigma"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TpcTofNsigma"), track.tpcNSigmaPr(), track.tofNSigmaPr()); - histos.fill(HIST("QA/Proton/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/Proton/h2_TOFSignal"), track.pt(), track.beta()); - histos.fill(HIST("QA/Proton/h2_ExpTPCSignal"), track.pt(), track.tpcExpSignalPr(track.tpcSignal())); - histos.fill(HIST("QA/after/h2_TPCSignal"), track.pt(), track.tpcSignal()); - histos.fill(HIST("QA/after/h2_TOFSignal"), track.pt(), track.beta()); - - const float combNSigmaPr2 = std::sqrt(pow(track.tpcNSigmaPr(), 2.0) + pow(track.tofNSigmaPr(), 2.0)); - - histos.fill(HIST("QA/Proton/h2_TpcTofNsigma1"), track.pt(), combNSigmaPr2); - } - - } else if (track.eta() > etaMin) { - pT_sum_etaGreaterEtamin += pt_Ch; - N_sum_etaGreaterEtamin++; - } - } - - // selecting subsample and filling profiles - float l_Random = fRndm->Rndm(); - int SampleIndex = static_cast(cfgNSubsample * l_Random); - - // B1, B2, and D Calculation for hadrons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0) { - fB1_hadron = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_hadron"), Cent_FT0M, 0.5, fB1_hadron); - Subsample[SampleIndex][4]->Fill(Cent_FT0M, 0.5, fB1_hadron); - - fB2_hadron = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_hadron"), Cent_FT0M, 0.5, fB2_hadron); - Subsample[SampleIndex][8]->Fill(Cent_FT0M, 0.5, fB2_hadron); - - fD_hadron = fB1_hadron * fB2_hadron; - histos.fill(HIST("fD_hadron"), Cent_FT0M, 0.5, fD_hadron); - Subsample[SampleIndex][16]->Fill(Cent_FT0M, 0.5, fD_hadron); - } - - // B1, B2, and D Calculation for pions - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Pi_eta_less_0 != 0) { - fB1_pion = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_pion"), Cent_FT0M, 0.5, fB1_pion); - Subsample[SampleIndex][5]->Fill(Cent_FT0M, 0.5, fB1_pion); - - fB2_pion = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_pion"), Cent_FT0M, 0.5, fB2_pion); - Subsample[SampleIndex][9]->Fill(Cent_FT0M, 0.5, fB2_pion); - - fD_pion = fB1_pion * fB2_pion; - histos.fill(HIST("fD_pion"), Cent_FT0M, 0.5, fD_pion); - Subsample[SampleIndex][17]->Fill(Cent_FT0M, 0.5, fD_pion); - } - - // B1, B2, and D Calculation for kaons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Ka_eta_less_0 != 0) { - fB1_kaon = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_kaon"), Cent_FT0M, 0.5, fB1_kaon); - Subsample[SampleIndex][6]->Fill(Cent_FT0M, 0.5, fB1_kaon); - - fB2_kaon = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_kaon"), Cent_FT0M, 0.5, fB2_kaon); - Subsample[SampleIndex][10]->Fill(Cent_FT0M, 0.5, fB2_kaon); - - fD_kaon = fB1_kaon * fB2_kaon; - histos.fill(HIST("fD_kaon"), Cent_FT0M, 0.5, fD_kaon); - Subsample[SampleIndex][18]->Fill(Cent_FT0M, 0.5, fD_kaon); - } - - // B1, B2, and D Calculation for protons - if (N_sum_etaGreaterEtamin != 0 && Nch_eta_less_0 != 0 && N_Pr_eta_less_0 != 0) { - fB1_proton = pT_sum_etaLess0 / Nch_eta_less_0; - histos.fill(HIST("fB1_proton"), Cent_FT0M, 0.5, fB1_proton); - Subsample[SampleIndex][7]->Fill(Cent_FT0M, 0.5, fB1_proton); - - fB2_proton = pT_sum_etaGreaterEtamin / N_sum_etaGreaterEtamin; - histos.fill(HIST("fB2_proton"), Cent_FT0M, 0.5, fB2_proton); - Subsample[SampleIndex][11]->Fill(Cent_FT0M, 0.5, fB2_proton); - - fD_proton = fB1_proton * fB2_proton; - histos.fill(HIST("fD_proton"), Cent_FT0M, 0.5, fD_proton); - Subsample[SampleIndex][19]->Fill(Cent_FT0M, 0.5, fD_proton); - } - - for (int i = 0; i < 14; i++) { - // A_hadrone Calculation - if (Nch_eta_less_0 != 0) { - fA_hadron[i] = fPt_profile->GetBinContent(i + 1) / Nch_eta_less_0; - histos.fill(HIST("fA_hadron"), Cent_FT0M, pT_bin[i], fA_hadron[i]); - Subsample[SampleIndex][0]->Fill(Cent_FT0M, pT_bin[i], fA_hadron[i]); - } - - // A_pion Calculation - if (N_Pi_eta_less_0 != 0) { - fA_pion[i] = fPt_profile_pion->GetBinContent(i + 1) / N_Pi_eta_less_0; - histos.fill(HIST("fA_pion"), Cent_FT0M, pT_bin[i], fA_pion[i]); - Subsample[SampleIndex][1]->Fill(Cent_FT0M, pT_bin[i], fA_pion[i]); - } - - // A_kaon Calculation - if (N_Ka_eta_less_0 != 0) { - fA_kaon[i] = fPt_profile_kaon->GetBinContent(i + 1) / N_Ka_eta_less_0; - histos.fill(HIST("fA_kaon"), Cent_FT0M, pT_bin[i], fA_kaon[i]); - Subsample[SampleIndex][2]->Fill(Cent_FT0M, pT_bin[i], fA_kaon[i]); - } - - // A_proton Calculation - if (N_Pr_eta_less_0 != 0) { - fA_proton[i] = fPt_profile_proton->GetBinContent(i + 1) / N_Pr_eta_less_0; - histos.fill(HIST("fA_proton"), Cent_FT0M, pT_bin[i], fA_proton[i]); - Subsample[SampleIndex][3]->Fill(Cent_FT0M, pT_bin[i], fA_proton[i]); - } - - // C_hadron Calculation - if (Nch_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_hadron[i] = fA_hadron[i] * fB2_hadron; - histos.fill(HIST("fC_hadron"), Cent_FT0M, pT_bin[i], fC_hadron[i]); - Subsample[SampleIndex][12]->Fill(Cent_FT0M, pT_bin[i], fC_hadron[i]); - } - - // C_pion Calculation - if (N_Pi_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_pion[i] = fA_pion[i] * fB2_pion; - histos.fill(HIST("fC_pion"), Cent_FT0M, pT_bin[i], fC_pion[i]); - Subsample[SampleIndex][13]->Fill(Cent_FT0M, pT_bin[i], fC_pion[i]); - } - - // A_kaon Calculation - if (N_Ka_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_kaon[i] = fA_kaon[i] * fB2_kaon; - histos.fill(HIST("fC_kaon"), Cent_FT0M, pT_bin[i], fC_kaon[i]); - Subsample[SampleIndex][14]->Fill(Cent_FT0M, pT_bin[i], fC_kaon[i]); - } - - // A_proton Calculation - if (N_Pr_eta_less_0 != 0 && N_sum_etaGreaterEtamin != 0) { - fC_proton[i] = fA_proton[i] * fB2_proton; - histos.fill(HIST("fC_proton"), Cent_FT0M, pT_bin[i], fC_proton[i]); - Subsample[SampleIndex][15]->Fill(Cent_FT0M, pT_bin[i], fC_proton[i]); - } - } - - fPt_profile->Delete(); - fPt_profile_pion->Delete(); - fPt_profile_kaon->Delete(); - fPt_profile_proton->Delete(); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -} diff --git a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx index 7ef12c2b69f..bf93bf8bc89 100644 --- a/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/eventMeanPtId.cxx @@ -38,6 +38,7 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" +#include "TF1.h" #include #include @@ -56,34 +57,70 @@ using namespace o2::framework::expressions; using namespace std; using o2::constants::physics::Pdg; -namespace o2::aod -{ -using MyCollisions = soa::Join; -using MyTracks = soa::Join; - -using MyMCRecoCollisions = soa::Join; -using MyMCRecoCollision = MyMCRecoCollisions::iterator; - -using MyMCRecoTracks = soa::Join; -using MyMCRecoTrack = MyMCRecoTracks::iterator; - -using EventCandidatesMC = soa::Join; -using MyCollision = MyCollisions::iterator; -using MyTrack = MyTracks::iterator; -} // namespace o2::aod - struct EventMeanPtId { + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + + O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut") + struct : ConfigurableGroup { + + O2_DEFINE_CONFIGURABLE(cfgMultPVFT0CCutEnabled, bool, true, "Enable PV multiplicity vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalFT0CCutEnabled, bool, true, "Enable globalTracks vs FT0C centrality cut") + O2_DEFINE_CONFIGURABLE(cfgMultGlobalPVCutEnabled, bool, true, "Enable globalTracks vs PV multiplicity cut") + + Configurable> cfgMultPVFT0CCutPars{"cfgMultPVFT0CCutPars", + std::vector{3303.11, -121.316, 1.90207, -0.0152644, 5.10121e-05, 190.633, -4.32972, 0.0340001, -5.83261e-05, -3.19566e-07}, + "PV multiplicity vs T0C centrality cut parameter values"}; + + Configurable> cfgMultGlobalFT0CCutPars{"cfgMultGlobalFT0CCutPars", + std::vector{1893.97, -61.3423, 0.790664, -0.00507208, 1.41683e-05, 167.997, -5.29125, 0.0840145, -0.000748102, 2.75743e-06}, + "globalTracks vs FT0C cut parameter values"}; + + Configurable> cfgMultGlobalPVCutPars{"cfgMultGlobalPVCutPars", + std::vector{65.0322, 0.557725, -0.772828, 0.059224, -1.96379e-05, 4.46295e-09}, + "globalTracks vs PV cut parameter values"}; + + std::vector multPVFT0CCutPars; + std::vector multGlobalFT0CPars; + std::vector multGlobalPVCutPars; + + TF1* fMultPVFT0CCutLow = nullptr; + TF1* fMultPVFT0CCutHigh = nullptr; + TF1* fMultGlobalFT0CCutLow = nullptr; + TF1* fMultGlobalFT0CCutHigh = nullptr; + TF1* fMultGlobalPVCutLow = nullptr; + TF1* fMultGlobalPVCutHigh = nullptr; + + } cfgFunCoeff; + Service ccdb; Service pdg; + Filter collisionFilter = nabs(aod::collision::posZ) <= cVtxZcut; + Filter trackFilter = (nabs(aod::track::eta) < cEtacut) && (aod::track::pt > ptMin) && (aod::track::pt < ptMax) && (requireGlobalTrackInFilter()); + + using MyCollisions = soa::Filtered>; + using MyCollision = MyCollisions::iterator; + + using MyTracks = soa::Filtered>; + using MyTrack = MyTracks::iterator; + + using MyMCRecoCollisions = soa::Filtered>; + using MyMCRecoCollision = MyMCRecoCollisions::iterator; + + using MyMCRecoTracks = soa::Filtered>; + using MyMCRecoTrack = MyMCRecoTracks::iterator; + + using EventCandidatesMC = soa::Join; + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable cfgUrlCCDB{"cfgUrlCCDB", "http://alice-ccdb.cern.ch", "url of ccdb"}; Configurable cfgPathCCDB{"cfgPathCCDB", "Users/s/swsingh/My/Object/test", "Path for ccdb-object"}; @@ -116,7 +153,7 @@ struct EventMeanPtId { AxisSpec vtxZAxis = {100, -20.0, 20.0, "Z (cm)"}; AxisSpec dcaAxis = {1002, -5.01, 5.01, "DCA_{xy} (cm)"}; AxisSpec dcazAxis = {1002, -5.01, 5.01, "DCA_{z} (cm)"}; - AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxis = {600, 0.0, 6.0, "#it{p}_{T} (GeV/#it{c})"}; // 600,0,6 AxisSpec pAxis = {400, 0.0, 4.0, "#it{p} (GeV/#it{c})"}; AxisSpec betaAxis = {200, 0.0, 2.0, "TOF_{#beta} (GeV/#it{c})"}; AxisSpec dEdxAxis = {2000, 0.0, 200.0, "dE/dx (GeV/#it{c})"}; @@ -126,12 +163,13 @@ struct EventMeanPtId { AxisSpec nSigmaTOFAxispid = {170, -8.5, 8.5, "n#sigma_{TOF}"}; AxisSpec centAxis = {100, 0., 100., "centrality"}; AxisSpec subAxis = {30, 0., 30., "sample"}; - // AxisSpec nchAxis = {4000, 0., 4000., "nch"}; + AxisSpec tnchAxis = {40, 0., 4000., "nch"}; AxisSpec nchAxis = {nchBins, nchMin, nchMax, "nch"}; AxisSpec varAxis1 = {400, 0., 4., "var1"}; AxisSpec varAxis2 = {400, 0., 4., "var2"}; - AxisSpec chi2Axis = {100, 0., 100., "Chi2"}; - AxisSpec crossedRowTpcAxis = {600, 0., 600., "TPC Crossed rows"}; + AxisSpec tpcchi2Axis = {700, 0., 7., "tpc Chi2"}; + AxisSpec itschi2Axis = {400, 0., 40., "its Chi2"}; + AxisSpec crossedRowTpcAxis = {1600, 0., 160., "TPC Crossed rows"}; AxisSpec counter = {10, 0., 10., "events"}; // QA Plots @@ -163,6 +201,7 @@ struct EventMeanPtId { histos.add("Data/hP", "hP", kTH1D, {pAxis}); histos.add("Data/hEta", ";hEta", kTH1D, {etaAxis}); histos.add("Data/hPt", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); + histos.add("Data/hPtvar", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); histos.add("Data/hNsigmaTPC", "hNsigmaTPC", kTH2D, {pAxis, nSigmaTPCAxis}); histos.add("Data/hDCAxy", "hDCAxy", kTH1D, {dcaAxis}); histos.add("Data/hDCAz", "hDCAz", kTH1D, {dcazAxis}); @@ -211,6 +250,9 @@ struct EventMeanPtId { histos.add("Data/hVar1x", "hVar1x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2x", "hVar2x", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVarx", "hVarx", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar1x", "hdiffVar1x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVar2x", "hdiffVar2x", kTH2D, {subAxis, nchAxis}); + histos.add("Data/hdiffVarx", "hdiffVarx", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2meanptx", "hVar2meanptx", kTH2D, {nchAxis, varAxis2}); histos.add("Data/hVar1pix", "hVar1pix", kTH2D, {subAxis, nchAxis}); histos.add("Data/hVar2pix", "hVar2pix", kTH2D, {subAxis, nchAxis}); @@ -236,13 +278,25 @@ struct EventMeanPtId { histos.add("Data/hdEdx_afterselection", "hdEdx_afterselection", kTH2D, {pAxis, dEdxAxis}); histos.add("Data/hTOFbeta_afterselection1", "hTOFbeta_afterselection1", kTH2D, {pAxis, betaAxis}); histos.add("Data/hdEdx_afterselection1", "hdEdx_afterselection1", kTH2D, {pAxis, dEdxAxis}); - histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_before", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_before", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_before", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); - histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {chi2Axis}); - histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {chi2Axis}); + histos.add("Data/hTPCchi2perCluster_after", "TPC #Chi^{2}/Cluster", kTH1D, {tpcchi2Axis}); + histos.add("Data/hITSchi2perCluster_after", "ITS #Chi^{2}/Cluster", kTH1D, {itschi2Axis}); histos.add("Data/hTPCCrossedrows_after", "Crossed TPC rows", kTH1D, {crossedRowTpcAxis}); histos.add("Data/hcent_nacc", "hcent_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0A_nacc", "hcentFT0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0M_nacc", "hcentFT0M_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFV0A_nacc", "hcentFV0A_nacc", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_before", "hNchPV_NchGlobal_before", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_before", "hcentFT0C_GlobalNch_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_before", "hcentFT0C_NchPV_before", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after", "hNchPV_NchGlobal_after", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hcentFT0C_GlobalNch_after", "hcentFT0C_GlobalNch_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hcentFT0C_NchPV_after", "hcentFT0C_NchPV_after", kTH2D, {centAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after3", "hNchPV_NchGlobal_after3", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after4", "hNchPV_NchGlobal_after4", kTH2D, {nchAxis, nchAxis}); + histos.add("Data/hNchPV_NchGlobal_after5", "hNchPV_NchGlobal_after5", kTH2D, {nchAxis, nchAxis}); histos.addClone("Data/", "Rec/"); // rec histograms @@ -297,17 +351,21 @@ struct EventMeanPtId { histos.add("ptHistogramKaon", "ptHistogramKaon", kTH1D, {ptAxis}); histos.add("ptHistogramProton", "ptHistogramProton", kTH1D, {ptAxis}); histos.add("hnch_gen_all", ";hnch_gen_all", kTH1D, {nchAxis}); - histos.add("hnch_gen_true", ";hnch_gen_true", kTH1D, {nchAxis}); - histos.add("hnch1", ";hnch1", kTH1D, {nchAxis}); - histos.add("hnch2", ";hnch2", kTH1D, {nchAxis}); - histos.add("hnch3", ";hnch3", kTH1D, {nchAxis}); + histos.add("hnch_gen_after_etacut", ";hnch_gen_after_etacut", kTH1D, {nchAxis}); + histos.add("hnch_afterPhysPrimary", ";hnch_afterPhysPrimary", kTH1D, {nchAxis}); histos.add("hnch_pi", ";hnch_pi", kTH1D, {nchAxis}); histos.add("hnch_ka", ";hnch_ka", kTH1D, {nchAxis}); histos.add("hnch_pr", ";hnch_pr", kTH1D, {nchAxis}); + histos.add("hnch_gen", ";hnch_gen", kTH1D, {nchAxis}); + histos.add("hPtvar_gen", ";#it{p}_{T} (GeV/#it{c})", kTH1D, {ptAxis}); histos.add("hVar1x_gen", "hVar1x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2x_gen", "hVar2x_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVarx_gen", "hVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar1x_gen", "hdiffVar1x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVar2x_gen", "hdiffVar2x_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hdiffVarx_gen", "hdiffVarx_gen", kTH2D, {subAxis, nchAxis}); + histos.add("hVar2meanptx_gen", "hVar2meanptx_gen", kTH2D, {nchAxis, varAxis2}); histos.add("hVar1pix_gen", "hVar1pix_gen", kTH2D, {subAxis, nchAxis}); histos.add("hVar2pix_gen", "hVar2pix_gen", kTH2D, {subAxis, nchAxis}); @@ -341,7 +399,8 @@ struct EventMeanPtId { histos.add("hPty_pi_gen", "hPty_pi_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_ka_gen", "hPty_ka_gen", kTH2D, {ptAxis, etaAxis}); histos.add("hPty_pr_gen", "hPty_pr_gen", kTH2D, {ptAxis, etaAxis}); - histos.add("hNch_vs_corr", "hNch_vs_corr", kTH1D, {nchAxis}); + histos.add("hNch_vs_corr", "hNch_vs_corr", kTH2D, {subAxis, nchAxis}); + histos.add("hNch_vs_Nch", "hNch_vs_Nch", kTH2D, {subAxis, nchAxis}); histos.add("hVar1_gen", "hVar1_gen", kTH2D, {subAxis, centAxis}); histos.add("hVar2_gen", "hVar2_gen", kTH2D, {subAxis, centAxis}); histos.add("hVarc_gen", "hVarc_gen", kTH2D, {subAxis, centAxis}); @@ -361,15 +420,65 @@ struct EventMeanPtId { histos.add("hEffVar2x_data", "hEffVar2x_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVarx_data", "hEffVarx_data", kTH2D, {subAxis, nchAxis}); histos.add("hEffVar2Meanptx_data", "hEffVar2Meanptx_data", kTH2D, {nchAxis, varAxis2}); + histos.add("hterm1", "hterm1", kTProfile, {tnchAxis}); + histos.add("hterm2", "hterm2", kTProfile, {tnchAxis}); + histos.add("hterm1_gen", "hterm1_gen", kTProfile, {tnchAxis}); + histos.add("hterm2_gen", "hterm2_gen", kTProfile, {tnchAxis}); + histos.add("hCentrality_rec_before", "hCentrality_rec_before", kTH1D, {centAxis}); + histos.add("hEta1", ";hEta1", kTH1D, {etaAxis}); + + cfgFunCoeff.multPVFT0CCutPars = cfgFunCoeff.cfgMultPVFT0CCutPars; + cfgFunCoeff.multGlobalFT0CPars = cfgFunCoeff.cfgMultGlobalFT0CCutPars; + cfgFunCoeff.multGlobalPVCutPars = cfgFunCoeff.cfgMultGlobalPVCutPars; + + Configurable cSigmaLowHighcut{"cSigmaLowHighcut", 3.0f, "lower and upper sigma cut"}; + + cfgFunCoeff.fMultPVFT0CCutLow = + new TF1("fMultPVFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutLow->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultPVFT0CCutHigh = + new TF1("fMultPVFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultPVFT0CCutHigh->SetParameters(&(cfgFunCoeff.multPVFT0CCutPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutLow = + new TF1("fMultGlobalFT0CCutLow", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutLow->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalFT0CCutHigh = + new TF1("fMultGlobalFT0CCutHigh", + "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.0*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalFT0CCutHigh->SetParameters(&(cfgFunCoeff.multGlobalFT0CPars[0])); + + cfgFunCoeff.fMultGlobalPVCutLow = + new TF1("fMultGlobalPVCutLow", + "[0] + [1]*x - 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutLow->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); + + cfgFunCoeff.fMultGlobalPVCutHigh = + new TF1("fMultGlobalPVCutHigh", + "[0] + [1]*x + 3.0*([2] + [3]*x + [4]*x*x + [5]*x*x*x)", + 0, 100); + cfgFunCoeff.fMultGlobalPVCutHigh->SetParameters(&(cfgFunCoeff.multGlobalPVCutPars[0])); } // Configurables - Configurable cVtxZcut{"cVtxZcut", 10.f, "Vertex Z"}; - Configurable cEtacut{"cEtacut", 0.8, "Eta cut"}; - Configurable cPtmincut{"cPtmincut", 0.2, "Pt min cut"}; - Configurable cPtmaxcut{"cPtmaxcut", 2.0, "Pt max cut"}; - Configurable cDcaXYcut{"cDcaXYcut", 0.12, "DCA XY cut"}; - Configurable cDcaZcut{"cDcaZcut", 2.0, "DCA Z cut"}; + Configurable cVtxZcut{"cVtxZcut", 10.0f, "Vertex Z"}; + Configurable cEtacut{"cEtacut", 0.8f, "Eta cut"}; + Configurable cPtmincut{"cPtmincut", 0.15f, "Pt min cut"}; + Configurable cPtmaxcut{"cPtmaxcut", 2.0f, "Pt max cut"}; + Configurable cPtmincut1{"cPtmincut1", 0.15f, " Pt min cut"}; + Configurable cPtmaxcut1{"cPtmaxcut1", 2.0f, " Pt max cut"}; + Configurable cDcaXYcut{"cDcaXYcut", 0.3f, "DCA XY cut"}; + Configurable cDcaZcut{"cDcaZcut", 2.0f, "DCA Z cut"}; Configurable cCentmincut{"cCentmincut", 0.0, "Min cent cut"}; Configurable cCentmaxcut{"cCentmaxcut", 90.0, "Max cent cut"}; Configurable cTPCcrosscut{"cTPCcrosscut", 70, "TPC crossrows cut"}; @@ -393,11 +502,18 @@ struct EventMeanPtId { Configurable cdata{"cdata", false, "Enable histogram filling for processData"}; Configurable citsNCluster{"citsNCluster", false, "Enable Number of ITS clusters"}; Configurable ctpcNClusterFound{"ctpcNClusterFound", false, "Enable Number of TPC clusters"}; + Configurable cPVContributor{"cPVContributor", false, "Enable Primary Vertex Contributor"}; + Configurable cDCAxy{"cDCAxy", true, "DCAxy cut"}; + Configurable cDCAz{"cDCAz", true, "DCAz cut"}; + Configurable cTPCcr{"cTPCcr", true, "tpc crossed rows"}; + Configurable cITSchi{"cITSchi", true, "ITS chi2"}; + Configurable cTPCchi{"cTPCchi", true, "TPC chi2"}; + Configurable ccentFT0C{"ccentFT0C", true, "Use FT0C centraity"}; // PID selection configurables - Configurable cPionPmincut{"cPionPmincut", 0.2, "pion min cut of pion"}; - Configurable cKaonPmincut{"cKaonPmincut", 0.2, "kaon min cut of kaon"}; - Configurable cProtonPmincut{"cProtonPmincut", 0.2, "proton min cut of proton"}; + Configurable cPionPmincut{"cPionPmincut", 0.15, "pion min cut of pion"}; + Configurable cKaonPmincut{"cKaonPmincut", 0.15, "kaon min cut of kaon"}; + Configurable cProtonPmincut{"cProtonPmincut", 0.15, "proton min cut of proton"}; Configurable cPionPmaxcut{"cPionPmaxcut", 2.0, "pion min cut of pion"}; Configurable cKaonPmaxcut{"cKaonPmaxcut", 2.0, "kaon min cut of kaon"}; Configurable cProtonPmaxcut{"cProtonPmaxcut", 2.0, "proton min cut of proton"}; @@ -414,16 +530,50 @@ struct EventMeanPtId { Configurable nchMin{"nchMin", 0.0, "Minimum value for nch axis"}; Configurable nchMax{"nchMax", 4000.0, "Maximum value for nch axis"}; + bool eventSelected(const float& globalNch, const float& pvTrack, const float& centrality) + { + if (cfgFunCoeff.cfgMultPVFT0CCutEnabled) { + + if (pvTrack < cfgFunCoeff.fMultPVFT0CCutLow->Eval(centrality)) + return false; + if (pvTrack > cfgFunCoeff.fMultPVFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalFT0CCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalFT0CCutLow->Eval(centrality)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalFT0CCutHigh->Eval(centrality)) + return false; + } + + if (cfgFunCoeff.cfgMultGlobalPVCutEnabled) { + + if (globalNch < cfgFunCoeff.fMultGlobalPVCutLow->Eval(pvTrack)) + return false; + if (globalNch > cfgFunCoeff.fMultGlobalPVCutHigh->Eval(pvTrack)) + return false; + } + + return true; + } + template - bool selCollision(C const& coll) + bool selCollision(C const& coll, float& cent) { - if (std::abs(coll.posZ()) > cVtxZcut) { + if (std::abs(coll.posZ()) >= cVtxZcut) { return false; } // Reject the collisions with large vertex-z histos.fill(HIST("hEventcounter"), 2.); - // cent = coll.centFT0M(); //centrality for run3 + if (ccentFT0C) { + cent = coll.centFT0C(); // centrality from FT0C + } else { + cent = coll.centFT0M(); // centrality from FT0M + } + if (cSel8Trig && !coll.sel8()) { return false; } // require min bias trigger @@ -452,7 +602,7 @@ struct EventMeanPtId { } histos.fill(HIST("trackSelRec"), 7); - // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} + // if (cItslayerall && !coll.selection_bit(aod::evsel::kIsGoodITSLayersAll)) {return false;} histos.fill(HIST("trackSelRec"), 8); if (cvtxtofmatched && !coll.selection_bit(aod::evsel::kIsVertexTOFmatched)) { @@ -471,10 +621,12 @@ struct EventMeanPtId { } // accept only global tracks histos.fill(HIST("tracksel"), 2); - // if (std::fabs(track.dcaXY()) > cDcaXYcut) {return false;} + if (cDCAxy && std::fabs(track.dcaXY()) > cDcaXYcut) { + return false; + } histos.fill(HIST("tracksel"), 3); - if (std::fabs(track.dcaZ()) > cDcaZcut) { + if (cDCAz && std::fabs(track.dcaZ()) > cDcaZcut) { return false; } histos.fill(HIST("tracksel"), 4); @@ -484,31 +636,31 @@ struct EventMeanPtId { } histos.fill(HIST("tracksel"), 5); - if (track.pt() < cPtmincut) { - return false; - } - if (track.pt() > cPtmaxcut) { + if (cTPCcr && track.tpcNClsCrossedRows() < cTPCcrosscut) { return false; } histos.fill(HIST("tracksel"), 6); - if (track.tpcNClsCrossedRows() < cTPCcrosscut) { + if (cITSchi && track.itsChi2NCl() >= cItsChiCut) { return false; } histos.fill(HIST("tracksel"), 7); - if (track.itsChi2NCl() > cItsChiCut) { + if (cTPCchi && track.tpcChi2NCl() >= cTpcChiCut) { return false; } histos.fill(HIST("tracksel"), 8); - if (track.tpcChi2NCl() > cTpcChiCut) { + if (track.sign() == 0) { return false; } - histos.fill(HIST("tracksel"), 9); - if (track.sign() == 0) - return false; + if (cPVContributor) { + if (!(track.isPVContributor())) { + return false; + } + histos.fill(HIST("tracksel"), 9); + } if (citsNCluster) { if (track.itsNCls() < cnITSClustersCut) { @@ -631,20 +783,36 @@ struct EventMeanPtId { } //++++++++++++++++++++++++++++++++++++DATA CALCULATION +++++++++++++++++++++++++++++++++++++++++++++++++++++// - void processData(aod::MyCollision const& coll, aod::MyTracks const& inputTracks) + void processData(MyCollision const& coll, MyTracks const& inputTracks) + { + float cent = -1; histos.fill(HIST("hEventcounter"), 1.); histos.fill(HIST("Data/hZvtx_before_sel"), coll.posZ()); - if (!selCollision(coll)) + if (!selCollision(coll, cent)) return; { histos.fill(HIST("Data/hZvtx_after_sel8"), coll.posZ()); } - const auto cent = coll.centFT0C(); histos.fill(HIST("Data/hCentrality"), cent); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Data/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Data/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Data/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Data/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + double nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0., nch = 0., nchPi = 0., nchKa = 0., nchPr = 0.; double q1 = 0., q2 = 0., var1 = 0., var2 = 0.; double sumPtWeight = 0., sumWeight = 0., sumPtPtWeight = 0., var1Eff = 0., var2Eff = 0.; @@ -653,7 +821,8 @@ struct EventMeanPtId { double q1Pr = 0., q2Pr = 0., var1Pr = 0., var2Pr = 0.; int sample = histos.get(HIST("Data/hZvtx_after_sel8"))->GetEntries(); - sample = sample % 30; // subsample error estimation + sample = sample % 30; + for (const auto& track : inputTracks) { nchAllBfCut += 1.; histos.fill(HIST("Data/hnchAll_bf_cut"), nchAllBfCut); @@ -671,11 +840,18 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Data/hnchTrue_pt"), nchPt); } - if (track.sign() == 0) - continue; if (!selTrack(track)) continue; + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; + histos.fill(HIST("Data/hnch"), nch); + histos.fill(HIST("Data/hPtvar"), track.pt()); + } + + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + nchAll += 1.; q1 += track.pt(); q2 += (track.pt() * track.pt()); @@ -703,12 +879,6 @@ struct EventMeanPtId { sumPtPtWeight += (track.pt() * track.pt()) / (eff * eff); sumWeight += weight; - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Data/hnch"), nch); - } - // only TPC tracks: Pion, Kaon, Proton if (track.hasTPC() && std::abs(track.tpcNSigmaPi()) < cNSigCut3) histos.fill(HIST("Data/NSigamaTPCpion"), track.pt(), track.tpcNSigmaPi()); @@ -793,6 +963,9 @@ struct EventMeanPtId { } } // Track loop ends! + histos.fill(HIST("Data/hcentFV0A_nacc"), coll.multFV0A(), nchAll); + histos.fill(HIST("Data/hcentFT0A_nacc"), coll.multFT0A(), nchAll); + histos.fill(HIST("Data/hcentFT0M_nacc"), coll.centFT0M(), nchAll); histos.fill(HIST("Data/hcent_nacc"), cent, nchAll); if (nchAll < cTwoPtlCut2) @@ -840,6 +1013,9 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Data/hVarx"), sample, nchAll); histos.fill(HIST("Data/hVar2meanptx"), nchAll, var2); + histos.fill(HIST("Data/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Data/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Data/hdiffVarx"), sample, nch); histos.fill(HIST("hEffVar1x_data"), sample, nchAll, var1Eff); histos.fill(HIST("hEffVar2x_data"), sample, nchAll, var2Eff); @@ -871,28 +1047,44 @@ struct EventMeanPtId { histos.fill(HIST("Data/hVar2meanptpx"), nchAll, var2Pr); } // event loop ends! - PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", false); + PROCESS_SWITCH(EventMeanPtId, processData, "process real data information", true); //++++++++++++++++++++++++++++++++++++MC Reconstructed +++++++++++++++++++++++++++++++++++++++++++++++++++++// - SliceCache cache; Preslice mcTrack = o2::aod::mcparticle::mcCollisionId; - void processMcReco(aod::MyMCRecoCollision const& coll, aod::MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + void processMcReco(MyMCRecoCollision const& coll, MyMCRecoTracks const& inputTracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) { + float cent = -1; (void)mcCollisions; if (!coll.has_mcCollision()) { return; } + histos.fill(HIST("Rec/hZvtx_before_sel"), coll.posZ()); histos.fill(HIST("hVtxZ_before_gen"), coll.mcCollision().posZ()); + histos.fill(HIST("hCentrality_rec_before"), cent); - if (!selCollision(coll)) // add + if (!selCollision(coll, cent)) return; - float cent = coll.centFT0C(); histos.fill(HIST("Rec/hZvtx_after_sel8"), coll.posZ()); histos.fill(HIST("Rec/hCentrality"), cent); + float globalNch = inputTracks.size(); + float pvTrack = coll.multNTracksPV(); + + histos.fill(HIST("Rec/hNchPV_NchGlobal_before"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_before"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_before"), coll.centFT0C(), pvTrack); + + if (cfgEvSelMultCorrelation && !eventSelected(globalNch, pvTrack, cent)) { + return; + } + + histos.fill(HIST("Rec/hNchPV_NchGlobal_after"), pvTrack, globalNch); + histos.fill(HIST("Rec/hcentFT0C_GlobalNch_after"), coll.centFT0C(), globalNch); + histos.fill(HIST("Rec/hcentFT0C_NchPV_after"), coll.centFT0C(), pvTrack); + double nch = 0., nchPi = 0., nchKa = 0., nchPr = 0., nchAll = 0., nchAllBfCut = 0., nchEta = 0., nchPt = 0.; double q1 = 0., q2 = 0.; double q1Pi = 0., q2Pi = 0., q1Ka = 0., q2Ka = 0., q1Pr = 0., q2Pr = 0.; @@ -918,9 +1110,19 @@ struct EventMeanPtId { nchPt += 1.; histos.fill(HIST("Rec/hnchTrue_pt"), nchPt); } + if (!selTrack(track)) continue; - // if (std::fabs(track.y()) > 0.5) continue; + + if (track.pt() >= cPtmincut1 && track.pt() <= cPtmaxcut1) { + nch += 1.; + histos.fill(HIST("Rec/hnch"), nch); + histos.fill(HIST("Rec/hPtvar"), track.pt()); + } + if (track.pt() < cPtmincut || track.pt() > cPtmaxcut) + continue; + + // if (std::fabs(track.y()) > 0.5) continue; histos.fill(HIST("hPt_rec"), track.pt()); histos.fill(HIST("hEta_rec"), track.eta()); @@ -937,6 +1139,9 @@ struct EventMeanPtId { auto mcParticle = track.mcParticle(); nchAll += 1.; + q1 += track.pt(); + q2 += (track.pt() * track.pt()); + histos.fill(HIST("Rec/hnchAll"), nchAll); histos.fill(HIST("ptHistogramAllchargeRec"), track.pt()); histos.fill(HIST("Rec/hDCAxy"), track.dcaXY()); @@ -954,14 +1159,6 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hNsigmaTPC"), track.p(), track.tpcNSigmaPr()); histos.fill(HIST("hPtEta_rec"), track.pt(), track.eta()); - if (track.pt() >= cPtmincut || track.pt() <= cPtmaxcut) // do not change this (it is for different pt work) - { - nch += 1.; - histos.fill(HIST("Rec/hnch"), nch); - } - q1 += track.pt(); - q2 += (track.pt() * track.pt()); - if (std::abs(mcParticle.pdgCode()) == PDG_t::kPiPlus) histos.fill(HIST("ptHistogramPionrec_pdg"), track.pt()); if (std::abs(mcParticle.pdgCode()) == PDG_t::kKPlus) @@ -1102,7 +1299,8 @@ struct EventMeanPtId { } // loop over tracks histos.fill(HIST("Rec/hcent_nacc"), cent, nchAll); histos.fill(HIST("hcent_nacc_corr"), cent, sumWeight); - histos.fill(HIST("hNch_vs_corr"), nchAll, sumWeight); + histos.fill(HIST("hNch_vs_corr"), sample, nchAll, sumWeight); + histos.fill(HIST("hNch_vs_Nch"), sample, nchAll, nchAll); if (nchAll < cTwoPtlCut2) return; @@ -1110,6 +1308,8 @@ struct EventMeanPtId { var2 = (q1 / nchAll); //------------------ Efficiency corrected histograms --------------- + histos.fill(HIST("hterm1"), nchAll, var1); + histos.fill(HIST("hterm2"), nchAll, var2); var1Eff = (sumPtWeight * sumPtWeight - sumPtPtWeight) / (sumWeight * (sumWeight - 1)); var2Eff = (sumPtWeight / sumWeight); @@ -1150,6 +1350,10 @@ struct EventMeanPtId { histos.fill(HIST("Rec/hVar1x"), sample, nchAll, var1); histos.fill(HIST("Rec/hVar2x"), sample, nchAll, var2); histos.fill(HIST("Rec/hVarx"), sample, nchAll); + histos.fill(HIST("Rec/hdiffVar1x"), sample, nch, var1); + histos.fill(HIST("Rec/hdiffVar2x"), sample, nch, var2); + histos.fill(HIST("Rec/hdiffVarx"), sample, nch); + histos.fill(HIST("Rec/hVar2meanptx"), nchAll, var2); histos.fill(HIST("Rec/hVar1pix"), sample, nchAll, var1Pi); histos.fill(HIST("Rec/hVar2pix"), sample, nchAll, var2Pi); @@ -1184,9 +1388,8 @@ struct EventMeanPtId { const auto& mcpartgen = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mccolgen.globalIndex(), cache); histos.fill(HIST("hVtxZ_after_gensim"), mccolgen.posZ()); - double nchGenAll = 0., nchGenTrue = 0.; + double nchGenAll = 0., nchGenTrue = 0., nch1 = 0., nchgen = 0.; double nchPiGen = 0., nchKaGen = 0., nchPrGen = 0.; - double nch1 = 0., nch2 = 0., nch3 = 0.; double q1AllGen = 0, q2AllGen = 0.; double q1PiGen = 0, q2PiGen = 0, q1KaGen = 0, q2KaGen = 0, q1PrGen = 0, q2PrGen = 0; double var1AllGen = 0, var2AllGen = 0.; @@ -1201,11 +1404,7 @@ struct EventMeanPtId { continue; } nch1++; - histos.fill(HIST("hnch1"), nch1); - nch2++; - histos.fill(HIST("hnch2"), nch2); - nch3++; - histos.fill(HIST("hnch3"), nch3); + histos.fill(HIST("hnch_afterPhysPrimary"), nch1); int pid = mcpart.pdgCode(); auto sign = 0; @@ -1220,8 +1419,15 @@ struct EventMeanPtId { if (std::fabs(mcpart.eta()) > cEtacut) continue; nchGenTrue++; - histos.fill(HIST("hnch_gen_true"), nchGenTrue); - if ((mcpart.pt() <= cPtmincut) || (mcpart.pt() >= cPtmaxcut)) + histos.fill(HIST("hnch_gen_after_etacut"), nchGenTrue); + + if (mcpart.pt() >= cPtmincut1 && mcpart.pt() <= cPtmaxcut1) { + nchgen += 1.; + histos.fill(HIST("hnch_gen"), nchgen); + histos.fill(HIST("hPtvar_gen"), mcpart.pt()); + } + + if ((mcpart.pt() < cPtmincut) || (mcpart.pt() > cPtmaxcut)) continue; histos.fill(HIST("hPt_gen"), mcpart.pt()); histos.fill(HIST("hEta_gen"), mcpart.eta()); @@ -1266,7 +1472,7 @@ struct EventMeanPtId { } //|y| < 0.5 cut ends! - } // particle + } // track loop ends! histos.fill(HIST("hcent_nacc_gen"), cent, nchGenAll); if (nchGenAll < cTwoPtlCut2) @@ -1278,6 +1484,8 @@ struct EventMeanPtId { histos.fill(HIST("hVar2_gen"), sampleGen, cent, var2AllGen); histos.fill(HIST("hVarc_gen"), sampleGen, cent); + histos.fill(HIST("hterm1_gen"), nchGenAll, var1AllGen); + histos.fill(HIST("hterm2_gen"), nchGenAll, var2AllGen); //--------------------------Pions------------------------------------------- if (nchPiGen >= cTwoPtlCut2) { var1PiGen = (q1PiGen * q1PiGen - q2PiGen) / (nchPiGen * (nchPiGen - 1)); @@ -1297,6 +1505,10 @@ struct EventMeanPtId { histos.fill(HIST("hVar1x_gen"), sampleGen, nchGenAll, var1AllGen); histos.fill(HIST("hVar2x_gen"), sampleGen, nchGenAll, var2AllGen); histos.fill(HIST("hVarx_gen"), sampleGen, nchGenAll); + histos.fill(HIST("hdiffVar1x_gen"), sampleGen, nchgen, var1AllGen); + histos.fill(HIST("hdiffVar2x_gen"), sampleGen, nchgen, var2AllGen); + histos.fill(HIST("hdiffVarx_gen"), sampleGen, nchgen); + histos.fill(HIST("hVar2meanptx_gen"), nchGenAll, var2AllGen); histos.fill(HIST("hVar1pix_gen"), sampleGen, nchGenAll, var1PiGen); histos.fill(HIST("hVar2pix_gen"), sampleGen, nchGenAll, var2PiGen); @@ -1312,7 +1524,7 @@ struct EventMeanPtId { histos.fill(HIST("hVar2meanptpx_gen"), nchGenAll, var2PrGen); } // void process - PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", true); + PROCESS_SWITCH(EventMeanPtId, processMcReco, "Process reconstructed", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)