Skip to content

Commit a674e4f

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 a674e4f

26 files changed

+1967
-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: 53 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,42 @@
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 <Math/Vector4Dfwd.h>
49+
#include <TPDGCode.h>
50+
51+
#include <KFPTrack.h>
52+
#include <KFPVertex.h>
53+
#include <KFParticle.h>
4454

4555
#include <algorithm>
4656
#include <array>
4757
#include <cmath>
58+
#include <cstdint>
4859
#include <cstdlib>
49-
#include <iterator>
5060
#include <map>
5161
#include <set>
5262
#include <string>
@@ -69,6 +79,12 @@ using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
6979
using MyTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi>;
7080
using MyTracksIUMC = soa::Join<MyTracksIU, aod::McTrackLabels, aod::mcTPCTuneOnData>;
7181

82+
enum MatCorrType {
83+
None = 0,
84+
TGeo = 1,
85+
LUT = 2
86+
};
87+
7288
struct PhotonConversionBuilder {
7389
Produces<aod::V0PhotonsKF> v0photonskf;
7490
Produces<aod::V0Legs> v0legs;
@@ -152,7 +168,7 @@ struct PhotonConversionBuilder {
152168
{"V0/hConversionPointXY", "conversion point in XY;X (cm);Y (cm)", {HistType::kTH2F, {{400, -100.0f, 100.0f}, {400, -100.f, 100.f}}}},
153169
{"V0/hConversionPointRZ", "conversion point in RZ;Z (cm);R_{xy} (cm)", {HistType::kTH2F, {{200, -100.0f, 100.0f}, {200, 0.f, 100.f}}}},
154170
{"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}}}},
171+
{"V0/hEtaPhi", "#eta vs. #varphi of V0 at PV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
156172
{"V0/hCosPA", "cosine of pointing angle;cosine of pointing angle", {HistType::kTH1F, {{100, 0.99f, 1.f}}}},
157173
{"V0/hCosPA_Rxy", "cosine of pointing angle;r_{xy} (cm);cosine of pointing angle", {HistType::kTH2F, {{200, 0, 100}, {100, 0.99f, 1.f}}}},
158174
{"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 +186,7 @@ struct PhotonConversionBuilder {
170186
{"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}}}},
171187
{"V0/hPhiV", "#phi_{V}; #phi_{V} (rad.)", {HistType::kTH1F, {{500, 0.0f, 2 * M_PI}}}},
172188
{"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}}}},
189+
{"V0Leg/hEtaPhi", "#eta vs. #varphi of leg at SV;#varphi (rad.);#eta", {HistType::kTH2F, {{72, 0.0f, o2::constants::math::TwoPI}, {200, -1, +1}}}},
174190
{"V0Leg/hRelDeltaPt", "pT resolution;p_{T} (GeV/c);#Deltap_{T}/p_{T}", {HistType::kTH2F, {{1000, 0.f, 10.f}, {100, 0, 1}}}},
175191
{"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}}}},
176192
{"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 +206,21 @@ struct PhotonConversionBuilder {
190206
ccdb->setLocalObjectValidityChecking();
191207
ccdb->setFatalWhenNull(false);
192208

193-
if (useMatCorrType == 1) {
209+
if (useMatCorrType == MatCorrType::TGeo) {
194210
LOGF(info, "TGeo correction requested, loading geometry");
195211
if (!o2::base::GeometryManager::isGeometryLoaded()) {
196212
ccdb->get<TGeoManager>(geoPath);
197213
}
198214
}
199-
if (useMatCorrType == 2) {
215+
if (useMatCorrType == MatCorrType::LUT) {
200216
LOGF(info, "LUT correction requested, loading LUT");
201217
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(lutPath));
202218
}
203219

204-
if (useMatCorrType == 1) {
220+
if (useMatCorrType == MatCorrType::TGeo) {
205221
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo;
206222
}
207-
if (useMatCorrType == 2) {
223+
if (useMatCorrType == MatCorrType::LUT) {
208224
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
209225
}
210226
}
@@ -467,8 +483,8 @@ struct PhotonConversionBuilder {
467483

468484
KFPTrack kfp_track_pos = createKFPTrackFromTrackParCov(pTrack, pos.sign(), pos.tpcNClsFound(), pos.tpcChi2NCl());
469485
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);
486+
KFParticle kfp_pos(kfp_track_pos, kPositron);
487+
KFParticle kfp_ele(kfp_track_ele, kElectron);
472488
const KFParticle* GammaDaughters[2] = {&kfp_pos, &kfp_ele};
473489

474490
KFParticle gammaKF;
@@ -553,7 +569,7 @@ struct PhotonConversionBuilder {
553569
gammaKF_PV.SetProductionVertex(KFPV);
554570
float v0pt = RecoDecay::sqrtSumOfSquares(gammaKF_PV.GetPx(), gammaKF_PV.GetPy());
555571
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();
572+
float v0phi = RecoDecay::constrainAngle(RecoDecay::phi(gammaKF_PV.GetPx(), gammaKF_PV.GetPy()));
557573

558574
// KFParticle gammaKF_DecayVtx2 = gammaKF;
559575
// gammaKF_DecayVtx2.SetProductionVertex(KFPV);
@@ -657,18 +673,18 @@ struct PhotonConversionBuilder {
657673
registry.fill(HIST("V0/hCosPAXY_Rxy"), rxy, cospaXY_kf);
658674
registry.fill(HIST("V0/hCosPARZ_Rxy"), rxy, cospaRZ_kf);
659675

660-
for (auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
676+
for (const auto& leg : {kfp_pos_DecayVtx, kfp_ele_DecayVtx}) {
661677
float legpt = RecoDecay::sqrtSumOfSquares(leg.GetPx(), leg.GetPy());
662678
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();
679+
float legphi = RecoDecay::constrainAngle(RecoDecay::phi(leg.GetPx(), leg.GetPy()));
664680
registry.fill(HIST("V0Leg/hPt"), legpt);
665681
registry.fill(HIST("V0Leg/hEtaPhi"), legphi, legeta);
666682
} // end of leg loop
667-
for (auto& leg : {pos, ele}) {
683+
for (const auto& leg : {pos, ele}) {
668684
registry.fill(HIST("V0Leg/hdEdx_Pin"), leg.tpcInnerParam(), leg.tpcSignal());
669685
registry.fill(HIST("V0Leg/hTPCNsigmaEl"), leg.tpcInnerParam(), leg.tpcNSigmaEl());
670686
} // end of leg loop
671-
for (auto& leg : {pTrack, nTrack}) {
687+
for (const auto& leg : {pTrack, nTrack}) {
672688
registry.fill(HIST("V0Leg/hXZ"), leg.getZ(), leg.getX());
673689
registry.fill(HIST("V0Leg/hRelDeltaPt"), leg.getPt(), leg.getPt() * std::sqrt(leg.getSigma1Pt2()));
674690
} // end of leg loop
@@ -793,7 +809,7 @@ struct PhotonConversionBuilder {
793809
} // end of pca_map loop
794810
// LOGF(info, "pca_map.size() = %d", pca_map.size());
795811

796-
for (auto& fullv0Id : stored_fullv0Ids) {
812+
for (const auto& fullv0Id : stored_fullv0Ids) {
797813
auto v0Id = std::get<0>(fullv0Id);
798814
// auto collisionId = std::get<1>(fullv0Id);
799815
// auto posId = std::get<2>(fullv0Id);
@@ -812,7 +828,7 @@ struct PhotonConversionBuilder {
812828
fillV0Table<isMC, TBCs, TCollisions, TTracks>(v0, true);
813829
} // end of fullv0Id loop
814830

815-
for (auto& collision : collisions) {
831+
for (const auto& collision : collisions) {
816832
if constexpr (isMC) {
817833
if (!collision.has_mcCollision()) {
818834
continue;

0 commit comments

Comments
 (0)