Skip to content

Commit 4d1a4db

Browse files
alibuildrspijkers
authored andcommitted
Please consider the following formatting changes (#1)
1 parent 1903f9f commit 4d1a4db

1 file changed

Lines changed: 32 additions & 30 deletions

File tree

PWGLF/Tasks/strangecorrelations.cxx

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ using namespace o2::framework;
4646
using namespace o2::framework::expressions;
4747
using std::array;
4848

49-
//use parameters + cov mat non-propagated, aux info + (extension propagated)
49+
// use parameters + cov mat non-propagated, aux info + (extension propagated)
5050
using FullTracksExt = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA>;
5151
using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA>;
5252
using FullTracksExtWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
5353
using FullTracksExtIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
5454

55-
// Let's try to add a column to the cascdataext table: IsSelected.
55+
// Let's try to add a column to the cascdataext table: IsSelected.
5656
// In the future this will probably also be a way to tell Xi's and Omega's apart
5757
namespace o2::aod
5858
{
@@ -63,10 +63,10 @@ DECLARE_SOA_COLUMN(IsSelected, isSelected, int); //~!
6363
DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //!
6464
cascadeflags::IsSelected);
6565
using CascDataExtSelected = soa::Join<CascDataExt, CascadeFlags>;
66-
}
66+
} // namespace o2::aod
6767

6868
// Should we make a separate struct with "cascadeSelector" here?
69-
// The process function of this would then produce the CascadeFlags table.
69+
// The process function of this would then produce the CascadeFlags table.
7070
struct cascadeSelector {
7171
Produces<aod::CascadeFlags> cascflags;
7272

@@ -78,34 +78,35 @@ struct cascadeSelector {
7878
},
7979
};
8080

