Skip to content

Commit 90ee3f2

Browse files
committed
More o2linter fixes
1 parent c9a4d8c commit 90ee3f2

3 files changed

Lines changed: 52 additions & 51 deletions

File tree

PWGLF/Tasks/Resonances/k892hadronphoton.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ using namespace o2::framework::expressions;
6060
using KStars = soa::Join<aod::KStarCores, aod::KStarPhotonExtras, aod::KShortExtras, aod::KStarCollRef>;
6161
using MCKStars = soa::Join<aod::KStarCores, aod::KStarPhotonExtras, aod::KShortExtras, aod::KStarMCCores, aod::KStarCollRef>;
6262

63-
static const std::vector<std::string> PhotonSels = {"NoSel", "V0Type", "DCADauToPV",
63+
static const std::vector<std::string> photonSels = {"NoSel", "V0Type", "DCADauToPV",
6464
"DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT",
6565
"Y", "V0Radius", "RZCut", "Armenteros", "CosPA",
6666
"PsiPair", "Phi", "Mass"};
6767

68-
static const std::vector<std::string> KShortSels = {"NoSel", "V0Radius", "DCADau", "Armenteros",
68+
static const std::vector<std::string> kshortSels = {"NoSel", "V0Radius", "DCADau", "Armenteros",
6969
"CosPA", "Y", "TPCCR", "DauITSCls", "Lifetime",
7070
"TPCTOFPID", "DCADauToPV", "Mass"};
7171

@@ -121,7 +121,7 @@ struct k892hadronphoton {
121121
} eventSelections;
122122

123123
// generated
124-
Configurable<bool> mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."};
124+
Configurable<bool> mcKeepOnlyFromGenerator{"mcKeepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."};
125125

126126
// QA
127127
Configurable<bool> fillBkgQAhistos{"fillBkgQAhistos", false, "if true, fill MC QA histograms for Bkg study. Only works with MC."};
@@ -134,7 +134,7 @@ struct k892hadronphoton {
134134

135135
//// K0Short criteria:
136136
struct : ConfigurableGroup {
137-
Configurable<float> kshort_MLThreshold{"kshort_MLThreshold", 0.1, "Decision Threshold value to select kshorts"};
137+
Configurable<float> kshortMLThreshold{"kshortMLThreshold", 0.1, "Decision Threshold value to select kshorts"};
138138
Configurable<float> kshortMinDCANegToPv{"kshortMinDCANegToPv", .05, "min DCA Neg To PV (cm)"};
139139
Configurable<float> kshortMinDCAPosToPv{"kshortMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"};
140140
Configurable<float> kshortMaxDCAV0Dau{"kshortMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"};
@@ -162,7 +162,7 @@ struct k892hadronphoton {
162162

163163
//// Photon criteria:
164164
struct : ConfigurableGroup {
165-
Configurable<float> gamma_MLThreshold{"gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"};
165+
Configurable<float> gammaMLThreshold{"gammaMLThreshold", 0.1, "Decision Threshold value to select gammas"};
166166
Configurable<int> photonv0TypeSel{"photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"};
167167
Configurable<float> photonMinDCADauToPv{"photonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"};
168168
Configurable<float> photonMaxDCAV0Dau{"photonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"};
@@ -408,16 +408,16 @@ struct k892hadronphoton {
408408
histos.add("Selection/Photon/hCandidateSel", "hCandidateSel", kTH1D, {axisCandSel});
409409
histos.add("Selection/KShort/hCandidateSel", "hCandidateSel", kTH1D, {axisCandSel});
410410

411-
for (size_t i = 0; i < PhotonSels.size(); ++i) {
412-
const auto& sel = PhotonSels[i];
411+
for (size_t i = 0; i < photonSels.size(); ++i) {
412+
const auto& sel = photonSels[i];
413413

414414
histos.add(Form("Selection/Photon/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisPhotonMass});
415415
histos.get<TH1>(HIST("Selection/Photon/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str());
416416
histos.add(Form("Selection/KStar/h2dPhoton%s", sel.c_str()), ("h2dPhoton" + sel).c_str(), kTH2D, {axisPt, axisKStarMass});
417417
}
418418

419-
for (size_t i = 0; i < KShortSels.size(); ++i) {
420-
const auto& sel = KShortSels[i];
419+
for (size_t i = 0; i < kshortSels.size(); ++i) {
420+
const auto& sel = kshortSels[i];
421421

422422
histos.add(Form("Selection/KShort/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisKShortMass});
423423
histos.get<TH1>(HIST("Selection/KShort/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str());
@@ -691,7 +691,7 @@ struct k892hadronphoton {
691691
continue;
692692

693693
// Selection on the source (generator/transport)
694-
if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator)
694+
if (!genParticle.producedByGenerator() && mcKeepOnlyFromGenerator)
695695
continue;
696696

697697
// Select corresponding mc collision && Basic event selection
@@ -988,28 +988,28 @@ struct k892hadronphoton {
988988
void fillSelHistos(TKStarObject const& kstar, int PDGRequired)
989989
{
990990

991-
static constexpr std::string_view PhotonSelsLocal[] = {"NoSel", "V0Type", "DCADauToPV",
991+
static constexpr std::string_view photonSelsLocal[] = {"NoSel", "V0Type", "DCADauToPV",
992992
"DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT",
993993
"Y", "V0Radius", "RZCut", "Armenteros", "CosPA",
994994
"PsiPair", "Phi", "Mass"};
995995

996-
static constexpr std::string_view KShortSelsLocal[] = {"NoSel", "V0Radius", "DCADau", "Armenteros",
996+
static constexpr std::string_view kshortSelsLocal[] = {"NoSel", "V0Radius", "DCADau", "Armenteros",
997997
"CosPA", "Y", "TPCCR", "DauITSCls", "Lifetime",
998998
"TPCTOFPID", "DCADauToPV", "Mass"};
999999

10001000
if (std::abs(PDGRequired) == PDG_t::kGamma) {
1001-
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(PhotonSelsLocal))) {
1001+
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(photonSelsLocal))) {
10021002
histos.fill(HIST("Selection/Photon/hCandidateSel"), selection_index);
1003-
histos.fill(HIST("Selection/Photon/h2d") + HIST(PhotonSelsLocal[selection_index]), kstar.photonPt(), kstar.photonMass());
1004-
histos.fill(HIST("Selection/KStar/h2dPhoton") + HIST(PhotonSelsLocal[selection_index]), kstar.pt(), kstar.kstarMass());
1003+
histos.fill(HIST("Selection/Photon/h2d") + HIST(photonSelsLocal[selection_index]), kstar.photonPt(), kstar.photonMass());
1004+
histos.fill(HIST("Selection/KStar/h2dPhoton") + HIST(photonSelsLocal[selection_index]), kstar.pt(), kstar.kstarMass());
10051005
}
10061006
}
10071007

10081008
if (std::abs(PDGRequired) == PDG_t::kK0Short) {
1009-
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(KShortSelsLocal))) {
1009+
if constexpr (selection_index >= 0 && selection_index < static_cast<int>(std::size(kshortSelsLocal))) {
10101010
histos.fill(HIST("Selection/KShort/hCandidateSel"), selection_index);
1011-
histos.fill(HIST("Selection/KShort/h2d") + HIST(KShortSelsLocal[selection_index]), kstar.kshortPt(), kstar.kshortMass());
1012-
histos.fill(HIST("Selection/KStar/h2dKShort") + HIST(KShortSelsLocal[selection_index]), kstar.pt(), kstar.kstarMass());
1011+
histos.fill(HIST("Selection/KShort/h2d") + HIST(kshortSelsLocal[selection_index]), kstar.kshortPt(), kstar.kshortMass());
1012+
histos.fill(HIST("Selection/KStar/h2dKShort") + HIST(kshortSelsLocal[selection_index]), kstar.pt(), kstar.kstarMass());
10131013
}
10141014
}
10151015
}

PWGLF/Tasks/Resonances/k892hadronphotonBkg.cxx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
// oussama.benchikhi@cern.ch
2121
//
2222

23-
#include "PWGLF/DataModel/LFSigmaTables.h"
2423
#include "PWGLF/DataModel/LFStrangenessMLTables.h"
2524
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
2625
#include "PWGLF/DataModel/LFStrangenessTables.h"
2726

2827
#include "Common/CCDB/EventSelectionParams.h"
2928
#include "Common/CCDB/ctpRateFetcher.h"
3029
#include "Common/Core/RecoDecay.h"
30+
#include "Common/DataModel/Centrality.h"
3131

3232
#include <CCDB/BasicCCDBManager.h>
3333
#include <CommonConstants/MathConstants.h>
@@ -42,18 +42,18 @@
4242
#include <Framework/InitContext.h>
4343
#include <Framework/OutputObjHeader.h>
4444
#include <Framework/runDataProcessing.h>
45+
#include "Framework/BinningPolicy.h"
4546

46-
#include <Math/Vector3D.h>
4747
#include <Math/Vector4D.h>
4848
#include <TH1.h>
49-
#include <TMath.h>
5049
#include <TRandom3.h>
5150

5251
#include <array>
5352
#include <cmath>
5453
#include <cstdint>
5554
#include <string>
5655
#include <vector>
56+
#include <cstddef>
5757

5858
using namespace o2;
5959
using namespace o2::framework;
@@ -127,7 +127,7 @@ struct k892hadronphotonBkg {
127127
//// Photon criteria:
128128
struct : ConfigurableGroup {
129129
std::string prefix = "photonSelections"; // JSON group name
130-
Configurable<float> gamma_MLThreshold{"gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"};
130+
Configurable<float> gammaMLThreshold{"gammaMLThreshold", 0.1, "Decision Threshold value to select gammas"};
131131
Configurable<int> photonv0TypeSel{"photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"};
132132
Configurable<float> photonMinDCADauToPv{"photonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"};
133133
Configurable<float> photonMaxDCAV0Dau{"photonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"};
@@ -155,7 +155,7 @@ struct k892hadronphotonBkg {
155155
// KShort criteria:
156156
struct : ConfigurableGroup {
157157
std::string prefix = "kshortSelections"; // JSON group name
158-
Configurable<float> kshort_MLThreshold{"kshort_MLThreshold", 0.1, "Decision Threshold value to select kshorts"};
158+
Configurable<float> kshortMLThreshold{"kshortMLThreshold", 0.1, "Decision Threshold value to select kshorts"};
159159
Configurable<float> kshortMinDCANegToPv{"kshortMinDCANegToPv", .05, "min DCA Neg To PV (cm)"};
160160
Configurable<float> kshortMinDCAPosToPv{"kshortMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"};
161161
Configurable<float> kshortMaxDCAV0Dau{"kshortMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"};
@@ -249,7 +249,7 @@ struct k892hadronphotonBkg {
249249
//_______________________________________________
250250
// Event selection (identical to the builder)
251251
template <typename TCollision>
252-
bool IsEventAccepted(TCollision const& collision, bool fillHists)
252+
bool isEventAccepted(TCollision const& collision, bool fillHists)
253253
{
254254
if (fillHists)
255255
histos.fill(HIST("hEventSelection"), 0. /* all collisions */);
@@ -393,10 +393,10 @@ struct k892hadronphotonBkg {
393393
if (gamma.v0Type() != photonSelections.photonv0TypeSel && photonSelections.photonv0TypeSel > -1)
394394
return false;
395395

396-
float PhotonY = RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassGamma);
396+
float photonY = RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassGamma);
397397

398398
if (useMLScores) {
399-
if (gamma.gammaBDTScore() <= photonSelections.gamma_MLThreshold)
399+
if (gamma.gammaBDTScore() <= photonSelections.gammaMLThreshold)
400400
return false;
401401

402402
} else {
@@ -405,7 +405,7 @@ struct k892hadronphotonBkg {
405405
if ((gamma.mGamma() < 0) || (gamma.mGamma() > photonSelections.photonMaxMass))
406406
return false;
407407

408-
if ((PhotonY < photonSelections.photonMinRapidity) || (PhotonY > photonSelections.photonMaxRapidity))
408+
if ((photonY < photonSelections.photonMinRapidity) || (photonY > photonSelections.photonMaxRapidity))
409409
return false;
410410

411411
if (gamma.negativeeta() < photonSelections.photonDauEtaMin || gamma.negativeeta() > photonSelections.photonDauEtaMax)
@@ -429,8 +429,8 @@ struct k892hadronphotonBkg {
429429
if (gamma.v0cosPA() < photonSelections.photonMinV0cospa)
430430
return false;
431431

432-
float PhotonPhi = RecoDecay::phi(gamma.px(), gamma.py());
433-
if ((((PhotonPhi > photonSelections.photonPhiMin1) && (PhotonPhi < photonSelections.photonPhiMax1)) || ((PhotonPhi > photonSelections.photonPhiMin2) && (PhotonPhi < photonSelections.photonPhiMax2))) && ((photonSelections.photonPhiMin1 != -1) && (photonSelections.photonPhiMax1 != -1) && (photonSelections.photonPhiMin2 != -1) && (photonSelections.photonPhiMax2 != -1)))
432+
float photonPhi = RecoDecay::phi(gamma.px(), gamma.py());
433+
if ((((photonPhi > photonSelections.photonPhiMin1) && (photonPhi < photonSelections.photonPhiMax1)) || ((photonPhi > photonSelections.photonPhiMin2) && (photonPhi < photonSelections.photonPhiMax2))) && ((photonSelections.photonPhiMin1 != -1) && (photonSelections.photonPhiMax1 != -1) && (photonSelections.photonPhiMin2 != -1) && (photonSelections.photonPhiMax2 != -1)))
434434
return false;
435435

436436
if (gamma.qtarm() > photonSelections.photonMaxQt)
@@ -465,7 +465,7 @@ struct k892hadronphotonBkg {
465465
return false;
466466

467467
if (useMLScores) {
468-
// if (kshort.k0ShortBDTScore() <= kshortSelections.KShort_MLThreshold)
468+
// if (kshort.k0ShortBDTScore() <= kshortSelections.kshortMLThreshold)
469469
return false;
470470

471471
} else {
@@ -600,7 +600,7 @@ struct k892hadronphotonBkg {
600600
// ── Pass 1: populate pools using single-particle selections ──
601601
for (const auto& coll : collisions) {
602602

603-
if (eventSelections.fUseEventSelection && !IsEventAccepted(coll, true))
603+
if (eventSelections.fUseEventSelection && !isEventAccepted(coll, true))
604604
continue;
605605

606606
for (size_t i = 0; i < v0grouped[coll.globalIndex()].size(); i++) {
@@ -654,7 +654,7 @@ struct k892hadronphotonBkg {
654654
for (int kIdx : kshorts1) {
655655
auto kshort = fullV0s.rawIteratorAt(kIdx);
656656
float kP = std::hypot(kshort.px(), kshort.py(), kshort.pz());
657-
ROOT::Math::PxPyPzEVector FourMomKShort(
657+
ROOT::Math::PxPyPzEVector fourMomKShort(
658658
kshort.px(), kshort.py(), kshort.pz(),
659659
std::sqrt(kP * kP +
660660
o2::constants::physics::MassK0Short *
@@ -663,23 +663,23 @@ struct k892hadronphotonBkg {
663663
for (int pIdx : photons2) {
664664
auto photon = fullV0s.rawIteratorAt(pIdx);
665665
float pP = std::hypot(photon.px(), photon.py(), photon.pz());
666-
ROOT::Math::PxPyPzEVector FourMomPhoton(
666+
ROOT::Math::PxPyPzEVector fourMomPhoton(
667667
photon.px(), photon.py(), photon.pz(), pP);
668668

669-
auto FourMomKStar = FourMomPhoton + FourMomKShort;
669+
auto fourMomKStar = fourMomPhoton + fourMomKShort;
670670

671-
double cosOA = FourMomPhoton.Vect().Dot(FourMomKShort.Vect()) /
672-
(FourMomPhoton.P() * FourMomKShort.P());
671+
double cosOA = fourMomPhoton.Vect().Dot(fourMomKShort.Vect()) /
672+
(fourMomPhoton.P() * fourMomKShort.P());
673673
double openAngle = std::acos(cosOA);
674-
float mass = FourMomKStar.M();
675-
float pt = FourMomKStar.Pt();
674+
float mass = fourMomKStar.M();
675+
float pt = fourMomKStar.Pt();
676676
// Rapidity computed under the K*(892) mass hypothesis (NOT the actual pair
677677
// invariant mass) to match the same-event rotational background and the
678678
// buildKStar signal selection, so the rapidity acceptance is identical for
679679
// signal and all backgrounds.
680-
float rapidity = RecoDecay::y(std::array{static_cast<float>(FourMomKStar.Px()),
681-
static_cast<float>(FourMomKStar.Py()),
682-
static_cast<float>(FourMomKStar.Pz())},
680+
float rapidity = RecoDecay::y(std::array{static_cast<float>(fourMomKStar.Px()),
681+
static_cast<float>(fourMomKStar.Py()),
682+
static_cast<float>(fourMomKStar.Pz())},
683683
o2::constants::physics::MassK0Star892);
684684

685685
if (openAngle > kstarBkgConfig.kstarMaxOPAngle)
@@ -701,32 +701,32 @@ struct k892hadronphotonBkg {
701701
for (int pIdx : photons1) {
702702
auto photon = fullV0s.rawIteratorAt(pIdx);
703703
float pP = std::hypot(photon.px(), photon.py(), photon.pz());
704-
ROOT::Math::PxPyPzEVector FourMomPhoton(
704+
ROOT::Math::PxPyPzEVector fourMomPhoton(
705705
photon.px(), photon.py(), photon.pz(), pP);
706706

707707
for (int kIdx : kshorts2) {
708708
auto kshort = fullV0s.rawIteratorAt(kIdx);
709709
float kP = std::hypot(kshort.px(), kshort.py(), kshort.pz());
710-
ROOT::Math::PxPyPzEVector FourMomKShort(
710+
ROOT::Math::PxPyPzEVector fourMomKShort(
711711
kshort.px(), kshort.py(), kshort.pz(),
712712
std::sqrt(kP * kP +
713713
o2::constants::physics::MassK0Short *
714714
o2::constants::physics::MassK0Short));
715715

716-
auto FourMomKStar = FourMomPhoton + FourMomKShort;
716+
auto fourMomKStar = fourMomPhoton + fourMomKShort;
717717

718-
double cosOA = FourMomPhoton.Vect().Dot(FourMomKShort.Vect()) /
719-
(FourMomPhoton.P() * FourMomKShort.P());
718+
double cosOA = fourMomPhoton.Vect().Dot(fourMomKShort.Vect()) /
719+
(fourMomPhoton.P() * fourMomKShort.P());
720720
double openAngle = std::acos(cosOA);
721-
float mass = FourMomKStar.M();
722-
float pt = FourMomKStar.Pt();
721+
float mass = fourMomKStar.M();
722+
float pt = fourMomKStar.Pt();
723723
// Rapidity computed under the K*(892) mass hypothesis (NOT the actual pair
724724
// invariant mass) to match the same-event rotational background and the
725725
// buildKStar signal selection, so the rapidity acceptance is identical for
726726
// signal and all backgrounds.
727-
float rapidity = RecoDecay::y(std::array{static_cast<float>(FourMomKStar.Px()),
728-
static_cast<float>(FourMomKStar.Py()),
729-
static_cast<float>(FourMomKStar.Pz())},
727+
float rapidity = RecoDecay::y(std::array{static_cast<float>(fourMomKStar.Px()),
728+
static_cast<float>(fourMomKStar.Py()),
729+
static_cast<float>(fourMomKStar.Pz())},
730730
o2::constants::physics::MassK0Star892);
731731

732732
if (openAngle > kstarBkgConfig.kstarMaxOPAngle)

iwyu.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
iwyu_tool.py: command not found

0 commit comments

Comments
 (0)