-
Notifications
You must be signed in to change notification settings - Fork 652
[PWGCF] Fix indexing between track and collision tables + dimension of THn histogram #13793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 <chrono> | ||
| #include <cstdio> | ||
| #include <experimental/type_traits> | ||
| #include <memory> | ||
| #include <string> | ||
| #include <tuple> | ||
| #include <utility> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -74,7 +78,6 @@ struct LongrangecorrDerived { | |
|
|
||
| SliceCache cache; | ||
| HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; | ||
| Configurable<double> cfgSampleSize{"cfgSampleSize", 10, "Sample size for mixed event"}; | ||
| Configurable<int> cfgNmixedevent{"cfgNmixedevent", 5, "how many events are mixed"}; | ||
| Configurable<int> cfgPidMask{"cfgPidMask", 0, "Selection bitmask for the TPC particle"}; | ||
| Configurable<int> 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,19 +103,33 @@ struct LongrangecorrDerived { | |
| OutputObj<CorrelationContainer> same{"sameEvent"}; | ||
| OutputObj<CorrelationContainer> mixed{"mixedEvent"}; | ||
|
|
||
| using CollTable = aod::CollLRTables; | ||
| using TrkTable = aod::TrkLRTables; | ||
| using MftTrkTable = aod::MftTrkLRTables; | ||
| using Ft0aTrkTable = aod::Ft0aLRTables; | ||
| using Ft0cTrkTable = aod::Ft0cLRTables; | ||
| using MftbestTrkTable = aod::MftBestTrkLRTables; | ||
| using V0TrkTable = aod::V0TrkLRTables; | ||
|
|
||
| Preslice<TrkTable> perColTpc = aod::lrcorrtrktable::collLRTableId; | ||
| Preslice<MftTrkTable> perColMft = aod::lrcorrtrktable::collLRTableId; | ||
| Preslice<MftbestTrkTable> perColMftbest = aod::lrcorrtrktable::collLRTableId; | ||
| Preslice<Ft0aTrkTable> perColFt0a = aod::lrcorrtrktable::collLRTableId; | ||
| Preslice<Ft0cTrkTable> perColFt0c = aod::lrcorrtrktable::collLRTableId; | ||
| Preslice<V0TrkTable> perColV0 = aod::lrcorrtrktable::collLRTableId; | ||
|
|
||
| void init(InitContext const&) | ||
| { | ||
| std::vector<AxisSpec> corrAxis = {{axisSample, "Sample"}, | ||
| {axisVtxZ, "z-vtx (cm)"}, | ||
| std::vector<AxisSpec> corrAxis = {{axisVtxZ, "z-vtx (cm)"}, | ||
| {axisMultiplicity, "multiplicity"}, | ||
| {axisPtTrigger, "p_{T} (GeV/c)"}, | ||
| {axisPtAssoc, "p_{T} (GeV/c)"}, | ||
| {axisDeltaPhi, "#Delta#varphi (rad)"}, | ||
| {axisDeltaEta, "#Delta#eta"}}; | ||
| std::vector<AxisSpec> effAxis = {{axisVertexEfficiency, "z-vtx (cm)"}, | ||
| {axisPtEfficiency, "p_{T} (GeV/c)"}, | ||
| {axisEtaEfficiency, "#eta"}}; | ||
| std::vector<AxisSpec> userAxis = {{axisMultiplicity, "multiplicity"}, | ||
| {axisInvMass, "m (GeV/c^2)"}}; | ||
| std::vector<AxisSpec> 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 <CorrelationContainer::CFStep step, typename TTarget, typename TTriggers, typename TAssocs> | ||
| 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<HasTpcTrack, typename TTriggers::iterator>::value) { | ||
| if (cfgPidMask != 0 && (cfgPidMask & (1u << static_cast<uint32_t>(triggerTrack.trackType()))) == 0u) | ||
|
|
@@ -186,9 +199,9 @@ struct LongrangecorrDerived { | |
| if (!mixing) { | ||
| fillTrigTrackQA(triggerTrack); | ||
| if constexpr (std::experimental::is_detected<HasInvMass, typename TTriggers::iterator>::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<HasInvMass, typename TTriggers::iterator>::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,92 +252,92 @@ struct LongrangecorrDerived { | |
| } // pair loop | ||
| } // process mixed | ||
|
|
||
| void processTpcft0aSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) | ||
| void processTpcft0aSE(CollTable::iterator const& col, TrkTable const& tracks, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processSame(col, tracks, ft0as); | ||
| } | ||
|
|
||
| void processTpcft0cSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::Ft0cLRTables const& ft0cs) | ||
| void processTpcft0cSE(CollTable::iterator const& col, TrkTable const& tracks, Ft0cTrkTable const& ft0cs) | ||
| { | ||
| processSame(col, tracks, ft0cs); | ||
| } | ||
|
|
||
| void processTpcmftSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) | ||
| void processTpcmftSE(CollTable::iterator const& col, TrkTable const& tracks, MftTrkTable const& mfts) | ||
| { | ||
| processSame(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processMftft0aSE(aod::CollLRTables::iterator const& col, aod::MftTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) | ||
| void processMftft0aSE(CollTable::iterator const& col, MftTrkTable const& mfts, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processSame(col, mfts, ft0as); | ||
| } | ||
|
|
||
| void processV0ft0aSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) | ||
| void processV0ft0aSE(CollTable::iterator const& col, V0TrkTable const& tracks, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processSame(col, tracks, ft0as); | ||
| } | ||
|
|
||
| void processV0mftSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) | ||
| void processV0mftSE(CollTable::iterator const& col, V0TrkTable const& tracks, MftTrkTable const& mfts) | ||
| { | ||
| processSame(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processTpcmftbestSE(aod::CollLRTables::iterator const& col, aod::TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) | ||
| void processTpcmftbestSE(CollTable::iterator const& col, TrkTable const& tracks, MftbestTrkTable const& mfts) | ||
| { | ||
| processSame(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processMftbestft0aSE(aod::CollLRTables::iterator const& col, aod::MftBestTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) | ||
| void processMftbestft0aSE(CollTable::iterator const& col, MftbestTrkTable const& mfts, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processSame(col, mfts, ft0as); | ||
| } | ||
|
|
||
| void processV0mftbestSE(aod::CollLRTables::iterator const& col, aod::V0TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) | ||
| void processV0mftbestSE(CollTable::iterator const& col, V0TrkTable const& tracks, MftbestTrkTable const& mfts) | ||
| { | ||
| processSame(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processTpcft0aME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) | ||
| void processTpcft0aME(CollTable const& col, TrkTable const& tracks, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processMixed(col, tracks, ft0as); | ||
| } | ||
|
|
||
| void processTpcft0cME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::Ft0cLRTables const& ft0cs) | ||
| void processTpcft0cME(CollTable const& col, TrkTable const& tracks, Ft0cTrkTable const& ft0cs) | ||
| { | ||
| processMixed(col, tracks, ft0cs); | ||
| } | ||
|
|
||
| void processTpcmftME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) | ||
| void processTpcmftME(CollTable const& col, TrkTable const& tracks, MftTrkTable const& mfts) | ||
| { | ||
| processMixed(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processMftft0aME(aod::CollLRTables const& col, aod::MftTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) | ||
| void processMftft0aME(CollTable const& col, MftTrkTable const& mfts, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processMixed(col, mfts, ft0as); | ||
| } | ||
|
|
||
| void processV0ft0aME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::Ft0aLRTables const& ft0as) | ||
| void processV0ft0aME(CollTable const& col, V0TrkTable const& tracks, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processMixed(col, tracks, ft0as); | ||
| } | ||
|
|
||
| void processV0mftME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::MftTrkLRTables const& mfts) | ||
| void processV0mftME(CollTable const& col, V0TrkTable const& tracks, MftTrkTable const& mfts) | ||
| { | ||
| processMixed(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processTpcmftbestME(aod::CollLRTables const& col, aod::TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) | ||
| void processTpcmftbestME(CollTable const& col, TrkTable const& tracks, MftbestTrkTable const& mfts) | ||
| { | ||
| processMixed(col, tracks, mfts); | ||
| } | ||
|
|
||
| void processMftbestft0aME(aod::CollLRTables const& col, aod::MftBestTrkLRTables const& mfts, aod::Ft0aLRTables const& ft0as) | ||
| void processMftbestft0aME(CollTable const& col, MftbestTrkTable const& mfts, Ft0aTrkTable const& ft0as) | ||
| { | ||
| processMixed(col, mfts, ft0as); | ||
| } | ||
|
|
||
| void processV0mftbestME(aod::CollLRTables const& col, aod::V0TrkLRTables const& tracks, aod::MftBestTrkLRTables const& mfts) | ||
| void processV0mftbestME(CollTable const& col, V0TrkTable const& tracks, MftbestTrkTable const& mfts) | ||
| { | ||
| processMixed(col, tracks, mfts); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also in here
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! It is done. |
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the plurals because they are not iterators
But not in the same way as in
LRIs
Collswhat should be plural and notTablesThe same for the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
It is done