Skip to content

Commit dd9fc6c

Browse files
committed
[PWGEM,PWGHF,Trigger] Fix O2linter warnings
- Preparation for AliceO2Group/AliceO2#14662 where eta, omega and etaPrime are added to the `PhysicsConstants.h` which clasehd with some local enum definitions here. 1. Removal of `using` in some header files and necessary changes because of this removal (EventFiltering for example) 2. Cleaning up includes in most touched files here after the removal of `using` 3. PI from match constanst, naming of some variables and other O2 Linter errors. Changes to configurable names were not done since this would mess up all ongoing analyses wagons. 4. Addition of new task for EMCal cluster energy calibration. For high mult AA collisions the cluster energy needs some extra calibration, since a single cluster often has energy deposition from more than just the photon that we are interested in. To correct for this enhancement in cluster energy this task should provide the neccesary output to create a correction for it. - Fix includes and added [[maybe_unused]] to some local variables that are used as inital parameters for configurables to silence compiler warnings/clangd. Add comment for explanation of this change as well.
1 parent f1006a3 commit dd9fc6c

26 files changed

+1965
-831
lines changed

EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,52 @@
1010
// or submit itself to any jurisdiction.
1111
///
1212
/// \file HeavyNeutralMesonFilter.cxx
13-
///
1413
/// \brief This code loops over collisions to filter events contaning heavy neutral mesons (omega or eta') using EMCal clusters and V0s (PCM)
15-
///
1614
/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt; Maximilian Korwieser (maximilian.korwieser@cern.ch) - Technical University Munich
1715
///
1816

19-
#include <vector>
20-
#include <iterator>
21-
#include <string>
22-
23-
#include "Math/GenVector/Boost.h"
24-
#include "Math/Vector4D.h"
25-
#include "TMath.h"
26-
#include "TRandom3.h"
27-
17+
#include "EventFiltering/filterTables.h"
18+
//
2819
#include "PWGEM/PhotonMeson/Utils/HNMUtilities.h"
20+
#include "PWGEM/PhotonMeson/Utils/PairUtilities.h"
2921
#include "PWGJE/DataModel/EMCALMatchedCollisions.h"
3022

31-
#include "Common/DataModel/PIDResponse.h"
32-
#include "Common/DataModel/PIDResponseITS.h"
33-
#include "fairlogger/Logger.h"
34-
#include "Framework/Configurable.h"
35-
#include "Framework/ASoAHelpers.h"
36-
#include "Framework/AnalysisDataModel.h"
37-
#include "Framework/AnalysisTask.h"
38-
#include "Framework/HistogramRegistry.h"
39-
#include "Framework/runDataProcessing.h"
40-
#include "CommonConstants/MathConstants.h"
41-
#include "Common/Core/TrackSelection.h"
42-
#include "Common/DataModel/TrackSelectionTables.h"
23+
#include "Common/CCDB/TriggerAliases.h"
24+
#include "Common/Core/RecoDecay.h"
4325
#include "Common/DataModel/EventSelection.h"
4426
#include "Common/DataModel/Multiplicity.h"
27+
#include "Common/DataModel/PIDResponseITS.h"
28+
#include "Common/DataModel/PIDResponseTOF.h"
29+
#include "Common/DataModel/PIDResponseTPC.h"
30+
#include "Common/DataModel/TrackSelectionTables.h"
31+
32+
#include <CommonConstants/MathConstants.h>
33+
#include <CommonConstants/PhysicsConstants.h>
34+
#include <Framework/AnalysisDataModel.h>
35+
#include <Framework/AnalysisHelpers.h>
36+
#include <Framework/AnalysisTask.h>
37+
#include <Framework/Array2D.h>
38+
#include <Framework/Configurable.h>
39+
#include <Framework/HistogramRegistry.h>
40+
#include <Framework/HistogramSpec.h>
41+
#include <Framework/InitContext.h>
42+
#include <Framework/Logger.h>
43+
#include <Framework/OutputObjHeader.h>
44+
#include <Framework/runDataProcessing.h>
45+
46+
#include <Math/GenVector/Boost.h>
47+
#include <Math/Vector4D.h> // IWYU pragma: keep
48+
#include <Math/Vector4Dfwd.h>
49+
#include <TH1.h>
50+
#include <TString.h>
51+
52+
#include <sys/types.h>
53+
54+
#include <array>
55+
#include <cmath>
56+
#include <cstddef>
57+
#include <string>
58+
#include <vector>
4559

