Skip to content

Commit 84f6625

Browse files
authored
Refactor mask parameter type from uint16_t& to uint16_t
1 parent 7a0f3c8 commit 84f6625

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

PWGHF/HFL/Tasks/taskSingleMuonMultMc.cxx

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Framework/O2DatabasePDGPlugin.h"
2626
#include "Framework/runDataProcessing.h"
2727
#include "ReconstructionDataFormats/TrackFwd.h"
28+
#include <Framework/ASoA.h>
2829
#include <Framework/Configurable.h>
2930

3031
#include <TString.h>
@@ -257,90 +258,90 @@ struct HfTaskSingleMuonMultMc {
257258
}
258259

259260
// particle has an associated MC particle
260-
bool isIdentified(const uint16_t& mask)
261+
bool isIdentified(const uint16_t mask)
261262
{
262263
return (TESTBIT(mask, IsIdentified));
263264
}
264265
// this particle is muon
265-
bool isMuon(const uint16_t& mask)
266+
bool isMuon(const uint16_t mask)
266267
{
267268
return (TESTBIT(mask, IsIdentified) && TESTBIT(mask, IsMuon));
268269
}
269270

270271
// this muon comes from transport
271-
bool isSecondaryMu(const uint16_t& mask)
272+
bool isSecondaryMu(const uint16_t mask)
272273
{
273274
return (isMuon(mask) && TESTBIT(mask, IsSecondary));
274275
}
275276

276277
// this muon comes from light flavor quark decay
277-
bool isLightDecayMu(const uint16_t& mask)
278+
bool isLightDecayMu(const uint16_t mask)
278279
{
279280
return (isMuon(mask) && TESTBIT(mask, HasLightParent) && (!TESTBIT(mask, IsSecondary)));
280281
}
281282

282283
// this muon comes from tau decays
283-
bool isTauDecayMu(const uint16_t& mask)
284+
bool isTauDecayMu(const uint16_t mask)
284285
{
285286
return (isMuon(mask) && TESTBIT(mask, HasTauParent) && (!TESTBIT(mask, HasWParent)) && (!TESTBIT(mask, HasZParent)) && (!TESTBIT(mask, HasBeautyParent)) && (!TESTBIT(mask, HasCharmParent)));
286287
}
287288