81-
void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIUWithPID const&){
82-
for (auto& casc : Cascades){
81+
void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIUWithPID const&)
82+
{
83+
for (auto& casc : Cascades) {
8384
auto v0 = casc.v0_as<o2::aod::V0sLinked>();
8485
if (!(v0.has_v0Data())) {
8586
cascflags(0);
8687
continue; // reject if no v0data
8788
}
8889
auto v0data = v0.v0Data();
89-
90+
9091
// Let's try to do some PID
9192
// these are the tracks:
9293
auto bachTrack = casc.bachelor_as<FullTracksExtIUWithPID>();
9394
auto posTrack = v0data.posTrack_as<FullTracksExtIUWithPID>();
9495
auto negTrack = v0data.negTrack_as<FullTracksExtIUWithPID>();
9596

96-
//Bachelor check: Regardless of sign, should be pion (Xi) or kaon (Omega TODO)
97+
// Bachelor check: Regardless of sign, should be pion (Xi) or kaon (Omega TODO)
9798
if (TMath::Abs(bachTrack.tpcNSigmaPi()) > 3) {
9899
cascflags(0);
99100
continue;
100101
}
101102

102-
if (casc.sign() < 0){ // FIXME: only Xi for now, implement Omega's TODO
103-
//Proton check:
103+
if (casc.sign() < 0) { // FIXME: only Xi for now, implement Omega's TODO
104+
// Proton check:
104105
if (TMath::Abs(posTrack.tpcNSigmaPr()) > 3) {
105106
cascflags(0);
106107
continue;
107108
}
108-
//Pion check:
109+
// Pion check:
109110
if (TMath::Abs(negTrack.tpcNSigmaPi()) > 3) {
110111
cascflags(0);
111112
continue;
@@ -114,9 +115,8 @@ struct cascadeSelector {
114115
// if we reach here, candidate is good!
115116
cascflags(1);
116117
} // cascade loop
117-
} // process
118-
}; // struct
119-
118+
} // process
119+
}; // struct
120120

121121
struct cascadeCorrelations {
122122
// Basic checks
@@ -128,10 +128,10 @@ struct cascadeCorrelations {
128128
{"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
129129
{"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
130130

131-
{"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2*PI, "#varphi"}}}},
131+
{"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2 * PI, "#varphi"}}}},
132132

133-
{"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {{100, -PI/2, 1.5*PI, "#Delta#varphi"}}}},
134-
{"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {{100, -PI/2, 1.5*PI, "#Delta#varphi"}}}},
133+
{"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
134+
{"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
135135
},
136136
};
137137

@@ -147,15 +147,17 @@ struct cascadeCorrelations {
147147
continue; // reject if no v0data
148148
}
149149
auto v0data = v0.v0Data();
150-
150+
151151
if (casc.sign() < 0) { // FIXME: could be done better...
152152
// Check if we don't use the same pion twice in single cascade reco
153-
if (casc.bachelorId() == v0data.negTrackId()) LOGF(info, "autocorrelation in neg cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
153+
if (casc.bachelorId() == v0data.negTrackId())
154+
LOGF(info, "autocorrelation in neg cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
154155
registry.fill(HIST("hMassXiMinus"), casc.mXi());
155156
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega());
156157
} else {
157158
// Check if we don't use the same pion twice in single cascade reco
158-
if (casc.bachelorId() == v0data.posTrackId()) LOGF(info, "autocorrelation in pos cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
159+
if (casc.bachelorId() == v0data.posTrackId())
160+
LOGF(info, "autocorrelation in pos cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
159161
registry.fill(HIST("hMassXiPlus"), casc.mXi());
160162
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega());
161163
}
@@ -166,23 +168,23 @@ struct cascadeCorrelations {
166168
for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables
167169
auto lambda0 = c0.v0_as<o2::aod::V0sLinked>();
168170
auto lambda1 = c1.v0_as<o2::aod::V0sLinked>();
169-
if (!(lambda0.has_v0Data()) || !(lambda1.has_v0Data())) {
170-
continue; // reject if no v0data in either of the lambda's
171-
}
171+
if (!(lambda0.has_v0Data()) || !(lambda1.has_v0Data())) {
172+
continue; // reject if no v0data in either of the lambda's
173+
}
172174
auto v0data0 = lambda0.v0Data();
173175
auto v0data1 = lambda1.v0Data();
174176

175177
LOGF(info, "Found a cascade pair!"); // casc table doesn't have global indices, makes no sense to print them (will just be numbered like 0,1,2,...)
176178
double phi0 = RecoDecay::phi(c0.px(), c0.py());
177179
double phi1 = RecoDecay::phi(c1.px(), c1.py());
178-
double dphi = std::fmod(phi0 - phi1 + 2.5*PI, 2*PI) - 0.5*PI;
179-
if(c0.sign()*c1.sign() < 0){ // OS
180+
double dphi = std::fmod(phi0 - phi1 + 2.5 * PI, 2 * PI) - 0.5 * PI;
181+
if (c0.sign() * c1.sign() < 0) { // OS
180182
registry.fill(HIST("hDeltaPhiOS"), dphi);
181183
} else { // SS
182184
// Let's see if we have many autocorrelations?
183185
// Should only be prevalent in SS due to pions, lambda's
184186
// Let's first check if the lambda's aren't the same:
185-
if(v0data0.v0Id() == v0data1.v0Id()) {
187+
if (v0data0.v0Id() == v0data1.v0Id()) {
186188
LOGF(info, "same v0 in SS correlation! %d %d", v0data0.v0Id(), v0data1.v0Id());
187189
continue;
188190
}
@@ -192,7 +194,7 @@ struct cascadeCorrelations {
192194
int NegId0 = v0data0.negTrackId();
193195
int PosId1 = v0data1.posTrackId();
194196
int NegId1 = v0data1.negTrackId();
195-
if(BachId0 == BachId1){
197+
if (BachId0 == BachId1) {
196198
LOGF(info, "same bachelor in SS correlation! %d %d", BachId0, BachId1);
197199
continue;
198200
}
@@ -201,7 +203,7 @@ struct cascadeCorrelations {
201203
LOGF(info, "cascades have a v0-track in common in SS correlation!");
202204
continue;
203205
}
204-
if (c0.sign() < 0){ // min cascade
206+
if (c0.sign() < 0) { // min cascade
205207
if (NegId0 == BachId1 || NegId1 == BachId0) {
206208
LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!");
207209
continue;
@@ -215,8 +217,8 @@ struct cascadeCorrelations {
215217
registry.fill(HIST("hDeltaPhiSS"), dphi);
216218
}
217219
} // correlations
218-
} // process
219-
}; //struct
220+
} // process
221+
}; // struct
220222

221223
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
222224
{

0 commit comments

Comments
 (0)