Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions PWGDQ/Tasks/v0selector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
registry.add("hDCAV0Dau", "hDCAV0Dau", HistType::kTH1F, {{1000, 0.0f, 10.0f}});
registry.add("hV0APplot", "hV0APplot", HistType::kTH2F, {{200, -1.0f, +1.0f}, {250, 0.0f, 0.25f}});
registry.add("hV0APplotSelected", "hV0APplotSelected", HistType::kTH2F, {{200, -1.0f, +1.0f}, {250, 0.0f, 0.25f}});
registry.add("hV0Psi", "hV0Psi", HistType::kTH2F, {{100, 0, TMath::PiOver2()}, {100, 0, 0.1}});

Check failure on line 252 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
if (selectCascades) {
registry.add("hCascPt", "pT", HistType::kTH1F, {{100, 0.0f, 10}});
registry.add("hCascEtaPhi", "#eta vs. #varphi", HistType::kTH2F, {{63, 0, 6.3}, {20, -1.0f, 1.0f}});
Expand Down Expand Up @@ -298,7 +298,7 @@
if (produceCascID.value) {
cascpidmap.resize(Cascs.size(), kUndef);
}
for (auto& V0 : V0s) {

Check failure on line 301 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// if (!(V0.posTrack_as<FullTracksExt>().trackType() & o2::aod::track::TPCrefit)) {
// continue;
// }
Expand All @@ -315,8 +315,8 @@
const auto& negTrack = V0.negTrack_as<FullTracksExt>();

bool isRejectV0{false};
for(const auto& prong : {posTrack, negTrack}) {
for (const auto& prong : {posTrack, negTrack}) {
isRejectV0 = isRejectV0 || std::fabs(prong.eta()) > 0.9;

Check failure on line 319 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
isRejectV0 = isRejectV0 || prong.tpcNClsCrossedRows() < mincrossedrows;
isRejectV0 = isRejectV0 || prong.tpcChi2NCl() > maxchi2tpc;
isRejectV0 = isRejectV0 || std::fabs(prong.dcaXY()) < dcamin;
Expand All @@ -324,7 +324,8 @@
}
isRejectV0 = isRejectV0 || (posTrack.sign() * negTrack.sign() > 0);

if (isRejectV0) continue;
if (isRejectV0)
continue;

float V0dca = V0.dcaV0daughters();
float V0CosinePA = V0.v0cosPA();
Expand Down Expand Up @@ -397,7 +398,7 @@
registry.fill(HIST("hMassK0SEta"), V0.eta(), mK0S);
registry.fill(HIST("hMassK0SPhi"), V0.phi(), mK0S);
}
if ((0.48 < mK0S && mK0S < 0.51) && std::abs(V0.posTrack_as<FullTracksExt>().tpcNSigmaPi()) < cutNsigmaPiTPC && std::abs(V0.negTrack_as<FullTracksExt>().tpcNSigmaPi()) < cutNsigmaPiTPC) {

Check failure on line 401 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pidmap[V0.posTrackId()] |= (uint8_t(1) << kK0S);
pidmap[V0.negTrackId()] |= (uint8_t(1) << kK0S);
storeV0AddID(V0.globalIndex(), kK0S);
Expand Down Expand Up @@ -426,7 +427,7 @@

} // end of V0 loop
if (produceV0ID.value) {
for (auto& V0 : V0s) {

Check failure on line 430 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
v0mapID(v0pidmap[V0.globalIndex()]);
}
}
Expand All @@ -442,7 +443,7 @@
const auto& bachelor = casc.bachelor_as<FullTracksExt>();

bool isRejectCascade{false};
for(const auto& prong : {posTrack, negTrack, bachelor}) {
for (const auto& prong : {posTrack, negTrack, bachelor}) {
isRejectCascade = isRejectCascade || std::fabs(prong.eta()) > 0.9;
isRejectCascade = isRejectCascade || prong.tpcNClsCrossedRows() < mincrossedrows;
isRejectCascade = isRejectCascade || prong.tpcChi2NCl() > maxchi2tpc;
Expand All @@ -451,7 +452,8 @@
}
isRejectCascade = isRejectCascade || (posTrack.sign() * negTrack.sign() > 0);

if (isRejectCascade) continue;
if (isRejectCascade)
continue;

if (fillhisto) {
registry.fill(HIST("hCascCandidate"), 2);
Expand Down Expand Up @@ -552,12 +554,12 @@
}
} // end of Casc loop
if (produceCascID.value) {
for (auto& casc : Cascs) {

Check failure on line 557 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
cascmapID(cascpidmap[casc.globalIndex()]);
}
}
}
for (auto& track : tracks) {

Check failure on line 562 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// printf("setting pidmap[%lld] = %d\n",track.globalIndex(),pidmap[track.globalIndex()]);
v0bits(pidmap[track.globalIndex()]);
} // end of track loop
Expand Down Expand Up @@ -643,12 +645,12 @@
}
registry.fill(HIST("hEventCounter"), 3.0); // Ncontrib > 0

if (abs(collision.posZ()) > 10.0) {

Check failure on line 648 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
}
registry.fill(HIST("hEventCounter"), 4.0); //|Zvtx| < 10 cm

for (auto& track : tracks) {

Check failure on line 653 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!track.has_collision()) {
continue;
}
Expand Down Expand Up @@ -760,7 +762,7 @@
void DefineHistograms(TString histClasses)
{
std::unique_ptr<TObjArray> objArray(histClasses.Tokenize(";"));
for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) {

Check failure on line 765 in PWGDQ/Tasks/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
TString classStr = objArray->At(iclass)->GetName();
fHistMan->AddHistClass(classStr.Data());

Expand Down
Loading