288289
// this muon comes from W+- decay
289-
bool isWBosonDecayMu(const uint16_t& mask)
290+
bool isWBosonDecayMu(const uint16_t mask)
290291
{
291292
return (isMuon(mask) && TESTBIT(mask, HasWParent) && (!TESTBIT(mask, HasZParent)) && (!TESTBIT(mask, HasTauParent)) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
292293
}
293294

294295
// this muon comes from Z decay
295-
bool isZBosonDecayMu(const uint16_t& mask)
296+
bool isZBosonDecayMu(const uint16_t mask)
296297
{
297298
return (isMuon(mask) && TESTBIT(mask, HasZParent) && (!TESTBIT(mask, HasWParent)) && (!TESTBIT(mask, HasTauParent)) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
298299
}
299300

300301
// this muon comes from quarkonium decay
301-
bool isQuarkoniumDecayMu(const uint16_t& mask)
302+
bool isQuarkoniumDecayMu(const uint16_t mask)
302303
{
303304
return (isMuon(mask) && TESTBIT(mask, HasQuarkoniumParent) && (!TESTBIT(mask, HasBeautyParent)) && (!TESTBIT(mask, HasCharmParent)) && (!TESTBIT(mask, HasLightParent)));
304305
}
305306

306307
// this muon comes from beauty decay and does not have light flavor parent
307-
bool isBeautyMu(const uint16_t& mask)
308+
bool isBeautyMu(const uint16_t mask)
308309
{
309310
return (isMuon(mask) && TESTBIT(mask, HasBeautyParent) && (!TESTBIT(mask, HasQuarkoniumParent)) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
310311
}
311312

312313
// this muon comes directly from beauty decay
313-
bool isBeautyDecayMu(const uint16_t& mask)
314+
bool isBeautyDecayMu(const uint16_t mask)
314315
{
315316
return (isBeautyMu(mask) && (!TESTBIT(mask, HasCharmParent) && (!TESTBIT(mask, HasQuarkoniumParent))) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
316317
}
317318

318319
// this muon comes from non-prompt charm decay and does not have light flavor parent
319-
bool isNonpromptCharmMu(const uint16_t& mask)
320+
bool isNonpromptCharmMu(const uint16_t mask)
320321
{
321322
return (isBeautyMu(mask) && TESTBIT(mask, HasCharmParent) && (!TESTBIT(mask, HasQuarkoniumParent)) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
322323
}
323324

324325
// this muon comes from prompt charm decay and does not have light flavor parent
325-
bool isPromptCharmMu(const uint16_t& mask)
326+
bool isPromptCharmMu(const uint16_t mask)
326327
{
327328
return (isMuon(mask) && TESTBIT(mask, HasCharmParent) && (!TESTBIT(mask, HasBeautyParent)) && (!TESTBIT(mask, HasQuarkoniumParent)) && (!TESTBIT(mask, HasLightParent)) && (!TESTBIT(mask, IsSecondary)));
328329
}
329330

330331
// this muon comes from other sources which have not classified above.
331-
bool isOtherMu(const uint16_t& mask)
332+
bool isOtherMu(const uint16_t mask)
332333
{
333334
return (isMuon(mask) && (!isSecondaryMu(mask)) && (!isLightDecayMu(mask)) && (!isTauDecayMu(mask)) && (!isWBosonDecayMu(mask)) && (!isZBosonDecayMu(mask)) && (!isQuarkoniumDecayMu(mask)) && (!isBeautyMu(mask)) && (!isPromptCharmMu(mask)));
334335
}
335336

336337
// this is a hadron
337-
bool isHadron(const uint16_t& mask)
338+
bool isHadron(const uint16_t mask)
338339
{
339340
return (TESTBIT(mask, IsIdentified) && (!TESTBIT(mask, IsMuon)));
340341
}
341342

342343
// this particle is unidentified
343-
bool isUnidentified(const uint16_t& mask)
344+
bool isUnidentified(const uint16_t mask)
344345
{
345346
return ((!TESTBIT(mask, IsIdentified)));
346347
}
@@ -398,7 +399,10 @@ struct HfTaskSingleMuonMultMc {
398399
}
399400
}
400401

401-
void process(McGenCollisions::iterator const& mccollision, McMuons const& muons, aod::McParticles const&, McRecCollisions const& collisions)
402+
void process(McGenCollisions::iterator const& mccollision,
403+
McMuons const& muons,
404+
aod::McParticles const&,
405+
McRecCollisions const& collisions)
402406
{
403407

404408
// event selections
@@ -474,7 +478,10 @@ struct HfTaskSingleMuonMultMc {
474478
}
475479
}
476480

477-
void processResTrack(McGenCollisions::iterator const& mccollision, McRecCollisions const& collisions, aod::McParticles const& particles, MyTracks const& tracks)
481+
void processResTrack(McGenCollisions::iterator const& mccollision,
482+
McRecCollisions const& collisions,
483+
aod::McParticles const& particles,
484+
MyTracks const& tracks)
478485
{
479486
// event selections
480487
if (std::abs(mccollision.posZ()) > zVtxMax) {
@@ -514,17 +521,19 @@ struct HfTaskSingleMuonMultMc {
514521
auto nTrk = 0;
515522
auto tracksample = tracks.sliceBy(perCol, collision.globalIndex());
516523
for (const auto& track : tracksample) {
517-
if (!track.isGlobalTrack())
524+
if (!track.isGlobalTrack()) {
518525
continue;
526+
}
519527
registry.fill(HIST("hParticleRec"), track.pt(), track.eta());
520528
++nTrk;
521529
}
522-
if (nTrk < 1)
530+
if (nTrk < 1) {
523531
continue;
532+
}
524533
registry.fill(HIST("hTrackResponse"), nP, nTrk);
525534
}
526535
}
527-
PROCESS_SWITCH(HfTaskSingleMuonMultMc, processResTrack, "Process Track Reconstruction/Generation", true);
536+
PROCESS_SWITCH(HfTaskSingleMuonMultMc, processResTrack, "Process Track Reconstruction/Generation", false);
528537
};
529538

530539
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)