From bf85d7af6cf1763cf270937acfb37417444b23a0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 2 Dec 2024 14:44:06 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../Tasks/CorrSparse.cxx | 89 ++++++++----------- 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx index 58cdd6ab19d..94db0765320 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx @@ -25,9 +25,6 @@ #include "PWGCF/Core/PairCuts.h" #include "Common/Core/RecoDecay.h" - - - namespace o2::aod { } // namespace o2::aod @@ -36,7 +33,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; - struct CorrSparse { Configurable cfgZVtxCut = {"zvtxcut", 10.0, "Vertex z cut. Default 10 cm"}; Configurable cfgPtCutMin = {"minpt", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; @@ -48,14 +44,12 @@ struct CorrSparse { Configurable cfgCutChi2prTPCcls = {"chi2cut", 2.5, "Chi2 cut. Default 2.5"}; - - ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -constants::math::PIHalf, constants::math::PIHalf * 3}, "delta phi axis for histograms"}; ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -2, 2}, "delta eta axis for histograms"}; 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 associated axis for histograms"}; - ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10,15,20,25,30,35,40,50,60,80,100 }, "multiplicity / centrality 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 associated axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100}, "multiplicity / centrality axis for histograms"}; HistogramRegistry registry{"registry"}; int logcolls = 0; @@ -64,26 +58,25 @@ struct CorrSparse { void init(InitContext&) { LOGF(info, "Starting init"); - registry.add("Yield", "pT vs eta vs Nch", {HistType::kTH3F, { {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}, {100, 0, 100, "Nch"}}}); // check to see total number of tracks - registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, { {100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}, {100, 0, 100, "Nch"}}}); - - //Make histograms to check the distributions after cuts - registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D,{axisDeltaPhi, axisDeltaEta}}); //check to see the delta eta and delta phi distribution - registry.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D ,{axisDeltaPhi, axisDeltaEta}}); - registry.add("Phi", "Phi", {HistType::kTH1D,{{72, -constants::math::PIHalf, constants::math::PI * 2, "Phi"}}}); - registry.add("Eta", "Eta", {HistType::kTH1D,{{40, -2, 2, "Eta"}}}); - registry.add("pT", "pT", {HistType::kTH1D,{axisPtTrigger}}); - registry.add("Nch", "N_{ch}", {HistType::kTH1D,{axisMultiplicity}}); - - registry.add("Sparse_mixed", "", {HistType::kTHnSparseD,{{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse - registry.add("Sparse_same", "", {HistType::kTHnSparseD,{{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); + registry.add("Yield", "pT vs eta vs Nch", {HistType::kTH3F, {{40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}, {100, 0, 100, "Nch"}}}); // check to see total number of tracks + registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}, {100, 0, 100, "Nch"}}}); + + // Make histograms to check the distributions after cuts + registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution + registry.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); + registry.add("Phi", "Phi", {HistType::kTH1D, {{72, -constants::math::PIHalf, constants::math::PI * 2, "Phi"}}}); + registry.add("Eta", "Eta", {HistType::kTH1D, {{40, -2, 2, "Eta"}}}); + registry.add("pT", "pT", {HistType::kTH1D, {axisPtTrigger}}); + registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); + + registry.add("Sparse_mixed", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse + registry.add("Sparse_same", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); const int maxMixBin = axisMultiplicity->size() * axisVertex->size(); - registry.add("eventcount", "bin", {HistType::kTH1F,{{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); //histogram to see how many events are in the same and mixed event + registry.add("eventcount", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); // histogram to see how many events are in the same and mixed event } - - // fill multiple histograms + // fill multiple histograms template void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. { @@ -94,13 +87,10 @@ struct CorrSparse { registry.fill(HIST("Phi"), track1.phi()); registry.fill(HIST("Eta"), track1.eta()); registry.fill(HIST("pT"), track1.pt()); - - - } } - template < typename TCollision> + template bool fillCollision(TCollision collision, float centrality) { @@ -110,20 +100,19 @@ struct CorrSparse { return true; } - -template < typename TTracks> -void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + template + void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms { // loop over all tracks for (auto& track1 : tracks1) { - + for (auto& track2 : tracks2) { if (track1 == track2) { continue; } - float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(),-PIHalf); + float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -PIHalf); float deltaEta = track1.eta() - track2.eta(); // fill the right sparse and histograms @@ -138,48 +127,40 @@ void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, } } -//make the filters and cuts. + // make the filters and cuts. - Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut; + Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut; - Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) - && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); - + Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); + + // define the filtered collisions and tracks - // define the filtered collisions and tracks - using aodCollisions = soa::Filtered>; using aodTracks = soa::Filtered>; - - - - -void processSame(aodCollisions::iterator const& collision, aodTracks const& tracks) + void processSame(aodCollisions::iterator const& collision, aodTracks const& tracks) { const auto centrality = collision.centFT0C(); - registry.fill(HIST("eventcount"), -2); //because its same event i put it in the -2 bin + registry.fill(HIST("eventcount"), -2); // because its same event i put it in the -2 bin fillYield(collision, centrality, tracks); - fillCorrelations( tracks, tracks, collision.posZ(), 1,tracks.size()); // fill the SE histogram and Sparse + fillCorrelations(tracks, tracks, collision.posZ(), 1, tracks.size()); // fill the SE histogram and Sparse } PROCESS_SWITCH(CorrSparse, processSame, "Process same event", true); - - -// i do the event mixing (i have not changed this from the tutorial i got). + // i do the event mixing (i have not changed this from the tutorial i got). std::vector vtxBinsEdges{VARIABLE_WIDTH, -7.0f, -5.0f, -3.0f, -1.0f, 1.0f, 3.0f, 5.0f, 7.0f}; std::vector multBinsEdges{VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0, 100.1f}; SliceCache cache; - + ColumnBinningPolicy bindingOnVtxAndMult{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) SameKindPair> + aodTracks, + ColumnBinningPolicy> pair{bindingOnVtxAndMult, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored - // the process for filling the mixed events + // the process for filling the mixed events void processMixed(aodCollisions& collisions, aodTracks const& tracks) { for (auto& [collision1, tracks1, collision2, tracks2] : pair) {