Skip to content

Commit fc14fe0

Browse files
committed
fixing compiler issues, attending comments from review and adding code for event count by multiplicity range
1 parent c4bfe7c commit fc14fe0

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ struct TwoParticleCorrelationPp {
160160
using FullCollisions = soa::Join<aod::Collisions, aod::EvSels>;
161161
using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA>;
162162

163-
struct SameEventTag {
164-
};
165-
struct MixedEventTag {
163+
enum EventType {
164+
SameEvent = 1,
165+
MixedEvent = 2
166166
};
167167

168168
SliceCache cache;
@@ -277,8 +277,8 @@ struct TwoParticleCorrelationPp {
277277
return true;
278278
}
279279

280-
template <typename TTarget, typename TTracks, typename TTag>
281-
void fillCorrelations(TTarget target, TTracks tracks1, TTracks tracks2, float multiplicity, float posZ, TTag)
280+
template <typename TTarget, typename TTracks>
281+
void fillCorrelations(TTarget target, TTracks tracks1, TTracks tracks2, float multiplicity, float posZ, int system)
282282
{
283283
for (const auto& track1 : tracks1) {
284284
if (isTrackCut(track1) == false) {
@@ -310,43 +310,40 @@ struct TwoParticleCorrelationPp {
310310
multiplicity,
311311
deltaPhi,
312312
posZ);
313-
if constexpr (std::is_same_v<TTag, SameEventTag>) {
313+
314+
if (system == SameEvent) {
314315
if (minMultiplicity <= multiplicity) {
315316
histos.fill(HIST("sameEvent2D"), deltaEta, deltaPhi);
316317
}
317318
if (minMultiplicity <= multiplicity && multiplicity <= range1Max) {
318319
histos.fill(HIST("sameEvent_2_10"), deltaEta, deltaPhi);
319-
}
320-
if (range2Min <= multiplicity && multiplicity <= range2Max) {
320+
} else if (range2Min <= multiplicity && multiplicity <= range2Max) {
321321
histos.fill(HIST("sameEvent_11_20"), deltaEta, deltaPhi);
322-
}
323-
if (range3Min <= multiplicity && multiplicity <= range3Max) {
322+
} else if (range3Min <= multiplicity && multiplicity <= range3Max) {
324323
histos.fill(HIST("sameEvent_21_30"), deltaEta, deltaPhi);
325-
}
326-
if (range4Min <= multiplicity && multiplicity <= range4Max) {
324+
} else if (range4Min <= multiplicity && multiplicity <= range4Max) {
327325
histos.fill(HIST("sameEvent_31_40"), deltaEta, deltaPhi);
328-
}
329-
if (range5Min <= multiplicity && multiplicity <= range5Max) {
326+
} else if (range5Min <= multiplicity && multiplicity <= range5Max) {
330327
histos.fill(HIST("sameEvent_41_50"), deltaEta, deltaPhi);
328+
} else {
329+
continue;
331330
}
332-
} else if constexpr (std::is_same_v<TTag, MixedEventTag>) {
331+
} else if (system == MixedEvent) {
333332
if (minMultiplicity <= multiplicity) {
334333
histos.fill(HIST("mixedEvent2D"), deltaEta, deltaPhi);
335334
}
336335
if (minMultiplicity <= multiplicity && multiplicity <= range1Max) {
337336
histos.fill(HIST("mixedEvent_2_10"), deltaEta, deltaPhi);
338-
}
339-
if (range2Min <= multiplicity && multiplicity <= range2Max) {
337+
} else if (range2Min <= multiplicity && multiplicity <= range2Max) {
340338
histos.fill(HIST("mixedEvent_11_20"), deltaEta, deltaPhi);
341-
}
342-
if (range3Min <= multiplicity && multiplicity <= range3Max) {
339+
} else if (range3Min <= multiplicity && multiplicity <= range3Max) {
343340
histos.fill(HIST("mixedEvent_21_30"), deltaEta, deltaPhi);
344-
}
345-
if (range4Min <= multiplicity && multiplicity <= range4Max) {
341+
} else if (range4Min <= multiplicity && multiplicity <= range4Max) {
346342
histos.fill(HIST("mixedEvent_31_40"), deltaEta, deltaPhi);
347-
}
348-
if (range5Min <= multiplicity && multiplicity <= range5Max) {
343+
} else if (range5Min <= multiplicity && multiplicity <= range5Max) {
349344
histos.fill(HIST("mixedEvent_41_50"), deltaEta, deltaPhi);
345+
} else {
346+
continue;
350347
}
351348
}
352349
}
@@ -381,8 +378,8 @@ struct TwoParticleCorrelationPp {
381378
if (fillCollision(mixed, multiplicity) == false) {
382379
return;
383380
}
384-
histos.fill(HIST("eventcount"), bindingOnVtx.getBin({collision1.posZ()}));
385-
fillCorrelations(mixed, tracks1, tracks2, multiplicity, collision1.posZ(), MixedEventTag{});
381+
//histos.fill(HIST("eventcount"), bindingOnVtx.getBin({collision1.posZ()}));
382+
fillCorrelations(mixed, tracks1, tracks2, multiplicity, collision1.posZ(), MixedEvent);
386383
}
387384
}
388385

@@ -407,17 +404,25 @@ struct TwoParticleCorrelationPp {
407404
return;
408405
}
409406
histos.fill(HIST("eventcount"), -2);
407+
if (minMultiplicity <= multiplicity && multiplicity <= range1Max) {
408+
histos.fill(HIST("eventcount"), 1);
409+
} else if (range2Min <= multiplicity && multiplicity <= range2Max) {
410+
histos.fill(HIST("eventcount"), 2);
411+
} else if (range3Min <= multiplicity && multiplicity <= range3Max) {
412+
histos.fill(HIST("eventcount"), 3);
413+
} else if (range4Min <= multiplicity && multiplicity <= range4Max) {
414+
histos.fill(HIST("eventcount"), 4);
415+
} else if (range5Min <= multiplicity && multiplicity <= range5Max) {
416+
histos.fill(HIST("eventcount"), 5);
417+
}
410418
fillQA(tracks, multiplicity);
411-
fillCorrelations(same, tracks, tracks, multiplicity, collision.posZ(), SameEventTag{});
419+
fillCorrelations(same, tracks, tracks, multiplicity, collision.posZ(), SameEvent);
412420
}
413421

414422
PROCESS_SWITCH(TwoParticleCorrelationPp, processSame, "Process same events", true);
415423

416424
void process(FullCollisions::iterator const& collision, FullTracks const& tracks)
417425
{
418-
419-
float multiplicity = 0;
420-
421426
// Configure events flow histogram labels
422427
auto hFlowEvents = histos.get<TH1>(HIST("Events/hEventsAfterCuts"));
423428
hFlowEvents->GetXaxis()->SetBinLabel(1, "All tracks");
@@ -555,11 +560,6 @@ struct TwoParticleCorrelationPp {
555560
continue; // TPC chi2
556561
}
557562
histos.fill(HIST("Tracks/hTracksAfterCuts"), 16);
558-
559-
if (isTrackCut(track) == false) {
560-
continue;
561-
}
562-
++multiplicity;
563563
}
564564
}
565565

0 commit comments

Comments
 (0)