From 91644aba990f520587175ac7ae7611199533e2e6 Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Wed, 9 Aug 2023 18:39:14 +0200 Subject: [PATCH 1/8] Fix histo registry --- ALICE3/Tasks/alice3-dilepton.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index a9a23609674..b3c00654bef 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -107,7 +107,7 @@ struct Alice3Dilepton { registry.add("Reconstructed/Track/Pt", "Track Pt", kTH1F, {axisPt}); registry.add("Reconstructed/Track/Eta", "Track Eta", kTH1F, {axisEta}); registry.add("Reconstructed/Track/Phi", "Track Eta", kTH1F, {axisPhi}); - registry.add("Reconstructed/Particle/Eta_Pt", "Eta vs. Pt", kTH2F, {axisPt, axisEta}, true); + registry.add("Reconstructed/Track/Eta_Pt", "Eta vs. Pt", kTH2F, {axisPt, axisEta}, true); registry.add("Reconstructed/Track/SigmaOTofvspt", "Track #sigma oTOF", kTH2F, {axisPt, axisSigmaEl}); registry.add("Reconstructed/Track/SigmaITofvspt", "Track #sigma iTOF", kTH2F, {axisPt, axisSigmaEl}); registry.add("Reconstructed/Track/outerTOFTrackLength", "Track length outer TOF", kTH1F, {axisTrackLengthOuterTOF}); From 76ed4e4f03d5fadd056c4802aff2427e2740bb27 Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Wed, 23 Aug 2023 16:38:38 +0200 Subject: [PATCH 2/8] Ghosts added to task --- ALICE3/Tasks/alice3-dilepton.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index b3c00654bef..74f0e7fa092 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -24,6 +24,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Framework/AnalysisDataModel.h" #include "ALICE3/DataModel/OTFTOF.h" +#include "ALICE3/DataModel/tracksAlice3.h" using namespace o2; using namespace o2::aod; @@ -54,6 +55,7 @@ struct Alice3Dilepton { Configurable ptMax{"pt-max", 5.f, "Upper limit in pT"}; Configurable etaMin{"eta-min", -5.f, "Lower limit in eta"}; Configurable etaMax{"eta-max", 5.f, "Upper limit in eta"}; + Configurable selectReconstructed{"selectReconstructed", true, "Select only reconstructed tracks (true) or ghosts (false)"}; HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -511,8 +513,8 @@ struct Alice3Dilepton { } // end of mc collision loop } // end of processGen - using MyTracksMC = soa::Join; - Filter trackFilter = etaMin < o2::aod::track::eta && o2::aod::track::eta < etaMax && ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax; + using MyTracksMC = soa::Join; + Filter trackFilter = etaMin < o2::aod::track::eta && o2::aod::track::eta < etaMax && ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax && o2::aod::track_alice3::isReconstructed == selectReconstructed; using MyFilteredTracksMC = soa::Filtered; Preslice perCollision = aod::track::collisionId; Partition posTracks = o2::aod::track::signed1Pt > 0.f; From c2c90c5d04e4e8a7890841aabb8741c009a57174 Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Thu, 24 Aug 2023 16:25:07 +0200 Subject: [PATCH 3/8] Add pid for electrons --- ALICE3/Tasks/alice3-dilepton.cxx | 59 ++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index 74f0e7fa092..65f8716d7eb 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -57,6 +57,12 @@ struct Alice3Dilepton { Configurable etaMax{"eta-max", 5.f, "Upper limit in eta"}; Configurable selectReconstructed{"selectReconstructed", true, "Select only reconstructed tracks (true) or ghosts (false)"}; + Configurable nSigmaEleCutOuterTOF{"nSigmaEleCutOuterTOF",3., "Electron inclusion in outer TOF"}; + Configurable nSigmaEleCutInnerTOF{"nSigmaEleCutInnerTOF",3., "Electron inclusion in inner TOF"}; + Configurable nSigmaPionCutOuterTOF{"nSigmaPionCutOuterTOF",3., "Pion exclusion in outer TOF"}; + Configurable nSigmaPionCutInnerTOF{"nSigmaPionCutInnerTOF",3., "Pion exclusion in inner TOF"}; + + HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -92,20 +98,15 @@ struct Alice3Dilepton { registry.add("Generated/Pair/ULS/Eta", "Pair Eta", kTH1F, {axisEta}); registry.add("Generated/Pair/ULS/Phi", "Pair Phi", kTH1F, {axisPhi}); registry.add("Generated/Pair/ULS/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); - registry.add("Generated/Pair/LSpp/Mass", "Pair Mass", kTH1F, {axisM}); - registry.add("Generated/Pair/LSpp/Pt", "Pair Pt", kTH1F, {axisPt}); - registry.add("Generated/Pair/LSpp/Eta", "Pair Eta", kTH1F, {axisEta}); - registry.add("Generated/Pair/LSpp/Phi", "Pair Phi", kTH1F, {axisPhi}); - registry.add("Generated/Pair/LSpp/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); - registry.add("Generated/Pair/LSnn/Mass", "Pair Mass", kTH1F, {axisM}); - registry.add("Generated/Pair/LSnn/Pt", "Pair Pt", kTH1F, {axisPt}); - registry.add("Generated/Pair/LSnn/Eta", "Pair Eta", kTH1F, {axisEta}); - registry.add("Generated/Pair/LSnn/Phi", "Pair Phi", kTH1F, {axisPhi}); - registry.add("Generated/Pair/LSnn/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); + + + registry.addClone("Generated/Pair/ULS", "Generated/Pair/LSpp"); + registry.addClone("Generated/Pair/ULS", "Generated/Pair/LSnn"); registry.add("Reconstructed/Event/VtxX", "Vertex X", kTH1F, {axisVx}); registry.add("Reconstructed/Event/VtxY", "Vertex Y", kTH1F, {axisVy}); registry.add("Reconstructed/Event/VtxZ", "Vertex Z", kTH1F, {axisVz}); + registry.add("Reconstructed/Track/Pt", "Track Pt", kTH1F, {axisPt}); registry.add("Reconstructed/Track/Eta", "Track Eta", kTH1F, {axisEta}); registry.add("Reconstructed/Track/Phi", "Track Eta", kTH1F, {axisPhi}); @@ -114,23 +115,16 @@ struct Alice3Dilepton { registry.add("Reconstructed/Track/SigmaITofvspt", "Track #sigma iTOF", kTH2F, {axisPt, axisSigmaEl}); registry.add("Reconstructed/Track/outerTOFTrackLength", "Track length outer TOF", kTH1F, {axisTrackLengthOuterTOF}); + registry.addClone("Reconstructed/Track","Reconstructed/TrackPID"); + registry.add("Reconstructed/Pair/ULS/Mass", "Pair Mass", kTH1F, {axisM}); registry.add("Reconstructed/Pair/ULS/Pt", "Pair Pt", kTH1F, {axisPt}); registry.add("Reconstructed/Pair/ULS/Eta", "Pair Eta", kTH1F, {axisEta}); registry.add("Reconstructed/Pair/ULS/Phi", "Pair Phi", kTH1F, {axisPhi}); registry.add("Reconstructed/Pair/ULS/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); - registry.add("Reconstructed/Pair/LSpp/Mass", "Pair Mass", kTH1F, {axisM}); - registry.add("Reconstructed/Pair/LSpp/Pt", "Pair Pt", kTH1F, {axisPt}); - registry.add("Reconstructed/Pair/LSpp/Eta", "Pair Eta", kTH1F, {axisEta}); - registry.add("Reconstructed/Pair/LSpp/Phi", "Pair Phi", kTH1F, {axisPhi}); - registry.add("Reconstructed/Pair/LSpp/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); - - registry.add("Reconstructed/Pair/LSnn/Mass", "Pair Mass", kTH1F, {axisM}); - registry.add("Reconstructed/Pair/LSnn/Pt", "Pair Pt", kTH1F, {axisPt}); - registry.add("Reconstructed/Pair/LSnn/Eta", "Pair Eta", kTH1F, {axisEta}); - registry.add("Reconstructed/Pair/LSnn/Phi", "Pair Phi", kTH1F, {axisPhi}); - registry.add("Reconstructed/Pair/LSnn/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); + registry.addClone("Reconstructed/Pair/ULS", "Reconstructed/Pair/LSpp"); + registry.addClone("Reconstructed/Pair/ULS", "Reconstructed/Pair/LSnn"); HistogramConfigSpec hs_rec{HistType::kTHnSparseF, {axisM, axisPt, axisDCAxy}, 3}; registry.add("Reconstructed/Pair/ULS/hs_rec", "", hs_rec); @@ -514,7 +508,11 @@ struct Alice3Dilepton { } // end of processGen using MyTracksMC = soa::Join; - Filter trackFilter = etaMin < o2::aod::track::eta && o2::aod::track::eta < etaMax && ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax && o2::aod::track_alice3::isReconstructed == selectReconstructed; + Filter trackFilter = etaMin < o2::aod::track::eta && + o2::aod::track::eta < etaMax && + ptMin < o2::aod::track::pt && + o2::aod::track::pt < ptMax && + o2::aod::track_alice3::isReconstructed == selectReconstructed; using MyFilteredTracksMC = soa::Filtered; Preslice perCollision = aod::track::collisionId; Partition posTracks = o2::aod::track::signed1Pt > 0.f; @@ -558,6 +556,23 @@ struct Alice3Dilepton { registry.fill(HIST("Reconstructed/Track/Eta"), track.eta()); registry.fill(HIST("Reconstructed/Track/Phi"), track.phi()); registry.fill(HIST("Reconstructed/Track/Eta_Pt"), track.pt(), track.eta()); + // implement pid + bool isEleOuterTOF = abs(track.nSigmaElectronOuterTOF()) < nSigmaEleCutOuterTOF; + bool isNotPionOuterTOF = abs(track.nSigmaPionOuterTOF()) > nSigmaPionCutOuterTOF; + bool isEleOuterTOF = isEleOuterTOF && isNotPionOuterTOF; + bool isEleInnerTOF = abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; + bool isNotPionInnerTOF = abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; + bool isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; + if (isEleOuterTOF || isEleInnerTOF) + { + registry.fill(HIST("Reconstructed/TrackPID/SigmaOTofvspt"), mcParticle.pt(), track.nSigmaElectronOuterTOF()); + registry.fill(HIST("Reconstructed/TrackPID/SigmaITofvspt"), mcParticle.pt(), track.nSigmaElectronInnerTOF()); + registry.fill(HIST("Reconstructed/TrackPID/outerTOFTrackLength"), track.outerTOFTrackLength()); + registry.fill(HIST("Reconstructed/TrackPID/Pt"), track.pt()); + registry.fill(HIST("Reconstructed/TrackPID/Eta"), track.eta()); + registry.fill(HIST("Reconstructed/TrackPID/Phi"), track.phi()); + registry.fill(HIST("Reconstructed/TrackPID/Eta_Pt"), track.pt(), track.eta()); + } } // end of track loop auto negTracks_coll = negTracks->sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), cache_rec); From f92b0cb76a4a295c00807239c78e2668e8197f8e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 24 Aug 2023 14:36:08 +0000 Subject: [PATCH 4/8] Please consider the following formatting changes --- ALICE3/Tasks/alice3-dilepton.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index fbe89181a7d..d56c23e00fb 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -56,10 +56,10 @@ struct Alice3Dilepton { Configurable etaMin{"eta-min", -5.f, "Lower limit in eta"}; Configurable etaMax{"eta-max", 5.f, "Upper limit in eta"}; Configurable selectReconstructed{"selectReconstructed", true, "Select only reconstructed tracks (true) or ghosts (false)"}; - Configurable nSigmaEleCutOuterTOF{"nSigmaEleCutOuterTOF",3., "Electron inclusion in outer TOF"}; - Configurable nSigmaEleCutInnerTOF{"nSigmaEleCutInnerTOF",3., "Electron inclusion in inner TOF"}; - Configurable nSigmaPionCutOuterTOF{"nSigmaPionCutOuterTOF",3., "Pion exclusion in outer TOF"}; - Configurable nSigmaPionCutInnerTOF{"nSigmaPionCutInnerTOF",3., "Pion exclusion in inner TOF"}; + Configurable nSigmaEleCutOuterTOF{"nSigmaEleCutOuterTOF", 3., "Electron inclusion in outer TOF"}; + Configurable nSigmaEleCutInnerTOF{"nSigmaEleCutInnerTOF", 3., "Electron inclusion in inner TOF"}; + Configurable nSigmaPionCutOuterTOF{"nSigmaPionCutOuterTOF", 3., "Pion exclusion in outer TOF"}; + Configurable nSigmaPionCutInnerTOF{"nSigmaPionCutInnerTOF", 3., "Pion exclusion in inner TOF"}; HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -97,7 +97,6 @@ struct Alice3Dilepton { registry.add("Generated/Pair/ULS/Phi", "Pair Phi", kTH1F, {axisPhi}); registry.add("Generated/Pair/ULS/Mass_Pt", "Pair Mass vs. Pt", kTH2F, {axisM, axisPt}, true); - registry.addClone("Generated/Pair/ULS", "Generated/Pair/LSpp"); registry.addClone("Generated/Pair/ULS", "Generated/Pair/LSnn"); @@ -113,7 +112,7 @@ struct Alice3Dilepton { registry.add("Reconstructed/Track/SigmaITofvspt", "Track #sigma iTOF", kTH2F, {axisPt, axisSigmaEl}); registry.add("Reconstructed/Track/outerTOFTrackLength", "Track length outer TOF", kTH1F, {axisTrackLengthOuterTOF}); - registry.addClone("Reconstructed/Track","Reconstructed/TrackPID"); + registry.addClone("Reconstructed/Track", "Reconstructed/TrackPID"); registry.add("Reconstructed/Pair/ULS/Mass", "Pair Mass", kTH1F, {axisM}); registry.add("Reconstructed/Pair/ULS/Pt", "Pair Pt", kTH1F, {axisPt}); @@ -507,10 +506,10 @@ struct Alice3Dilepton { using MyTracksMC = soa::Join; Filter trackFilter = etaMin < o2::aod::track::eta && - o2::aod::track::eta < etaMax && - ptMin < o2::aod::track::pt && - o2::aod::track::pt < ptMax && - o2::aod::track_alice3::isReconstructed == selectReconstructed; + o2::aod::track::eta < etaMax && + ptMin < o2::aod::track::pt && + o2::aod::track::pt < ptMax && + o2::aod::track_alice3::isReconstructed == selectReconstructed; Filter trackFilter = etaMin < o2::aod::track::eta && o2::aod::track::eta < etaMax && ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax && o2::aod::track_alice3::isReconstructed == selectReconstructed; using MyFilteredTracksMC = soa::Filtered; Preslice perCollision = aod::track::collisionId; @@ -562,8 +561,7 @@ struct Alice3Dilepton { bool isEleInnerTOF = abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; bool isNotPionInnerTOF = abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; bool isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; - if (isEleOuterTOF || isEleInnerTOF) - { + if (isEleOuterTOF || isEleInnerTOF) { registry.fill(HIST("Reconstructed/TrackPID/SigmaOTofvspt"), mcParticle.pt(), track.nSigmaElectronOuterTOF()); registry.fill(HIST("Reconstructed/TrackPID/SigmaITofvspt"), mcParticle.pt(), track.nSigmaElectronInnerTOF()); registry.fill(HIST("Reconstructed/TrackPID/outerTOFTrackLength"), track.outerTOFTrackLength()); From 24f1302bad3a7332d75e3a1cbe2d03f6b7ad987b Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Thu, 24 Aug 2023 17:05:26 +0200 Subject: [PATCH 5/8] fix merge conflict --- ALICE3/Tasks/alice3-dilepton.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index d56c23e00fb..e4993e6ec0a 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -557,11 +557,12 @@ struct Alice3Dilepton { // implement pid bool isEleOuterTOF = abs(track.nSigmaElectronOuterTOF()) < nSigmaEleCutOuterTOF; bool isNotPionOuterTOF = abs(track.nSigmaPionOuterTOF()) > nSigmaPionCutOuterTOF; - bool isEleOuterTOF = isEleOuterTOF && isNotPionOuterTOF; + isEleOuterTOF = isEleOuterTOF && isNotPionOuterTOF; bool isEleInnerTOF = abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; bool isNotPionInnerTOF = abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; - bool isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; - if (isEleOuterTOF || isEleInnerTOF) { + isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; + if (isEleOuterTOF || isEleInnerTOF) + { registry.fill(HIST("Reconstructed/TrackPID/SigmaOTofvspt"), mcParticle.pt(), track.nSigmaElectronOuterTOF()); registry.fill(HIST("Reconstructed/TrackPID/SigmaITofvspt"), mcParticle.pt(), track.nSigmaElectronInnerTOF()); registry.fill(HIST("Reconstructed/TrackPID/outerTOFTrackLength"), track.outerTOFTrackLength()); From ef7ae9673ff41b00867d9c9d04fceebc03a514f0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 24 Aug 2023 15:06:44 +0000 Subject: [PATCH 6/8] Please consider the following formatting changes --- ALICE3/Tasks/alice3-dilepton.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index e4993e6ec0a..5dcf6b4ed02 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -561,8 +561,7 @@ struct Alice3Dilepton { bool isEleInnerTOF = abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; bool isNotPionInnerTOF = abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; - if (isEleOuterTOF || isEleInnerTOF) - { + if (isEleOuterTOF || isEleInnerTOF) { registry.fill(HIST("Reconstructed/TrackPID/SigmaOTofvspt"), mcParticle.pt(), track.nSigmaElectronOuterTOF()); registry.fill(HIST("Reconstructed/TrackPID/SigmaITofvspt"), mcParticle.pt(), track.nSigmaElectronInnerTOF()); registry.fill(HIST("Reconstructed/TrackPID/outerTOFTrackLength"), track.outerTOFTrackLength()); From 773240ad0b68a9fe9a00d6dd61e2d87602f21fb6 Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Thu, 24 Aug 2023 17:59:07 +0200 Subject: [PATCH 7/8] Fix code --- ALICE3/Tasks/alice3-dilepton.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index 5dcf6b4ed02..b8b77e9cf1c 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -510,7 +510,6 @@ struct Alice3Dilepton { ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax && o2::aod::track_alice3::isReconstructed == selectReconstructed; - Filter trackFilter = etaMin < o2::aod::track::eta && o2::aod::track::eta < etaMax && ptMin < o2::aod::track::pt && o2::aod::track::pt < ptMax && o2::aod::track_alice3::isReconstructed == selectReconstructed; using MyFilteredTracksMC = soa::Filtered; Preslice perCollision = aod::track::collisionId; Partition posTracks = o2::aod::track::signed1Pt > 0.f; From 73baf68875336f0cbdd5d00e5534755354d542af Mon Sep 17 00:00:00 2001 From: Sebastian Scheid Date: Fri, 25 Aug 2023 07:02:16 +0200 Subject: [PATCH 8/8] Specify abs() -> std::abs() --- ALICE3/Tasks/alice3-dilepton.cxx | 72 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index b8b77e9cf1c..3f1eaee0f26 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -169,15 +169,15 @@ struct Alice3Dilepton { if (mother1_pdg != mother2_pdg) return -1; - if (abs(mother1_pdg) != 22 // photon - && abs(mother1_pdg) != 111 // pi0 - && abs(mother1_pdg) != 221 // eta - && abs(mother1_pdg) != 331 // eta' - && abs(mother1_pdg) != 113 // rho - && abs(mother1_pdg) != 223 // omega - && abs(mother1_pdg) != 333 // phi - && abs(mother1_pdg) != 443 // Jpsi - && abs(mother1_pdg) != 100443 // psi2S + if (std::abs(mother1_pdg) != 22 // photon + && std::abs(mother1_pdg) != 111 // pi0 + && std::abs(mother1_pdg) != 221 // eta + && std::abs(mother1_pdg) != 331 // eta' + && std::abs(mother1_pdg) != 113 // rho + && std::abs(mother1_pdg) != 223 // omega + && std::abs(mother1_pdg) != 333 // phi + && std::abs(mother1_pdg) != 443 // Jpsi + && std::abs(mother1_pdg) != 100443 // psi2S ) { return -1; } @@ -210,7 +210,7 @@ struct Alice3Dilepton { int mother1_pdg = mother_p1.pdgCode(); int mother2_pdg = mother_p2.pdgCode(); - if (((500 < abs(mother1_pdg) && abs(mother1_pdg) < 599) || (5000 < abs(mother1_pdg) && abs(mother1_pdg) < 5999)) && ((500 < abs(mother2_pdg) && abs(mother2_pdg) < 599) || (5000 < abs(mother2_pdg) && abs(mother2_pdg) < 5999))) { + if (((500 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 599) || (5000 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 5999)) && ((500 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 599) || (5000 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 5999))) { return HFllType::kBe_Be; // bb->ee, decay type = 2 } @@ -222,9 +222,9 @@ struct Alice3Dilepton { int grand_mother1_pdg = grand_mother_p1.pdgCode(); int grand_mother2_pdg = grand_mother_p2.pdgCode(); - if (((400 < abs(mother1_pdg) && abs(mother1_pdg) < 499) || (4000 < abs(mother1_pdg) && abs(mother1_pdg) < 4999)) && ((400 < abs(mother2_pdg) && abs(mother2_pdg) < 499) || (4000 < abs(mother2_pdg) && abs(mother2_pdg) < 4999))) { // mother is charm + if (((400 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 499) || (4000 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 4999)) && ((400 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 499) || (4000 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 4999))) { // mother is charm - if (((500 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 599) || (5000 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 5999)) && ((500 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 599) || (5000 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 5999))) { // grand mother is beauty + if (((500 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 599) || (5000 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 5999)) && ((500 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 599) || (5000 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 5999))) { // grand mother is beauty return kBCe_BCe; // b->c->e and b->c->e, decay type = 1 } else { return kCe_Ce; // prompt cc->ee, decay type = 0 @@ -233,8 +233,8 @@ struct Alice3Dilepton { if (motherid_p1 == grand_motherid_p2 || grand_motherid_p1 == motherid_p2) { if ( - (((500 < abs(mother1_pdg) && abs(mother1_pdg) < 599) || (5000 < abs(mother1_pdg) && abs(mother1_pdg) < 5999)) && ((500 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 599) || (5000 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 5999))) || - (((500 < abs(mother2_pdg) && abs(mother2_pdg) < 599) || (5000 < abs(mother2_pdg) && abs(mother2_pdg) < 5999)) && ((500 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 599) || (5000 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 5999)))) { + (((500 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 599) || (5000 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 5999)) && ((500 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 599) || (5000 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 5999))) || + (((500 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 599) || (5000 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 5999)) && ((500 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 599) || (5000 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 5999)))) { return HFllType::kBCe_Be_SameB; // b->c->e and c->e, decay type = 3 } } @@ -273,8 +273,8 @@ struct Alice3Dilepton { if (motherid_p1 != grand_motherid_p2 && grand_motherid_p1 != motherid_p2) { // different mother and grand mother if ( - (((500 < abs(mother1_pdg) && abs(mother1_pdg) < 599) || (5000 < abs(mother1_pdg) && abs(mother1_pdg) < 5999)) && ((500 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 599) || (5000 < abs(grand_mother2_pdg) && abs(grand_mother2_pdg) < 5999))) || - (((500 < abs(mother2_pdg) && abs(mother2_pdg) < 599) || (5000 < abs(mother2_pdg) && abs(mother2_pdg) < 5999)) && ((500 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 599) || (5000 < abs(grand_mother1_pdg) && abs(grand_mother1_pdg) < 5999)))) { + (((500 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 599) || (5000 < std::abs(mother1_pdg) && std::abs(mother1_pdg) < 5999)) && ((500 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 599) || (5000 < std::abs(grand_mother2_pdg) && std::abs(grand_mother2_pdg) < 5999))) || + (((500 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 599) || (5000 < std::abs(mother2_pdg) && std::abs(mother2_pdg) < 5999)) && ((500 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 599) || (5000 < std::abs(grand_mother1_pdg) && std::abs(grand_mother1_pdg) < 5999)))) { return HFllType::kBCe_Be_DiffB; // b->c->e and c->e, decay type = 4 } } @@ -292,12 +292,12 @@ struct Alice3Dilepton { } auto mct1 = t1.template mcParticle_as(); - if (abs(mct1.pdgCode()) != pdg || !mct1.isPhysicalPrimary()) { + if (std::abs(mct1.pdgCode()) != pdg || !mct1.isPhysicalPrimary()) { continue; } auto mct2 = t2.template mcParticle_as(); - if (abs(mct2.pdgCode()) != pdg || !mct2.isPhysicalPrimary()) { + if (std::abs(mct2.pdgCode()) != pdg || !mct2.isPhysicalPrimary()) { continue; } @@ -315,8 +315,8 @@ struct Alice3Dilepton { // float dcaXY_res_t2 = sqrt(t2.cYY()); float pair_dca_xy = sqrt((pow(t2.dcaXY() / sqrt(t2.cYY()), 2) + pow(t1.dcaXY() / sqrt(t1.cYY()), 2)) / 2.); - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; registry.fill(HIST("Reconstructed/Pair/ULS/Mass"), v12.M()); @@ -334,12 +334,12 @@ struct Alice3Dilepton { } auto mct1 = t1.template mcParticle_as(); - if (abs(mct1.pdgCode()) != pdg || !mct1.isPhysicalPrimary()) { + if (std::abs(mct1.pdgCode()) != pdg || !mct1.isPhysicalPrimary()) { continue; } auto mct2 = t2.template mcParticle_as(); - if (abs(mct2.pdgCode()) != pdg || !mct2.isPhysicalPrimary()) { + if (std::abs(mct2.pdgCode()) != pdg || !mct2.isPhysicalPrimary()) { continue; } @@ -357,8 +357,8 @@ struct Alice3Dilepton { // float dcaXY_res_t2 = sqrt(t2.cYY()); float pair_dca_xy = sqrt((pow(t2.dcaXY() / sqrt(t2.cYY()), 2) + pow(t1.dcaXY() / sqrt(t1.cYY()), 2)) / 2.); - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); // reconstructed pt/eta/phi ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; if constexpr (pairtype == PairType::kLSpp) { @@ -385,7 +385,7 @@ struct Alice3Dilepton { { if constexpr (pairtype == PairType::kULS) { for (auto& [t1, t2] : combinations(soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (abs(t1.pdgCode()) != pdg || abs(t2.pdgCode()) != pdg) { + if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) { continue; } @@ -405,8 +405,8 @@ struct Alice3Dilepton { } // auto mother = mcparticles.iteratorAt(motherid); - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; registry.fill(HIST("Generated/Pair/ULS/Mass"), v12.M()); @@ -418,7 +418,7 @@ struct Alice3Dilepton { } else if constexpr (pairtype == PairType::kLSpp || pairtype == PairType::kLSnn) { for (auto& [t1, t2] : combinations(soa::CombinationsStrictlyUpperIndexPolicy(tracks1, tracks2))) { - if (abs(t1.pdgCode()) != pdg || abs(t2.pdgCode()) != pdg) { + if (std::abs(t1.pdgCode()) != pdg || std::abs(t2.pdgCode()) != pdg) { continue; } @@ -438,8 +438,8 @@ struct Alice3Dilepton { } // auto mother = mcparticles.iteratorAt(motherid); - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), std::abs(pdg) == 11 ? o2::constants::physics::MassElectron : o2::constants::physics::MassMuon); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; if constexpr (pairtype == PairType::kLSpp) { @@ -473,7 +473,7 @@ struct Alice3Dilepton { auto mcParticles_per_coll = mcParticles.sliceBy(perMCCollision, mccollision.globalIndex()); for (const auto& mcParticle : mcParticles_per_coll) { - if (abs(mcParticle.pdgCode()) != pdg) { + if (std::abs(mcParticle.pdgCode()) != pdg) { continue; } if (!mcParticle.isPhysicalPrimary()) { @@ -540,7 +540,7 @@ struct Alice3Dilepton { continue; } const auto mcParticle = track.mcParticle_as(); - if (abs(mcParticle.pdgCode()) != pdg) { + if (std::abs(mcParticle.pdgCode()) != pdg) { continue; } if (!mcParticle.isPhysicalPrimary()) { @@ -554,11 +554,11 @@ struct Alice3Dilepton { registry.fill(HIST("Reconstructed/Track/Phi"), track.phi()); registry.fill(HIST("Reconstructed/Track/Eta_Pt"), track.pt(), track.eta()); // implement pid - bool isEleOuterTOF = abs(track.nSigmaElectronOuterTOF()) < nSigmaEleCutOuterTOF; - bool isNotPionOuterTOF = abs(track.nSigmaPionOuterTOF()) > nSigmaPionCutOuterTOF; + bool isEleOuterTOF = std::abs(track.nSigmaElectronOuterTOF()) < nSigmaEleCutOuterTOF; + bool isNotPionOuterTOF = std::abs(track.nSigmaPionOuterTOF()) > nSigmaPionCutOuterTOF; isEleOuterTOF = isEleOuterTOF && isNotPionOuterTOF; - bool isEleInnerTOF = abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; - bool isNotPionInnerTOF = abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; + bool isEleInnerTOF = std::abs(track.nSigmaElectronInnerTOF()) < nSigmaEleCutInnerTOF; + bool isNotPionInnerTOF = std::abs(track.nSigmaPionInnerTOF()) > nSigmaPionCutInnerTOF; isEleInnerTOF = isEleInnerTOF && isNotPionInnerTOF; if (isEleOuterTOF || isEleInnerTOF) { registry.fill(HIST("Reconstructed/TrackPID/SigmaOTofvspt"), mcParticle.pt(), track.nSigmaElectronOuterTOF());