Skip to content

Commit

Permalink
Fix O2 Linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
samrangy committed Dec 10, 2024
1 parent 512d322 commit 184ed13
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
1 change: 1 addition & 0 deletions PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,4 @@ DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs I
} // namespace o2::aod

#endif // PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_

30 changes: 15 additions & 15 deletions PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ using SelectedParticlesMcGen = soa::Join<aod::McParticles, aod::HfCand2ProngMcGe

// Code to select collisions with at least one D0
struct HfCorrelatorD0HadronsSelection {
SliceCache cache;

Produces<aod::DmesonSelection> d0Sel;

Configurable<int> selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"};
Expand All @@ -90,8 +88,9 @@ struct HfCorrelatorD0HadronsSelection {
Configurable<float> ptCandMin{"ptCandMin", -1., "min. cand. pT"};

HfHelper hfHelper;

SliceCache cache;
Preslice<aod::HfCand2Prong> perCol = aod::hf_cand::collisionId;

Check failure on line 93 in PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
Partition<soa::Join<aod::HfCand2Prong, aod::HfSelD0>> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar;
Partition<soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfCand2ProngMcRec>> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar;

Expand Down Expand Up @@ -162,8 +161,6 @@ struct HfCorrelatorD0HadronsSelection {

/// D0-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth)
struct HfCorrelatorD0Hadrons {
SliceCache cache;

Produces<aod::D0HadronPair> entryD0HadronPair;
Produces<aod::D0HadronRecoInfo> entryD0HadronRecoInfo;
Produces<aod::D0HadronMlInfo> entryD0HadronMlInfo;
Expand All @@ -178,36 +175,38 @@ struct HfCorrelatorD0Hadrons {
Configurable<float> ptCandMin{"ptCandMin", 1., "min. cand. pT"};
Configurable<float> ptTrackMin{"ptTrackMin", 0.3, "min. track pT"};
Configurable<float> ptTrackMax{"ptTrackMax", 99., "max. track pT"};
Configurable<std::vector<double>> bins{"ptBinsForMassAndEfficiency", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"};
Configurable<std::vector<double>> bins{"bins", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"};
Configurable<std::vector<double>> efficiencyDmeson{"efficiencyDmeson", std::vector<double>{vecEfficiencyDmeson}, "Efficiency values for D0 meson"};
Configurable<int> applyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"};
Configurable<int> applyEfficiency{"applyEfficiency", 1, "Flag for applying D-meson efficiency weights"};
Configurable<float> multMin{"multMin", 0., "minimum multiplicity accepted"};
Configurable<float> multMax{"multMax", 10000., "maximum multiplicity accepted"};
Configurable<float> ptSoftPionMax{"ptSoftPionMax", 3.f * 800.f * std::pow(10.f, -6.f), "max. pT cut for soft pion identification"};
Configurable<std::vector<int>> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."};
Configurable<bool> correlateD0WithLeadingParticle{"correlateD0WithLeadingParticle", false, "Switch for correlation of D0 mesons with leading particle only"};
Configurable<bool> storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"};
Configurable<int> numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"};
ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"};
ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"};
ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks

HfHelper hfHelper;
BinningType corrBinning{{zPoolBins, multPoolBins}, true};

int leadingIndex = 0;
double massD0{0.};
double massPi{0.};
double massK{0.};
double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay

Preslice<aod::HfCand2Prong> perCol = aod::hf_cand::collisionId;

Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true;

Check warning on line 195 in PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfCorrelatorD0Hadrons: Filter appears too early (before end of SliceCache).
Filter trackFilter = requireGlobalTrackWoDCAInFilter() && (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax);
Filter d0Filter = (aod::hf_sel_candidate_d0::isSelD0 >= 1) || (aod::hf_sel_candidate_d0::isSelD0bar >= 1);
Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true;
Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast<int>(Pdg::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary);

Check failure on line 200 in PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
HfHelper hfHelper;
SliceCache cache;
Preslice<aod::HfCand2Prong> perCol = aod::hf_cand::collisionId;

Check failure on line 204 in PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"};
ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"};
ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks

BinningType corrBinning{{zPoolBins, multPoolBins}, true};

HistogramRegistry registry{
"registry",
Expand Down Expand Up @@ -925,3 +924,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
adaptAnalysisTask<HfCorrelatorD0HadronsSelection>(cfgc),
adaptAnalysisTask<HfCorrelatorD0Hadrons>(cfgc)};
}

15 changes: 8 additions & 7 deletions PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ const double ptHadronMax = 10.0;
struct HfTaskCorrelationD0Hadrons {

// pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_to_pi_k (i.e. the mass pT bins), but can be redefined via json files
Configurable<std::vector<double>> binsCorrelations{"ptBinsForCorrelations", std::vector<double>{vecPtBinsCorrelations}, "pT bin limits for correlation plots"};
Configurable<std::vector<double>> binsCorrelations{"binsCorrelations", std::vector<double>{vecPtBinsCorrelations}, "pT bin limits for correlation plots"};
// pT bins for effiencies: same as above
Configurable<std::vector<double>> binsEfficiency{"ptBinsForEfficiency", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for efficiency"};
Configurable<std::vector<double>> binsEfficiency{"binsEfficiency", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for efficiency"};
Configurable<std::vector<int>> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."};
Configurable<std::vector<double>> mlOutputPromptD0{"mlScorePromptD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"};
Configurable<std::vector<double>> mlOutputBkgD0{"mlScoreBkgD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"};
Configurable<std::vector<double>> mlOutputPromptD0bar{"mlScorePromptD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"};
Configurable<std::vector<double>> mlOutputBkgD0bar{"mlScoreBkgD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"};
Configurable<std::vector<double>> mlOutputPromptD0{"mlOutputPromptD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"};
Configurable<std::vector<double>> mlOutputBkgD0{"mlOutputBkgD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"};
Configurable<std::vector<double>> mlOutputPromptD0bar{"mlOutputPromptD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"};
Configurable<std::vector<double>> mlOutputBkgD0bar{"mlOutputBkgD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"};
// signal and sideband region edges, to be defined via json file (initialised to empty)
Configurable<std::vector<double>> signalRegionLeft{"signalRegionLeft", std::vector<double>{vecsignalRegionLeft}, "Inner values of signal region vs pT"};
Configurable<std::vector<double>> signalRegionRight{"signalRegionRight", std::vector<double>{vecsignalRegionRight}, "Outer values of signal region vs pT"};
Expand All @@ -104,7 +104,7 @@ struct HfTaskCorrelationD0Hadrons {
Configurable<std::vector<double>> efficiencyDmeson{"efficiencyDmeson", std::vector<double>{vecEfficiencyDmeson}, "Efficiency values for D meson specie under study"};
Configurable<bool> isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"};
Configurable<double> leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"};
Configurable<int> applyEfficiency{"efficiencyFlagD", 1, "Flag for applying efficiency weights"};
Configurable<int> applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"};

HistogramRegistry registry{
"registry",
Expand Down Expand Up @@ -668,3 +668,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<HfTaskCorrelationD0Hadrons>(cfgc)};
}

0 comments on commit 184ed13

Please sign in to comment.