1414// / \author Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch)
1515
1616#include < vector>
17+
1718#include " Framework/runDataProcessing.h"
1819#include " Framework/AnalysisTask.h"
1920#include " Framework/AnalysisDataModel.h"
2021#include " Framework/ASoAHelpers.h"
22+ #include " Framework/ASoA.h"
2123#include " Framework/HistogramRegistry.h"
2224#include " Framework/RunningWorkflowInfo.h"
2325#include " CommonConstants/MathConstants.h"
26+ #include " CCDB/BasicCCDBManager.h"
27+ #include " Common/Core/RecoDecay.h"
28+
2429#include " Common/DataModel/EventSelection.h"
2530#include " Common/DataModel/TrackSelectionTables.h"
2631#include " Common/DataModel/Centrality.h"
2732#include " Common/DataModel/Multiplicity.h"
33+ #include " PWGCF/DataModel/CorrelationsDerived.h"
2834#include " PWGCF/Core/CorrelationContainer.h"
2935#include " PWGCF/Core/PairCuts.h"
30- #include " Common/Core/RecoDecay.h"
36+
37+ namespace o2 ::aod
38+ {
39+ namespace corrsparse
40+ {
41+ DECLARE_SOA_COLUMN (Multiplicity, multiplicity, int );
42+ }
43+ DECLARE_SOA_TABLE (Multiplicity, " AOD" , " MULTIPLICITY" ,
44+ corrsparse::Multiplicity);
45+
46+ } // namespace o2::aod
3147
3248using namespace o2 ;
3349using namespace o2 ::framework;
3450using namespace o2 ::framework::expressions;
3551
52+ // define the filtered collisions and tracks
3653#define O2_DEFINE_CONFIGURABLE (NAME, TYPE, DEFAULT, HELP ) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
3754
55+ struct CalcNch {
56+ O2_DEFINE_CONFIGURABLE (cfgZVtxCut, float , 10 .0f , " Accepted z-vertex range" )
57+ O2_DEFINE_CONFIGURABLE (cfgPtCutMin, float , 0 .2f , " minimum accepted track pT" )
58+ O2_DEFINE_CONFIGURABLE (cfgPtCutMax, float , 10 .0f , " maximum accepted track pT" )
59+ O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .8f , " Eta cut" )
60+ O2_DEFINE_CONFIGURABLE (cfgMinMixEventNum, int , 5 , " Minimum number of events to mix" )
61+
62+ Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t ) true ));
63+
64+ using AodCollisions = soa::Join<aod::Collisions, aod::EvSel>; // aod::CentFT0Cs
65+ using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra>>;
66+
67+ Produces<aod::Multiplicity> multiplicityNch;
68+
69+ HistogramRegistry registry{" registry" };
70+
71+ void init (InitContext&)
72+ {
73+ AxisSpec axisNch = {100 , 0 , 100 };
74+ AxisSpec axisVrtx = {10 , -10 , 10 };
75+
76+ registry.add (" Ncharge" , " N_{charge}" , {HistType::kTH1D , {axisNch}});
77+ registry.add (" zVtx_all" , " zVtx_all" , {HistType::kTH1D , {axisVrtx}});
78+ }
79+
80+ void process (AodCollisions::iterator const & collision, AodTracks const & tracks)
81+ {
82+ multiplicityNch (tracks.size ());
83+ registry.fill (HIST (" Ncharge" ), tracks.size ());
84+ registry.fill (HIST (" zVtx_all" ), collision.posZ ());
85+ }
86+ };
87+
3888struct CorrSparse {
3989 O2_DEFINE_CONFIGURABLE (cfgZVtxCut, float , 10 .0f , " Accepted z-vertex range" )
4090 O2_DEFINE_CONFIGURABLE (cfgPtCutMin, float , 0 .2f , " minimum accepted track pT" )
4191 O2_DEFINE_CONFIGURABLE (cfgPtCutMax, float , 10 .0f , " maximum accepted track pT" )
4292 O2_DEFINE_CONFIGURABLE (cfgEtaCut, float , 0 .8f , " Eta cut" )
4393 O2_DEFINE_CONFIGURABLE (cfgMinMixEventNum, int , 5 , " Minimum number of events to mix" )
94+ O2_DEFINE_CONFIGURABLE (cfgMinMult, int , 0 , " Minimum multiplicity for collision" )
95+ O2_DEFINE_CONFIGURABLE (cfgMaxMult, int , 10 , " Maximum multiplicity for collision" )
4496
4597 ConfigurableAxis axisVertex{" axisVertex" , {10 , -10 , 10 }, " vertex axis for histograms" };
4698 ConfigurableAxis axisEta{" axisEta" , {40 , -1 ., 1 .}, " eta axis for histograms" };
@@ -54,17 +106,21 @@ struct CorrSparse {
54106 ConfigurableAxis vtxMix{" vtxMix" , {VARIABLE_WIDTH, -10 , -9 , -8 , -7 , -6 , -5 , -4 , -3 , -2 , -1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }, " vertex axis for mixed event histograms" };
55107 ConfigurableAxis multMix{" multMix" , {VARIABLE_WIDTH, 0 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 50 , 60 , 80 , 100 }, " multiplicity / centrality axis for mixed event histograms" };
56108
57- // make the filters and cuts.
58-
59- Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut && (aod::evsel::sel8) == true ;
109+ ConfigurableAxis axisVertexEfficiency{ " axisVertexEfficiency " , { 10 , - 10 , 10 }, " vertex axis for efficiency histograms " };
110+ ConfigurableAxis axisEtaEfficiency{ " axisEtaEfficiency " , { 20 , - 1.0 , 1.0 }, " eta axis for efficiency histograms " };
111+ ConfigurableAxis axisPtEfficiency{ " axisPtEfficiency " , {VARIABLE_WIDTH, 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.25 , 1.5 , 1.75 , 2.0 , 2.25 , 2.5 , 2.75 , 3.0 , 3.25 , 3.5 , 3.75 , 4.0 , 4.5 , 5.0 , 6.0 , 7.0 , 8.0 }, " pt axis for efficiency histograms " } ;
60112
113+ // make the filters and cuts.
114+ Filter collisionFilter = (nabs(aod::collision::posZ) < cfgZVtxCut) && (aod::corrsparse::multiplicity) > cfgMinMult && (aod::corrsparse::multiplicity) < cfgMaxMult && (aod::evsel::sel8) == true ;
61115 Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t ) true ));
62116
63- // define the filtered collisions and tracks
64-
65- using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, o2::aod::BarrelMults>>; // aod::CentFT0Cs
117+ using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, o2::aod::Multiplicity>>; // aod::CentFT0Cs
66118 using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra>>;
67119
120+ // Define the outputs
121+ OutputObj<CorrelationContainer> same{Form (" sameEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
122+ OutputObj<CorrelationContainer> mixed{Form (" mixedEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
123+
68124 HistogramRegistry registry{" registry" };
69125
70126 void init (InitContext&)
@@ -79,11 +135,25 @@ struct CorrSparse {
79135 registry.add (" Nch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
80136 registry.add (" zVtx" , " zVtx" , {HistType::kTH1D , {axisVertex}});
81137
82- registry.add (" Sparse_mixed" , " " , {HistType::kTHnSparseF , {{axisMultiplicity, axisVertex, axisPtTrigger, axisPtAssoc, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse
83- registry.add (" Sparse_same" , " " , {HistType::kTHnSparseF , {{axisMultiplicity, axisVertex, axisPtTrigger, axisPtAssoc, axisDeltaPhi, axisDeltaEta}}});
84- registry.add (" Trig_Hist" , " " , {HistType::kTHnSparseF , {{axisMultiplicity, axisVertex, axisPtTrigger}}});
138+ registry.add (" Trig_hist" , " " , {HistType::kTHnSparseF , {{axisMultiplicity, axisVertex, axisPtTrigger}}});
85139
86140 registry.add (" eventcount" , " bin" , {HistType::kTH1F , {{3 , 0 , 3 , " bin" }}}); // histogram to see how many events are in the same and mixed event
141+
142+ std::vector<AxisSpec> corrAxis = {{axisMultiplicity, " Nch" },
143+ {axisVertex, " z-vtx (cm)" },
144+ {axisPtTrigger, " p_{T} (GeV/c)" },
145+ {axisPtAssoc, " p_{T} (GeV/c)" },
146+ {axisDeltaPhi, " #Delta#varphi (rad)" },
147+ {axisDeltaEta, " #Delta#eta" }};
148+ std::vector<AxisSpec> effAxis = {
149+ {axisVertexEfficiency, " z-vtx (cm)" },
150+ {axisPtEfficiency, " p_{T} (GeV/c)" },
151+ {axisEtaEfficiency, " #eta" },
152+ };
153+ std::vector<AxisSpec> userAxis;
154+
155+ same.setObject (new CorrelationContainer (Form (" sameEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" sameEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
156+ mixed.setObject (new CorrelationContainer (Form (" mixedEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" mixedEvent_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
87157 }
88158 enum EventType {
89159 SameEvent = 1 ,
@@ -104,14 +174,14 @@ struct CorrSparse {
104174 }
105175 }
106176
107- template <typename TTracks>
177+ template <CorrelationContainer::CFStep step, typename TTracks>
108178 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
109179 {
110180 // loop over all tracks
111181 for (auto const & track1 : tracks1) {
112182
113183 if (system == SameEvent) {
114- registry.fill (HIST (" Trig_Hist " ), Nch, posZ, track1.pt ());
184+ registry.fill (HIST (" Trig_hist " ), Nch, posZ, track1.pt ());
115185 }
116186
117187 for (auto const & track2 : tracks2) {
@@ -124,11 +194,11 @@ struct CorrSparse {
124194
125195 // fill the right sparse and histograms
126196 if (system == SameEvent) {
197+ same->getPairHist ()->Fill (step, Nch, posZ, track1.pt (), track2.pt (), deltaPhi, deltaEta);
127198 registry.fill (HIST (" deltaEta_deltaPhi_same" ), deltaPhi, deltaEta);
128- registry.fill (HIST (" Sparse_same" ), Nch, posZ, track1.pt (), track2.pt (), deltaPhi, deltaEta);
129199 } else if (system == MixedEvent) {
200+ mixed->getPairHist ()->Fill (step, Nch, posZ, track1.pt (), track2.pt (), deltaPhi, deltaEta);
130201 registry.fill (HIST (" deltaEta_deltaPhi_mixed" ), deltaPhi, deltaEta);
131- registry.fill (HIST (" Sparse_mixed" ), Nch, posZ, track1.pt (), track2.pt (), deltaPhi, deltaEta);
132202 }
133203 }
134204 }
@@ -139,14 +209,14 @@ struct CorrSparse {
139209
140210 registry.fill (HIST (" eventcount" ), SameEvent); // because its same event i put it in the 1 bin
141211 fillYield (collision, tracks);
142- fillCorrelations (tracks, tracks, collision.posZ (), SameEvent, tracks.size ()); // fill the SE histogram and Sparse
212+ fillCorrelations<CorrelationContainer:: kCFStepReconstructed > (tracks, tracks, collision.posZ (), SameEvent, tracks.size ()); // fill the SE histogram and Sparse
143213 }
144214 PROCESS_SWITCH (CorrSparse, processSame, " Process same event" , true );
145215
146216 // event mixing
147217
148218 SliceCache cache;
149- using MixedBinning = ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultTPC >;
219+ using MixedBinning = ColumnBinningPolicy<aod::collision::PosZ, aod::corrsparse::Multiplicity >;
150220
151221 // the process for filling the mixed events
152222 void processMixed (AodCollisions const & collisions, AodTracks const & tracks)
@@ -157,7 +227,7 @@ struct CorrSparse {
157227
158228 for (auto const & [collision1, tracks1, collision2, tracks2] : pairs) {
159229 registry.fill (HIST (" eventcount" ), MixedEvent); // fill the mixed event in the 3 bin
160- fillCorrelations (tracks1, tracks2, collision1.posZ (), MixedEvent, tracks1.size ());
230+ fillCorrelations<CorrelationContainer:: kCFStepReconstructed > (tracks1, tracks2, collision1.posZ (), MixedEvent, tracks1.size ());
161231 }
162232 }
163233 PROCESS_SWITCH (CorrSparse, processMixed, " Process mixed events" , true );
@@ -166,6 +236,7 @@ struct CorrSparse {
166236WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
167237{
168238 return WorkflowSpec{
239+ adaptAnalysisTask<CalcNch>(cfgc),
169240 adaptAnalysisTask<CorrSparse>(cfgc),
170241 };
171242}
0 commit comments