2323#include " Common/Core/RecoDecay.h"
2424#include " Common/DataModel/Centrality.h"
2525#include " Common/DataModel/EventSelection.h"
26- #include " Common/DataModel/Multiplicity.h"
2726#include " Common/DataModel/PIDResponseTPC.h"
2827#include " Common/DataModel/TrackSelectionTables.h"
2928#include " EventFiltering/Zorro.h"
@@ -328,19 +327,19 @@ struct HfTaskElectronWeakBoson {
328327 {
329328 double energySum = 0.0 ;
330329 double isoEnergy = 10.0 ;
331- double etaAssCluster = cluster.eta ();
332- double phiAssCluster = cluster.phi ();
330+ double const etaAssCluster = cluster.eta ();
331+ double const phiAssCluster = cluster.phi ();
333332
334333 for (const auto & associateCluster : clusters) {
335334 // Calculate angular distances
336- double dEta = associateCluster.eta () - etaAssCluster;
335+ double const dEta = associateCluster.eta () - etaAssCluster;
337336 double dPhi = associateCluster.phi () - phiAssCluster;
338337
339338 // Normalize φ difference
340339 dPhi = RecoDecay::constrainAngle (dPhi, -o2::constants::math::PI);
341340
342341 // Calculate ΔR
343- double deltaR = std::sqrt (dEta * dEta + dPhi * dPhi);
342+ double const deltaR = std::sqrt (dEta * dEta + dPhi * dPhi);
344343
345344 // Sum energy within isolation cone
346345 if (deltaR < rIsolation) {
@@ -368,11 +367,11 @@ struct HfTaskElectronWeakBoson {
368367
369368 for (const auto & track : tracks) {
370369
371- double dEta = track.eta () - etaEle;
370+ double const dEta = track.eta () - etaEle;
372371 double dPhi = track.phi () - phiEle;
373372 dPhi = RecoDecay::constrainAngle (dPhi, -o2::constants::math::PI);
374373
375- double deltaR = std::sqrt (dEta * dEta + dPhi * dPhi);
374+ double const deltaR = std::sqrt (dEta * dEta + dPhi * dPhi);
376375
377376 if (deltaR < rIsolation) {
378377 trackCount++;
@@ -389,7 +388,7 @@ struct HfTaskElectronWeakBoson {
389388 return std::make_pair (trackCount - 1 , isoMomentum);
390389 }
391390
392- void recoMassZee (KFParticle kfpIsoEle,
391+ void recoMassZee (const KFParticle& kfpIsoEle,
393392 int charge,
394393 float centrality,
395394 TrackEle const & tracks)
@@ -418,12 +417,12 @@ struct HfTaskElectronWeakBoson {
418417 continue ;
419418 }
420419
421- KFPTrack kfpTrackAssEle = createKFPTrackFromTrack (track);
422- KFParticle kfpAssEle (kfpTrackAssEle, pdgAss);
420+ KFPTrack const kfpTrackAssEle = createKFPTrackFromTrack (track);
421+ KFParticle const kfpAssEle (kfpTrackAssEle, pdgAss);
423422 // reco by RecoDecay
424423 auto child1 = RecoDecayPtEtaPhi::pVector (kfpIsoEle.GetPt () * correctionPtElectron, kfpIsoEle.GetEta (), kfpIsoEle.GetPhi ());
425424 auto child2 = RecoDecayPtEtaPhi::pVector (kfpAssEle.GetPt () * correctionPtElectron, kfpAssEle.GetEta (), kfpAssEle.GetPhi ());
426- double invMassEE = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
425+ double const invMassEE = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
427426
428427 registry.fill (HIST (" hInvMassZee" ), centrality, track.sign () * charge, kfpIsoEle.GetPt (), invMassEE);
429428
@@ -433,7 +432,7 @@ struct HfTaskElectronWeakBoson {
433432 zeeKF.SetConstructMethod (kfConstructMethod);
434433 zeeKF.Construct (electronPairs, 2 );
435434 // LOG(info) << "Invarimass cal by KF particle Chi2/NDF = " << zeeKF.GetChi2()/zeeKF.GetNDF();
436- float chiSqNdf = zeeKF.GetChi2 () / zeeKF.GetNDF ();
435+ float const chiSqNdf = zeeKF.GetChi2 () / zeeKF.GetNDF ();
437436 if (zeeKF.GetNDF () < 1 ) {
438437 continue ;
439438 }
@@ -470,16 +469,16 @@ struct HfTaskElectronWeakBoson {
470469
471470 // Get BC for this collision
472471 auto bc = collision.bc_as <aod::BCsWithTimestamps>();
473- uint64_t globalBC = bc.globalBC ();
474- int runNumber = bc.runNumber ();
472+ uint64_t const globalBC = bc.globalBC ();
473+ int const runNumber = bc.runNumber ();
475474
476475 // Initialize Zorro for the first event (once per run)
477476 static bool isFirstEvent = true ;
478477 static int lastRunNumber = -1 ;
479478
480479 if ((isFirstEvent || runNumber != lastRunNumber) && cfgSkimmedProcessing) {
481480 LOGF (info, " Initializing Zorro for run %d" , runNumber);
482- uint64_t currentTimestamp = bc.timestamp ();
481+ uint64_t const currentTimestamp = bc.timestamp ();
483482
484483 // debug for timestamp
485484 LOGF (info, " Using CCDB path: %s, timestamp: %llu" , cfgCCDBPath.value .c_str (), currentTimestamp);
@@ -490,12 +489,13 @@ struct HfTaskElectronWeakBoson {
490489 lastRunNumber = runNumber;
491490
492491 // initialize magnetic field
493- o2::parameters::GRPMagField * grpo = ccdb->getForTimeStamp <o2::parameters::GRPMagField>(ccdbPathGrpMag, currentTimestamp);
492+ auto * grpo = ccdb->getForTimeStamp <o2::parameters::GRPMagField>(ccdbPathGrpMag, currentTimestamp);
494493 o2::base::Propagator::initFieldFromGRP (grpo);
495- double magneticField = o2::base::Propagator::Instance ()->getNominalBz ();
494+ double const magneticField = o2::base::Propagator::Instance ()->getNominalBz ();
496495 LOG (info) << " magneticField = " << magneticField;
497- if (magneticField)
496+ if (magneticField != 0.0 ) {
498497 KFParticle::SetField (magneticField);
498+ }
499499 }
500500
501501 // Check if this is a triggered event using Zorro
@@ -610,30 +610,31 @@ struct HfTaskElectronWeakBoson {
610610 bool isIsolated = false ;
611611 bool isIsolatedTr = false ;
612612
613- if (tracksofcluster.size () && isEMCacceptance) {
613+ if (( tracksofcluster.size () != 0 ) && isEMCacceptance) {
614614 int nMatch = 0 ;
615615 for (const auto & match : tracksofcluster) {
616- if (match.emcalcluster_as <SelectedClusters>().time () < timeEmcMin || match.emcalcluster_as <SelectedClusters>().time () > timeEmcMax)
616+ if (match.emcalcluster_as <SelectedClusters>().time () < timeEmcMin || match.emcalcluster_as <SelectedClusters>().time () > timeEmcMax) {
617617 continue ;
618+ }
618619
619- float m02Emc = match.emcalcluster_as <SelectedClusters>().m02 ();
620- float energyEmc = match.emcalcluster_as <SelectedClusters>().energy ();
621- double phiEmc = match.emcalcluster_as <SelectedClusters>().phi ();
622- double etaEmc = match.emcalcluster_as <SelectedClusters>().eta ();
623- double timeEmc = match.emcalcluster_as <SelectedClusters>().time ();
620+ float const m02Emc = match.emcalcluster_as <SelectedClusters>().m02 ();
621+ float const energyEmc = match.emcalcluster_as <SelectedClusters>().energy ();
622+ double const phiEmc = match.emcalcluster_as <SelectedClusters>().phi ();
623+ double const etaEmc = match.emcalcluster_as <SelectedClusters>().eta ();
624+ double const timeEmc = match.emcalcluster_as <SelectedClusters>().time ();
624625 // LOG(info) << "tr phi0 = " << match.track_as<TrackEle>().phi();
625626 // LOG(info) << "tr phi1 = " << track.phi();
626627 // LOG(info) << "emc phi = " << phiEmc;
627628
628629 if (nMatch == 0 ) {
629- double dEta = match.track_as <TrackEle>().trackEtaEmcal () - etaEmc;
630+ double const dEta = match.track_as <TrackEle>().trackEtaEmcal () - etaEmc;
630631 double dPhi = match.track_as <TrackEle>().trackPhiEmcal () - phiEmc;
631632 dPhi = RecoDecay::constrainAngle (dPhi, -o2::constants::math::PI);
632633
633634 registry.fill (HIST (" hMatchPhi" ), phiEmc, match.track_as <TrackEle>().trackPhiEmcal ());
634635 registry.fill (HIST (" hMatchEta" ), etaEmc, match.track_as <TrackEle>().trackEtaEmcal ());
635636
636- double r = RecoDecay::sqrtSumOfSquares (dPhi, dEta);
637+ double const r = RecoDecay::sqrtSumOfSquares (dPhi, dEta);
637638 // LOG(info) << "r match = " << r;
638639 if (r < rMin) {
639640 rMin = r;
@@ -644,8 +645,9 @@ struct HfTaskElectronWeakBoson {
644645 registry.fill (HIST (" hEMCtime" ), timeEmc);
645646 registry.fill (HIST (" hEnergy" ), energyEmc);
646647
647- if (std::abs (dPhi) > rMatchMax || std::abs (dEta) > rMatchMax)
648+ if (std::abs (dPhi) > rMatchMax || std::abs (dEta) > rMatchMax) {
648649 continue ;
650+ }
649651
650652 registry.fill (HIST (" hTrMatchR" ), match.track_as <TrackEle>().pt (), r);
651653 registry.fill (HIST (" hEnergyNcell" ), energyEmc, match.emcalcluster_as <SelectedClusters>().nCells ());
@@ -668,10 +670,12 @@ struct HfTaskElectronWeakBoson {
668670
669671 if (match.track_as <TrackEle>().tpcNSigmaEl () > nsigTpcMin && match.track_as <TrackEle>().tpcNSigmaEl () < nsigTpcMax) {
670672 registry.fill (HIST (" hEop" ), match.track_as <TrackEle>().pt (), eop);
671- if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax)
673+ if (eop > eopMin && eop < eopMax && isoEnergy < energyIsolationMax) {
672674 isIsolated = true ;
673- if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax && isoMomentum < momentumIsolationMax)
675+ }
676+ if (eop > eopMin && eop < eopMax && trackCount < trackIsolationMax && isoMomentum < momentumIsolationMax) {
674677 isIsolatedTr = true ;
678+ }
675679
676680 if (isIsolated && isIsolatedTr) {
677681 registry.fill (HIST (" hEopIsolation" ), match.track_as <TrackEle>().pt (), eop);
@@ -681,8 +685,8 @@ struct HfTaskElectronWeakBoson {
681685 if (match.track_as <TrackEle>().sign () > 0 ) {
682686 pdgIso = kPositron ;
683687 }
684- KFPTrack kfpTrackIsoEle = createKFPTrackFromTrack (match.track_as <TrackEle>());
685- KFParticle kfpIsoEle (kfpTrackIsoEle, pdgIso);
688+ KFPTrack const kfpTrackIsoEle = createKFPTrackFromTrack (match.track_as <TrackEle>());
689+ KFParticle const kfpIsoEle (kfpTrackIsoEle, pdgIso);
686690 recoMassZee (kfpIsoEle, match.track_as <TrackEle>().sign (), centrality, tracks);
687691
688692 } // end of pt cut for e from Z
@@ -732,7 +736,7 @@ struct HfTaskElectronWeakBoson {
732736
733737 } // end of track loop
734738 // Z-hadron
735- if (reconstructedZ.size () > 0 ) {
739+ if (! reconstructedZ.empty () ) {
736740 for (const auto & zBoson : reconstructedZ) {
737741 // Z boson selection
738742 if (zBoson.mass < massZMin || zBoson.mass > massZMax) {
@@ -747,23 +751,23 @@ struct HfTaskElectronWeakBoson {
747751 continue ;
748752 }
749753 // calculate Z-h correlation
750- double deltaPhi = RecoDecay::constrainAngle (trackAss.phi - zBoson.phi , -o2::constants::math::PIHalf);
751- double ptRatio = trackAss.pt / zBoson.pt ;
754+ double const deltaPhi = RecoDecay::constrainAngle (trackAss.phi - zBoson.phi , -o2::constants::math::PIHalf);
755+ double const ptRatio = trackAss.pt / zBoson.pt ;
752756 registry.fill (HIST (" hZHadronDphi" ), centrality, zBoson.charge , zBoson.pt , deltaPhi, ptRatio, trackAss.pt );
753757 }
754758 }
755759 } // end of Z-hadron correlation
756760 // Z->ee QA
757761 if (enableZeeRecoQA) {
758- if (selectedElectronsIso.size () > 0 && selectedPositronsIso.size () > 0 ) {
762+ if (! selectedElectronsIso.empty () && ! selectedPositronsIso.empty () ) {
759763 // signal
760764 for (const auto & trackEle : selectedElectronsIso) {
761765 auto child1 = RecoDecayPtEtaPhi::pVector (trackEle.pt , trackEle.eta , trackEle.phi );
762- float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad;
766+ float const sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad;
763767 for (const auto & trackPos : selectedPositronsIso) {
764768 auto child2 = RecoDecayPtEtaPhi::pVector (trackPos.pt , trackPos.eta , trackPos.phi );
765- double invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
766- float sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad;
769+ double const invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
770+ float const sectorpos = trackPos.phi / o2::constants::math::SectorSpanRad;
767771 if (invMass > massZMinQA) {
768772 registry.fill (HIST (" hInvMassZeeQA" ), invMass, trackEle.pt , trackPos.pt , trackEle.dcaxyTrk , trackPos.dcaxyTrk , trackPos.dcazTrk , trackEle.nclusterTPC , trackPos.nclusterTPC , trackEle.nclusterITS , trackPos.nclusterITS , sectorneg, sectorpos, trackEle.eop , trackPos.eop , trackEle.energyIso , trackPos.energyIso , trackEle.momIso , trackPos.momIso , trackEle.ntrackIso , trackPos.ntrackIso );
769773 }
@@ -773,12 +777,12 @@ struct HfTaskElectronWeakBoson {
773777 for (size_t i = 0 ; i < selectedElectronsIso.size (); ++i) {
774778 const auto & trackEle = selectedElectronsIso[i];
775779 auto child1 = RecoDecayPtEtaPhi::pVector (trackEle.pt , trackEle.eta , trackEle.phi );
776- float sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad;
780+ float const sectorneg = trackEle.phi / o2::constants::math::SectorSpanRad;
777781 for (size_t j = i + 1 ; j < selectedElectronsIso.size (); ++j) {
778782 const auto & trackEle2 = selectedElectronsIso[j];
779783 auto child2 = RecoDecayPtEtaPhi::pVector (trackEle2.pt , trackEle2.eta , trackEle2.phi );
780- float sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad;
781- double invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
784+ float const sectorpos = trackEle2.phi / o2::constants::math::SectorSpanRad;
785+ double const invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
782786 if (invMass > massZMinQA) {
783787 registry.fill (HIST (" hInvMassZeeQAbg" ), invMass, trackEle.pt , trackEle2.pt , trackEle.dcaxyTrk , trackEle2.dcaxyTrk , trackEle2.dcazTrk , trackEle.nclusterTPC , trackEle2.nclusterTPC , trackEle.nclusterITS , trackEle2.nclusterITS , sectorneg, sectorpos, trackEle.eop , trackEle2.eop , trackEle.energyIso , trackEle2.energyIso , trackEle.momIso , trackEle2.momIso , trackEle.ntrackIso , trackEle2.ntrackIso );
784788 }
@@ -788,12 +792,12 @@ struct HfTaskElectronWeakBoson {
788792 for (size_t i = 0 ; i < selectedPositronsIso.size (); ++i) {
789793 const auto & trackPos = selectedPositronsIso[i];
790794 auto child1 = RecoDecayPtEtaPhi::pVector (trackPos.pt , trackPos.eta , trackPos.phi );
791- float sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad;
795+ float const sectorneg = trackPos.phi / o2::constants::math::SectorSpanRad;
792796 for (size_t j = i + 1 ; j < selectedPositronsIso.size (); ++j) {
793797 const auto & trackPos2 = selectedPositronsIso[j];
794798 auto child2 = RecoDecayPtEtaPhi::pVector (trackPos2.pt , trackPos2.eta , trackPos2.phi );
795- float sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad;
796- double invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
799+ float const sectorpos = trackPos2.phi / o2::constants::math::SectorSpanRad;
800+ double const invMass = RecoDecay::m (std::array{child1, child2}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
797801 if (invMass > massZMinQA) {
798802 registry.fill (HIST (" hInvMassZeeQAbg" ), invMass, trackPos.pt , trackPos2.pt , trackPos.dcaxyTrk , trackPos2.dcaxyTrk , trackPos2.dcazTrk , trackPos.nclusterTPC , trackPos2.nclusterTPC , trackPos.nclusterITS , trackPos2.nclusterITS , sectorneg, sectorpos, trackPos.eop , trackPos2.eop , trackPos.energyIso , trackPos2.energyIso , trackPos.momIso , trackPos2.momIso , trackPos.ntrackIso , trackPos2.ntrackIso );
799803 }
0 commit comments