From c2d755b40ab517d284b759ef048cf53822d4d6b6 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Thu, 7 Jul 2022 23:35:35 +0200 Subject: [PATCH 01/16] First et --- PWGLF/Tasks/CMakeLists.txt | 5 + PWGLF/Tasks/rsn_analysis.cxx | 244 +++++++++++++++++++++++++++++++++++ 2 files changed, 249 insertions(+) create mode 100644 PWGLF/Tasks/rsn_analysis.cxx diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index c6e678c179f..d94986bb995 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -94,4 +94,9 @@ o2physics_add_dpl_workflow(track-checks PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(rsn-analysis + SOURCES rsn_analysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase + COMPONENT_NAME Analysis) + diff --git a/PWGLF/Tasks/rsn_analysis.cxx b/PWGLF/Tasks/rsn_analysis.cxx new file mode 100644 index 00000000000..8788f2a744b --- /dev/null +++ b/PWGLF/Tasks/rsn_analysis.cxx @@ -0,0 +1,244 @@ +// Copyright CERN and copyright holders of ALICE O2. This software is +// distributed under the terms of the GNU General Public License v3 (GPL +// Version 3), copied verbatim in the file "COPYING". +// +// See http://alice-o2.web.cern.ch/license for full licensing information. +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// O2 includes +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "TLorentzVector.h" + +using namespace std; +using namespace o2; +using namespace o2::framework; + +enum EventSelection { + kNoSelection = 0, + kTVXselection = 1, + kVertexCut = 2 +}; + +using kCollisionsTable = soa::Join< aod::Collisions, aod::EvSels >; +using kTracksTable = soa::Join< aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::pidTOFFullKa, aod::pidTPCFullKa, aod::pidTOFFullPi, aod::pidTPCFullPi >; + +struct rsn_analysis { + HistogramRegistry uHistograms { "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject }; + // + // Create Output Objects + void + init + (o2::framework::InitContext&) { + // Histogram is added to the ouput registry + // + // Event QA + uHistograms.add( "QA/Event/EnumEvents", "Event selection; ; Selected Events", kTH1F, {{10, 0, 10}}); + uHistograms.add( "QA/Event/VertexZ", "Event selection; Vertex Z (cm); Selected Events", kTH1F, {{4000, -20, 20}}); + uHistograms.add( "QA/Event/Selected/VertexZ", "Event selection; Vertex Z (cm); Selected Events", kTH1F, {{4000, -20, 20}}); + // + // Track QA + uHistograms.add( "QA/Track/Momentum", "Momentum distribution of selected Tracks; #it{p} (GeV/#it{c}); Selected Tracks", kTH1F, {{1000, 0, 20}}); + uHistograms.add( "QA/Track/TMomentum", "Transverse momentum distribution of selected Tracks; #it{p}_{T} (GeV/#it{c}); Selected Tracks", kTH1F, {{1000, 0, 20}}); + // + // PID QA + // --- Kaon + uHistograms.add( "QA/Kaon/TOF_TPC_Map", "TOF + TPC Combined PID for Kaons; #sigma_{TOF}^{Kaon}; #sigma_{TPC}^{Kaon}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); + uHistograms.add( "QA/Kaon/TOF_Nsigma", "TOF NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Kaon/TPC_Nsigma", "TPC NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Kaon/Selected/TOF_TPC_Map", "TOF + TPC Combined PID for Kaons; #sigma_{TPC}^{Kaon}; #sigma_{TPC}^{Kaon}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); + uHistograms.add( "QA/Kaon/Selected/TOF_Nsigma", "TOF NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Kaon/Selected/TPC_Nsigma", "TPC NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + // --- Pion + uHistograms.add( "QA/Pion/TOF_TPC_Map", "TOF + TPC Combined PID for Pions; #sigma_{TOF}^{Pion}; #sigma_{TPC}^{Pion}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); + uHistograms.add( "QA/Pion/TOF_Nsigma", "TOF NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Pion/TPC_Nsigma", "TPC NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Pion/Selected/TOF_TPC_Map", "TOF + TPC Combined PID for Pions; #sigma_{TPC}^{Pion}; #sigma_{TPC}^{Pion}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); + uHistograms.add( "QA/Pion/Selected/TOF_Nsigma", "TOF NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + uHistograms.add( "QA/Pion/Selected/TPC_Nsigma", "TPC NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); + // + // Analysis Plots + // --- Phi + uHistograms.add( "Analysis/Phi/FullInvariantMass", "K^{+}K^{-} Invariant Mass; M_{K^{+}K^{-}}; Counts;", kTH1F, {{1000, 0.99, 1.10}}); + uHistograms.add( "Analysis/Phi/PTInvariantMass", "#it{p}_{T} (GeV/#it{c}); K^{+}K^{-} Invariant Mass; M_{K^{+}K^{-}};", kTH2F, {{1000, 0., 20.},{1000, 0.99, 1.10}}); + // --- K* + uHistograms.add( "Analysis/Kstar/FullInvariantMass", "K^{#pm}#pi^{#pm} Invariant Mass; M_{K^{#pm}#pi^{#pm}}; Counts;", kTH1F, {{1000, 0.84, 0.95}}); + uHistograms.add( "Analysis/Kstar/PTInvariantMass", "#it{p}_{T} (GeV/#it{c}); K^{#pm}#pi^{#pm} Invariant Mass; M_{K^{#pm}#pi^{#pm}};", kTH2F, {{1000, 0., 20.},{1000, 0.84, 0.95}}); + } + // + // Configurables + // --- Event + Configurable kVertexZ {"kVertexCut", 10., "Vertex Z Cut"}; + // --- PID + // --- --- Kaons + Configurable kKaonsTOFveto {"kKaonsTOFveto", 3., "TOF Veto NSigma for Kaons"}; + Configurable kKaonsTPCveto {"kKaonsTPCveto", 5., "TPC NSigma for Kaons w/ TOF Veto"}; + Configurable kKaonsTPCstda {"kKaonsTPCstda", 3., "TPC NSigma for Kaons Standalone"}; + // --- --- Pions + Configurable kPionsTOFveto {"kPionsTOFveto", 3., "TOF Veto NSigma for Pions"}; + Configurable kPionsTPCveto {"kPionsTPCveto", 5., "TPC NSigma for Pions w/ TOF Veto"}; + Configurable kPionsTPCstda {"kPionsTPCstda", 3., "TPC NSigma for Pions Standalone"}; + // + // Processing A02D + void + process + ( kCollisionsTable::iterator const& kCollision, kTracksTable const& kTracks ) { + // + // Collision QA + uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection ); + // + // --- Event selection: Trigger based on TVX + if ( !kCollision.sel8() ) return; + uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kTVXselection ); + // + // --- Event selection: Vertex position + uHistograms.fill( HIST("QA/Event/VertexZ"), kCollision.posZ() ); + if ( !( fabs(kCollision.posZ()) < kVertexZ ) ) return; + uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kVertexCut ); + uHistograms.fill( HIST("QA/Event/Selected/VertexZ"), kCollision.posZ() ); + // + // Storage for Kaons + // --- PX PY PZ HasPositiveCharge + std::vector> kPosSelectedKaons; + std::vector> kNegSelectedKaons; + std::vector> kPosSelectedPions; + std::vector> kNegSelectedPions; + // + // Loop on Tracks + for ( auto kCurrentTrack : kTracks ) { + // + // Track Selection + if ( !kCurrentTrack.isGlobalTrack() ) continue; + uHistograms.fill( HIST("QA/Track/Momentum"), kCurrentTrack.dcaZ() ); + uHistograms.fill( HIST("QA/Track/TMomentum"), kCurrentTrack.pt() ); + // + // PID Selection + // --- PID QA Kaons + uHistograms.fill( HIST("QA/Kaon/TOF_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tofNSigmaKa() ); + uHistograms.fill( HIST("QA/Kaon/TPC_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tpcNSigmaKa() ); + uHistograms.fill( HIST("QA/Kaon/TOF_TPC_Map"), kCurrentTrack.tofNSigmaKa(), kCurrentTrack.tpcNSigmaKa() ); + // --- PID QA Pions + uHistograms.fill( HIST("QA/Pion/TOF_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tofNSigmaPi() ); + uHistograms.fill( HIST("QA/Pion/TPC_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tpcNSigmaPi() ); + uHistograms.fill( HIST("QA/Pion/TOF_TPC_Map"), kCurrentTrack.tofNSigmaPi(), kCurrentTrack.tpcNSigmaPi() ); + // + if ( uIsKaonSelected( kCurrentTrack ) ) { + if ( kCurrentTrack.sign() > 0 ) kPosSelectedKaons.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); + else kNegSelectedKaons.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); + } + // + if ( uIsPionSelected( kCurrentTrack ) ) { + if ( kCurrentTrack.sign() > 0 ) kPosSelectedPions.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); + else kNegSelectedPions.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); + } + } + // + // Invariant Mass for Phi + TLorentzVector kPositiveDecayDaughter; + TLorentzVector kNegativeDecayDaughter; + TLorentzVector kResonanceCandidate; + for ( auto kPosKaon : kPosSelectedKaons ) { + for ( auto kNegKaon : kNegSelectedKaons ) { + // + kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .493677 ); + kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .493677 ); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if ( kResonanceCandidate.Mag() < 0.90 || kResonanceCandidate.Mag() > 1.10 ) continue; + if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; + // + uHistograms.fill( HIST("Analysis/Phi/FullInvariantMass"), kResonanceCandidate.Mag() ); + } + } + // Invariant Mass for K* + for ( auto kPosKaon : kPosSelectedKaons ) { + for ( auto kNegKaon : kNegSelectedPions ) { + // + kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .493677 ); + kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .139570 ); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if ( kResonanceCandidate.Mag() < 0.84 || kResonanceCandidate.Mag() > 0.95 ) continue; + if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; + // + uHistograms.fill( HIST("Analysis/Kstar/FullInvariantMass"), kResonanceCandidate.Mag() ); + } + } + for ( auto kPosKaon : kPosSelectedPions ) { + for ( auto kNegKaon : kNegSelectedKaons ) { + // + kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .139570 ); + kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .493677 ); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if ( kResonanceCandidate.Mag() < 0.84 || kResonanceCandidate.Mag() > 0.95 ) continue; + if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; + // + uHistograms.fill( HIST("Analysis/Kstar/FullInvariantMass"), kResonanceCandidate.Mag() ); + } + } + } + // + bool + uIsKaonSelected + ( kTracksTable::iterator const& kCurrentTrack ) { + // + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaKa(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaKa(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if ( !kHasTPC || fabs(kTPCSigma) > kKaonsTPCveto ) return false; + if ( !kHasTOF && fabs(kTPCSigma) > kKaonsTPCstda ) return false; + if ( kHasTOF && fabs(kTOFSigma) > kKaonsTOFveto ) return false; + // + uHistograms.fill( HIST("QA/Kaon/Selected/TOF_Nsigma"), kTMomentum, kTOFSigma ); + uHistograms.fill( HIST("QA/Kaon/Selected/TPC_Nsigma"), kTMomentum, kTPCSigma ); + uHistograms.fill( HIST("QA/Kaon/Selected/TOF_TPC_Map"), kTOFSigma, kTPCSigma ); + return true; + } + // + bool + uIsPionSelected + ( kTracksTable::iterator const& kCurrentTrack ) { + // + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaPi(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaPi(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if ( !kHasTPC || fabs(kTPCSigma) > kPionsTPCveto ) return false; + if ( !kHasTOF && fabs(kTPCSigma) > kPionsTPCstda ) return false; + if ( kHasTOF && fabs(kTOFSigma) > kPionsTOFveto ) return false; + // + uHistograms.fill( HIST("QA/Pion/Selected/TOF_Nsigma"), kTMomentum, kTOFSigma ); + uHistograms.fill( HIST("QA/Pion/Selected/TPC_Nsigma"), kTMomentum, kTPCSigma ); + uHistograms.fill( HIST("QA/Pion/Selected/TOF_TPC_Map"), kTOFSigma, kTPCSigma ); + return true; + } + // + bool + uIsTrackSelected + ( ) { + return true; + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) // This puts your task in the DPL workflow +{ + // Equivalent to the AddTask in AliPhysics + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From 48e096b37e089ad0225abbf388231051d42b5b28 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Thu, 7 Jul 2022 23:44:24 +0200 Subject: [PATCH 02/16] clang format --- PWGLF/Tasks/rsn_analysis.cxx | 505 +++++++++++++++++++++-------------- 1 file changed, 306 insertions(+), 199 deletions(-) diff --git a/PWGLF/Tasks/rsn_analysis.cxx b/PWGLF/Tasks/rsn_analysis.cxx index 8788f2a744b..56004b8aadf 100644 --- a/PWGLF/Tasks/rsn_analysis.cxx +++ b/PWGLF/Tasks/rsn_analysis.cxx @@ -9,234 +9,341 @@ // or submit itself to any jurisdiction. // O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include "TLorentzVector.h" using namespace std; using namespace o2; using namespace o2::framework; -enum EventSelection { - kNoSelection = 0, - kTVXselection = 1, - kVertexCut = 2 -}; +enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; -using kCollisionsTable = soa::Join< aod::Collisions, aod::EvSels >; -using kTracksTable = soa::Join< aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::pidTOFFullKa, aod::pidTPCFullKa, aod::pidTOFFullPi, aod::pidTPCFullPi >; +using kCollisionsTable = soa::Join; +using kTracksTable = + soa::Join; struct rsn_analysis { - HistogramRegistry uHistograms { "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject }; + HistogramRegistry uHistograms{ + "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; + // + // Create Output Objects + void init(o2::framework::InitContext &) { + // Histogram is added to the ouput registry // - // Create Output Objects - void - init - (o2::framework::InitContext&) { - // Histogram is added to the ouput registry - // - // Event QA - uHistograms.add( "QA/Event/EnumEvents", "Event selection; ; Selected Events", kTH1F, {{10, 0, 10}}); - uHistograms.add( "QA/Event/VertexZ", "Event selection; Vertex Z (cm); Selected Events", kTH1F, {{4000, -20, 20}}); - uHistograms.add( "QA/Event/Selected/VertexZ", "Event selection; Vertex Z (cm); Selected Events", kTH1F, {{4000, -20, 20}}); - // - // Track QA - uHistograms.add( "QA/Track/Momentum", "Momentum distribution of selected Tracks; #it{p} (GeV/#it{c}); Selected Tracks", kTH1F, {{1000, 0, 20}}); - uHistograms.add( "QA/Track/TMomentum", "Transverse momentum distribution of selected Tracks; #it{p}_{T} (GeV/#it{c}); Selected Tracks", kTH1F, {{1000, 0, 20}}); - // - // PID QA - // --- Kaon - uHistograms.add( "QA/Kaon/TOF_TPC_Map", "TOF + TPC Combined PID for Kaons; #sigma_{TOF}^{Kaon}; #sigma_{TPC}^{Kaon}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); - uHistograms.add( "QA/Kaon/TOF_Nsigma", "TOF NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Kaon/TPC_Nsigma", "TPC NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Kaon/Selected/TOF_TPC_Map", "TOF + TPC Combined PID for Kaons; #sigma_{TPC}^{Kaon}; #sigma_{TPC}^{Kaon}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); - uHistograms.add( "QA/Kaon/Selected/TOF_Nsigma", "TOF NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Kaon/Selected/TPC_Nsigma", "TPC NSigma for Kaons; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - // --- Pion - uHistograms.add( "QA/Pion/TOF_TPC_Map", "TOF + TPC Combined PID for Pions; #sigma_{TOF}^{Pion}; #sigma_{TPC}^{Pion}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); - uHistograms.add( "QA/Pion/TOF_Nsigma", "TOF NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Pion/TPC_Nsigma", "TPC NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Pion/Selected/TOF_TPC_Map", "TOF + TPC Combined PID for Pions; #sigma_{TPC}^{Pion}; #sigma_{TPC}^{Pion}", kTH2F, {{1000, -10, 10},{1000, -10, 10}}); - uHistograms.add( "QA/Pion/Selected/TOF_Nsigma", "TOF NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - uHistograms.add( "QA/Pion/Selected/TPC_Nsigma", "TPC NSigma for Pions; #it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", kTH2F, {{1000, 0, 20},{1000, -10, 10}}); - // - // Analysis Plots - // --- Phi - uHistograms.add( "Analysis/Phi/FullInvariantMass", "K^{+}K^{-} Invariant Mass; M_{K^{+}K^{-}}; Counts;", kTH1F, {{1000, 0.99, 1.10}}); - uHistograms.add( "Analysis/Phi/PTInvariantMass", "#it{p}_{T} (GeV/#it{c}); K^{+}K^{-} Invariant Mass; M_{K^{+}K^{-}};", kTH2F, {{1000, 0., 20.},{1000, 0.99, 1.10}}); - // --- K* - uHistograms.add( "Analysis/Kstar/FullInvariantMass", "K^{#pm}#pi^{#pm} Invariant Mass; M_{K^{#pm}#pi^{#pm}}; Counts;", kTH1F, {{1000, 0.84, 0.95}}); - uHistograms.add( "Analysis/Kstar/PTInvariantMass", "#it{p}_{T} (GeV/#it{c}); K^{#pm}#pi^{#pm} Invariant Mass; M_{K^{#pm}#pi^{#pm}};", kTH2F, {{1000, 0., 20.},{1000, 0.84, 0.95}}); + // Event QA + uHistograms.add("QA/Event/EnumEvents", + "Event selection; ; " + " Selected Events", + kTH1F, {{10, 0, 10}}); + uHistograms.add("QA/Event/VertexZ", + "Event selection; " + "Vertex Z (cm); Selected Events", + kTH1F, {{4000, -20, 20}}); + uHistograms.add("QA/Event/Selected/VertexZ", + "Event selection; " + "Vertex Z (cm); Selected Events", + kTH1F, {{4000, -20, 20}}); + // + // Track QA + uHistograms.add("QA/Track/Momentum", + "Momentum distribution of selected Tracks; " + "#it{p} (GeV/#it{c}); Selected Tracks", + kTH1F, {{1000, 0, 20}}); + uHistograms.add("QA/Track/TMomentum", + "Transverse momentum distribution of selected Tracks; " + "#it{p}_{T} (GeV/#it{c}); Selected Tracks", + kTH1F, {{1000, 0, 20}}); + // + // PID QA + // --- Kaon + uHistograms.add("QA/Kaon/TOF_TPC_Map", + "TOF + TPC Combined PID for Kaons; " + "#sigma_{TOF}^{Kaon}; #sigma_{TPC}^{Kaon}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/TOF_Nsigma", + "TOF NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/TPC_Nsigma", + "TPC NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TOF_TPC_Map", + "TOF + TPC Combined PID for Kaons; " + "#sigma_{TPC}^{Kaon}; #sigma_{TPC}^{Kaon}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TOF_Nsigma", + "TOF NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TPC_Nsigma", + "TPC NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + // --- Pion + uHistograms.add("QA/Pion/TOF_TPC_Map", + "TOF + TPC Combined PID for Pions; " + "#sigma_{TOF}^{Pion}; #sigma_{TPC}^{Pion}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/TOF_Nsigma", + "TOF NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/TPC_Nsigma", + "TPC NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TOF_TPC_Map", + "TOF + TPC Combined PID for Pions; " + "#sigma_{TPC}^{Pion}; #sigma_{TPC}^{Pion}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TOF_Nsigma", + "TOF NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TPC_Nsigma", + "TPC NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + // + // Analysis Plots + // --- Phi + uHistograms.add("Analysis/Phi/FullInvariantMass", + "K^{+}K^{-} Invariant Mass; " + "M_{K^{+}K^{-}}; Counts;", + kTH1F, {{1000, 0.99, 1.10}}); + uHistograms.add("Analysis/Phi/PTInvariantMass", + "#it{p}_{T} (GeV/#it{c}); K^{+}K^{-} Invariant Mass; " + " M_{K^{+}K^{-}};", + kTH2F, {{1000, 0., 20.}, {1000, 0.99, 1.10}}); + // --- K* + uHistograms.add("Analysis/Kstar/FullInvariantMass", + "K^{#pm}#pi^{#pm} Invariant Mass; " + "M_{K^{#pm}#pi^{#pm}}; Counts;", + kTH1F, {{1000, 0.84, 0.95}}); + uHistograms.add("Analysis/Kstar/PTInvariantMass", + "#it{p}_{T} (GeV/#it{c}); K^{#pm}#pi^{#pm} Invariant Mass; " + " M_{K^{#pm}#pi^{#pm}};", + kTH2F, {{1000, 0., 20.}, {1000, 0.84, 0.95}}); + } + // + // Configurables + // --- Event + Configurable kVertexZ{"kVertexCut", 10., "Vertex Z Cut"}; + // --- PID + // --- --- Kaons + Configurable kKaonsTOFveto{"kKaonsTOFveto", 3., + "TOF Veto NSigma for Kaons"}; + Configurable kKaonsTPCveto{"kKaonsTPCveto", 5., + "TPC NSigma for Kaons w/ TOF Veto"}; + Configurable kKaonsTPCstda{"kKaonsTPCstda", 3., + "TPC NSigma for Kaons Standalone"}; + // --- --- Pions + Configurable kPionsTOFveto{"kPionsTOFveto", 3., + "TOF Veto NSigma for Pions"}; + Configurable kPionsTPCveto{"kPionsTPCveto", 5., + "TPC NSigma for Pions w/ TOF Veto"}; + Configurable kPionsTPCstda{"kPionsTPCstda", 3., + "TPC NSigma for Pions Standalone"}; + // + // Processing A02D + void process(kCollisionsTable::iterator const &kCollision, + kTracksTable const &kTracks) { + // + // Collision QA + uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); + // + // --- Event selection: Trigger based on TVX + if (!kCollision.sel8()) + return; + uHistograms.fill(HIST("QA/Event/EnumEvents"), + EventSelection::kTVXselection); + // + // --- Event selection: Vertex position + uHistograms.fill(HIST("QA/Event/VertexZ"), kCollision.posZ()); + if (!(fabs(kCollision.posZ()) < kVertexZ)) + return; + uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kVertexCut); + uHistograms.fill(HIST("QA/Event/Selected/VertexZ"), kCollision.posZ()); + // + // Storage for Kaons + // --- PX PY PZ HasPositiveCharge + std::vector> kPosSelectedKaons; + std::vector> kNegSelectedKaons; + std::vector> kPosSelectedPions; + std::vector> kNegSelectedPions; + // + // Loop on Tracks + for (auto kCurrentTrack : kTracks) { + // + // Track Selection + if (!kCurrentTrack.isGlobalTrack()) + continue; + uHistograms.fill(HIST("QA/Track/Momentum"), kCurrentTrack.dcaZ()); + uHistograms.fill(HIST("QA/Track/TMomentum"), kCurrentTrack.pt()); + // + // PID Selection + // --- PID QA Kaons + uHistograms.fill(HIST("QA/Kaon/TOF_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tofNSigmaKa()); + uHistograms.fill(HIST("QA/Kaon/TPC_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tpcNSigmaKa()); + uHistograms.fill(HIST("QA/Kaon/TOF_TPC_Map"), kCurrentTrack.tofNSigmaKa(), + kCurrentTrack.tpcNSigmaKa()); + // --- PID QA Pions + uHistograms.fill(HIST("QA/Pion/TOF_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tofNSigmaPi()); + uHistograms.fill(HIST("QA/Pion/TPC_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tpcNSigmaPi()); + uHistograms.fill(HIST("QA/Pion/TOF_TPC_Map"), kCurrentTrack.tofNSigmaPi(), + kCurrentTrack.tpcNSigmaPi()); + // + if (uIsKaonSelected(kCurrentTrack)) { + if (kCurrentTrack.sign() > 0) + kPosSelectedKaons.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + else + kNegSelectedKaons.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + } + // + if (uIsPionSelected(kCurrentTrack)) { + if (kCurrentTrack.sign() > 0) + kPosSelectedPions.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + else + kNegSelectedPions.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + } } // - // Configurables - // --- Event - Configurable kVertexZ {"kVertexCut", 10., "Vertex Z Cut"}; - // --- PID - // --- --- Kaons - Configurable kKaonsTOFveto {"kKaonsTOFveto", 3., "TOF Veto NSigma for Kaons"}; - Configurable kKaonsTPCveto {"kKaonsTPCveto", 5., "TPC NSigma for Kaons w/ TOF Veto"}; - Configurable kKaonsTPCstda {"kKaonsTPCstda", 3., "TPC NSigma for Kaons Standalone"}; - // --- --- Pions - Configurable kPionsTOFveto {"kPionsTOFveto", 3., "TOF Veto NSigma for Pions"}; - Configurable kPionsTPCveto {"kPionsTPCveto", 5., "TPC NSigma for Pions w/ TOF Veto"}; - Configurable kPionsTPCstda {"kPionsTPCstda", 3., "TPC NSigma for Pions Standalone"}; - // - // Processing A02D - void - process - ( kCollisionsTable::iterator const& kCollision, kTracksTable const& kTracks ) { + // Invariant Mass for Phi + TLorentzVector kPositiveDecayDaughter; + TLorentzVector kNegativeDecayDaughter; + TLorentzVector kResonanceCandidate; + for (auto kPosKaon : kPosSelectedKaons) { + for (auto kNegKaon : kNegSelectedKaons) { // - // Collision QA - uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection ); + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .493677); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .493677); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; // - // --- Event selection: Trigger based on TVX - if ( !kCollision.sel8() ) return; - uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kTVXselection ); + if (kResonanceCandidate.Mag() < 0.90 || + kResonanceCandidate.Mag() > 1.10) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; // - // --- Event selection: Vertex position - uHistograms.fill( HIST("QA/Event/VertexZ"), kCollision.posZ() ); - if ( !( fabs(kCollision.posZ()) < kVertexZ ) ) return; - uHistograms.fill( HIST("QA/Event/EnumEvents"), EventSelection::kVertexCut ); - uHistograms.fill( HIST("QA/Event/Selected/VertexZ"), kCollision.posZ() ); - // - // Storage for Kaons - // --- PX PY PZ HasPositiveCharge - std::vector> kPosSelectedKaons; - std::vector> kNegSelectedKaons; - std::vector> kPosSelectedPions; - std::vector> kNegSelectedPions; - // - // Loop on Tracks - for ( auto kCurrentTrack : kTracks ) { - // - // Track Selection - if ( !kCurrentTrack.isGlobalTrack() ) continue; - uHistograms.fill( HIST("QA/Track/Momentum"), kCurrentTrack.dcaZ() ); - uHistograms.fill( HIST("QA/Track/TMomentum"), kCurrentTrack.pt() ); - // - // PID Selection - // --- PID QA Kaons - uHistograms.fill( HIST("QA/Kaon/TOF_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tofNSigmaKa() ); - uHistograms.fill( HIST("QA/Kaon/TPC_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tpcNSigmaKa() ); - uHistograms.fill( HIST("QA/Kaon/TOF_TPC_Map"), kCurrentTrack.tofNSigmaKa(), kCurrentTrack.tpcNSigmaKa() ); - // --- PID QA Pions - uHistograms.fill( HIST("QA/Pion/TOF_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tofNSigmaPi() ); - uHistograms.fill( HIST("QA/Pion/TPC_Nsigma"), kCurrentTrack.pt(), kCurrentTrack.tpcNSigmaPi() ); - uHistograms.fill( HIST("QA/Pion/TOF_TPC_Map"), kCurrentTrack.tofNSigmaPi(), kCurrentTrack.tpcNSigmaPi() ); - // - if ( uIsKaonSelected( kCurrentTrack ) ) { - if ( kCurrentTrack.sign() > 0 ) kPosSelectedKaons.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); - else kNegSelectedKaons.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); - } - // - if ( uIsPionSelected( kCurrentTrack ) ) { - if ( kCurrentTrack.sign() > 0 ) kPosSelectedPions.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); - else kNegSelectedPions.push_back( std::tuple( kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz() ) ); - } - } - // - // Invariant Mass for Phi - TLorentzVector kPositiveDecayDaughter; - TLorentzVector kNegativeDecayDaughter; - TLorentzVector kResonanceCandidate; - for ( auto kPosKaon : kPosSelectedKaons ) { - for ( auto kNegKaon : kNegSelectedKaons ) { - // - kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .493677 ); - kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .493677 ); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if ( kResonanceCandidate.Mag() < 0.90 || kResonanceCandidate.Mag() > 1.10 ) continue; - if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; - // - uHistograms.fill( HIST("Analysis/Phi/FullInvariantMass"), kResonanceCandidate.Mag() ); - } - } - // Invariant Mass for K* - for ( auto kPosKaon : kPosSelectedKaons ) { - for ( auto kNegKaon : kNegSelectedPions ) { - // - kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .493677 ); - kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .139570 ); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if ( kResonanceCandidate.Mag() < 0.84 || kResonanceCandidate.Mag() > 0.95 ) continue; - if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; - // - uHistograms.fill( HIST("Analysis/Kstar/FullInvariantMass"), kResonanceCandidate.Mag() ); - } - } - for ( auto kPosKaon : kPosSelectedPions ) { - for ( auto kNegKaon : kNegSelectedKaons ) { - // - kPositiveDecayDaughter.SetXYZM( get<0>(kPosKaon), get<1>(kPosKaon), get<2>(kPosKaon), .139570 ); - kNegativeDecayDaughter.SetXYZM( get<0>(kNegKaon), get<1>(kNegKaon), get<2>(kNegKaon), .493677 ); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if ( kResonanceCandidate.Mag() < 0.84 || kResonanceCandidate.Mag() > 0.95 ) continue; - if ( fabs( kResonanceCandidate.Rapidity() ) > 0.5 ) continue; - // - uHistograms.fill( HIST("Analysis/Kstar/FullInvariantMass"), kResonanceCandidate.Mag() ); - } - } + uHistograms.fill(HIST("Analysis/Phi/FullInvariantMass"), + kResonanceCandidate.Mag()); + } } - // - bool - uIsKaonSelected - ( kTracksTable::iterator const& kCurrentTrack ) { + // Invariant Mass for K* + for (auto kPosKaon : kPosSelectedKaons) { + for (auto kNegKaon : kNegSelectedPions) { // - // Utility variables - Bool_t kHasTPC = kCurrentTrack.hasTPC(); - Double_t kTPCSigma = kCurrentTrack.tpcNSigmaKa(); - Bool_t kHasTOF = kCurrentTrack.hasTOF(); - Double_t kTOFSigma = kCurrentTrack.tofNSigmaKa(); - Double_t kTMomentum = kCurrentTrack.pt(); + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .493677); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .139570); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; // - // Selection - if ( !kHasTPC || fabs(kTPCSigma) > kKaonsTPCveto ) return false; - if ( !kHasTOF && fabs(kTPCSigma) > kKaonsTPCstda ) return false; - if ( kHasTOF && fabs(kTOFSigma) > kKaonsTOFveto ) return false; + if (kResonanceCandidate.Mag() < 0.84 || + kResonanceCandidate.Mag() > 0.95) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; // - uHistograms.fill( HIST("QA/Kaon/Selected/TOF_Nsigma"), kTMomentum, kTOFSigma ); - uHistograms.fill( HIST("QA/Kaon/Selected/TPC_Nsigma"), kTMomentum, kTPCSigma ); - uHistograms.fill( HIST("QA/Kaon/Selected/TOF_TPC_Map"), kTOFSigma, kTPCSigma ); - return true; + uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), + kResonanceCandidate.Mag()); + } } - // - bool - uIsPionSelected - ( kTracksTable::iterator const& kCurrentTrack ) { + for (auto kPosKaon : kPosSelectedPions) { + for (auto kNegKaon : kNegSelectedKaons) { // - // Utility variables - Bool_t kHasTPC = kCurrentTrack.hasTPC(); - Double_t kTPCSigma = kCurrentTrack.tpcNSigmaPi(); - Bool_t kHasTOF = kCurrentTrack.hasTOF(); - Double_t kTOFSigma = kCurrentTrack.tofNSigmaPi(); - Double_t kTMomentum = kCurrentTrack.pt(); + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .139570); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .493677); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; // - // Selection - if ( !kHasTPC || fabs(kTPCSigma) > kPionsTPCveto ) return false; - if ( !kHasTOF && fabs(kTPCSigma) > kPionsTPCstda ) return false; - if ( kHasTOF && fabs(kTOFSigma) > kPionsTOFveto ) return false; + if (kResonanceCandidate.Mag() < 0.84 || + kResonanceCandidate.Mag() > 0.95) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; // - uHistograms.fill( HIST("QA/Pion/Selected/TOF_Nsigma"), kTMomentum, kTOFSigma ); - uHistograms.fill( HIST("QA/Pion/Selected/TPC_Nsigma"), kTMomentum, kTPCSigma ); - uHistograms.fill( HIST("QA/Pion/Selected/TOF_TPC_Map"), kTOFSigma, kTPCSigma ); - return true; + uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), + kResonanceCandidate.Mag()); + } } + } + // + bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { // - bool - uIsTrackSelected - ( ) { - return true; - } + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaKa(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaKa(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if (!kHasTPC || fabs(kTPCSigma) > kKaonsTPCveto) + return false; + if (!kHasTOF && fabs(kTPCSigma) > kKaonsTPCstda) + return false; + if (kHasTOF && fabs(kTOFSigma) > kKaonsTOFveto) + return false; + // + uHistograms.fill(HIST("QA/Kaon/Selected/TOF_Nsigma"), kTMomentum, + kTOFSigma); + uHistograms.fill(HIST("QA/Kaon/Selected/TPC_Nsigma"), kTMomentum, + kTPCSigma); + uHistograms.fill(HIST("QA/Kaon/Selected/TOF_TPC_Map"), kTOFSigma, + kTPCSigma); + return true; + } + // + bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { + // + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaPi(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaPi(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if (!kHasTPC || fabs(kTPCSigma) > kPionsTPCveto) + return false; + if (!kHasTOF && fabs(kTPCSigma) > kPionsTPCstda) + return false; + if (kHasTOF && fabs(kTOFSigma) > kPionsTOFveto) + return false; + // + uHistograms.fill(HIST("QA/Pion/Selected/TOF_Nsigma"), kTMomentum, + kTOFSigma); + uHistograms.fill(HIST("QA/Pion/Selected/TPC_Nsigma"), kTMomentum, + kTPCSigma); + uHistograms.fill(HIST("QA/Pion/Selected/TOF_TPC_Map"), kTOFSigma, + kTPCSigma); + return true; + } + // + bool uIsTrackSelected() { return true; } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) // This puts your task in the DPL workflow +WorkflowSpec defineDataProcessing( + ConfigContext const &cfgc) // This puts your task in the DPL workflow { // Equivalent to the AddTask in AliPhysics WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; From 81cf6e1654905beaa817b70af51b39e70519860e Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Thu, 7 Jul 2022 23:47:42 +0200 Subject: [PATCH 03/16] header --- PWGLF/Tasks/rsn_analysis.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/rsn_analysis.cxx b/PWGLF/Tasks/rsn_analysis.cxx index 56004b8aadf..bff2a20ff41 100644 --- a/PWGLF/Tasks/rsn_analysis.cxx +++ b/PWGLF/Tasks/rsn_analysis.cxx @@ -1,13 +1,22 @@ -// Copyright CERN and copyright holders of ALICE O2. This software is -// distributed under the terms of the GNU General Public License v3 (GPL -// Version 3), copied verbatim in the file "COPYING". +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // -// See http://alice-o2.web.cern.ch/license for full licensing information. +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// +/// \file rsn_analysis.cxx +/// +/// \brief Analysis task for the measurement of resonances +/// +/// \author Nicola Rubini +/// + // O2 includes #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" From e42e2c53af04a013c5a199444538c5d8f7586459 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Thu, 7 Jul 2022 23:50:44 +0200 Subject: [PATCH 04/16] minor fix --- PWGLF/Tasks/CMakeLists.txt | 4 +- PWGLF/Tasks/rsnanalysis.cxx | 360 ++++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 PWGLF/Tasks/rsnanalysis.cxx diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index d94986bb995..1654d19d8f6 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -94,8 +94,8 @@ o2physics_add_dpl_workflow(track-checks PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(rsn-analysis - SOURCES rsn_analysis.cxx +o2physics_add_dpl_workflow(rsnanalysis + SOURCES rsnanalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx new file mode 100644 index 00000000000..8851b5b1deb --- /dev/null +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -0,0 +1,360 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// +/// \file rsn_analysis.cxx +/// +/// \brief Analysis task for the measurement of resonances +/// +/// \author Nicola Rubini +/// + +// O2 includes +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "TLorentzVector.h" + +using namespace std; +using namespace o2; +using namespace o2::framework; + +enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; + +using kCollisionsTable = soa::Join; +using kTracksTable = + soa::Join; + +struct rsn_analysis { + HistogramRegistry uHistograms{ + "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; + // + // Create Output Objects + void init(o2::framework::InitContext &) { + // Histogram is added to the ouput registry + // + // Event QA + uHistograms.add("QA/Event/EnumEvents", + "Event selection; ; " + " Selected Events", + kTH1F, {{10, 0, 10}}); + uHistograms.add("QA/Event/VertexZ", + "Event selection; " + "Vertex Z (cm); Selected Events", + kTH1F, {{4000, -20, 20}}); + uHistograms.add("QA/Event/Selected/VertexZ", + "Event selection; " + "Vertex Z (cm); Selected Events", + kTH1F, {{4000, -20, 20}}); + // + // Track QA + uHistograms.add("QA/Track/Momentum", + "Momentum distribution of selected Tracks; " + "#it{p} (GeV/#it{c}); Selected Tracks", + kTH1F, {{1000, 0, 20}}); + uHistograms.add("QA/Track/TMomentum", + "Transverse momentum distribution of selected Tracks; " + "#it{p}_{T} (GeV/#it{c}); Selected Tracks", + kTH1F, {{1000, 0, 20}}); + // + // PID QA + // --- Kaon + uHistograms.add("QA/Kaon/TOF_TPC_Map", + "TOF + TPC Combined PID for Kaons; " + "#sigma_{TOF}^{Kaon}; #sigma_{TPC}^{Kaon}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/TOF_Nsigma", + "TOF NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/TPC_Nsigma", + "TPC NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TOF_TPC_Map", + "TOF + TPC Combined PID for Kaons; " + "#sigma_{TPC}^{Kaon}; #sigma_{TPC}^{Kaon}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TOF_Nsigma", + "TOF NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Kaon/Selected/TPC_Nsigma", + "TPC NSigma for Kaons; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + // --- Pion + uHistograms.add("QA/Pion/TOF_TPC_Map", + "TOF + TPC Combined PID for Pions; " + "#sigma_{TOF}^{Pion}; #sigma_{TPC}^{Pion}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/TOF_Nsigma", + "TOF NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/TPC_Nsigma", + "TPC NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TOF_TPC_Map", + "TOF + TPC Combined PID for Pions; " + "#sigma_{TPC}^{Pion}; #sigma_{TPC}^{Pion}", + kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TOF_Nsigma", + "TOF NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + uHistograms.add("QA/Pion/Selected/TPC_Nsigma", + "TPC NSigma for Pions; " + "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", + kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); + // + // Analysis Plots + // --- Phi + uHistograms.add("Analysis/Phi/FullInvariantMass", + "K^{+}K^{-} Invariant Mass; " + "M_{K^{+}K^{-}}; Counts;", + kTH1F, {{1000, 0.99, 1.10}}); + uHistograms.add("Analysis/Phi/PTInvariantMass", + "#it{p}_{T} (GeV/#it{c}); K^{+}K^{-} Invariant Mass; " + " M_{K^{+}K^{-}};", + kTH2F, {{1000, 0., 20.}, {1000, 0.99, 1.10}}); + // --- K* + uHistograms.add("Analysis/Kstar/FullInvariantMass", + "K^{#pm}#pi^{#pm} Invariant Mass; " + "M_{K^{#pm}#pi^{#pm}}; Counts;", + kTH1F, {{1000, 0.84, 0.95}}); + uHistograms.add("Analysis/Kstar/PTInvariantMass", + "#it{p}_{T} (GeV/#it{c}); K^{#pm}#pi^{#pm} Invariant Mass; " + " M_{K^{#pm}#pi^{#pm}};", + kTH2F, {{1000, 0., 20.}, {1000, 0.84, 0.95}}); + } + // + // Configurables + // --- Event + Configurable kVertexZ{"kVertexCut", 10., "Vertex Z Cut"}; + // --- PID + // --- --- Kaons + Configurable kKaonsTOFveto{"kKaonsTOFveto", 3., + "TOF Veto NSigma for Kaons"}; + Configurable kKaonsTPCveto{"kKaonsTPCveto", 5., + "TPC NSigma for Kaons w/ TOF Veto"}; + Configurable kKaonsTPCstda{"kKaonsTPCstda", 3., + "TPC NSigma for Kaons Standalone"}; + // --- --- Pions + Configurable kPionsTOFveto{"kPionsTOFveto", 3., + "TOF Veto NSigma for Pions"}; + Configurable kPionsTPCveto{"kPionsTPCveto", 5., + "TPC NSigma for Pions w/ TOF Veto"}; + Configurable kPionsTPCstda{"kPionsTPCstda", 3., + "TPC NSigma for Pions Standalone"}; + // + // Processing A02D + void process(kCollisionsTable::iterator const &kCollision, + kTracksTable const &kTracks) { + // + // Collision QA + uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); + // + // --- Event selection: Trigger based on TVX + if (!kCollision.sel8()) + return; + uHistograms.fill(HIST("QA/Event/EnumEvents"), + EventSelection::kTVXselection); + // + // --- Event selection: Vertex position + uHistograms.fill(HIST("QA/Event/VertexZ"), kCollision.posZ()); + if (!(fabs(kCollision.posZ()) < kVertexZ)) + return; + uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kVertexCut); + uHistograms.fill(HIST("QA/Event/Selected/VertexZ"), kCollision.posZ()); + // + // Storage for Kaons + // --- PX PY PZ HasPositiveCharge + std::vector> kPosSelectedKaons; + std::vector> kNegSelectedKaons; + std::vector> kPosSelectedPions; + std::vector> kNegSelectedPions; + // + // Loop on Tracks + for (auto kCurrentTrack : kTracks) { + // + // Track Selection + if (!kCurrentTrack.isGlobalTrack()) + continue; + uHistograms.fill(HIST("QA/Track/Momentum"), kCurrentTrack.dcaZ()); + uHistograms.fill(HIST("QA/Track/TMomentum"), kCurrentTrack.pt()); + // + // PID Selection + // --- PID QA Kaons + uHistograms.fill(HIST("QA/Kaon/TOF_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tofNSigmaKa()); + uHistograms.fill(HIST("QA/Kaon/TPC_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tpcNSigmaKa()); + uHistograms.fill(HIST("QA/Kaon/TOF_TPC_Map"), kCurrentTrack.tofNSigmaKa(), + kCurrentTrack.tpcNSigmaKa()); + // --- PID QA Pions + uHistograms.fill(HIST("QA/Pion/TOF_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tofNSigmaPi()); + uHistograms.fill(HIST("QA/Pion/TPC_Nsigma"), kCurrentTrack.pt(), + kCurrentTrack.tpcNSigmaPi()); + uHistograms.fill(HIST("QA/Pion/TOF_TPC_Map"), kCurrentTrack.tofNSigmaPi(), + kCurrentTrack.tpcNSigmaPi()); + // + if (uIsKaonSelected(kCurrentTrack)) { + if (kCurrentTrack.sign() > 0) + kPosSelectedKaons.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + else + kNegSelectedKaons.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + } + // + if (uIsPionSelected(kCurrentTrack)) { + if (kCurrentTrack.sign() > 0) + kPosSelectedPions.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + else + kNegSelectedPions.push_back(std::tuple( + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + } + } + // + // Invariant Mass for Phi + TLorentzVector kPositiveDecayDaughter; + TLorentzVector kNegativeDecayDaughter; + TLorentzVector kResonanceCandidate; + for (auto kPosKaon : kPosSelectedKaons) { + for (auto kNegKaon : kNegSelectedKaons) { + // + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .493677); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .493677); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if (kResonanceCandidate.Mag() < 0.90 || + kResonanceCandidate.Mag() > 1.10) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; + // + uHistograms.fill(HIST("Analysis/Phi/FullInvariantMass"), + kResonanceCandidate.Mag()); + } + } + // Invariant Mass for K* + for (auto kPosKaon : kPosSelectedKaons) { + for (auto kNegKaon : kNegSelectedPions) { + // + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .493677); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .139570); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if (kResonanceCandidate.Mag() < 0.84 || + kResonanceCandidate.Mag() > 0.95) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; + // + uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), + kResonanceCandidate.Mag()); + } + } + for (auto kPosKaon : kPosSelectedPions) { + for (auto kNegKaon : kNegSelectedKaons) { + // + kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), + get<2>(kPosKaon), .139570); + kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), + get<2>(kNegKaon), .493677); + kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; + // + if (kResonanceCandidate.Mag() < 0.84 || + kResonanceCandidate.Mag() > 0.95) + continue; + if (fabs(kResonanceCandidate.Rapidity()) > 0.5) + continue; + // + uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), + kResonanceCandidate.Mag()); + } + } + } + // + bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { + // + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaKa(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaKa(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if (!kHasTPC || fabs(kTPCSigma) > kKaonsTPCveto) + return false; + if (!kHasTOF && fabs(kTPCSigma) > kKaonsTPCstda) + return false; + if (kHasTOF && fabs(kTOFSigma) > kKaonsTOFveto) + return false; + // + uHistograms.fill(HIST("QA/Kaon/Selected/TOF_Nsigma"), kTMomentum, + kTOFSigma); + uHistograms.fill(HIST("QA/Kaon/Selected/TPC_Nsigma"), kTMomentum, + kTPCSigma); + uHistograms.fill(HIST("QA/Kaon/Selected/TOF_TPC_Map"), kTOFSigma, + kTPCSigma); + return true; + } + // + bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { + // + // Utility variables + Bool_t kHasTPC = kCurrentTrack.hasTPC(); + Double_t kTPCSigma = kCurrentTrack.tpcNSigmaPi(); + Bool_t kHasTOF = kCurrentTrack.hasTOF(); + Double_t kTOFSigma = kCurrentTrack.tofNSigmaPi(); + Double_t kTMomentum = kCurrentTrack.pt(); + // + // Selection + if (!kHasTPC || fabs(kTPCSigma) > kPionsTPCveto) + return false; + if (!kHasTOF && fabs(kTPCSigma) > kPionsTPCstda) + return false; + if (kHasTOF && fabs(kTOFSigma) > kPionsTOFveto) + return false; + // + uHistograms.fill(HIST("QA/Pion/Selected/TOF_Nsigma"), kTMomentum, + kTOFSigma); + uHistograms.fill(HIST("QA/Pion/Selected/TPC_Nsigma"), kTMomentum, + kTPCSigma); + uHistograms.fill(HIST("QA/Pion/Selected/TOF_TPC_Map"), kTOFSigma, + kTPCSigma); + return true; + } + // + bool uIsTrackSelected() { return true; } +}; + +WorkflowSpec defineDataProcessing( + ConfigContext const &cfgc) // This puts your task in the DPL workflow +{ + // Equivalent to the AddTask in AliPhysics + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} From 02e24634c5fd1e969fc31800b1a03c61a3ecc33c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 8 Jul 2022 00:10:52 +0200 Subject: [PATCH 05/16] Update CMakeLists.txt --- PWGLF/Tasks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 1654d19d8f6..b093bef8554 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -94,7 +94,7 @@ o2physics_add_dpl_workflow(track-checks PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(rsnanalysis +o2physics_add_dpl_workflow(rsn_analysis SOURCES rsnanalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) From c65ba327f1007f051e5b1dc968be32b6edb04b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 8 Jul 2022 01:08:15 +0200 Subject: [PATCH 06/16] Update rsnanalysis.cxx --- PWGLF/Tasks/rsnanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 8851b5b1deb..bff2a20ff41 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". From b3e6a625d954e7f3c9a8509ed053aaac293cb23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 8 Jul 2022 01:12:46 +0200 Subject: [PATCH 07/16] Delete rsn_analysis.cxx --- PWGLF/Tasks/rsn_analysis.cxx | 360 ----------------------------------- 1 file changed, 360 deletions(-) delete mode 100644 PWGLF/Tasks/rsn_analysis.cxx diff --git a/PWGLF/Tasks/rsn_analysis.cxx b/PWGLF/Tasks/rsn_analysis.cxx deleted file mode 100644 index bff2a20ff41..00000000000 --- a/PWGLF/Tasks/rsn_analysis.cxx +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file rsn_analysis.cxx -/// -/// \brief Analysis task for the measurement of resonances -/// -/// \author Nicola Rubini -/// - -// O2 includes -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "TLorentzVector.h" - -using namespace std; -using namespace o2; -using namespace o2::framework; - -enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; - -using kCollisionsTable = soa::Join; -using kTracksTable = - soa::Join; - -struct rsn_analysis { - HistogramRegistry uHistograms{ - "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; - // - // Create Output Objects - void init(o2::framework::InitContext &) { - // Histogram is added to the ouput registry - // - // Event QA - uHistograms.add("QA/Event/EnumEvents", - "Event selection; ; " - " Selected Events", - kTH1F, {{10, 0, 10}}); - uHistograms.add("QA/Event/VertexZ", - "Event selection; " - "Vertex Z (cm); Selected Events", - kTH1F, {{4000, -20, 20}}); - uHistograms.add("QA/Event/Selected/VertexZ", - "Event selection; " - "Vertex Z (cm); Selected Events", - kTH1F, {{4000, -20, 20}}); - // - // Track QA - uHistograms.add("QA/Track/Momentum", - "Momentum distribution of selected Tracks; " - "#it{p} (GeV/#it{c}); Selected Tracks", - kTH1F, {{1000, 0, 20}}); - uHistograms.add("QA/Track/TMomentum", - "Transverse momentum distribution of selected Tracks; " - "#it{p}_{T} (GeV/#it{c}); Selected Tracks", - kTH1F, {{1000, 0, 20}}); - // - // PID QA - // --- Kaon - uHistograms.add("QA/Kaon/TOF_TPC_Map", - "TOF + TPC Combined PID for Kaons; " - "#sigma_{TOF}^{Kaon}; #sigma_{TPC}^{Kaon}", - kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); - uHistograms.add("QA/Kaon/TOF_Nsigma", - "TOF NSigma for Kaons; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Kaon/TPC_Nsigma", - "TPC NSigma for Kaons; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Kaon/Selected/TOF_TPC_Map", - "TOF + TPC Combined PID for Kaons; " - "#sigma_{TPC}^{Kaon}; #sigma_{TPC}^{Kaon}", - kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); - uHistograms.add("QA/Kaon/Selected/TOF_Nsigma", - "TOF NSigma for Kaons; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Kaon};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Kaon/Selected/TPC_Nsigma", - "TPC NSigma for Kaons; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Kaon};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - // --- Pion - uHistograms.add("QA/Pion/TOF_TPC_Map", - "TOF + TPC Combined PID for Pions; " - "#sigma_{TOF}^{Pion}; #sigma_{TPC}^{Pion}", - kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); - uHistograms.add("QA/Pion/TOF_Nsigma", - "TOF NSigma for Pions; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Pion/TPC_Nsigma", - "TPC NSigma for Pions; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Pion/Selected/TOF_TPC_Map", - "TOF + TPC Combined PID for Pions; " - "#sigma_{TPC}^{Pion}; #sigma_{TPC}^{Pion}", - kTH2F, {{1000, -10, 10}, {1000, -10, 10}}); - uHistograms.add("QA/Pion/Selected/TOF_Nsigma", - "TOF NSigma for Pions; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TOF}^{Pion};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - uHistograms.add("QA/Pion/Selected/TPC_Nsigma", - "TPC NSigma for Pions; " - "#it{p}_{T} (GeV/#it{c}); #sigma_{TPC}^{Pion};", - kTH2F, {{1000, 0, 20}, {1000, -10, 10}}); - // - // Analysis Plots - // --- Phi - uHistograms.add("Analysis/Phi/FullInvariantMass", - "K^{+}K^{-} Invariant Mass; " - "M_{K^{+}K^{-}}; Counts;", - kTH1F, {{1000, 0.99, 1.10}}); - uHistograms.add("Analysis/Phi/PTInvariantMass", - "#it{p}_{T} (GeV/#it{c}); K^{+}K^{-} Invariant Mass; " - " M_{K^{+}K^{-}};", - kTH2F, {{1000, 0., 20.}, {1000, 0.99, 1.10}}); - // --- K* - uHistograms.add("Analysis/Kstar/FullInvariantMass", - "K^{#pm}#pi^{#pm} Invariant Mass; " - "M_{K^{#pm}#pi^{#pm}}; Counts;", - kTH1F, {{1000, 0.84, 0.95}}); - uHistograms.add("Analysis/Kstar/PTInvariantMass", - "#it{p}_{T} (GeV/#it{c}); K^{#pm}#pi^{#pm} Invariant Mass; " - " M_{K^{#pm}#pi^{#pm}};", - kTH2F, {{1000, 0., 20.}, {1000, 0.84, 0.95}}); - } - // - // Configurables - // --- Event - Configurable kVertexZ{"kVertexCut", 10., "Vertex Z Cut"}; - // --- PID - // --- --- Kaons - Configurable kKaonsTOFveto{"kKaonsTOFveto", 3., - "TOF Veto NSigma for Kaons"}; - Configurable kKaonsTPCveto{"kKaonsTPCveto", 5., - "TPC NSigma for Kaons w/ TOF Veto"}; - Configurable kKaonsTPCstda{"kKaonsTPCstda", 3., - "TPC NSigma for Kaons Standalone"}; - // --- --- Pions - Configurable kPionsTOFveto{"kPionsTOFveto", 3., - "TOF Veto NSigma for Pions"}; - Configurable kPionsTPCveto{"kPionsTPCveto", 5., - "TPC NSigma for Pions w/ TOF Veto"}; - Configurable kPionsTPCstda{"kPionsTPCstda", 3., - "TPC NSigma for Pions Standalone"}; - // - // Processing A02D - void process(kCollisionsTable::iterator const &kCollision, - kTracksTable const &kTracks) { - // - // Collision QA - uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); - // - // --- Event selection: Trigger based on TVX - if (!kCollision.sel8()) - return; - uHistograms.fill(HIST("QA/Event/EnumEvents"), - EventSelection::kTVXselection); - // - // --- Event selection: Vertex position - uHistograms.fill(HIST("QA/Event/VertexZ"), kCollision.posZ()); - if (!(fabs(kCollision.posZ()) < kVertexZ)) - return; - uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kVertexCut); - uHistograms.fill(HIST("QA/Event/Selected/VertexZ"), kCollision.posZ()); - // - // Storage for Kaons - // --- PX PY PZ HasPositiveCharge - std::vector> kPosSelectedKaons; - std::vector> kNegSelectedKaons; - std::vector> kPosSelectedPions; - std::vector> kNegSelectedPions; - // - // Loop on Tracks - for (auto kCurrentTrack : kTracks) { - // - // Track Selection - if (!kCurrentTrack.isGlobalTrack()) - continue; - uHistograms.fill(HIST("QA/Track/Momentum"), kCurrentTrack.dcaZ()); - uHistograms.fill(HIST("QA/Track/TMomentum"), kCurrentTrack.pt()); - // - // PID Selection - // --- PID QA Kaons - uHistograms.fill(HIST("QA/Kaon/TOF_Nsigma"), kCurrentTrack.pt(), - kCurrentTrack.tofNSigmaKa()); - uHistograms.fill(HIST("QA/Kaon/TPC_Nsigma"), kCurrentTrack.pt(), - kCurrentTrack.tpcNSigmaKa()); - uHistograms.fill(HIST("QA/Kaon/TOF_TPC_Map"), kCurrentTrack.tofNSigmaKa(), - kCurrentTrack.tpcNSigmaKa()); - // --- PID QA Pions - uHistograms.fill(HIST("QA/Pion/TOF_Nsigma"), kCurrentTrack.pt(), - kCurrentTrack.tofNSigmaPi()); - uHistograms.fill(HIST("QA/Pion/TPC_Nsigma"), kCurrentTrack.pt(), - kCurrentTrack.tpcNSigmaPi()); - uHistograms.fill(HIST("QA/Pion/TOF_TPC_Map"), kCurrentTrack.tofNSigmaPi(), - kCurrentTrack.tpcNSigmaPi()); - // - if (uIsKaonSelected(kCurrentTrack)) { - if (kCurrentTrack.sign() > 0) - kPosSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); - else - kNegSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); - } - // - if (uIsPionSelected(kCurrentTrack)) { - if (kCurrentTrack.sign() > 0) - kPosSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); - else - kNegSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); - } - } - // - // Invariant Mass for Phi - TLorentzVector kPositiveDecayDaughter; - TLorentzVector kNegativeDecayDaughter; - TLorentzVector kResonanceCandidate; - for (auto kPosKaon : kPosSelectedKaons) { - for (auto kNegKaon : kNegSelectedKaons) { - // - kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), - get<2>(kPosKaon), .493677); - kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), - get<2>(kNegKaon), .493677); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if (kResonanceCandidate.Mag() < 0.90 || - kResonanceCandidate.Mag() > 1.10) - continue; - if (fabs(kResonanceCandidate.Rapidity()) > 0.5) - continue; - // - uHistograms.fill(HIST("Analysis/Phi/FullInvariantMass"), - kResonanceCandidate.Mag()); - } - } - // Invariant Mass for K* - for (auto kPosKaon : kPosSelectedKaons) { - for (auto kNegKaon : kNegSelectedPions) { - // - kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), - get<2>(kPosKaon), .493677); - kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), - get<2>(kNegKaon), .139570); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if (kResonanceCandidate.Mag() < 0.84 || - kResonanceCandidate.Mag() > 0.95) - continue; - if (fabs(kResonanceCandidate.Rapidity()) > 0.5) - continue; - // - uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), - kResonanceCandidate.Mag()); - } - } - for (auto kPosKaon : kPosSelectedPions) { - for (auto kNegKaon : kNegSelectedKaons) { - // - kPositiveDecayDaughter.SetXYZM(get<0>(kPosKaon), get<1>(kPosKaon), - get<2>(kPosKaon), .139570); - kNegativeDecayDaughter.SetXYZM(get<0>(kNegKaon), get<1>(kNegKaon), - get<2>(kNegKaon), .493677); - kResonanceCandidate = kPositiveDecayDaughter + kNegativeDecayDaughter; - // - if (kResonanceCandidate.Mag() < 0.84 || - kResonanceCandidate.Mag() > 0.95) - continue; - if (fabs(kResonanceCandidate.Rapidity()) > 0.5) - continue; - // - uHistograms.fill(HIST("Analysis/Kstar/FullInvariantMass"), - kResonanceCandidate.Mag()); - } - } - } - // - bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { - // - // Utility variables - Bool_t kHasTPC = kCurrentTrack.hasTPC(); - Double_t kTPCSigma = kCurrentTrack.tpcNSigmaKa(); - Bool_t kHasTOF = kCurrentTrack.hasTOF(); - Double_t kTOFSigma = kCurrentTrack.tofNSigmaKa(); - Double_t kTMomentum = kCurrentTrack.pt(); - // - // Selection - if (!kHasTPC || fabs(kTPCSigma) > kKaonsTPCveto) - return false; - if (!kHasTOF && fabs(kTPCSigma) > kKaonsTPCstda) - return false; - if (kHasTOF && fabs(kTOFSigma) > kKaonsTOFveto) - return false; - // - uHistograms.fill(HIST("QA/Kaon/Selected/TOF_Nsigma"), kTMomentum, - kTOFSigma); - uHistograms.fill(HIST("QA/Kaon/Selected/TPC_Nsigma"), kTMomentum, - kTPCSigma); - uHistograms.fill(HIST("QA/Kaon/Selected/TOF_TPC_Map"), kTOFSigma, - kTPCSigma); - return true; - } - // - bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { - // - // Utility variables - Bool_t kHasTPC = kCurrentTrack.hasTPC(); - Double_t kTPCSigma = kCurrentTrack.tpcNSigmaPi(); - Bool_t kHasTOF = kCurrentTrack.hasTOF(); - Double_t kTOFSigma = kCurrentTrack.tofNSigmaPi(); - Double_t kTMomentum = kCurrentTrack.pt(); - // - // Selection - if (!kHasTPC || fabs(kTPCSigma) > kPionsTPCveto) - return false; - if (!kHasTOF && fabs(kTPCSigma) > kPionsTPCstda) - return false; - if (kHasTOF && fabs(kTOFSigma) > kPionsTOFveto) - return false; - // - uHistograms.fill(HIST("QA/Pion/Selected/TOF_Nsigma"), kTMomentum, - kTOFSigma); - uHistograms.fill(HIST("QA/Pion/Selected/TPC_Nsigma"), kTMomentum, - kTPCSigma); - uHistograms.fill(HIST("QA/Pion/Selected/TOF_TPC_Map"), kTOFSigma, - kTPCSigma); - return true; - } - // - bool uIsTrackSelected() { return true; } -}; - -WorkflowSpec defineDataProcessing( - ConfigContext const &cfgc) // This puts your task in the DPL workflow -{ - // Equivalent to the AddTask in AliPhysics - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; - return workflow; -} From 374df2c94ee3a6eef183ec53728de43f1b7d0a11 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 07:51:28 +0200 Subject: [PATCH 08/16] Error fix --- PWGLF/Tasks/CMakeLists.txt | 2 +- PWGLF/Tasks/rsnanalysis.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index b093bef8554..1654d19d8f6 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -94,7 +94,7 @@ o2physics_add_dpl_workflow(track-checks PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(rsn_analysis +o2physics_add_dpl_workflow(rsnanalysis SOURCES rsnanalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index bff2a20ff41..8851b5b1deb 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". From 5dbdb003dbb84ddba2857fca739393eb498fae10 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 08:04:41 +0200 Subject: [PATCH 09/16] Test for fix PR --- PWGLF/Tasks/CMakeLists.txt | 14 ++-- PWGLF/Tasks/rsnanalysis.cxx | 3 + PWGLF/Tasks/spectraTOFtiny.cxx | 122 +++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 PWGLF/Tasks/spectraTOFtiny.cxx diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 1654d19d8f6..262f43eab1e 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -9,11 +9,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(nuclei-batask - SOURCES LFNucleiBATask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(mc-spectra-efficiency SOURCES mcspectraefficiency.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore @@ -24,6 +19,11 @@ o2physics_add_dpl_workflow(spectra-tof PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(spectra-tof-tiny + SOURCES spectraTOFtiny.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(spectra-tpc SOURCES spectraTPC.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore @@ -97,6 +97,4 @@ o2physics_add_dpl_workflow(track-checks o2physics_add_dpl_workflow(rsnanalysis SOURCES rsnanalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase - COMPONENT_NAME Analysis) - - + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 8851b5b1deb..01205eb2ad7 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -1,3 +1,6 @@ +//\`\`\` +// $COPYRIGHT +// \`\`\` // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright // holders. All rights not expressly granted are reserved. diff --git a/PWGLF/Tasks/spectraTOFtiny.cxx b/PWGLF/Tasks/spectraTOFtiny.cxx new file mode 100644 index 00000000000..91d215dd9f4 --- /dev/null +++ b/PWGLF/Tasks/spectraTOFtiny.cxx @@ -0,0 +1,122 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// +/// \file spectraTOFtiny.h +/// \author Nicolo' Jacazio +/// +/// \brief Task for the analysis of the spectra with the TOF detector using the tiny tables +/// + +// O2 includes +#include "ReconstructionDataFormats/Track.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// Spectra task +struct tofSpectraTiny { + static constexpr int Np = 9; + static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"}; + static constexpr std::string_view hp[Np] = {"p/El", "p/Mu", "p/Pi", "p/Ka", "p/Pr", "p/De", "p/Tr", "p/He", "p/Al"}; + static constexpr std::string_view hpt[Np] = {"pt/El", "pt/Mu", "pt/Pi", "pt/Ka", "pt/Pr", "pt/De", "pt/Tr", "pt/He", "pt/Al"}; + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(o2::framework::InitContext&) + { + const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"}; + histos.add("event/vertexz", "", HistType::kTH1F, {vtxZAxis}); + auto h = histos.add("evsel", "evsel", HistType::kTH1F, {{10, 0.5, 10.5}}); + h->GetXaxis()->SetBinLabel(1, "Events read"); + h->GetXaxis()->SetBinLabel(2, "posZ passed"); + h = histos.add("tracksel", "tracksel", HistType::kTH1F, {{10, 0.5, 10.5}}); + h->GetXaxis()->SetBinLabel(1, "Tracks read"); + h->GetXaxis()->SetBinLabel(2, "Eta passed"); + h->GetXaxis()->SetBinLabel(3, "Quality passed"); + h->GetXaxis()->SetBinLabel(4, "TOF passed"); + histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}}); + histos.add("pt/Unselected", "Unselected;#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}}); + for (int i = 0; i < Np; i++) { + histos.add(hp[i].data(), Form("%s;#it{p} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}}); + histos.add(hpt[i].data(), Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}}); + } + } + + template + void fillParticleHistos(const T& track, const float& nsigma) + { + if (abs(nsigma) > cfgNSigmaCut) { + return; + } + histos.fill(HIST(hp[i]), track.p()); + histos.fill(HIST(hpt[i]), track.pt()); + } + + //Defining filters and input + Configurable cfgNSigmaCut{"cfgNSigmaCut", 3, "Value of the Nsigma cut"}; + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; + using TrackCandidates = soa::Join; + void process(aod::Collision const& collision, + TrackCandidates const& tracks) + { + histos.fill(HIST("evsel"), 1); + if (abs(collision.posZ()) > cfgCutVertex) { + return; + } + histos.fill(HIST("evsel"), 2); + histos.fill(HIST("event/vertexz"), collision.posZ()); + + for (const auto& track : tracks) { + histos.fill(HIST("tracksel"), 1); + if (abs(track.eta()) > cfgCutEta) { + continue; + } + histos.fill(HIST("tracksel"), 2); + if (!track.isGlobalTrack()) { + continue; + } + histos.fill(HIST("tracksel"), 3); + if (!track.hasTOF()) { + continue; + } + histos.fill(HIST("tracksel"), 4); + + histos.fill(HIST("p/Unselected"), track.p()); + histos.fill(HIST("pt/Unselected"), track.pt()); + + fillParticleHistos<0>(track, track.tofNSigmaEl()); + fillParticleHistos<1>(track, track.tofNSigmaMu()); + fillParticleHistos<2>(track, track.tofNSigmaPi()); + fillParticleHistos<3>(track, track.tofNSigmaKa()); + fillParticleHistos<4>(track, track.tofNSigmaPr()); + fillParticleHistos<5>(track, track.tofNSigmaDe()); + fillParticleHistos<6>(track, track.tofNSigmaTr()); + fillParticleHistos<7>(track, track.tofNSigmaHe()); + fillParticleHistos<8>(track, track.tofNSigmaAl()); + } + } // end of the process function +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 7e02b560cdea9d28d17bb6203357fb437f4c048f Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 08:08:38 +0200 Subject: [PATCH 10/16] Test for fix --- PWGLF/Tasks/rsnanalysis.cxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 01205eb2ad7..13e9e8c5d08 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -1,6 +1,3 @@ -//\`\`\` -// $COPYRIGHT -// \`\`\` // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright // holders. All rights not expressly granted are reserved. @@ -12,13 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// /// \file rsn_analysis.cxx -/// /// \brief Analysis task for the measurement of resonances -/// /// \author Nicola Rubini -/// // O2 includes #include "Common/DataModel/EventSelection.h" From dd7be379304b825c06214aea09fd58f48100c65b Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 08:11:39 +0200 Subject: [PATCH 11/16] Test for fix --- PWGLF/Tasks/rsnanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 13e9e8c5d08..5038a4c1657 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". From c6a27a94783eb1b939dd7d54c63e4157338e1ce3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 8 Jul 2022 06:12:07 +0000 Subject: [PATCH 12/16] Please consider the following formatting changes --- PWGLF/Tasks/rsnanalysis.cxx | 38 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 5038a4c1657..0534671f66d 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -25,20 +25,25 @@ using namespace std; using namespace o2; using namespace o2::framework; -enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; +enum EventSelection { kNoSelection = 0, + kTVXselection = 1, + kVertexCut = 2 }; using kCollisionsTable = soa::Join; using kTracksTable = - soa::Join; + soa::Join; struct rsn_analysis { HistogramRegistry uHistograms{ - "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; + "Histograms", + {}, + OutputObjHandlingPolicy::AnalysisObject}; // // Create Output Objects - void init(o2::framework::InitContext &) { + void init(o2::framework::InitContext&) + { // Histogram is added to the ouput registry // // Event QA @@ -158,8 +163,9 @@ struct rsn_analysis { "TPC NSigma for Pions Standalone"}; // // Processing A02D - void process(kCollisionsTable::iterator const &kCollision, - kTracksTable const &kTracks) { + void process(kCollisionsTable::iterator const& kCollision, + kTracksTable const& kTracks) + { // // Collision QA uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); @@ -212,19 +218,19 @@ struct rsn_analysis { if (uIsKaonSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } // if (uIsPionSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } } // @@ -292,7 +298,8 @@ struct rsn_analysis { } } // - bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { + bool uIsKaonSelected(kTracksTable::iterator const& kCurrentTrack) + { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -318,7 +325,8 @@ struct rsn_analysis { return true; } // - bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { + bool uIsPionSelected(kTracksTable::iterator const& kCurrentTrack) + { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -348,7 +356,7 @@ struct rsn_analysis { }; WorkflowSpec defineDataProcessing( - ConfigContext const &cfgc) // This puts your task in the DPL workflow + ConfigContext const& cfgc) // This puts your task in the DPL workflow { // Equivalent to the AddTask in AliPhysics WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; From 32281b25d173e3fb94e93e6529990dc018d292b8 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 10:14:27 +0200 Subject: [PATCH 13/16] PR fix --- PWGLF/Tasks/CMakeLists.txt | 5 -- PWGLF/Tasks/rsnanalysis.cxx | 38 ++++------ PWGLF/Tasks/spectraTOFtiny.cxx | 122 --------------------------------- 3 files changed, 15 insertions(+), 150 deletions(-) delete mode 100644 PWGLF/Tasks/spectraTOFtiny.cxx diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 262f43eab1e..6609b5267ff 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -19,11 +19,6 @@ o2physics_add_dpl_workflow(spectra-tof PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(spectra-tof-tiny - SOURCES spectraTOFtiny.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(spectra-tpc SOURCES spectraTPC.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 0534671f66d..5038a4c1657 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -25,25 +25,20 @@ using namespace std; using namespace o2; using namespace o2::framework; -enum EventSelection { kNoSelection = 0, - kTVXselection = 1, - kVertexCut = 2 }; +enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; using kCollisionsTable = soa::Join; using kTracksTable = - soa::Join; + soa::Join; struct rsn_analysis { HistogramRegistry uHistograms{ - "Histograms", - {}, - OutputObjHandlingPolicy::AnalysisObject}; + "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; // // Create Output Objects - void init(o2::framework::InitContext&) - { + void init(o2::framework::InitContext &) { // Histogram is added to the ouput registry // // Event QA @@ -163,9 +158,8 @@ struct rsn_analysis { "TPC NSigma for Pions Standalone"}; // // Processing A02D - void process(kCollisionsTable::iterator const& kCollision, - kTracksTable const& kTracks) - { + void process(kCollisionsTable::iterator const &kCollision, + kTracksTable const &kTracks) { // // Collision QA uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); @@ -218,19 +212,19 @@ struct rsn_analysis { if (uIsKaonSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } // if (uIsPionSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } } // @@ -298,8 +292,7 @@ struct rsn_analysis { } } // - bool uIsKaonSelected(kTracksTable::iterator const& kCurrentTrack) - { + bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -325,8 +318,7 @@ struct rsn_analysis { return true; } // - bool uIsPionSelected(kTracksTable::iterator const& kCurrentTrack) - { + bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -356,7 +348,7 @@ struct rsn_analysis { }; WorkflowSpec defineDataProcessing( - ConfigContext const& cfgc) // This puts your task in the DPL workflow + ConfigContext const &cfgc) // This puts your task in the DPL workflow { // Equivalent to the AddTask in AliPhysics WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; diff --git a/PWGLF/Tasks/spectraTOFtiny.cxx b/PWGLF/Tasks/spectraTOFtiny.cxx deleted file mode 100644 index 91d215dd9f4..00000000000 --- a/PWGLF/Tasks/spectraTOFtiny.cxx +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file spectraTOFtiny.h -/// \author Nicolo' Jacazio -/// -/// \brief Task for the analysis of the spectra with the TOF detector using the tiny tables -/// - -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -// Spectra task -struct tofSpectraTiny { - static constexpr int Np = 9; - static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"}; - static constexpr std::string_view hp[Np] = {"p/El", "p/Mu", "p/Pi", "p/Ka", "p/Pr", "p/De", "p/Tr", "p/He", "p/Al"}; - static constexpr std::string_view hpt[Np] = {"pt/El", "pt/Mu", "pt/Pi", "pt/Ka", "pt/Pr", "pt/De", "pt/Tr", "pt/He", "pt/Al"}; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - void init(o2::framework::InitContext&) - { - const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"}; - histos.add("event/vertexz", "", HistType::kTH1F, {vtxZAxis}); - auto h = histos.add("evsel", "evsel", HistType::kTH1F, {{10, 0.5, 10.5}}); - h->GetXaxis()->SetBinLabel(1, "Events read"); - h->GetXaxis()->SetBinLabel(2, "posZ passed"); - h = histos.add("tracksel", "tracksel", HistType::kTH1F, {{10, 0.5, 10.5}}); - h->GetXaxis()->SetBinLabel(1, "Tracks read"); - h->GetXaxis()->SetBinLabel(2, "Eta passed"); - h->GetXaxis()->SetBinLabel(3, "Quality passed"); - h->GetXaxis()->SetBinLabel(4, "TOF passed"); - histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {{100, 0, 20}}); - histos.add("pt/Unselected", "Unselected;#it{p}_{T} (GeV/#it{c})", kTH1F, {{100, 0, 20}}); - for (int i = 0; i < Np; i++) { - histos.add(hp[i].data(), Form("%s;#it{p} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}}); - histos.add(hpt[i].data(), Form("%s;#it{p}_{T} (GeV/#it{c})", pT[i]), kTH1F, {{100, 0, 20}}); - } - } - - template - void fillParticleHistos(const T& track, const float& nsigma) - { - if (abs(nsigma) > cfgNSigmaCut) { - return; - } - histos.fill(HIST(hp[i]), track.p()); - histos.fill(HIST(hpt[i]), track.pt()); - } - - //Defining filters and input - Configurable cfgNSigmaCut{"cfgNSigmaCut", 3, "Value of the Nsigma cut"}; - Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; - Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; - using TrackCandidates = soa::Join; - void process(aod::Collision const& collision, - TrackCandidates const& tracks) - { - histos.fill(HIST("evsel"), 1); - if (abs(collision.posZ()) > cfgCutVertex) { - return; - } - histos.fill(HIST("evsel"), 2); - histos.fill(HIST("event/vertexz"), collision.posZ()); - - for (const auto& track : tracks) { - histos.fill(HIST("tracksel"), 1); - if (abs(track.eta()) > cfgCutEta) { - continue; - } - histos.fill(HIST("tracksel"), 2); - if (!track.isGlobalTrack()) { - continue; - } - histos.fill(HIST("tracksel"), 3); - if (!track.hasTOF()) { - continue; - } - histos.fill(HIST("tracksel"), 4); - - histos.fill(HIST("p/Unselected"), track.p()); - histos.fill(HIST("pt/Unselected"), track.pt()); - - fillParticleHistos<0>(track, track.tofNSigmaEl()); - fillParticleHistos<1>(track, track.tofNSigmaMu()); - fillParticleHistos<2>(track, track.tofNSigmaPi()); - fillParticleHistos<3>(track, track.tofNSigmaKa()); - fillParticleHistos<4>(track, track.tofNSigmaPr()); - fillParticleHistos<5>(track, track.tofNSigmaDe()); - fillParticleHistos<6>(track, track.tofNSigmaTr()); - fillParticleHistos<7>(track, track.tofNSigmaHe()); - fillParticleHistos<8>(track, track.tofNSigmaAl()); - } - } // end of the process function -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} From 9be542f3e8beb84a72585d75cda08f93fa88a7b8 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 10:15:27 +0200 Subject: [PATCH 14/16] PR fix --- PWGLF/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 6609b5267ff..0e6624680bf 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -9,6 +9,11 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +o2physics_add_dpl_workflow(nuclei-batask + SOURCES LFNucleiBATask.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(mc-spectra-efficiency SOURCES mcspectraefficiency.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore From 9b8a50f940afa32b84fb6181a7f00ba69d5c3099 Mon Sep 17 00:00:00 2001 From: Nicola Rubini Date: Fri, 8 Jul 2022 10:16:11 +0200 Subject: [PATCH 15/16] PR fix --- PWGLF/Tasks/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 0e6624680bf..19856979a23 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -10,9 +10,9 @@ # or submit itself to any jurisdiction. o2physics_add_dpl_workflow(nuclei-batask - SOURCES LFNucleiBATask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES LFNucleiBATask.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mc-spectra-efficiency SOURCES mcspectraefficiency.cxx From 712e8c8a3eb84ec55b87878ea47eed4fd091284e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 8 Jul 2022 08:16:38 +0000 Subject: [PATCH 16/16] Please consider the following formatting changes --- PWGLF/Tasks/rsnanalysis.cxx | 38 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/rsnanalysis.cxx b/PWGLF/Tasks/rsnanalysis.cxx index 5038a4c1657..0534671f66d 100644 --- a/PWGLF/Tasks/rsnanalysis.cxx +++ b/PWGLF/Tasks/rsnanalysis.cxx @@ -25,20 +25,25 @@ using namespace std; using namespace o2; using namespace o2::framework; -enum EventSelection { kNoSelection = 0, kTVXselection = 1, kVertexCut = 2 }; +enum EventSelection { kNoSelection = 0, + kTVXselection = 1, + kVertexCut = 2 }; using kCollisionsTable = soa::Join; using kTracksTable = - soa::Join; + soa::Join; struct rsn_analysis { HistogramRegistry uHistograms{ - "Histograms", {}, OutputObjHandlingPolicy::AnalysisObject}; + "Histograms", + {}, + OutputObjHandlingPolicy::AnalysisObject}; // // Create Output Objects - void init(o2::framework::InitContext &) { + void init(o2::framework::InitContext&) + { // Histogram is added to the ouput registry // // Event QA @@ -158,8 +163,9 @@ struct rsn_analysis { "TPC NSigma for Pions Standalone"}; // // Processing A02D - void process(kCollisionsTable::iterator const &kCollision, - kTracksTable const &kTracks) { + void process(kCollisionsTable::iterator const& kCollision, + kTracksTable const& kTracks) + { // // Collision QA uHistograms.fill(HIST("QA/Event/EnumEvents"), EventSelection::kNoSelection); @@ -212,19 +218,19 @@ struct rsn_analysis { if (uIsKaonSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedKaons.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } // if (uIsPionSelected(kCurrentTrack)) { if (kCurrentTrack.sign() > 0) kPosSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); else kNegSelectedPions.push_back(std::tuple( - kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); + kCurrentTrack.px(), kCurrentTrack.py(), kCurrentTrack.pz())); } } // @@ -292,7 +298,8 @@ struct rsn_analysis { } } // - bool uIsKaonSelected(kTracksTable::iterator const &kCurrentTrack) { + bool uIsKaonSelected(kTracksTable::iterator const& kCurrentTrack) + { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -318,7 +325,8 @@ struct rsn_analysis { return true; } // - bool uIsPionSelected(kTracksTable::iterator const &kCurrentTrack) { + bool uIsPionSelected(kTracksTable::iterator const& kCurrentTrack) + { // // Utility variables Bool_t kHasTPC = kCurrentTrack.hasTPC(); @@ -348,7 +356,7 @@ struct rsn_analysis { }; WorkflowSpec defineDataProcessing( - ConfigContext const &cfgc) // This puts your task in the DPL workflow + ConfigContext const& cfgc) // This puts your task in the DPL workflow { // Equivalent to the AddTask in AliPhysics WorkflowSpec workflow{adaptAnalysisTask(cfgc)};