Skip to content

Commit db08825

Browse files
committed
[PWGEM,PWGHF,Trigger] Fix O2linter warnings
PWGHF: Preparation for AliceO2Group/AliceO2#14662 where eta, omega and etaPrime are added to the `PhysicsConstants.h` which clasehd with some local enum definitions here. PWGEM: 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. Trigger: 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 b178c96 commit db08825

26 files changed

+2009
-829
lines changed

EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx

Lines changed: 43 additions & 28 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"
17+
#include "RecoDecay.h"
2718

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"
4324
#include "Common/DataModel/EventSelection.h"
4425
#include "Common/DataModel/Multiplicity.h"
26+
#include "Common/DataModel/PIDResponseITS.h"
27+
#include "Common/DataModel/PIDResponseTOF.h"
28+
#include "Common/DataModel/PIDResponseTPC.h"
29+
#include "Common/DataModel/TrackSelectionTables.h"
30+
#include "EventFiltering/filterTables.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/OutputObjHeader.h>
43+
#include <Framework/runDataProcessing.h>
44+
45+
#include <Math/GenVector/Boost.h>
46+
#include <Math/Vector4D.h> // IWYU pragma: keep
47+
#include <Math/Vector4Dfwd.h>
48+
#include <TH1.h>
49+
#include <TString.h>
50+
51+
#include <fairlogger/Logger.h>
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: 220 additions & 217 deletions
Large diffs are not rendered by default.

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 226 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
@@ -574,6 +574,12 @@ DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTER", //! table of skimmed
574574
emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
575575
using SkimEMCCluster = SkimEMCClusters::iterator;
576576

