diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index b67ae8e7eb6..17f4499e011 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -46,6 +46,7 @@ #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/PID.h" @@ -58,7 +59,10 @@ #include #include +#include +#include #include +#include #include #include @@ -74,7 +78,6 @@ struct LongrangecorrDerived { SliceCache cache; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - Configurable cfgSampleSize{"cfgSampleSize", 10, "Sample size for mixed event"}; Configurable cfgNmixedevent{"cfgNmixedevent", 5, "how many events are mixed"}; Configurable cfgPidMask{"cfgPidMask", 0, "Selection bitmask for the TPC particle"}; Configurable cfgV0Mask{"cfgV0Mask", 0, "Selection bitmask for the V0 particle"}; @@ -85,10 +88,7 @@ struct LongrangecorrDerived { ConfigurableAxis axisEtaTrig{"axisEtaTrig", {40, -1., 1.}, "#eta trig axis"}; ConfigurableAxis axisPtTrigger{"axisPtTrigger", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt trigger axis for histograms"}; ConfigurableAxis axisPtAssoc{"axisPtAssoc", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt assoc axis for histograms"}; - ConfigurableAxis axisSample{"axisSample", {cfgSampleSize, 0, cfgSampleSize}, "sample axis for histograms"}; ConfigurableAxis axisVtxZ{"axisVtxZ", {40, -20, 20}, "vertex axis"}; - ConfigurableAxis channelFt0aAxis{"channelFt0aAxis", {96, 0.0, 96.0}, "FT0A channel"}; - ConfigurableAxis amplitudeFt0a{"amplitudeFt0a", {5000, 0, 10000}, "FT0A amplitude"}; ConfigurableAxis axisEtaAssoc{"axisEtaAssoc", {96, 3.5, 4.9}, "#eta assoc axis"}; ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -6, -2}, "delta eta axis for histograms"}; @@ -103,10 +103,25 @@ struct LongrangecorrDerived { OutputObj same{"sameEvent"}; OutputObj mixed{"mixedEvent"}; + using CollsTable = aod::CollLRTables; + using TrksTable = aod::TrkLRTables; + using MftTrksTable = aod::MftTrkLRTables; + using Ft0aTrksTable = aod::Ft0aLRTables; + using Ft0cTrksTable = aod::Ft0cLRTables; + using MftbestTrksTable = aod::MftBestTrkLRTables; + using V0TrksTable = aod::V0TrkLRTables; + + Preslice perColTpc = aod::lrcorrtrktable::collLRTableId; + Preslice perColMft = aod::lrcorrtrktable::collLRTableId; + Preslice perColMftbest = aod::lrcorrtrktable::collLRTableId; + Preslice perColFt0a = aod::lrcorrtrktable::collLRTableId; + Preslice perColFt0c = aod::lrcorrtrktable::collLRTableId; + Preslice perColV0 = aod::lrcorrtrktable::collLRTableId; + void init(InitContext const&) { - std::vector corrAxis = {{axisSample, "Sample"}, - {axisVtxZ, "z-vtx (cm)"}, + std::vector corrAxis = {{axisVtxZ, "z-vtx (cm)"}, + {axisMultiplicity, "multiplicity"}, {axisPtTrigger, "p_{T} (GeV/c)"}, {axisPtAssoc, "p_{T} (GeV/c)"}, {axisDeltaPhi, "#Delta#varphi (rad)"}, @@ -114,8 +129,7 @@ struct LongrangecorrDerived { std::vector effAxis = {{axisVertexEfficiency, "z-vtx (cm)"}, {axisPtEfficiency, "p_{T} (GeV/c)"}, {axisEtaEfficiency, "#eta"}}; - std::vector userAxis = {{axisMultiplicity, "multiplicity"}, - {axisInvMass, "m (GeV/c^2)"}}; + std::vector userAxis = {{axisInvMass, "m (GeV/c^2)"}}; same.setObject(new CorrelationContainer("sameEvent", "sameEvent", corrAxis, effAxis, userAxis)); mixed.setObject(new CorrelationContainer("mixedEvent", "mixedEvent", corrAxis, effAxis, userAxis)); @@ -128,7 +142,7 @@ struct LongrangecorrDerived { histos.add("Trig_phi", "Trig_phi", kTH1D, {axisPhi}); histos.add("Trig_etavsphi", "Trig_etavsphi", kTH2D, {axisPhi, axisEtaTrig}); histos.add("Trig_pt", "Trig_pt", kTH1D, {axisPtTrigger}); - histos.add("Trig_hist", "Trig_hist", kTHnSparseF, {axisSample, axisVtxZ, axisPtTrigger, axisMultiplicity, axisInvMass}); + histos.add("Trig_hist", "Trig_hist", kTHnSparseF, {axisVtxZ, axisMultiplicity, axisPtTrigger, axisInvMass}); histos.add("Assoc_eta", "Assoc_eta", kTH1D, {axisEtaAssoc}); histos.add("Assoc_phi", "Assoc_phi", kTH1D, {axisPhi}); @@ -174,7 +188,6 @@ struct LongrangecorrDerived { template void fillCorrHist(TTarget target, TTriggers const& triggers, TAssocs const& assocs, bool mixing, float vz, float multiplicity, float eventWeight) { - int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); for (auto const& triggerTrack : triggers) { if constexpr (std::experimental::is_detected::value) { if (cfgPidMask != 0 && (cfgPidMask & (1u << static_cast(triggerTrack.trackType()))) == 0u) @@ -186,9 +199,9 @@ struct LongrangecorrDerived { if (!mixing) { fillTrigTrackQA(triggerTrack); if constexpr (std::experimental::is_detected::value) { - histos.fill(HIST("Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity, triggerTrack.invMass(), eventWeight); + histos.fill(HIST("Trig_hist"), vz, multiplicity, triggerTrack.pt(), triggerTrack.invMass(), eventWeight); } else { - histos.fill(HIST("Trig_hist"), fSampleIndex, vz, triggerTrack.pt(), multiplicity, 1.0, eventWeight); + histos.fill(HIST("Trig_hist"), vz, multiplicity, triggerTrack.pt(), 1.0, eventWeight); } } for (auto const& assoTrack : assocs) { @@ -201,9 +214,9 @@ struct LongrangecorrDerived { histos.fill(HIST("deltaEta_deltaPhi_mixed"), deltaPhi, deltaEta); } if constexpr (std::experimental::is_detected::value) { - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, multiplicity, triggerTrack.invMass(), eventWeight); + target->getPairHist()->Fill(step, vz, multiplicity, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, triggerTrack.invMass(), eventWeight); } else { - target->getPairHist()->Fill(step, fSampleIndex, vz, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, multiplicity, 0., eventWeight); + target->getPairHist()->Fill(step, vz, multiplicity, triggerTrack.pt(), triggerTrack.pt(), deltaPhi, deltaEta, 1.0, eventWeight); } } // associated tracks } // trigger tracks @@ -239,94 +252,94 @@ struct LongrangecorrDerived { } // pair loop } // process mixed - void processTpcft0aSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) + void processTpcft0aSE(CollsTable::iterator const& col, TrksTable const& tracks, Ft0aTrksTable const& ft0as) { processSame(col, tracks, ft0as); } - void processTpcft0cSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::Ft0cLRTables const& ft0cs) + void processTpcft0cSE(CollsTable::iterator const& col, TrksTable const& tracks, Ft0cTrksTable const& ft0cs) { processSame(col, tracks, ft0cs); } - void processTpcmftSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) + void processTpcmftSE(CollsTable::iterator const& col, TrksTable const& tracks, MftTrksTable const& mfts) { processSame(col, tracks, mfts); } - void processMftft0aSE(aod::CollLRTables::iterator const& col, aod::MftTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) + void processMftft0aSE(CollsTable::iterator const& col, MftTrksTable const& mfts, Ft0aTrksTable const& ft0as) { processSame(col, mfts, ft0as); } - void processV0ft0aSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) + void processV0ft0aSE(CollsTable::iterator const& col, V0TrksTable const& tracks, Ft0aTrksTable const& ft0as) { processSame(col, tracks, ft0as); } - void processV0mftSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) + void processV0mftSE(CollsTable::iterator const& col, V0TrksTable const& tracks, MftTrksTable const& mfts) { processSame(col, tracks, mfts); } - void processTpcmftbestSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) + void processTpcmftbestSE(CollsTable::iterator const& col, TrksTable const& tracks, MftbestTrksTable const& mfts) { processSame(col, tracks, mfts); } - void processMftbestft0aSE(aod::CollLRTables::iterator const& col, aod::MftBestTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) + void processMftbestft0aSE(CollsTable::iterator const& col, MftbestTrksTable const& mfts, Ft0aTrksTable const& ft0as) { processSame(col, mfts, ft0as); } - void processV0mftbestSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) + void processV0mftbestSE(CollsTable::iterator const& col, V0TrksTable const& tracks, MftbestTrksTable const& mfts) { processSame(col, tracks, mfts); } - void processTpcft0aME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) + void processTpcft0aME(CollsTable const& cols, TrksTable const& tracks, Ft0aTrksTable const& ft0as) { - processMixed(col, tracks, ft0as); + processMixed(cols, tracks, ft0as); } - void processTpcft0cME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::Ft0cLRTables const& ft0cs) + void processTpcft0cME(CollsTable const& cols, TrksTable const& tracks, Ft0cTrksTable const& ft0cs) { - processMixed(col, tracks, ft0cs); + processMixed(cols, tracks, ft0cs); } - void processTpcmftME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) + void processTpcmftME(CollsTable const& cols, TrksTable const& tracks, MftTrksTable const& mfts) { - processMixed(col, tracks, mfts); + processMixed(cols, tracks, mfts); } - void processMftft0aME(aod::CollLRTables const& col, aod::MftTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) + void processMftft0aME(CollsTable const& cols, MftTrksTable const& mfts, Ft0aTrksTable const& ft0as) { - processMixed(col, mfts, ft0as); + processMixed(cols, mfts, ft0as); } - void processV0ft0aME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) + void processV0ft0aME(CollsTable const& cols, V0TrksTable const& tracks, Ft0aTrksTable const& ft0as) { - processMixed(col, tracks, ft0as); + processMixed(cols, tracks, ft0as); } - void processV0mftME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) + void processV0mftME(CollsTable const& cols, V0TrksTable const& tracks, MftTrksTable const& mfts) { - processMixed(col, tracks, mfts); + processMixed(cols, tracks, mfts); } - void processTpcmftbestME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) + void processTpcmftbestME(CollsTable const& cols, TrksTable const& tracks, MftbestTrksTable const& mfts) { - processMixed(col, tracks, mfts); + processMixed(cols, tracks, mfts); } - void processMftbestft0aME(aod::CollLRTables const& col, aod::MftBestTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) + void processMftbestft0aME(CollsTable const& cols, MftbestTrksTable const& mfts, Ft0aTrksTable const& ft0as) { - processMixed(col, mfts, ft0as); + processMixed(cols, mfts, ft0as); } - void processV0mftbestME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) + void processV0mftbestME(CollsTable const& cols, V0TrksTable const& tracks, MftbestTrksTable const& mfts) { - processMixed(col, tracks, mfts); + processMixed(cols, tracks, mfts); } PROCESS_SWITCH(LongrangecorrDerived, processTpcft0aSE, "same event TPC vs FT0A", false);