Skip to content

Commit 9d6c360

Browse files
committed
rename macros
1 parent e0bb705 commit 9d6c360

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

DPG/Tasks/AOTTrack/PID/TPC/treeCreatorPidTpcQa.cxx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <Framework/runDataProcessing.h>
3838
#include <ReconstructionDataFormats/PID.h>
3939

40+
#include <array>
4041
#include <cmath>
4142
#include <cstdint>
4243
#include <string>
@@ -46,16 +47,16 @@ using namespace o2::framework;
4647
using namespace o2::track;
4748
using namespace o2::dpg_tpcskimstablecreator;
4849

49-
#define PARTICLE_LIST(MACRO_ARG) \
50-
MACRO_ARG(El, Electron) \
51-
MACRO_ARG(Mu, Muon) \
52-
MACRO_ARG(Pi, Pion) \
53-
MACRO_ARG(Ka, Kaon) \
54-
MACRO_ARG(Pr, Proton) \
55-
MACRO_ARG(De, Deuteron) \
56-
MACRO_ARG(Tr, Triton) \
57-
MACRO_ARG(He, Helium3) \
58-
MACRO_ARG(Al, Alpha)
50+
#define DO_FOR_ALL_PARTICLES(MACRO) \
51+
MACRO(El, Electron) \
52+
MACRO(Mu, Muon) \
53+
MACRO(Pi, Pion) \
54+
MACRO(Ka, Kaon) \
55+
MACRO(Pr, Proton) \
56+
MACRO(De, Deuteron) \
57+
MACRO(Tr, Triton) \
58+
MACRO(He, Helium3) \
59+
MACRO(Al, Alpha)
5960

6061
struct TreeCreatorPidTpcQa {
6162
Produces<o2::aod::QaPidTpc> rowPidTpcQa;
@@ -76,22 +77,22 @@ struct TreeCreatorPidTpcQa {
7677
Configurable<float> cutTpcInnerParameterMax##ParticleNameLong{"cutTpcInnerParameterMax" #ParticleNameLong, 999.f, "Upper-value cut on tpcInnerParam for " #ParticleNameLong}; /* o2-linter: disable=name/configurable (Configurable defined in macro)*/ \
7778
Configurable<float> cutNSigmaTpcAbs##ParticleNameLong{"cutNSigmaTpcAbs" #ParticleNameLong, 999.f, "Cut on absolute value of nSigmaTpc for " #ParticleNameLong}; // o2-linter: disable=name/configurable (Configurable defined in macro)
7879

79-
PARTICLE_LIST(DECLARE_PARTICLE_WISE_CONFIGURABLES)
80+
DO_FOR_ALL_PARTICLES(DECLARE_PARTICLE_WISE_CONFIGURABLES)
8081
#undef DECLARE_PARTICLE_WISE_CONFIGURABLES
8182

8283
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutTpcInnerParameterMin##ParticleNameLong,
8384
std::array<Configurable<float>*, PID::Alpha + 1> cutTpcInnerParameterMin{
84-
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
85+
DO_FOR_ALL_PARTICLES(PACK_CONFIGURABLES_TO_ARRAY)};
8586
#undef PACK_CONFIGURABLES_TO_ARRAY
8687

8788
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutTpcInnerParameterMax##ParticleNameLong,
8889
std::array<Configurable<float>*, PID::Alpha + 1> cutTpcInnerParameterMax{
89-
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
90+
DO_FOR_ALL_PARTICLES(PACK_CONFIGURABLES_TO_ARRAY)};
9091
#undef PACK_CONFIGURABLES_TO_ARRAY
9192

9293
#define PACK_CONFIGURABLES_TO_ARRAY(ParticleNameShort, ParticleNameLong) &cutNSigmaTpcAbs##ParticleNameLong,
9394
std::array<Configurable<float>*, PID::Alpha + 1> cutNSigmaTpcAbs{
94-
PARTICLE_LIST(PACK_CONFIGURABLES_TO_ARRAY)};
95+
DO_FOR_ALL_PARTICLES(PACK_CONFIGURABLES_TO_ARRAY)};
9596
#undef PACK_CONFIGURABLES_TO_ARRAY
9697

9798
Service<o2::ccdb::BasicCCDBManager> ccdb{};
@@ -112,7 +113,7 @@ struct TreeCreatorPidTpcQa {
112113
int enabledProcesses{0};
113114

114115
switch (Id) {
115-
#define PARTICLE_CASE(ParticleNameShort, ParticleNameLong) \
116+
#define INIT_PARTICLE(ParticleNameShort, ParticleNameLong) \
116117
case PID::ParticleNameLong: \
117118
if (!doprocess##ParticleNameLong && !doprocessFull##ParticleNameLong && !doprocessFullWithTOF##ParticleNameLong) { \
118119
return false; \
@@ -129,8 +130,8 @@ struct TreeCreatorPidTpcQa {
129130
LOG(info) << "Enabled TPC QA for " << #ParticleNameLong; \
130131
break;
131132

132-
PARTICLE_LIST(PARTICLE_CASE)
133-
#undef PARTICLE_CASE
133+
DO_FOR_ALL_PARTICLES(INIT_PARTICLE)
134+
#undef INIT_PARTICLE
134135
}
135136
if (enabledProcesses != 1) {
136137
LOG(fatal) << "Cannot enable more than one process function per particle, check and retry!";
@@ -231,7 +232,7 @@ struct TreeCreatorPidTpcQa {
231232
} \
232233
PROCESS_SWITCH(TreeCreatorPidTpcQa, process##ParticleNameLong, Form("Process for the %s hypothesis for TPC NSigma QA", #ParticleNameLong), false);
233234

234-
PARTICLE_LIST(MAKE_PROCESS_FUNCTION)
235+
DO_FOR_ALL_PARTICLES(MAKE_PROCESS_FUNCTION)
235236
#undef MAKE_PROCESS_FUNCTION
236237

237238
// QA of full tables
@@ -244,7 +245,7 @@ struct TreeCreatorPidTpcQa {
244245
} \
245246
PROCESS_SWITCH(TreeCreatorPidTpcQa, processFull##ParticleNameLong, Form("Process for the %s hypothesis for full TPC PID QA", #ParticleNameLong), false);
246247

247-
PARTICLE_LIST(MAKE_PROCESS_FUNCTION)
248+
DO_FOR_ALL_PARTICLES(MAKE_PROCESS_FUNCTION)
248249
#undef MAKE_PROCESS_FUNCTION
249250

250251
// QA of full tables with TOF information
@@ -257,12 +258,12 @@ struct TreeCreatorPidTpcQa {
257258
} \
258259
PROCESS_SWITCH(TreeCreatorPidTpcQa, processFullWithTOF##ParticleNameLong, Form("Process for the %s hypothesis for full TPC PID QA with the TOF info added", #ParticleNameLong), false);
259260

260-
PARTICLE_LIST(MAKE_PROCESS_FUNCTION)
261+
DO_FOR_ALL_PARTICLES(MAKE_PROCESS_FUNCTION)
261262
#undef MAKE_PROCESS_FUNCTION
262263
};
263264

264265
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
265266
{
266267
return WorkflowSpec{adaptAnalysisTask<TreeCreatorPidTpcQa>(cfgc)};
267268
}
268-
#undef PARTICLE_LIST
269+
#undef DO_FOR_ALL_PARTICLES

0 commit comments

Comments
 (0)