Skip to content

Commit 0700e0e

Browse files
authored
Merge pull request #2 from alibuild/alibot-cleanup-12784
[PWGCF] Please consider the following formatting changes to AliceO2Group#12784
2 parents fb51a3c + e350fc1 commit 0700e0e

File tree

3 files changed

+42
-32
lines changed

3 files changed

+42
-32
lines changed

PWGCF/DataModel/CorrelationsDerived.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ using CFCollisionWithLabel = CFCollisionsWithLabel::iterator;
6565
namespace cfeventshape
6666
{
6767
DECLARE_SOA_INDEX_COLUMN(CFCollision, cfCollision); //! Index to collision
68-
DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity
68+
DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity
6969
} // namespace cfeventshape
7070
DECLARE_SOA_TABLE(CFEventShapes, "AOD", "CFEVENTSHAPE", //! Event shape table
7171
o2::soa::Index<>,

PWGCF/TableProducer/filterCorrelations.cxx

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,13 @@ struct EventShapeProducer {
582582
O2_DEFINE_CONFIGURABLE(AbsEtaTrack, float, 0.8, "Maximum |eta| of tracks required to estimate spherocity");
583583
O2_DEFINE_CONFIGURABLE(usePtWeighted, bool, false, "Use pt-weighted spherocity");
584584
O2_DEFINE_CONFIGURABLE(outputQAHistos, bool, false, "Whether to output QA histograms for spherocity");
585-
585+
586586
HistogramRegistry QAhistos{"QAhistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
587587
HistogramRegistry QAhistosCent{"QAhistosCent", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
588588
HistogramRegistry QAhistosSpherocity{"QAhistosSpherocity", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
589-
589+
590590
std::vector<float> nx, ny, px, py;
591-
591+
592592
void init(InitContext const&)
593593
{
594594
AxisSpec axisPt = {100, 0.0, 50.0};
@@ -598,10 +598,11 @@ struct EventShapeProducer {
598598
AxisSpec axisMult = {100, 0.0, 100.0};
599599
AxisSpec axisSpherocity = {1000, 0.0, 1.0};
600600

601-
QAhistos.add("multS0", "",{HistType::kTH2F,{axisMult, axisSpherocity}});
601+
QAhistos.add("multS0", "", {HistType::kTH2F, {axisMult, axisSpherocity}});
602602
QAhistos.add("spherocity", "", {HistType::kTH1F, {axisSpherocity}});
603603

604-
if(!outputQAHistos) return;
604+
if (!outputQAHistos)
605+
return;
605606
QAhistos.add("pt", "", {HistType::kTH1F, {axisPt}});
606607
QAhistos.add("eta", "", {HistType::kTH1F, {axisEta}});
607608
QAhistos.add("phi", "", {HistType::kTH1F, {axisPhi}});
@@ -613,19 +614,20 @@ struct EventShapeProducer {
613614
QAhistosCent.add("ntracks_20_40", "", {HistType::kTH1F, {axisNtracks}});
614615
QAhistosCent.add("ntracks_40_60", "", {HistType::kTH1F, {axisNtracks}});
615616
QAhistosCent.add("ntracks_60_100", "", {HistType::kTH1F, {axisNtracks}});
616-
617+
617618
QAhistosSpherocity.add("spherocity_0_20", "", {HistType::kTH1F, {axisSpherocity}});
618619
QAhistosSpherocity.add("spherocity_20_40", "", {HistType::kTH1F, {axisSpherocity}});
619620
QAhistosSpherocity.add("spherocity_40_60", "", {HistType::kTH1F, {axisSpherocity}});
620621
QAhistosSpherocity.add("spherocity_60_100", "", {HistType::kTH1F, {axisSpherocity}});
621622
}
622623

623624
// Spherocity calculation based on the central barrel tracks
624-
template<typename TTracks>
625+
template <typename TTracks>
625626
float CalculateSpherocity(TTracks const& tracks, bool usePtWeighted, bool outputQAHistos)
626-
{
627+
{
627628
const size_t nTracks = tracks.size();
628-
if (nTracks < static_cast<size_t>(minTracks)) return -2.0f;
629+
if (nTracks < static_cast<size_t>(minTracks))
630+
return -2.0f;
629631

630632
if (nx.size() < nTracks) {
631633
nx.resize(nTracks);
@@ -641,10 +643,10 @@ struct EventShapeProducer {
641643
for (auto& track : tracks) {
642644
const float cosPhi = std::cos(track.phi());
643645
const float sinPhi = std::sin(track.phi());
644-
646+
645647
nx[idx] = cosPhi;
646648
ny[idx] = sinPhi;
647-
649+
648650
if (usePtWeighted) {
649651
const float pt = track.pt();
650652
px[idx] = pt * cosPhi;
@@ -664,8 +666,9 @@ struct EventShapeProducer {
664666
idx++;
665667
}
666668

667-
if (sumPt == 0.0f) return -1.5f; // no tracks -- avoid division by zero
668-
669+
if (sumPt == 0.0f)
670+
return -1.5f; // no tracks -- avoid division by zero
671+
669672
// Validation check for non-weighted case
670673
if (!usePtWeighted && std::abs(static_cast<float>(nTracks) - sumPt) > 0.01f) {
671674
LOGF(info, "Spherocity calculation: number of tracks (%zu) does not match sum of pT (%f)", nTracks, sumPt);
@@ -676,35 +679,41 @@ struct EventShapeProducer {
676679
float numerator = 0.0f;
677680
const float nyi = ny[i];
678681
const float nxi = nx[i];
679-
682+
680683
for (size_t j = 0; j < nTracks; j++) {
681684
numerator += std::abs(nyi * px[j] - nxi * py[j]);
682685
}
683-
686+
684687
const float sFull = std::pow(numerator / sumPt, 2);
685-
if (sFull < retval) retval = sFull;
688+
if (sFull < retval)
689+
retval = sFull;
686690
}
687691

688692
retval = retval * M_PI * M_PI / 4.0f; // normalization factor
689-
693+
690694
if (retval < 0.0f || retval > 1.0f) {
691695
LOGF(info, "Spherocity value is out of range: %f", retval);
692696
return -0.5f;
693697
}
694-
698+
695699
return retval;
696-
}//spherocity calculation ends
697-
700+
} // spherocity calculation ends
701+
698702
Filter cftrackFilter = (aod::cftrack::pt > minPtTrack) && (nabs(aod::cftrack::eta) < AbsEtaTrack);
699703

700704
using myCollisions = aod::CFCollisions;
701705
using myTracks = soa::Filtered<aod::CFTracks>;
702706

703-
inline int getCentralityBin(float multiplicity) {
704-
if (multiplicity < 20.0f) return 0;
705-
else if (multiplicity < 40.0f) return 1;
706-
else if (multiplicity < 60.0f) return 2;
707-
else if (multiplicity < 100.0f) return 3;
707+
inline int getCentralityBin(float multiplicity)
708+
{
709+
if (multiplicity < 20.0f)
710+
return 0;
711+
else if (multiplicity < 40.0f)
712+
return 1;
713+
else if (multiplicity < 60.0f)
714+
return 2;
715+
else if (multiplicity < 100.0f)
716+
return 3;
708717
return -1; // outside range
709718
}
710719

@@ -715,12 +724,13 @@ struct EventShapeProducer {
715724
const float multiplicity = coll.multiplicity();
716725
QAhistos.fill(HIST("multS0"), multiplicity, spherocity);
717726
QAhistos.fill(HIST("spherocity"), spherocity);
718-
719-
if (!outputQAHistos) return;
720-
727+
728+
if (!outputQAHistos)
729+
return;
730+
721731
const size_t nTracks = tracks.size();
722732
const int centralityBin = getCentralityBin(multiplicity);
723-
733+
724734
QAhistos.fill(HIST("ntracks"), nTracks);
725735
QAhistos.fill(HIST("mult"), multiplicity);
726736

PWGCF/Tasks/correlations.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ struct CorrelationTask {
129129
Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex;
130130
// This filter is only applied to AOD
131131
Filter collisionVertexTypeFilter = (aod::collision::flags & static_cast<uint16_t>(aod::collision::CollisionFlagsRun2::Run2VertexerTracks)) == static_cast<uint16_t>(aod::collision::CollisionFlagsRun2::Run2VertexerTracks);
132-
132+
133133
Filter collisionSpherocityFilter = (aod::cfeventshape::spherocity > cfgS0CutLow) && (aod::cfeventshape::spherocity < cfgS0CutUp);
134-
134+
135135
// Track filters
136136
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
137137
Filter cfTrackFilter = (nabs(aod::cftrack::eta) < cfgCutEta) && (aod::cftrack::pt > cfgCutPt) && ((aod::track::trackType & (uint8_t)cfgTrackBitMask) == (uint8_t)cfgTrackBitMask);

0 commit comments

Comments
 (0)