4660
using namespace o2;
4761
using namespace o2::framework;
@@ -90,21 +104,22 @@ const std::vector<std::string> pidCutsName{"TPC min", "TPC max", "TPCTOF max", "
90104
const std::vector<std::string> femtoFilterNames{"PPOmega", "PPEtaPrime", "Omegad", "EtaPrimed", "OmegaP", "EtaPrimeP"};
91105

92106
// configs for tracks
93-
const float pidcutsTable[kNFemtoPartners][kNPIDLimits]{
107+
// these are need [[maybe_unused]] to silence a warning from clangd, since the compiler will inline them directly to the configs down below and then say: Variable 'X' is not needed and will not be emitted
108+
[[maybe_unused]] const float pidcutsTable[kNFemtoPartners][kNPIDLimits]{
94109
{-4.f, 4.f, 4.f, -99.f, 99.f},
95110
{-4.f, 4.f, 4.f, -6.f, 6.f},
96111
{-4.f, 4.f, 4.f, -99.f, 99.f}};
97112

98-
const float ptcutsTable[kNFemtoPartners][3]{
113+
[[maybe_unused]] const float ptcutsTable[kNFemtoPartners][3]{
99114
{0.35f, 6.f, 0.75f},
100115
{0.55f, 2.f, 1.2f},
101116
{0.35f, 6.f, 0.75f}};
102117

103-
const float nClusterMinTPC[1][kNFemtoPartners]{{80.0f, 80.0f, 80.0f}};
104-
const float nClusterMinITS[1][kNFemtoPartners]{{4, 4, 4}};
118+
[[maybe_unused]] const float nClusterMinTPC[1][kNFemtoPartners]{{80.0f, 80.0f, 80.0f}};
119+
[[maybe_unused]] const float nClusterMinITS[1][kNFemtoPartners]{{4, 4, 4}};
105120

106-
static const float triggerSwitches[1][kNFemtoTriggers]{{1, 1, 1, 1, 1, 1}};
107-
const float triggerLimits[1][kNFemtoTriggers]{{1.f, 1.f, 1.f, 1.f, 1.f, 1.f}};
121+
[[maybe_unused]] static const float triggerSwitches[1][kNFemtoTriggers]{{1, 1, 1, 1, 1, 1}};
122+
[[maybe_unused]] const float triggerLimits[1][kNFemtoTriggers]{{1.f, 1.f, 1.f, 1.f, 1.f, 1.f}};
108123
} // namespace hnmtrigger
109124

110125
struct HeavyNeutralMesonFilter {

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 204 additions & 223 deletions
Large diffs are not rendered by default.

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 210 additions & 229 deletions
Large diffs are not rendered by default.

PWGEM/PhotonMeson/DataModel/gammaTables.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,12 @@ DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTER", //! table of skimmed
584584
emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
585585
using SkimEMCCluster = SkimEMCClusters::iterator;
586586

587+
DECLARE_SOA_TABLE_VERSIONED(SkimEMCClusters_001, "AOD", "SKIMEMCCLUSTER", 1, //! table of skimmed EMCal clusters
588+
o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi,
589+
skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::DeltaPhi,
590+
emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
591+
using SkimEMCCluster = SkimEMCClusters::iterator;
592+
587593
DECLARE_SOA_TABLE(EMCEMEventIds, "AOD", "EMCEMEVENTID", emccluster::EMEventId); // To be joined with SkimEMCClusters table at analysis level.
588594
// iterators
589595
using EMCEMEventId = EMCEMEventIds::iterator;

PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// ========================
13-
// \file photonconversionbuilder.cxx
14-
// \brief this task produces photon data table with KFParticle.
15-
//
16-
// \author Daiki Sekihata <daiki.sekihata@cern.ch>, Tokyo
12+
13+
/// \file photonconversionbuilder.cxx
14+
/// \brief this task produces photon data table with KFParticle.
15+
/// \author Daiki Sekihata <daiki.sekihata@cern.ch>, Tokyo
1716

1817
#include "PWGEM/Dilepton/Utils/PairUtilities.h"
1918
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
@@ -22,31 +21,41 @@
2221

2322
#include "Common/Core/RecoDecay.h"
2423
#include "Common/Core/TPCVDriftManager.h"
25-
#include "Common/Core/TableHelper.h"
26-
#include "Common/Core/TrackSelection.h"
2724
#include "Common/Core/trackUtilities.h"
28-
#include "Common/DataModel/TrackSelectionTables.h"
25+
#include "Common/DataModel/EventSelection.h"
26+
#include "Common/DataModel/PIDResponseTPC.h"
2927
#include "Tools/KFparticle/KFUtilities.h"
3028

31-
#include "CCDB/BasicCCDBManager.h"
32-
#include "DataFormatsParameters/GRPMagField.h"
33-
#include "DataFormatsParameters/GRPObject.h"
34-
#include "DetectorsBase/GeometryManager.h"
35-
#include "DetectorsBase/Propagator.h"
36-
#include "Framework/ASoAHelpers.h"
37-
#include "Framework/AnalysisDataModel.h"
38-
#include "Framework/AnalysisTask.h"
39-
#include "Framework/RunningWorkflowInfo.h"
40-
#include "Framework/runDataProcessing.h"
41-
#include "ReconstructionDataFormats/Track.h"
42-
43-
#include "Math/Vector4D.h"
29+
#include <CCDB/BasicCCDBManager.h>
30+
#include <CommonConstants/MathConstants.h>
31+
#include <CommonConstants/PhysicsConstants.h>
32+
#include <DataFormatsParameters/GRPMagField.h>
33+
#include <DataFormatsParameters/GRPObject.h>
34+
#include <DetectorsBase/GeometryManager.h>
35+
#include <DetectorsBase/MatLayerCylSet.h>
36+
#include <DetectorsBase/Propagator.h>
37+
#include <Framework/AnalysisDataModel.h>
38+
#include <Framework/AnalysisHelpers.h>
39+
#include <Framework/AnalysisTask.h>
40+
#include <Framework/Configurable.h>
41+
#include <Framework/HistogramRegistry.h>
42+
#include <Framework/HistogramSpec.h>
43+
#include <Framework/InitContext.h>
44+
#include <Framework/runDataProcessing.h>
45+
#include <ReconstructionDataFormats/PID.h>
46+
47+
#include <Math/Vector4D.h> // IWYU pragma: keep
48+
#include <TPDGCode.h>
49+
50+
#include <KFPTrack.h>
51+
#include <KFPVertex.h>
52+
#include <KFParticle.h>
4453

4554
#include <algorithm>
4655
#include <array>
4756
#include <cmath>
57+
#include <cstdint>
4858
#include <cstdlib>
49-
#include <iterator>
5059
#include <map>
5160
#include <set>
5261
#include <string>
@@ -69,6 +78,12 @@ using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
6978
using MyTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi>;
7079
using MyTracksIUMC = soa::Join<MyTracksIU, aod::McTrackLabels, aod::mcTPCTuneOnData>;
7180

81+
enum MatCorrType {
82+
None = 0,
83+
TGeo = 1,
84+
LUT = 2
85+
};
86+
7287
struct PhotonConversionBuilder {
7388
Produces<aod::V0PhotonsKF> v0photonskf;
7489
Produces<aod::V0Legs> v0legs;
@@ -152,7 +167,7 @@ struct PhotonConversionBuilder {
152167
{"V0/hConversionPointXY", "conversion point in XY;X (cm);Y (cm)", {HistType::kTH2F, {{400, -100.0f, 100.0f}, {400, -100.f, 100.f}}}},
153168
{"V0/hConversionPointRZ", "conversion point in RZ;Z (cm);R_{xy} (cm)", {HistType::kTH2F, {{200, -100.0f, 100.0f}, {200, 0.f, 100.f}}}},
154169
{"V0/hPt", "pT of V0 at PV;p_{T,#gamma} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}},
155-
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, 2 * M_PI}, {200, -1, +1}}}},
170+
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
156171
{"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.99f, 1.f}}}},
157172
{"V0/hCosPA_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}},
158173
{"V0/hCosPAXY_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}},
@@ -170,7 +185,7 @@ struct PhotonConversionBuilder {
170185
{"V0/hPCA_diffX", "PCA vs. trackiu X - R_{xy};distance btween 2 legs (cm);min trackiu X - R_{xy} (cm)", {HistType::kTH2F, {{500, 0.0f, 5.f}, {100, -50.0, 50.0f}}}},
171186
{"V0/hPhiV", "#phi_{V}; #phi_{V} (rad.)", {HistType::kTH1F, {{500, 0.0f, 2 * M_PI}}}},
172187
{"V0Leg/hPt", "pT of leg at SV;p_{T,e} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}},
173-
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, 2 * M_PI}, {200, -1, +1}}}},
188+
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
174189
{"V0Leg/hRelDeltaPt", "pT resolution;p_{T} (GeV/c);#Deltap_{T}/p_{T}", {HistType::kTH2F, {{1000, 0.f, 10.f}, {100, 0, 1}}}},
175190
{"V0Leg/hDCAxyz", "DCA xy vs. z to PV;DCA_{xy} (cm);DCA_{z} (cm)", {HistType::kTH2F, {{200, -50.f, 50.f}, {200, -50.f, +50.f}}}},
176191
{"V0Leg/hdEdx_Pin", "TPC dE/dx vs. p_{in};p_{in} (GeV/c);TPC dE/dx", {HistType::kTH2F, {{1000, 0.f, 10.f}, {200, 0.f, 200.f}}}},
@@ -190,21 +205,21 @@ struct PhotonConversionBuilder {
190205
ccdb->setLocalObjectValidityChecking();
191206
ccdb->setFatalWhenNull(false);
192207

193-
if (useMatCorrType == 1) {
208+
if (useMatCorrType == MatCorrType::TGeo) {
194209
LOGF(info, "TGeo correction requested, loading geometry");
195210
if (!o2::base::GeometryManager::isGeometryLoaded()) {
196211
ccdb->get<TGeoManager>(geoPath);
197212
}
198213
}
199-
if (useMatCorrType == 2) {
214+
if (useMatCorrType == MatCorrType::LUT) {
200215
LOGF(info, "LUT correction requested, loading LUT");
201216
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(lutPath));
202217
}
203218

204-
if (useMatCorrType == 1) {
219+
if (useMatCorrType == MatCorrType::TGeo) {
205220
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo;
206221
}
207-
if (useMatCorrType == 2) {
222+
if (useMatCorrType == MatCorrType::LUT) {
208223
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
209224
}
210225
}
@@ -467,8 +482,8 @@ struct PhotonConversionBuilder {
467482

468483
KFPTrack kfp_track_pos = createKFPTrackFromTrackParCov(pTrack, pos.sign(), pos.tpcNClsFound(), pos.tpcChi2NCl());
469484
KFPTrack kfp_track_ele = createKFPTrackFromTrackParCov(nTrack, ele.sign(), ele.tpcNClsFound(), ele.tpcChi2NCl());
470-
KFParticle kfp_pos(kfp_track_pos, -11);
471-
KFParticle kfp_ele(kfp_track_ele, 11);
485+
KFParticle kfp_pos(kfp_track_pos, kPositron);
486+
KFParticle kfp_ele(kfp_track_ele, kElectron);
472487
const KFParticle* GammaDaughters[2] = {&kfp_pos, &kfp_ele};
473488

474489
KFParticle gammaKF;
@@ -553,7 +568,7 @@ struct PhotonConversionBuilder {
553568
gammaKF_PV.SetProductionVertex(KFPV);
554569
float v0pt = RecoDecay::sqrtSumOfSquares(gammaKF_PV.GetPx(), gammaKF_PV.GetPy());
555570
float v0eta = RecoDecay::eta(std::array{gammaKF_PV.GetPx(), gammaKF_PV.GetPy(), gammaKF_PV.GetPz()});
556-
float v0phi = RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()) > 0.f ? RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()) : RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()) + TMath::TwoPi();
571+
float v0phi = RecoDecay::constrainAngle(RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()));
557572

558573
// KFParticle gammaKF_DecayVtx2 = gammaKF;
559574
// gammaKF_DecayVtx2.SetProductionVertex(KFPV);
@@ -657,18 +672,18 @@ struct PhotonConversionBuilder {
657672
registry.fill(HIST("V0/hCosPAXY_Rxy"), rxy, cospaXY_kf);
658673
registry.fill(HIST("V0/hCosPARZ_Rxy"), rxy, cospaRZ_kf);
659674

660-
for (auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
675+
for (const auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
661676
float legpt = RecoDecay::sqrtSumOfSquares(leg.GetPx(), leg.GetPy());
662677
float legeta = RecoDecay::eta(std::array{leg.GetPx(), leg.GetPy(), leg.GetPz()});
663-
float legphi = RecoDecay::phi(leg.GetPx(), leg.GetPy()) > 0.f ? RecoDecay::phi(leg.GetPx(), leg.GetPy()) : RecoDecay::phi(leg.GetPx(), leg.GetPy()) + TMath::TwoPi();
678+
float legphi = RecoDecay::constrainAngle(RecoDecay::phi(leg.GetPx(), leg.GetPy()));
664679
registry.fill(HIST("V0Leg/hPt"), legpt);
665680
registry.fill(HIST("V0Leg/hEtaPhi"), legphi, legeta);
666681
} // end of leg loop
667-
for (auto& leg : {pos, ele}) {
682+
for (const auto& leg : {pos, ele}) {
668683
registry.fill(HIST("V0Leg/hdEdx_Pin"), leg.tpcInnerParam(), leg.tpcSignal());
669684
registry.fill(HIST("V0Leg/hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl());
670685
} // end of leg loop
671-
for (auto& leg : {pTrack, nTrack}) {
686+
for (const auto& leg : {pTrack, nTrack}) {
672687
registry.fill(HIST("V0Leg/hXZ"), leg.getZ(), leg.getX());
673688
registry.fill(HIST("V0Leg/hRelDeltaPt"), leg.getPt(), leg.getPt() * std::sqrt(leg.getSigma1Pt2()));
674689
} // end of leg loop
@@ -793,7 +808,7 @@ struct PhotonConversionBuilder {
793808
} // end of pca_map loop
794809
// LOGF(info, "pca_map.size() = %d", pca_map.size());
795810

796-
for (auto& fullv0Id : stored_fullv0Ids) {
811+
for (const auto& fullv0Id : stored_fullv0Ids) {
797812
auto v0Id = std::get<0>(fullv0Id);
798813
// auto collisionId = std::get<1>(fullv0Id);
799814
// auto posId = std::get<2>(fullv0Id);
@@ -812,7 +827,7 @@ struct PhotonConversionBuilder {
812827
fillV0Table<isMC, TBCs, TCollisions, TTracks>(v0, true);
813828
} // end of fullv0Id loop
814829

815-
for (auto& collision : collisions) {
830+
for (const auto& collision : collisions) {
816831
if constexpr (isMC) {
817832
if (!collision.has_mcCollision()) {
818833
continue;

0 commit comments

Comments
 (0)