1717#include " Common/DataModel/EventSelection.h"
1818#include " Common/DataModel/TrackSelectionTables.h"
1919
20- #include " CommonConstants/PhysicsConstants.h"
21- #include " Framework/ASoAHelpers.h"
22- #include " Framework/AnalysisDataModel.h"
23- #include " Framework/AnalysisTask.h"
24- #include " Framework/HistogramRegistry.h"
25- #include " Framework/O2DatabasePDGPlugin.h"
26- #include " Framework/runDataProcessing.h"
27- #include " ReconstructionDataFormats/TrackFwd.h"
20+ #include < Framework/ASoA.h>
21+ #include < Framework/AnalysisDataModel.h>
22+ #include < Framework/AnalysisHelpers.h>
23+ #include < Framework/AnalysisTask.h>
2824#include < Framework/Configurable.h>
29-
25+ #include < Framework/HistogramRegistry.h>
26+ #include < Framework/HistogramSpec.h>
27+ #include < Framework/InitContext.h>
28+ #include < Framework/O2DatabasePDGPlugin.h>
29+ #include < Framework/OutputObjHeader.h>
30+ #include < Framework/runDataProcessing.h>
31+
32+ #include < TPDGCode.h>
3033#include < TString.h>
3134
35+ #include < Rtypes.h>
36+
37+ #include < cstdint>
38+ #include < cstdlib>
39+
3240using namespace o2 ;
3341using namespace o2 ::aod;
3442using namespace o2 ::framework;
3543using namespace o2 ::framework::expressions;
3644using namespace o2 ::aod::fwdtrack;
3745
38- auto static constexpr MinCharge = 3 .f;
46+ // Minimum PDG charge (in units of 1/3 e)
47+ auto static constexpr ChargeMin = 3 .f;
3948
4049namespace
4150{
@@ -257,92 +266,92 @@ struct HfTaskSingleMuonMultMc {
257266 }
258267
259268 // particle has an associated MC particle
260- bool isIdentified (const uint16_t & mask)
269+ bool isIdentified (const uint16_t mask)
261270 {
262271 return (TESTBIT (mask, IsIdentified));
263272 }
264273 // this particle is muon
265- bool isMuon (const uint16_t & mask)
274+ bool isMuon (const uint16_t mask)
266275 {
267276 return (TESTBIT (mask, IsIdentified) && TESTBIT (mask, IsMuon));
268277 }
269278
270279 // this muon comes from transport
271- bool isSecondaryMu (const uint16_t & mask)
280+ bool isSecondaryMu (const uint16_t mask)
272281 {
273282 return (isMuon (mask) && TESTBIT (mask, IsSecondary));
274283 }
275284
276285 // this muon comes from light flavor quark decay
277- bool isLightDecayMu (const uint16_t & mask)
286+ bool isLightDecayMu (const uint16_t mask)
278287 {
279288 return (isMuon (mask) && TESTBIT (mask, HasLightParent) && (!TESTBIT (mask, IsSecondary)));
280289 }
281290
282291 // this muon comes from tau decays
283- bool isTauDecayMu (const uint16_t & mask)
292+ bool isTauDecayMu (const uint16_t mask)
284293 {
285294 return (isMuon (mask) && TESTBIT (mask, HasTauParent) && (!TESTBIT (mask, HasWParent)) && (!TESTBIT (mask, HasZParent)) && (!TESTBIT (mask, HasBeautyParent)) && (!TESTBIT (mask, HasCharmParent)));
286295 }
287296
288297 // this muon comes from W+- decay
289- bool isWBosonDecayMu (const uint16_t & mask)
298+ bool isWBosonDecayMu (const uint16_t mask)
290299 {
291300 return (isMuon (mask) && TESTBIT (mask, HasWParent) && (!TESTBIT (mask, HasZParent)) && (!TESTBIT (mask, HasTauParent)) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
292301 }
293302
294303 // this muon comes from Z decay
295- bool isZBosonDecayMu (const uint16_t & mask)
304+ bool isZBosonDecayMu (const uint16_t mask)
296305 {
297306 return (isMuon (mask) && TESTBIT (mask, HasZParent) && (!TESTBIT (mask, HasWParent)) && (!TESTBIT (mask, HasTauParent)) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
298307 }
299308
300309 // this muon comes from quarkonium decay
301- bool isQuarkoniumDecayMu (const uint16_t & mask)
310+ bool isQuarkoniumDecayMu (const uint16_t mask)
302311 {
303312 return (isMuon (mask) && TESTBIT (mask, HasQuarkoniumParent) && (!TESTBIT (mask, HasBeautyParent)) && (!TESTBIT (mask, HasCharmParent)) && (!TESTBIT (mask, HasLightParent)));
304313 }
305314
306315 // this muon comes from beauty decay and does not have light flavor parent
307- bool isBeautyMu (const uint16_t & mask)
316+ bool isBeautyMu (const uint16_t mask)
308317 {
309318 return (isMuon (mask) && TESTBIT (mask, HasBeautyParent) && (!TESTBIT (mask, HasQuarkoniumParent)) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
310319 }
311320
312321 // this muon comes directly from beauty decay
313- bool isBeautyDecayMu (const uint16_t & mask)
322+ bool isBeautyDecayMu (const uint16_t mask)
314323 {
315324 return (isBeautyMu (mask) && (!TESTBIT (mask, HasCharmParent) && (!TESTBIT (mask, HasQuarkoniumParent))) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
316325 }
317326
318327 // this muon comes from non-prompt charm decay and does not have light flavor parent
319- bool isNonpromptCharmMu (const uint16_t & mask)
328+ bool isNonpromptCharmMu (const uint16_t mask)
320329 {
321330 return (isBeautyMu (mask) && TESTBIT (mask, HasCharmParent) && (!TESTBIT (mask, HasQuarkoniumParent)) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
322331 }
323332
324333 // this muon comes from prompt charm decay and does not have light flavor parent
325- bool isPromptCharmMu (const uint16_t & mask)
334+ bool isPromptCharmMu (const uint16_t mask)
326335 {
327336 return (isMuon (mask) && TESTBIT (mask, HasCharmParent) && (!TESTBIT (mask, HasBeautyParent)) && (!TESTBIT (mask, HasQuarkoniumParent)) && (!TESTBIT (mask, HasLightParent)) && (!TESTBIT (mask, IsSecondary)));
328337 }
329338
330339 // this muon comes from other sources which have not classified above.
331- bool isOtherMu (const uint16_t & mask)
340+ bool isOtherMu (const uint16_t mask)
332341 {
333342 return (isMuon (mask) && (!isSecondaryMu (mask)) && (!isLightDecayMu (mask)) && (!isTauDecayMu (mask)) && (!isWBosonDecayMu (mask)) && (!isZBosonDecayMu (mask)) && (!isQuarkoniumDecayMu (mask)) && (!isBeautyMu (mask)) && (!isPromptCharmMu (mask)));
334343 }
335344
336345 // this is a hadron
337- bool isHadron (const uint16_t & mask)
346+ bool isHadron (const uint16_t mask)
338347 {
339348 return (TESTBIT (mask, IsIdentified) && (!TESTBIT (mask, IsMuon)));
340349 }
341350
342351 // this particle is unidentified
343- bool isUnidentified (const uint16_t & mask)
352+ bool isUnidentified (const uint16_t mask)
344353 {
345- return (( !TESTBIT (mask, IsIdentified) ));
354+ return (!TESTBIT (mask, IsIdentified));
346355 }
347356
348357 // fill the histograms of each particle types
@@ -398,7 +407,10 @@ struct HfTaskSingleMuonMultMc {
398407 }
399408 }
400409
401- void process (McGenCollisions::iterator const & mccollision, McMuons const & muons, aod::McParticles const &, McRecCollisions const & collisions)
410+ void process (McGenCollisions::iterator const & mccollision,
411+ McMuons const & muons,
412+ aod::McParticles const &,
413+ McRecCollisions const & collisions)
402414 {
403415
404416 // event selections
@@ -409,14 +421,14 @@ struct HfTaskSingleMuonMultMc {
409421 registry.fill (HIST (" hNEventGenMu" ), 1 );
410422
411423 for (const auto & muon : muons) {
412- if (!( muon.has_mcParticle () )) {
424+ if (!muon.has_mcParticle ()) {
413425 continue ;
414426 }
415427 auto mcPart (muon.mcParticle ());
416428 auto pdgGen (mcPart.pdgCode ());
417429 auto etaGen (mcPart.eta ());
418430
419- if (!( std::abs (pdgGen) == kMuonMinus ) ) {
431+ if (std::abs (pdgGen) != kMuonMinus ) {
420432 continue ;
421433 }
422434 if ((etaGen >= etaMax) || (etaGen < etaMin)) {
@@ -439,7 +451,7 @@ struct HfTaskSingleMuonMultMc {
439451 continue ;
440452 }
441453
442- if (!( muon.has_mcParticle () )) {
454+ if (!muon.has_mcParticle ()) {
443455 continue ;
444456 }
445457 const auto pt (muon.pt ()), eta (muon.eta ()), rAbsorb (muon.rAtAbsorberEnd ()), pDca (muon.pDca ()), chi2 (muon.chi2MatchMCHMFT ());
@@ -474,7 +486,10 @@ struct HfTaskSingleMuonMultMc {
474486 }
475487 }
476488
477- void processResTrack (McGenCollisions::iterator const & mccollision, McRecCollisions const & collisions, aod::McParticles const & particles, MyTracks const & tracks)
489+ void processResTrack (McGenCollisions::iterator const & mccollision,
490+ McRecCollisions const & collisions,
491+ aod::McParticles const & particles,
492+ MyTracks const & tracks)
478493 {
479494 // event selections
480495 if (std::abs (mccollision.posZ ()) > zVtxMax) {
@@ -496,7 +511,7 @@ struct HfTaskSingleMuonMultMc {
496511 charge = p->Charge ();
497512 }
498513
499- if (std::abs (charge) < MinCharge ) {
514+ if (std::abs (charge) < ChargeMin ) {
500515 continue ;
501516 }
502517 if (particle.pt () < ptTrackMin || std::abs (particle.eta ()) >= etaTrackMax) {
@@ -514,17 +529,19 @@ struct HfTaskSingleMuonMultMc {
514529 auto nTrk = 0 ;
515530 auto tracksample = tracks.sliceBy (perCol, collision.globalIndex ());
516531 for (const auto & track : tracksample) {
517- if (!track.isGlobalTrack ())
532+ if (!track.isGlobalTrack ()) {
518533 continue ;
534+ }
519535 registry.fill (HIST (" hParticleRec" ), track.pt (), track.eta ());
520536 ++nTrk;
521537 }
522- if (nTrk < 1 )
538+ if (nTrk < 1 ) {
523539 continue ;
540+ }
524541 registry.fill (HIST (" hTrackResponse" ), nP, nTrk);
525542 }
526543 }
527- PROCESS_SWITCH (HfTaskSingleMuonMultMc, processResTrack, " Process Track Reconstruction/Generation" , true );
544+ PROCESS_SWITCH (HfTaskSingleMuonMultMc, processResTrack, " Process Track Reconstruction/Generation" , false );
528545};
529546
530547WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments