Skip to content

Commit 6c6c793

Browse files
committed
Modify 'CMakeLists.txt' and fix o2linter errors for 'k1AnalysisMicro.cxx'
1 parent 7fed98f commit 6c6c793

File tree

2 files changed

+60
-56
lines changed

2 files changed

+60
-56
lines changed

PWGLF/Tasks/Resonances/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ o2physics_add_dpl_workflow(k1analysis
5454
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
5555
COMPONENT_NAME Analysis)
5656

57+
o2physics_add_dpl_workflow(k1analysismicro
58+
SOURCES k1AnalysisMicro.cxx
59+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
60+
COMPONENT_NAME Analysis)
61+
5762
o2physics_add_dpl_workflow(phianalysisrun3
5863
SOURCES phianalysisrun3.cxx
5964
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

PWGLF/Tasks/Resonances/k1analysismicro.cxx renamed to PWGLF/Tasks/Resonances/k1AnalysisMicro.cxx

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
12-
/// \file k1analysismicro.cxx
13-
/// \brief Reconstruction of track-track decay resonance candidates
1411
///
12+
/// \file k1AnalysisMicro.cxx
13+
/// \brief Reconstruction of track-track decay resonance candidates
14+
/// \author Su-Jeong Ji <su-jeong.ji@cern.ch>, Bong-Hwi Lim <bong-hwi.lim@cern.ch>
1515
///
16-
/// \author Bong-Hwi Lim <bong-hwi.lim@cern.ch>
16+
1717

1818
#include <vector>
1919
#include <TLorentzVector.h>
@@ -26,7 +26,7 @@
2626
#include "Framework/AnalysisTask.h"
2727
#include "Framework/ASoAHelpers.h"
2828
#include "Framework/runDataProcessing.h"
29-
#include "LFResonanceTables.h"
29+
#include "PWGLF/DataModel/LFResonanceTables.h"
3030
#include "DataFormatsParameters/GRPObject.h"
3131
#include "CommonConstants/PhysicsConstants.h"
3232

@@ -38,13 +38,13 @@ using namespace o2::constants::physics;
3838
using namespace o2::constants::math;
3939
;
4040

41-
struct k1analysismicro {
42-
enum binAnti : unsigned int {
41+
struct K1AnalysisMicro {
42+
enum BinAnti : unsigned int {
4343
kNormal = 0,
4444
kAnti,
4545
kNAEnd
4646
};
47-
enum binType : unsigned int {
47+
enum BinType : unsigned int {
4848
kK1P = 0,
4949
kK1N,
5050
kK1P_Mix,
@@ -71,8 +71,8 @@ struct k1analysismicro {
7171
Configurable<int> cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"};
7272
/// Event Mixing
7373
Configurable<int> nEvtMixing{"nEvtMixing", 5, "Number of events to mix"};
74-
ConfigurableAxis CfgVtxBins{"CfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
75-
ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"};
74+
ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
75+
ConfigurableAxis cfgMultBins{"cfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"};
7676
/// Pre-selection cuts
7777
Configurable<double> cMinPtcut{"cMinPtcut", 0.15, "Track minium pt cut"};
7878

@@ -100,7 +100,6 @@ struct k1analysismicro {
100100
Configurable<bool> cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz
101101
Configurable<bool> cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor
102102
Configurable<bool> additionalQAplots{"additionalQAplots", true, "Additional QA plots"};
103-
Configurable<bool> tof_at_high_pt{"tof_at_high_pt", false, "Use TOF at high pT"};
104103
Configurable<bool> additionalEvsel{"additionalEvsel", true, "Additional event selcection"};
105104
Configurable<int> cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"};
106105
Configurable<bool> cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"};
@@ -142,8 +141,8 @@ struct k1analysismicro {
142141
AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"};
143142

144143
// THnSparse
145-
AxisSpec axisAnti = {binAnti::kNAEnd, 0, binAnti::kNAEnd, "Type of bin: Normal or Anti"};
146-
AxisSpec axisType = {binType::kTYEnd, 0, binType::kTYEnd, "Type of bin with charge and mix"};
144+
AxisSpec axisAnti = {BinAnti::kNAEnd, 0, BinAnti::kNAEnd, "Type of bin: Normal or Anti"};
145+
AxisSpec axisType = {BinType::kTYEnd, 0, BinType::kTYEnd, "Type of bin with charge and mix"};
147146
AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"};
148147

149148
// DCA QA
@@ -386,15 +385,15 @@ struct k1analysismicro {
386385
template <typename T, typename T2>
387386
bool isTrueK1(const T& trk1, const T& trk2, const T2& bTrack)
388387
{
389-
if (abs(trk1.pdgCode()) != kPiPlus || abs(trk2.pdgCode()) != kPiPlus)
388+
if (std::abs(trk1.pdgCode()) != kPiPlus || std::abs(trk2.pdgCode()) != kPiPlus)
390389
return false;
391-
if (abs(bTrack.pdgCode()) != kKPlus)
390+
if (std::abs(bTrack.pdgCode()) != kKPlus)
392391
return false;
393392
auto mother1 = trk1.motherId();
394393
auto mother2 = trk2.motherId();
395394
if (mother1 != mother2)
396395
return false;
397-
if (((abs(trk1.motherPDG()) && abs(trk2.motherPDG()) != kPDGRho770) && (abs(bTrack.motherPDG()) != kK1Plus)) || (abs(trk1.motherPDG()) && abs(bTrack.motherPDG()) != kK0Star892 && (abs(trk2.motherPDG()) != kK1Plus)) || (abs(trk2.motherPDG()) && abs(bTrack.motherPDG()) != kK0Star892 && (abs(trk1.motherPDG()) != kK1Plus)))
396+
if (((std::abs(trk1.motherPDG()) && std::abs(trk2.motherPDG()) != kPDGRho770) && (std::abs(bTrack.motherPDG()) != kK1Plus)) || (std::abs(trk1.motherPDG()) && std::abs(bTrack.motherPDG()) != kK0Star892 && (std::abs(trk2.motherPDG()) != kK1Plus)) || (std::abs(trk2.motherPDG()) && std::abs(bTrack.motherPDG()) != kK0Star892 && (std::abs(trk1.motherPDG()) != kK1Plus)))
398397
return false;
399398
auto siblings = bTrack.siblingIds();
400399
if (siblings[0] != mother1 && siblings[1] != mother2)
@@ -405,27 +404,27 @@ struct k1analysismicro {
405404
template <typename T>
406405
bool isTrueK892(const T& trk1, const T& trk2)
407406
{
408-
if (abs(trk1.pdgCode()) != kPiPlus || abs(trk2.pdgCode()) != kKPlus)
407+
if (std::abs(trk1.pdgCode()) != kPiPlus || std::abs(trk2.pdgCode()) != kKPlus)
409408
return false;
410409
auto mother1 = trk1.motherId();
411410
auto mother2 = trk2.motherId();
412411
if (mother1 != mother2)
413412
return false;
414-
if (abs(trk1.motherPDG()) != kK0Star892)
413+
if (std::abs(trk1.motherPDG()) != kK0Star892)
415414
return false;
416415
return true;
417416
}
418417

419418
template <typename T>
420419
bool isTrueRho(const T& trk1, const T& trk2)
421420
{
422-
if (abs(trk1.pdgCode()) != kPiPlus || abs(trk2.pdgCode()) != kPiPlus)
421+
if (std::abs(trk1.pdgCode()) != kPiPlus || std::abs(trk2.pdgCode()) != kPiPlus)
423422
return false;
424423
auto mother1 = trk1.motherId();
425424
auto mother2 = trk2.motherId();
426425
if (mother1 != mother2)
427426
return false;
428-
if (abs(trk1.motherPDG()) != kPDGRho770)
427+
if (std::abs(trk1.motherPDG()) != kPDGRho770)
429428
return false;
430429
return true;
431430
}
@@ -434,7 +433,7 @@ struct k1analysismicro {
434433
{
435434
auto multiplicity = collision.cent();
436435
TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonanceSecondary, lDecayDaughter_bach, lResonanceK1;
437-
for (auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks2, dTracks2))) {
436+
for (const auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks2, dTracks2))) {
438437
// Full index policy is needed to consider all possible combinations
439438
if (trk1.index() == trk2.index())
440439
continue; // We need to run (0,1), (1,0) pairs too. But the same id pairs are not needed.
@@ -522,7 +521,7 @@ struct k1analysismicro {
522521
}
523522
// Mass Window cut is removed
524523

525-
for (auto bTrack : dTracks1) {
524+
for (const auto& bTrack : dTracks1) {
526525
if (bTrack.index() == trk1.index() || bTrack.index() == trk2.index())
527526
continue;
528527
if (!trackCut<IsResoMicrotrack>(bTrack))
@@ -556,8 +555,8 @@ struct k1analysismicro {
556555
// QA histograms after the cuts are removed as no cuts are applied
557556

558557
if constexpr (!IsMix) {
559-
unsigned int typeK1 = bTrack.sign() > 0 ? binType::kK1P : binType::kK1N;
560-
unsigned int typeNormal = binAnti::kNormal;
558+
unsigned int typeK1 = bTrack.sign() > 0 ? BinType::kK1P : BinType::kK1N;
559+
unsigned int typeNormal = BinAnti::kNormal;
561560
if (trk1.sign() * trk2.sign() < 0) {
562561
histos.fill(HIST("k1invmass"), lResonanceK1.M());
563562
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, lResonanceK1.Pt(), lResonanceK1.M());
@@ -568,7 +567,7 @@ struct k1analysismicro {
568567

569568
if constexpr (IsMC) {
570569
if (isTrueK1(trk1, trk2, bTrack)) {
571-
typeK1 = bTrack.sign() > 0 ? binType::kK1P_Rec : binType::kK1N_Rec;
570+
typeK1 = bTrack.sign() > 0 ? BinType::kK1P_Rec : BinType::kK1N_Rec;
572571
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, lResonanceK1.Pt(), lResonanceK1.M());
573572
histos.fill(HIST("k1invmass_MC"), lResonanceK1.M());
574573
histos.fill(HIST("QAMC/K1OA"), lK1Angle);
@@ -631,118 +630,118 @@ struct k1analysismicro {
631630
}
632631
} // IsMC
633632
} else {
634-
unsigned int typeK1 = bTrack.sign() > 0 ? binType::kK1P_Mix : binType::kK1N_Mix;
635-
unsigned int typeNormal = binAnti::kNormal;
633+
unsigned int typeK1 = bTrack.sign() > 0 ? BinType::kK1P_Mix : BinType::kK1N_Mix;
634+
unsigned int typeNormal = BinAnti::kNormal;
636635
histos.fill(HIST("hInvmass_K1_Mix"), typeNormal, typeK1, multiplicity, lResonanceK1.Pt(), lResonanceK1.M());
637636
histos.fill(HIST("k1invmass_Mix"), lResonanceK1.M());
638637
}
639638
} // bTrack
640639
}
641640
} // fillHistograms
642641

643-
void processResoTracks(aod::ResoCollision& collision,
642+
void processResoTracks(aod::ResoCollision const& collision,
644643
aod::ResoTracks const& resotracks)
645644
{
646645
fillHistograms<false, false, false>(collision, resotracks, resotracks);
647646
}
648-
PROCESS_SWITCH(k1analysismicro, processResoTracks, "Process ResoTracks", false);
647+
PROCESS_SWITCH(K1AnalysisMicro, processResoTracks, "Process ResoTracks", false);
649648

650-
void processResoMicroTracks(aod::ResoCollision& collision,
649+
void processResoMicroTracks(aod::ResoCollision const& collision,
651650
aod::ResoMicroTracks const& resomicrotracks)
652651
{
653652
fillHistograms<false, false, true>(collision, resomicrotracks, resomicrotracks);
654653
}
655-
PROCESS_SWITCH(k1analysismicro, processResoMicroTracks, "Process ResoMicroTracks", true);
654+
PROCESS_SWITCH(K1AnalysisMicro, processResoMicroTracks, "Process ResoMicroTracks", true);
656655

657-
void processMC(aod::ResoCollision& collision,
656+
void processMC(aod::ResoCollision const& collision,
658657
soa::Join<aod::ResoTracks, aod::ResoMCTracks> const& resotracks)
659658
{
660659
fillHistograms<true, false, false>(collision, resotracks, resotracks);
661660
}
662-
PROCESS_SWITCH(k1analysismicro, processMC, "Process Event for MC", false);
661+
PROCESS_SWITCH(K1AnalysisMicro, processMC, "Process Event for MC", false);
663662

664-
void processMCTrue(ResoMCCols::iterator const& collision, aod::ResoMCParents& resoParents)
663+
void processMCTrue(ResoMCCols::iterator const& collision, aod::ResoMCParents const& resoParents)
665664
{
666665
auto multiplicity = collision.cent();
667-
for (auto& part : resoParents) {
668-
if (abs(part.pdgCode()) != kK1Plus)
666+
for (const auto& part : resoParents) {
667+
if (std::abs(part.pdgCode()) != kK1Plus)
669668
continue;
670-
if (abs(part.y()) > 0.5) {
669+
if (std::abs(part.y()) > 0.5) {
671670
continue;
672671
}
673672
bool pass1 = false;
674673
bool pass2 = false;
675674
bool pass3 = false;
676675
bool pass4 = false;
677-
if (abs(part.daughterPDG1()) == 313 || abs(part.daughterPDG2()) == 313) { // At least one decay into K892
676+
if (std::abs(part.daughterPDG1()) == 313 || std::abs(part.daughterPDG2()) == 313) { // At least one decay into K892
678677
pass2 = true;
679678
}
680-
if (abs(part.daughterPDG1()) == kPiPlus || abs(part.daughterPDG2()) == kPiPlus) { // At lest one decay into pion
679+
if (std::abs(part.daughterPDG1()) == kPiPlus || std::abs(part.daughterPDG2()) == kPiPlus) { // At lest one decay into pion
681680
pass1 = true;
682681
}
683-
if (abs(part.daughterPDG1()) == kPDGRho770 || abs(part.daughterPDG2()) == kPDGRho770) {
682+
if (std::abs(part.daughterPDG1()) == kPDGRho770 || std::abs(part.daughterPDG2()) == kPDGRho770) {
684683
pass4 = true;
685684
}
686-
if (abs(part.daughterPDG1()) == kKPlus || abs(part.daughterPDG2()) == kKPlus) {
685+
if (std::abs(part.daughterPDG1()) == kKPlus || std::abs(part.daughterPDG2()) == kKPlus) {
687686
pass3 = true;
688687
}
689688
if (!pass1 || !pass2 || !pass3 || !pass4) // If we have both decay products
690689
continue;
691-
auto typeNormal = part.pdgCode() > 0 ? binAnti::kNormal : binAnti::kAnti;
690+
auto typeNormal = part.pdgCode() > 0 ? BinAnti::kNormal : BinAnti::kAnti;
692691
if (collision.isVtxIn10()) // INEL>10
693692
{
694-
auto typeK1 = part.pdgCode() > 0 ? binType::kK1P_GenINEL10 : binType::kK1N_GenINEL10;
693+
auto typeK1 = part.pdgCode() > 0 ? BinType::kK1P_GenINEL10 : BinType::kK1N_GenINEL10;
695694
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, part.pt(), 1);
696695
}
697696
if (collision.isVtxIn10() && collision.isInSel8()) // INEL>10, vtx10
698697
{
699-
auto typeK1 = part.pdgCode() > 0 ? binType::kK1P_GenINELgt10 : binType::kK1N_GenINELgt10;
698+
auto typeK1 = part.pdgCode() > 0 ? BinType::kK1P_GenINELgt10 : BinType::kK1N_GenINELgt10;
700699
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, part.pt(), 1);
701700
}
702701
if (collision.isVtxIn10() && collision.isTriggerTVX()) // vtx10, TriggerTVX
703702
{
704-
auto typeK1 = part.pdgCode() > 0 ? binType::kK1P_GenTrig10 : binType::kK1N_GenTrig10;
703+
auto typeK1 = part.pdgCode() > 0 ? BinType::kK1P_GenTrig10 : BinType::kK1N_GenTrig10;
705704
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, part.pt(), 1);
706705
}
707706
if (collision.isInAfterAllCuts()) // after all event selection
708707
{
709-
auto typeK1 = part.pdgCode() > 0 ? binType::kK1P_GenEvtSel : binType::kK1N_GenEvtSel;
708+
auto typeK1 = part.pdgCode() > 0 ? BinType::kK1P_GenEvtSel : BinType::kK1N_GenEvtSel;
710709
histos.fill(HIST("hInvmass_K1"), typeNormal, typeK1, multiplicity, part.pt(), 1);
711710
}
712711
}
713712
}
714-
PROCESS_SWITCH(k1analysismicro, processMCTrue, "Process Event for MC", false);
713+
PROCESS_SWITCH(K1AnalysisMicro, processMCTrue, "Process Event for MC", false);
715714

716715
// Processing Event Mixing
717716
using BinningTypeVtxZT0M = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent>;
718-
void processME(o2::aod::ResoCollisions& collisions, aod::ResoTracks const& resotracks)
717+
void processME(o2::aod::ResoCollisions const& collisions, aod::ResoTracks const& resotracks)
719718
{
720719
auto tracksTuple = std::make_tuple(resotracks);
721-
BinningTypeVtxZT0M colBinning{{CfgVtxBins, CfgMultBins}, true};
720+
BinningTypeVtxZT0M colBinning{{cfgVtxBins, cfgMultBins}, true};
722721
SameKindPair<aod::ResoCollisions, aod::ResoTracks, BinningTypeVtxZT0M> pairs{colBinning, nEvtMixing, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
723722

724-
for (auto& [collision1, tracks1, collision2, tracks2] : pairs) {
723+
for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) {
725724
fillHistograms<false, true, false>(collision1, tracks1, tracks2);
726725
}
727726
};
728-
PROCESS_SWITCH(k1analysismicro, processME, "Process EventMixing light without partition", false);
727+
PROCESS_SWITCH(K1AnalysisMicro, processME, "Process EventMixing light without partition", false);
729728

730729
// Processing Event Mixing -- Micro
731730
// using BinningTypeVtxZT0M = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent>;
732-
void processMEMicro(o2::aod::ResoCollisions& collisions, aod::ResoMicroTracks const& resomicrotracks)
731+
void processMEMicro(o2::aod::ResoCollisions const& collisions, aod::ResoMicroTracks const& resomicrotracks)
733732
{
734733
auto tracksTuple = std::make_tuple(resomicrotracks);
735-
BinningTypeVtxZT0M colBinning{{CfgVtxBins, CfgMultBins}, true};
734+
BinningTypeVtxZT0M colBinning{{cfgVtxBins, cfgMultBins}, true};
736735
SameKindPair<aod::ResoCollisions, aod::ResoMicroTracks, BinningTypeVtxZT0M> pairs{colBinning, nEvtMixing, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
737736

738-
for (auto& [collision1, tracks1, collision2, tracks2] : pairs) {
737+
for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) {
739738
fillHistograms<false, true, true>(collision1, tracks1, tracks2);
740739
}
741740
};
742-
PROCESS_SWITCH(k1analysismicro, processMEMicro, "Process EventMixing light without partition", true);
741+
PROCESS_SWITCH(K1AnalysisMicro, processMEMicro, "Process EventMixing light without partition", true);
743742
}; // struct
744743

745744
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
746745
{
747-
return WorkflowSpec{adaptAnalysisTask<k1analysismicro>(cfgc, TaskName{"lf-k1analysis"})};
746+
return WorkflowSpec{adaptAnalysisTask<K1AnalysisMicro>(cfgc)};
748747
}

0 commit comments

Comments
 (0)