577+
DECLARE_SOA_TABLE_VERSIONED(SkimEMCClusters_001, "AOD", "SKIMEMCCLUSTER", 1, //! table of skimmed EMCal clusters
578+
o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi,
579+
skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::DeltaPhi,
580+
emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
581+
using SkimEMCCluster = SkimEMCClusters::iterator;
582+
577583
DECLARE_SOA_TABLE(EMCEMEventIds, "AOD", "EMCEMEVENTID", emccluster::EMEventId); // To be joined with SkimEMCClusters table at analysis level.
578584
// iterators
579585
using EMCEMEventId = EMCEMEventIds::iterator;

PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,52 @@
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/PhotonMeson/DataModel/gammaTables.h"
1918
#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h"
2019
#include "PWGEM/PhotonMeson/Utils/TrackSelection.h"
2120

2221
#include "Common/Core/RecoDecay.h"
2322
#include "Common/Core/TPCVDriftManager.h"
24-
#include "Common/Core/TableHelper.h"
25-
#include "Common/Core/TrackSelection.h"
2623
#include "Common/Core/trackUtilities.h"
27-
#include "Common/DataModel/TrackSelectionTables.h"
24+
#include "Common/DataModel/EventSelection.h"
25+
#include "Common/DataModel/PIDResponseTPC.h"
2826
#include "Tools/KFparticle/KFUtilities.h"
2927

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

4453
#include <algorithm>
4554
#include <array>
4655
#include <cmath>
56+
#include <cstdint>
4757
#include <cstdlib>
48-
#include <iterator>
4958
#include <map>
5059
#include <set>
5160
#include <string>
@@ -68,6 +77,12 @@ using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
6877
using MyTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi>;
6978
using MyTracksIUMC = soa::Join<MyTracksIU, aod::McTrackLabels, aod::mcTPCTuneOnData>;
7079

80+
enum MatCorrType {
81+
None = 0,
82+
TGeo = 1,
83+
LUT = 2
84+
};
85+
7186
struct PhotonConversionBuilder {
7287
Produces<aod::V0PhotonsKF> v0photonskf;
7388
Produces<aod::V0Legs> v0legs;
@@ -150,7 +165,7 @@ struct PhotonConversionBuilder {
150165
{"V0/hConversionPointXY", "conversion point in XY;X (cm);Y (cm)", {HistType::kTH2F, {{400, -100.0f, 100.0f}, {400, -100.f, 100.f}}}},
151166
{"V0/hConversionPointRZ", "conversion point in RZ;Z (cm);R_{xy} (cm)", {HistType::kTH2F, {{200, -100.0f, 100.0f}, {200, 0.f, 100.f}}}},
152167
{"V0/hPt", "pT of V0 at PV;p_{T,#gamma} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}},
153-
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, 2 * M_PI}, {200, -1, +1}}}},
168+
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
154169
{"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.99f, 1.f}}}},
155170
{"V0/hCosPA_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}},
156171
{"V0/hCosPAXY_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}},
@@ -167,7 +182,7 @@ struct PhotonConversionBuilder {
167182
{"V0/hRxy_minX_TPC_TPC", "min trackiu X vs. R_{xy};trackiu X (cm);min trackiu X - R_{xy} (cm)", {HistType::kTH2F, {{100, 0.0f, 100.f}, {100, -50.0, 50.0f}}}},
168183
{"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}}}},
169184
{"V0Leg/hPt", "pT of leg at SV;p_{T,e} (GeV/c)", {HistType::kTH1F, {{1000, 0.0f, 10.0f}}}},
170-
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, 2 * M_PI}, {200, -1, +1}}}},
185+
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
171186
{"V0Leg/hRelDeltaPt", "pT resolution;p_{T} (GeV/c);#Deltap_{T}/p_{T}", {HistType::kTH2F, {{1000, 0.f, 10.f}, {100, 0, 1}}}},
172187
{"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}}}},
173188
{"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}}}},
@@ -187,21 +202,21 @@ struct PhotonConversionBuilder {
187202
ccdb->setLocalObjectValidityChecking();
188203
ccdb->setFatalWhenNull(false);
189204

190-
if (useMatCorrType == 1) {
205+
if (useMatCorrType == MatCorrType::TGeo) {
191206
LOGF(info, "TGeo correction requested, loading geometry");
192207
if (!o2::base::GeometryManager::isGeometryLoaded()) {
193208
ccdb->get<TGeoManager>(geoPath);
194209
}
195210
}
196-
if (useMatCorrType == 2) {
211+
if (useMatCorrType == MatCorrType::LUT) {
197212
LOGF(info, "LUT correction requested, loading LUT");
198213
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(lutPath));
199214
}
200215

201-
if (useMatCorrType == 1) {
216+
if (useMatCorrType == MatCorrType::TGeo) {
202217
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo;
203218
}
204-
if (useMatCorrType == 2) {
219+
if (useMatCorrType == MatCorrType::LUT) {
205220
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
206221
}
207222
}
@@ -464,8 +479,8 @@ struct PhotonConversionBuilder {
464479

465480
KFPTrack kfp_track_pos = createKFPTrackFromTrackParCov(pTrack, pos.sign(), pos.tpcNClsFound(), pos.tpcChi2NCl());
466481
KFPTrack kfp_track_ele = createKFPTrackFromTrackParCov(nTrack, ele.sign(), ele.tpcNClsFound(), ele.tpcChi2NCl());
467-
KFParticle kfp_pos(kfp_track_pos, -11);
468-
KFParticle kfp_ele(kfp_track_ele, 11);
482+
KFParticle kfp_pos(kfp_track_pos, kPositron);
483+
KFParticle kfp_ele(kfp_track_ele, kElectron);
469484
const KFParticle* GammaDaughters[2] = {&kfp_pos, &kfp_ele};
470485

471486
KFParticle gammaKF;
@@ -550,7 +565,7 @@ struct PhotonConversionBuilder {
550565
gammaKF_PV.SetProductionVertex(KFPV);
551566
float v0pt = RecoDecay::sqrtSumOfSquares(gammaKF_PV.GetPx(), gammaKF_PV.GetPy());
552567
float v0eta = RecoDecay::eta(std::array{gammaKF_PV.GetPx(), gammaKF_PV.GetPy(), gammaKF_PV.GetPz()});
553-
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();
568+
float v0phi = RecoDecay::constrainAngle(RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()));
554569

555570
// KFParticle gammaKF_DecayVtx2 = gammaKF;
556571
// gammaKF_DecayVtx2.SetProductionVertex(KFPV);
@@ -651,18 +666,18 @@ struct PhotonConversionBuilder {
651666
registry.fill(HIST("V0/hCosPAXY_Rxy"), rxy, cospaXY_kf);
652667
registry.fill(HIST("V0/hCosPARZ_Rxy"), rxy, cospaRZ_kf);
653668

654-
for (auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
669+
for (const auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
655670
float legpt = RecoDecay::sqrtSumOfSquares(leg.GetPx(), leg.GetPy());
656671
float legeta = RecoDecay::eta(std::array{leg.GetPx(), leg.GetPy(), leg.GetPz()});
657-
float legphi = RecoDecay::phi(leg.GetPx(), leg.GetPy()) > 0.f ? RecoDecay::phi(leg.GetPx(), leg.GetPy()) : RecoDecay::phi(leg.GetPx(), leg.GetPy()) + TMath::TwoPi();
672+
float legphi = RecoDecay::constrainAngle(RecoDecay::phi(leg.GetPx(), leg.GetPy()));
658673
registry.fill(HIST("V0Leg/hPt"), legpt);
659674
registry.fill(HIST("V0Leg/hEtaPhi"), legphi, legeta);
660675
} // end of leg loop
661-
for (auto& leg : {pos, ele}) {
676+
for (const auto& leg : {pos, ele}) {
662677
registry.fill(HIST("V0Leg/hdEdx_Pin"), leg.tpcInnerParam(), leg.tpcSignal());
663678
registry.fill(HIST("V0Leg/hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl());
664679
} // end of leg loop
665-
for (auto& leg : {pTrack, nTrack}) {
680+
for (const auto& leg : {pTrack, nTrack}) {
666681
registry.fill(HIST("V0Leg/hXZ"), leg.getZ(), leg.getX());
667682
registry.fill(HIST("V0Leg/hRelDeltaPt"), leg.getPt(), leg.getPt() * std::sqrt(leg.getSigma1Pt2()));
668683
} // end of leg loop
@@ -786,7 +801,7 @@ struct PhotonConversionBuilder {
786801
} // end of pca_map loop
787802
// LOGF(info, "pca_map.size() = %d", pca_map.size());
788803

789-
for (auto& fullv0Id : stored_fullv0Ids) {
804+
for (const auto& fullv0Id : stored_fullv0Ids) {
790805
auto v0Id = std::get<0>(fullv0Id);
791806
// auto collisionId = std::get<1>(fullv0Id);
792807
// auto posId = std::get<2>(fullv0Id);
@@ -805,7 +820,7 @@ struct PhotonConversionBuilder {
805820
fillV0Table<isMC, TBCs, TCollisions, TTracks>(v0, true);
806821
} // end of fullv0Id loop
807822

808-
for (auto& collision : collisions) {
823+
for (const auto& collision : collisions) {
809824
if constexpr (isMC) {
810825
if (!collision.has_mcCollision()) {
811826
continue;

0 commit comments

Comments
 (0)