Skip to content

Commit acefb1e

Browse files
authored
[PWGUD] nch axis to nsample axis new (#11599)
1 parent 36a03b6 commit acefb1e

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

PWGUD/Tasks/flowCorrelationsUpc.cxx

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,31 @@
1414
/// \author Mingrui Zhao (mingrui.zhao@cern.ch, mingrui.zhao@mail.labz0.org)
1515
/// copied from Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch)
1616

17-
#include <vector>
17+
#include "PWGCF/Core/CorrelationContainer.h"
18+
#include "PWGCF/Core/PairCuts.h"
19+
#include "PWGCF/DataModel/CorrelationsDerived.h"
20+
#include "PWGUD/Core/SGSelector.h"
21+
#include "PWGUD/DataModel/UDTables.h"
1822

19-
#include "Framework/runDataProcessing.h"
20-
#include "Framework/AnalysisTask.h"
21-
#include "Framework/AnalysisDataModel.h"
22-
#include "Framework/ASoAHelpers.h"
23+
#include "Common/Core/RecoDecay.h"
24+
#include "Common/DataModel/Centrality.h"
25+
#include "Common/DataModel/EventSelection.h"
26+
#include "Common/DataModel/Multiplicity.h"
27+
#include "Common/DataModel/TrackSelectionTables.h"
28+
29+
#include "CCDB/BasicCCDBManager.h"
30+
#include "CommonConstants/MathConstants.h"
2331
#include "Framework/ASoA.h"
32+
#include "Framework/ASoAHelpers.h"
33+
#include "Framework/AnalysisDataModel.h"
34+
#include "Framework/AnalysisTask.h"
2435
#include "Framework/HistogramRegistry.h"
2536
#include "Framework/RunningWorkflowInfo.h"
26-
#include "CommonConstants/MathConstants.h"
27-
#include "CCDB/BasicCCDBManager.h"
28-
#include "Common/Core/RecoDecay.h"
37+
#include "Framework/runDataProcessing.h"
2938

30-
#include "PWGUD/DataModel/UDTables.h"
31-
#include "PWGUD/Core/SGSelector.h"
39+
#include "TRandom3.h"
3240

33-
#include "Common/DataModel/EventSelection.h"
34-
#include "Common/DataModel/TrackSelectionTables.h"
35-
#include "Common/DataModel/Centrality.h"
36-
#include "Common/DataModel/Multiplicity.h"
37-
#include "PWGCF/DataModel/CorrelationsDerived.h"
38-
#include "PWGCF/Core/CorrelationContainer.h"
39-
#include "PWGCF/Core/PairCuts.h"
41+
#include <vector>
4042

4143
namespace o2::aod
4244
{
@@ -98,6 +100,7 @@ struct FlowCorrelationsUpc {
98100
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
99101
O2_DEFINE_CONFIGURABLE(cfgMinMult, int, 0, "Minimum multiplicity for collision")
100102
O2_DEFINE_CONFIGURABLE(cfgMaxMult, int, 10, "Maximum multiplicity for collision")
103+
O2_DEFINE_CONFIGURABLE(cfgSampleSize, double, 10, "Sample size for mixed event")
101104

102105
ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for histograms"};
103106
ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"};
@@ -114,6 +117,7 @@ struct FlowCorrelationsUpc {
114117
ConfigurableAxis axisVertexEfficiency{"axisVertexEfficiency", {10, -10, 10}, "vertex axis for efficiency histograms"};
115118
ConfigurableAxis axisEtaEfficiency{"axisEtaEfficiency", {20, -1.0, 1.0}, "eta axis for efficiency histograms"};
116119
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"};
120+
ConfigurableAxis axisSample{"axisSample", {cfgSampleSize, 0, cfgSampleSize}, "sample axis for histograms"};
117121

118122
// Added UPC Cuts
119123
SGSelector sgSelector;
@@ -149,11 +153,11 @@ struct FlowCorrelationsUpc {
149153
registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}});
150154
registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}});
151155

152-
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisMultiplicity, axisVertex, axisPtTrigger}}});
156+
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
153157

154158
registry.add("eventcount", "bin", {HistType::kTH1F, {{3, 0, 3, "bin"}}}); // histogram to see how many events are in the same and mixed event
155159

156-
std::vector<AxisSpec> corrAxis = {{axisMultiplicity, "Nch"},
160+
std::vector<AxisSpec> corrAxis = {{axisSample, "Sample"},
157161
{axisVertex, "z-vtx (cm)"},
158162
{axisPtTrigger, "p_{T} (GeV/c)"},
159163
{axisPtAssoc, "p_{T} (GeV/c)"},
@@ -190,13 +194,16 @@ struct FlowCorrelationsUpc {
190194
}
191195

192196
template <CorrelationContainer::CFStep step, typename TTracks>
193-
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
197+
void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
194198
{
199+
200+
int fSampleIndex = gRandom->Uniform(0, cfgSampleSize);
201+
195202
// loop over all tracks
196203
for (auto const& track1 : tracks1) {
197204

198205
if (system == SameEvent) {
199-
registry.fill(HIST("Trig_hist"), Nch, posZ, track1.pt());
206+
registry.fill(HIST("Trig_hist"), fSampleIndex, posZ, track1.pt());
200207
}
201208

202209
for (auto const& track2 : tracks2) {
@@ -213,10 +220,10 @@ struct FlowCorrelationsUpc {
213220

214221
// fill the right sparse and histograms
215222
if (system == SameEvent) {
216-
same->getPairHist()->Fill(step, Nch, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta);
223+
same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta);
217224
registry.fill(HIST("deltaEta_deltaPhi_same"), deltaPhi, deltaEta);
218225
} else if (system == MixedEvent) {
219-
mixed->getPairHist()->Fill(step, Nch, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta);
226+
mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track2.pt(), deltaPhi, deltaEta);
220227
registry.fill(HIST("deltaEta_deltaPhi_mixed"), deltaPhi, deltaEta);
221228
}
222229
}
@@ -247,7 +254,7 @@ struct FlowCorrelationsUpc {
247254

248255
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
249256
fillYield(collision, tracks);
250-
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), SameEvent, tracks.size()); // fill the SE histogram and Sparse
257+
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), SameEvent); // fill the SE histogram and Sparse
251258
}
252259
PROCESS_SWITCH(FlowCorrelationsUpc, processSame, "Process same event", true);
253260

@@ -265,7 +272,7 @@ struct FlowCorrelationsUpc {
265272

266273
for (auto const& [collision1, tracks1, collision2, tracks2] : pairs) {
267274
registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin
268-
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent, tracks1.size());
275+
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks1, tracks2, collision1.posZ(), MixedEvent);
269276
}
270277
}
271278
PROCESS_SWITCH(FlowCorrelationsUpc, processMixed, "Process mixed events", true);

0 commit comments

Comments
 (0)