Skip to content

Commit 3ef0e3b

Browse files
committed
[PWGEM,Photon] Further clean up
- Move `skimmerDalitzEE.cxx` to `Legacy`, `skimmerPrimaryElectronFromDalitzEE.cxx` should be used instead - Add `#include <Framework/ASoA.h>` everywhere with `globalIndex()` in use - Fix different linter warnings and errors and some of the touched files
1 parent 3b90f61 commit 3ef0e3b

31 files changed

Lines changed: 376 additions & 396 deletions

PWGEM/PhotonMeson/Core/PHOSPhotonCut.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <Framework/Concepts.h>
2020

2121
#include <array>
22+
#include <cmath>
2223
#include <string>
2324

2425
class PHOSPhotonCut
@@ -55,10 +56,10 @@ class PHOSPhotonCut
5556
}
5657

5758
// only temporary solution to avoid noisy channels.
58-
if (-1.20 + 10.2 * sqrt(cluster.e()) < cluster.nCells()) {
59+
if (-1.20 + 10.2 * std::sqrt(cluster.e()) < cluster.nCells()) {
5960
return false;
6061
}
61-
if (cluster.nCells() < -3.04 + 3.14 * sqrt(cluster.e())) {
62+
if (cluster.nCells() < -3.04 + 3.14 * std::sqrt(cluster.e())) {
6263
return false;
6364
}
6465

PWGEM/PhotonMeson/Core/PairCut.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
#include <Framework/Logger.h>
1919

20-
#include <Rtypes.h>
20+
#include <array>
21+
#include <cstddef>
22+
#include <string>
2123

22-
ClassImp(PairCut);
23-
24-
const char* PairCut::mCutNames[static_cast<int>(PairCut::PairCuts::kNCuts)] = {"Asym"};
24+
const std::array<std::string, static_cast<std::size_t>(PairCut::PairCuts::kNCuts)> PairCut::mCutNames = {"Asym"};
2525

2626
void PairCut::SetAsymRange(float min, float max)
2727
{

PWGEM/PhotonMeson/Core/PairCut.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#ifndef PWGEM_PHOTONMESON_CORE_PAIRCUT_H_
1717
#define PWGEM_PHOTONMESON_CORE_PAIRCUT_H_
1818

19+
#include <array>
20+
#include <cmath>
21+
#include <cstddef>
1922
#include <string>
2023

2124
class PairCut
@@ -30,19 +33,15 @@ class PairCut
3033
kNCuts
3134
};
3235

33-
const std::string getName() const { return name; }
34-
const std::string getTitle() const { return title; }
36+
[[nodiscard]] std::string getName() const { return name; }
37+
[[nodiscard]] std::string getTitle() const { return title; }
3538

36-
static const char* mCutNames[static_cast<int>(PairCuts::kNCuts)];
39+
static const std::array<std::string, static_cast<std::size_t>(PairCuts::kNCuts)> mCutNames;
3740

3841
template <typename G1, typename G2>
3942
bool IsSelected(G1 const& g1, G2 const& g2) const
4043
{
41-
if (!IsSelectedPair(g1, g2, PairCuts::kAsym)) {
42-
return false;
43-
}
44-
45-
return true;
44+
return IsSelectedPair(g1, g2, PairCuts::kAsym);
4645
}
4746

4847
// template <typename U1, typename U2, typename G1, typename G2>
@@ -51,7 +50,7 @@ class PairCut
5150
{
5251
switch (cut) {
5352
case PairCuts::kAsym: {
54-
float asym = abs(g1.e() - g2.e()) / (g1.e() + g2.e());
53+
float asym = std::abs(g1.e() - g2.e()) / (g1.e() + g2.e());
5554
// float asym = abs(g1.p() - g2.p()) / (g1.p() + g2.p());
5655
return mMinAsym < asym && asym < mMaxAsym;
5756
}

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <DetectorsBase/Propagator.h>
4545
#include <EMCALBase/Geometry.h>
4646
#include <EMCALBase/GeometryBase.h>
47+
#include <Framework/ASoA.h>
4748
#include <Framework/ASoAHelpers.h>
4849
#include <Framework/AnalysisDataModel.h>
4950
#include <Framework/AnalysisHelpers.h>

PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <CommonConstants/PhysicsConstants.h>
4242
#include <DataFormatsParameters/GRPMagField.h>
4343
#include <DetectorsBase/Propagator.h>
44+
#include <Framework/ASoA.h>
4445
#include <Framework/ASoAHelpers.h>
4546
#include <Framework/AnalysisDataModel.h>
4647
#include <Framework/AnalysisHelpers.h>

PWGEM/PhotonMeson/Core/TaggingPi0.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <CommonConstants/PhysicsConstants.h>
3939
#include <DataFormatsParameters/GRPMagField.h>
4040
#include <DetectorsBase/Propagator.h>
41+
#include <Framework/ASoA.h>
4142
#include <Framework/ASoAHelpers.h>
4243
#include <Framework/AnalysisDataModel.h>
4344
#include <Framework/AnalysisHelpers.h>

PWGEM/PhotonMeson/Core/TaggingPi0MC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <CommonConstants/PhysicsConstants.h>
4040
#include <DataFormatsParameters/GRPMagField.h>
4141
#include <DetectorsBase/Propagator.h>
42+
#include <Framework/ASoA.h>
4243
#include <Framework/ASoAHelpers.h>
4344
#include <Framework/AnalysisDataModel.h>
4445
#include <Framework/AnalysisHelpers.h>

PWGEM/PhotonMeson/Legacy/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ o2physics_add_dpl_workflow(skimmer-gamma-conversion-truthonlymc
1919
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
2020
COMPONENT_NAME Analysis)
2121

22+
o2physics_add_dpl_workflow(skimmer-dalitz-ee
23+
SOURCES skimmerDalitzEE.cxx
24+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
25+
COMPONENT_NAME Analysis)
26+
2227
o2physics_add_dpl_workflow(create-pcm
2328
SOURCES createPCM.cxx
2429
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore

PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx renamed to PWGEM/PhotonMeson/Legacy/skimmerDalitzEE.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
/// \file skimmerDalitzEE
1213
/// \brief write relevant information for dalitz ee analysis to an AO2D.root file. This file is then the only necessary input to perform pcm analysis.
1314
/// \author daiki.sekihata@cern.ch
1415

@@ -22,6 +23,7 @@
2223
#include <CommonConstants/PhysicsConstants.h>
2324
#include <DataFormatsParameters/GRPMagField.h>
2425
#include <DataFormatsParameters/GRPObject.h>
26+
#include <Framework/ASoA.h>
2527
#include <Framework/ASoAHelpers.h>
2628
#include <Framework/AnalysisDataModel.h>
2729
#include <Framework/AnalysisHelpers.h>

PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ o2physics_add_dpl_workflow(skimmer-primary-electron-from-dalitzee
4646
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
4747
COMPONENT_NAME Analysis)
4848

49-
o2physics_add_dpl_workflow(skimmer-dalitz-ee
50-
SOURCES skimmerDalitzEE.cxx
51-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
52-
COMPONENT_NAME Analysis)
53-
5449
o2physics_add_dpl_workflow(non-lin-producer
5550
SOURCES nonLinProducer.cxx
5651
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore

0 commit comments

Comments
 (0)