From 6e3df8c4864f00c294a9b6c2aa1d0a01f628e45a Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 11 Mar 2024 08:18:30 -0600 Subject: [PATCH 01/16] PWGUD: Analysis in photonuclear events --- PWGUD/Tasks/CMakeLists.txt | 5 + PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 224 ++++++++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 PWGUD/Tasks/upcPhotonuclearAnalysis.cxx diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index edf72cb8984..c7d5785d1e2 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -71,4 +71,9 @@ o2physics_add_dpl_workflow(upc-tau-rl o2physics_add_dpl_workflow(polarisation-rho SOURCES PolarisationRho.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGPIDSelector + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(upc-photonuclear + SOURCES upcPhotonuclearAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx new file mode 100644 index 00000000000..abcc62a4887 --- /dev/null +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -0,0 +1,224 @@ +// 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. +/// +/// \brief This task is an empty skeleton that fills a simple eta histogram. +/// it is meant to be a blank page for further developments. +/// \author Josué Martínez García, josuem@cern.ch + +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct upcPhotonuclearAnalysis { + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Declare configurables + Configurable cutMyptMin{"cutMyptMin", 0.1f, {"My Track cut"}}; + Configurable cutMyptMax{"cutMyptMax", 1e10f, {"My Track cut"}}; + Configurable cutMyetaMin{"cutMyetaMin", -1.0, {"My Track cut"}}; + Configurable cutMyetaMax{"cutMyetaMax", 1.0, {"My Track cut"}}; + Configurable cutMydcaZmax{"cutMydcaZmax", 2.f, {"My Track cut"}}; + Configurable cutMydcaXYmax{"cutMydcaXYmax", 1e0f, {"My Track cut"}}; + Configurable cutMydcaXYusePt{"cutMydcaXYusePt", false, {"My Track cut"}}; + + using FullSGUDCollision = soa::Join::iterator; + using FullUDTracks = soa::Join; + + void init(InitContext const&) + { + const AxisSpec axisCollision{4, 0.5, 3.5}; + const AxisSpec axisZvtx{40, -20., 20.}; + const AxisSpec axisPt{402, -0.05, 20.05}; + const AxisSpec axisPhi{64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}; + const AxisSpec axisEta{50, -1.2, 1.2}; + const AxisSpec axisNch{101, -0.5, 100.5}; + const AxisSpec axisZNEnergy{1000, -100, 150000}; + const AxisSpec axisZNTime{200, -100, 100}; + + histos.add("Events/hCountCollisions", "0 total - 1 side A - 2 side C - 3 both side; Number of analysed collision; counts", kTH1F, {axisCollision}); + + // histos to selection gap in side A + histos.add("Tracks/SGsideA/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); + histos.add("Tracks/SGsideA/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); + histos.add("Tracks/SGsideA/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); + histos.add("Tracks/SGsideA/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + + histos.add("Events/SGsideA/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); + histos.add("Events/SGsideA/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{ #LT p_{T} #GT }; #it{p_{T}}", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideA/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideA/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideA/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); + histos.add("Events/SGsideA/hTimeZNA", "Time in side A distribution; Time in side A; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideA/hTimeZNC", "Time in side C distribution; Time in side C; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideA/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); + + // histos to selection gap in side A + histos.add("Tracks/SGsideC/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); + histos.add("Tracks/SGsideC/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); + histos.add("Tracks/SGsideC/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); + histos.add("Tracks/SGsideC/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + + histos.add("Events/SGsideC/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); + histos.add("Events/SGsideC/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{ #LT p_{T} #GT }; #it{p_{T}}", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideC/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideC/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideC/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); + histos.add("Events/SGsideC/hTimeZNA", "Time in side A distribution; Time in side A; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideC/hTimeZNC", "Time in side C distribution; Time in side C; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideC/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); + + // histos to selection gap in side A + histos.add("Tracks/SGsideBoth/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); + histos.add("Tracks/SGsideBoth/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); + histos.add("Tracks/SGsideBoth/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); + histos.add("Tracks/SGsideBoth/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + + histos.add("Events/SGsideBoth/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); + histos.add("Events/SGsideBoth/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{ #LT p_{T} #GT }; #it{N_{ch}}; #it{ #LTp_{T}#GT }", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideBoth/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideBoth/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); + histos.add("Events/SGsideBoth/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); + histos.add("Events/SGsideBoth/hTimeZNA", "Time in side A distribution; Time in side A; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideBoth/hTimeZNC", "Time in side C distribution; Time in side C; counts", kTH1F, {axisZNTime}); + histos.add("Events/SGsideBoth/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); + } + + template + bool isTrackCut(T const& track) + { + if (track.pt() < cutMyptMin || track.pt() > cutMyptMax) { + return false; + } + if (eta(track.px(), track.py(), track.pz()) < cutMyetaMin || eta(track.px(), track.py(), track.pz()) > cutMyetaMax) { + return false; + } + if (std::abs(track.dcaZ()) > cutMydcaZmax) { + return false; + } + if (cutMydcaXYusePt) { + float maxDCA = 0.0105f + 0.0350f / std::pow(track.pt(), 1.1f); + if (std::abs(track.dcaXY()) > maxDCA) { + return false; + } + } else { + if (std::abs(track.dcaXY()) > cutMydcaXYmax) { + return false; + } + } + return true; + } + + void processSG(FullSGUDCollision const& reconstructedCollision, FullUDTracks const& reconstructedTracks) + { + histos.fill(HIST("Events/hCountCollisions"), 0); + int SGside = reconstructedCollision.gapSide(); + int nTracksCharged = 0; + float sumPt = 0; + + switch (SGside) { + case 0: // for side A + histos.fill(HIST("Events/hCountCollisions"), 1); + histos.fill(HIST("Events/SGsideA/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); + histos.fill(HIST("Events/SGsideA/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideA/hEnergyRelationSides"), reconstructedCollision.energyCommonZNA(), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideA/hTimeZNA"), reconstructedCollision.timeZNA()); + histos.fill(HIST("Events/SGsideA/hTimeZNC"), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideA/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + for (auto& track : reconstructedTracks) { + if (track.sign() == 1 || track.sign() == -1) { + if (isTrackCut(track) == false) { + continue; + } + nTracksCharged++; + sumPt += track.pt(); + histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); + histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + } + } + histos.fill(HIST("Events/SGsideA/hNch"), nTracksCharged); + histos.fill(HIST("Events/SGsideA/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + break; + case 1: // for side C + histos.fill(HIST("Events/hCountCollisions"), 2); + histos.fill(HIST("Events/SGsideC/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); + histos.fill(HIST("Events/SGsideC/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideC/hEnergyRelationSides"), reconstructedCollision.energyCommonZNA(), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideC/hTimeZNA"), reconstructedCollision.timeZNA()); + histos.fill(HIST("Events/SGsideC/hTimeZNC"), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideC/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + for (auto& track : reconstructedTracks) { + if (track.sign() == 1 || track.sign() == -1) { + if (isTrackCut(track) == false) { + continue; + } + nTracksCharged++; + sumPt += track.pt(); + histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); + histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + } + } + histos.fill(HIST("Events/SGsideC/hNch"), nTracksCharged); + histos.fill(HIST("Events/SGsideC/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + break; + case 2: // for both sides + histos.fill(HIST("Events/hCountCollisions"), 3); + histos.fill(HIST("Events/SGsideBoth/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); + histos.fill(HIST("Events/SGsideBoth/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideBoth/hEnergyRelationSides"), reconstructedCollision.energyCommonZNA(), reconstructedCollision.energyCommonZNC()); + histos.fill(HIST("Events/SGsideBoth/hTimeZNA"), reconstructedCollision.timeZNA()); + histos.fill(HIST("Events/SGsideBoth/hTimeZNC"), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideBoth/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + for (auto& track : reconstructedTracks) { + if (track.sign() == 1 || track.sign() == -1) { + if (isTrackCut(track) == false) { + continue; + } + nTracksCharged++; + sumPt += track.pt(); + histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); + histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + } + } + histos.fill(HIST("Events/SGsideBoth/hNch"), nTracksCharged); + histos.fill(HIST("Events/SGsideBoth/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + break; + default: + return; + break; + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"upcphotonuclear"})}; +} \ No newline at end of file From 08afae759fae7e71ff1b8efef56bf7143a8d0d7a Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 11 Mar 2024 09:55:40 -0600 Subject: [PATCH 02/16] formatting issues --- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index abcc62a4887..a66997c9da0 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.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". @@ -9,8 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief This task is an empty skeleton that fills a simple eta histogram. -/// it is meant to be a blank page for further developments. +/// \brief /// \author Josué Martínez García, josuem@cern.ch #include "Framework/AnalysisDataModel.h" @@ -221,4 +220,4 @@ struct upcPhotonuclearAnalysis { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"upcphotonuclear"})}; -} \ No newline at end of file +} From 7d4e9be761ff3e4b4536a0008bcf176d02cdd3e6 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 11 Mar 2024 10:59:07 -0600 Subject: [PATCH 03/16] update with process switch --- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index a66997c9da0..b6ce8d3a59e 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -215,6 +215,7 @@ struct upcPhotonuclearAnalysis { break; } } + PROCESS_SWITCH(upcPhotonuclearAnalysis, processSG, "Process in UD tables", true) }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From a5f22f0069a0029cb6b3e8ae6dcf1e81fc3a6d81 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 11 Mar 2024 23:17:45 -0600 Subject: [PATCH 04/16] ; --- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index b6ce8d3a59e..94add1bf3de 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -215,7 +215,7 @@ struct upcPhotonuclearAnalysis { break; } } - PROCESS_SWITCH(upcPhotonuclearAnalysis, processSG, "Process in UD tables", true) + PROCESS_SWITCH(upcPhotonuclearAnalysis, processSG, "Process in UD tables", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 447618fc1884a277d36ffaa6f5842b9dd64fbdee Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 12 Mar 2024 04:49:37 -0600 Subject: [PATCH 05/16] Update --- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 55 ++++++++++++++----------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index 94add1bf3de..21d0d221600 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -35,38 +35,40 @@ struct upcPhotonuclearAnalysis { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Declare configurables - Configurable cutMyptMin{"cutMyptMin", 0.1f, {"My Track cut"}}; - Configurable cutMyptMax{"cutMyptMax", 1e10f, {"My Track cut"}}; + Configurable cutMyPosZMin{"cutMyPosZMin", -20., {"My collision cut"}}; + Configurable cutMyPosZMax{"cutMyPosZMax", 20., {"My collision cut"}}; + Configurable cutMyptMin{"cutMyptMin", 0.15, {"My Track cut"}}; + Configurable cutMyptMax{"cutMyptMax", 10., {"My Track cut"}}; Configurable cutMyetaMin{"cutMyetaMin", -1.0, {"My Track cut"}}; Configurable cutMyetaMax{"cutMyetaMax", 1.0, {"My Track cut"}}; Configurable cutMydcaZmax{"cutMydcaZmax", 2.f, {"My Track cut"}}; Configurable cutMydcaXYmax{"cutMydcaXYmax", 1e0f, {"My Track cut"}}; Configurable cutMydcaXYusePt{"cutMydcaXYusePt", false, {"My Track cut"}}; - using FullSGUDCollision = soa::Join::iterator; - using FullUDTracks = soa::Join; + using FullSGUDCollision = soa::Join::iterator; + using FullUDTracks = soa::Join; void init(InitContext const&) { - const AxisSpec axisCollision{4, 0.5, 3.5}; + const AxisSpec axisCollision{4, -0.5, 3.5}; const AxisSpec axisZvtx{40, -20., 20.}; const AxisSpec axisPt{402, -0.05, 20.05}; const AxisSpec axisPhi{64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}; const AxisSpec axisEta{50, -1.2, 1.2}; const AxisSpec axisNch{101, -0.5, 100.5}; - const AxisSpec axisZNEnergy{1000, -100, 150000}; - const AxisSpec axisZNTime{200, -100, 100}; + const AxisSpec axisZNEnergy{1000, 0, 1000}; + const AxisSpec axisZNTime{40, -20, 20}; histos.add("Events/hCountCollisions", "0 total - 1 side A - 2 side C - 3 both side; Number of analysed collision; counts", kTH1F, {axisCollision}); // histos to selection gap in side A - histos.add("Tracks/SGsideA/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Tracks/SGsideA/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideA/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideA/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Events/SGsideA/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideA/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); - histos.add("Events/SGsideA/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{ #LT p_{T} #GT }; #it{p_{T}}", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideA/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{N_{ch}}; #it{ #LT p_{T} #GT }", kTH2F, {axisNch, axisPt}); histos.add("Events/SGsideA/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideA/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideA/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); @@ -75,13 +77,13 @@ struct upcPhotonuclearAnalysis { histos.add("Events/SGsideA/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); // histos to selection gap in side A - histos.add("Tracks/SGsideC/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Tracks/SGsideC/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideC/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideC/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Events/SGsideC/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideC/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); - histos.add("Events/SGsideC/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{ #LT p_{T} #GT }; #it{p_{T}}", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideC/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{N_{ch}}; #it{ #LT p_{T} #GT }", kTH2F, {axisNch, axisPt}); histos.add("Events/SGsideC/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideC/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideC/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); @@ -90,13 +92,13 @@ struct upcPhotonuclearAnalysis { histos.add("Events/SGsideC/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); // histos to selection gap in side A - histos.add("Tracks/SGsideBoth/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Tracks/SGsideBoth/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideBoth/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideBoth/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Events/SGsideBoth/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideBoth/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); - histos.add("Events/SGsideBoth/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{ #LT p_{T} #GT }; #it{N_{ch}}; #it{ #LTp_{T}#GT }", kTH2F, {axisPt, axisNch}); + histos.add("Events/SGsideBoth/hPtVSNch", "#it{ #LT p_{T} #GT } vs #it{N_{ch}}; #it{N_{ch}}; #it{ #LT p_{T} #GT }", kTH2F, {axisNch, axisPt}); histos.add("Events/SGsideBoth/hEnergyZNA", "Energy in side A distribution; Energy in side A; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideBoth/hEnergyZNC", "Energy in side C distribution; Energy in side C; counts", kTH1F, {axisZNEnergy}); histos.add("Events/SGsideBoth/hEnergyRelationSides", "Energy in side A vs energy in side C; Energy in side A; Energy in side C", kTH2F, {axisZNEnergy, axisZNEnergy}); @@ -146,6 +148,7 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Events/SGsideA/hTimeZNA"), reconstructedCollision.timeZNA()); histos.fill(HIST("Events/SGsideA/hTimeZNC"), reconstructedCollision.timeZNC()); histos.fill(HIST("Events/SGsideA/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideA/hTrackZVtx"), reconstructedCollision.posZ()); for (auto& track : reconstructedTracks) { if (track.sign() == 1 || track.sign() == -1) { if (isTrackCut(track) == false) { @@ -153,14 +156,14 @@ struct upcPhotonuclearAnalysis { } nTracksCharged++; sumPt += track.pt(); - histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); - histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); - histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); - histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + histos.fill(HIST("Tracks/SGsideA/hTrackPt"), track.pt()); + histos.fill(HIST("Tracks/SGsideA/hTrackPhi"), phi(track.px(), track.py())); + histos.fill(HIST("Tracks/SGsideA/hTrackEta"), eta(track.px(), track.py(), track.pz())); } } histos.fill(HIST("Events/SGsideA/hNch"), nTracksCharged); - histos.fill(HIST("Events/SGsideA/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + histos.fill(HIST("Events/SGsideA/hPtVSNch"), nTracksCharged, (sumPt / nTracksCharged) ); + nTracksCharged = sumPt = 0; break; case 1: // for side C histos.fill(HIST("Events/hCountCollisions"), 2); @@ -170,6 +173,7 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Events/SGsideC/hTimeZNA"), reconstructedCollision.timeZNA()); histos.fill(HIST("Events/SGsideC/hTimeZNC"), reconstructedCollision.timeZNC()); histos.fill(HIST("Events/SGsideC/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideC/hTrackZVtx"), reconstructedCollision.posZ()); for (auto& track : reconstructedTracks) { if (track.sign() == 1 || track.sign() == -1) { if (isTrackCut(track) == false) { @@ -177,14 +181,14 @@ struct upcPhotonuclearAnalysis { } nTracksCharged++; sumPt += track.pt(); - histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); - histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); - histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); - histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + histos.fill(HIST("Tracks/SGsideC/hTrackPt"), track.pt()); + histos.fill(HIST("Tracks/SGsideC/hTrackPhi"), phi(track.px(), track.py())); + histos.fill(HIST("Tracks/SGsideC/hTrackEta"), eta(track.px(), track.py(), track.pz())); } } histos.fill(HIST("Events/SGsideC/hNch"), nTracksCharged); - histos.fill(HIST("Events/SGsideC/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + histos.fill(HIST("Events/SGsideC/hPtVSNch"), nTracksCharged, (sumPt / nTracksCharged)); + nTracksCharged = sumPt = 0; break; case 2: // for both sides histos.fill(HIST("Events/hCountCollisions"), 3); @@ -194,6 +198,7 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Events/SGsideBoth/hTimeZNA"), reconstructedCollision.timeZNA()); histos.fill(HIST("Events/SGsideBoth/hTimeZNC"), reconstructedCollision.timeZNC()); histos.fill(HIST("Events/SGsideBoth/hTimeRelationSides"), reconstructedCollision.timeZNA(), reconstructedCollision.timeZNC()); + histos.fill(HIST("Events/SGsideBoth/hTrackZVtx"), reconstructedCollision.posZ()); for (auto& track : reconstructedTracks) { if (track.sign() == 1 || track.sign() == -1) { if (isTrackCut(track) == false) { @@ -201,14 +206,14 @@ struct upcPhotonuclearAnalysis { } nTracksCharged++; sumPt += track.pt(); - histos.fill(HIST("Tracks/SGsideBoth/hTrackZVtx"), track.z()); histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); } } histos.fill(HIST("Events/SGsideBoth/hNch"), nTracksCharged); - histos.fill(HIST("Events/SGsideBoth/hPtVSNch"), sumPt / nTracksCharged, nTracksCharged); + histos.fill(HIST("Events/SGsideBoth/hPtVSNch"), nTracksCharged, (sumPt / nTracksCharged)); + nTracksCharged = sumPt = 0; break; default: return; From b2c43d41773fcb594a1bd193b1158ebff23aab80 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 12 Mar 2024 19:48:31 -0600 Subject: [PATCH 06/16] format issue --- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index 21d0d221600..5032fa539b2 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -162,7 +162,7 @@ struct upcPhotonuclearAnalysis { } } histos.fill(HIST("Events/SGsideA/hNch"), nTracksCharged); - histos.fill(HIST("Events/SGsideA/hPtVSNch"), nTracksCharged, (sumPt / nTracksCharged) ); + histos.fill(HIST("Events/SGsideA/hPtVSNch"), nTracksCharged, (sumPt / nTracksCharged)); nTracksCharged = sumPt = 0; break; case 1: // for side C From ab7e666289c22e2a8ebbc7eb835b56df8e8b8a7f Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Sun, 14 Apr 2024 15:07:52 -0600 Subject: [PATCH 07/16] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 5 +++-- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index edfb91ef6c3..77bf7fc68c1 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -65,7 +65,8 @@ struct lumiStabilityTask { bool checkAnyCoincidence(const std::vector& channels) { - std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {4, 7}}; + std::constexpr std::array, 4> channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; + //std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; for (const auto& pair : channelPairs) { if (std::find(channels.begin(), channels.end(), pair.first) != channels.end() && std::find(channels.begin(), channels.end(), pair.second) != channels.end()) { @@ -79,7 +80,7 @@ struct lumiStabilityTask { { for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); - if (bc.timestamp() == false) { + if (bc.timestamp() == 0) { continue; } diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index 5032fa539b2..eb8cdb17ed9 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -34,9 +34,10 @@ struct upcPhotonuclearAnalysis { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // Declare configurables + // Declare configurables on events/collisions Configurable cutMyPosZMin{"cutMyPosZMin", -20., {"My collision cut"}}; Configurable cutMyPosZMax{"cutMyPosZMax", 20., {"My collision cut"}}; + // Declare configurables on tracks Configurable cutMyptMin{"cutMyptMin", 0.15, {"My Track cut"}}; Configurable cutMyptMax{"cutMyptMax", 10., {"My Track cut"}}; Configurable cutMyetaMin{"cutMyetaMin", -1.0, {"My Track cut"}}; @@ -76,7 +77,7 @@ struct upcPhotonuclearAnalysis { histos.add("Events/SGsideA/hTimeZNC", "Time in side C distribution; Time in side C; counts", kTH1F, {axisZNTime}); histos.add("Events/SGsideA/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); - // histos to selection gap in side A + // histos to selection gap in side C histos.add("Tracks/SGsideC/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideC/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideC/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); @@ -91,7 +92,7 @@ struct upcPhotonuclearAnalysis { histos.add("Events/SGsideC/hTimeZNC", "Time in side C distribution; Time in side C; counts", kTH1F, {axisZNTime}); histos.add("Events/SGsideC/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); - // histos to selection gap in side A + // histos to selection gap in both sides histos.add("Tracks/SGsideBoth/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideBoth/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideBoth/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); @@ -107,6 +108,14 @@ struct upcPhotonuclearAnalysis { histos.add("Events/SGsideBoth/hTimeRelationSides", "Time in side A vs time in side C; Time in side A; Time in side C", kTH2F, {axisZNTime, axisZNTime}); } + template + bool isCollisionCut(C const& collision){ + if ( collision.posZ() < || < collision.posZ() ) { + return false; + } + if ( ) + } + template bool isTrackCut(T const& track) { From 880eec70954e19863304bd006bc8cdbb324cbfe9 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 16 Apr 2024 03:24:09 -0600 Subject: [PATCH 08/16] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 87 +++++++++------ PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 137 ++++++++++++++++++++++-- 2 files changed, 185 insertions(+), 39 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 77bf7fc68c1..6bbcef8b096 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -16,6 +16,7 @@ #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Framework/ASoAHelpers.h" #include "DataFormatsFDD/Digit.h" @@ -23,7 +24,10 @@ using namespace o2; using namespace o2::framework; +using namespace o2::aod::evsel; + using BCsWithTimestamps = soa::Join; +using BCsRun3 = soa::Join; int nBCsPerOrbit = 3564; @@ -33,39 +37,41 @@ struct lumiStabilityTask { void init(InitContext const&) { - const AxisSpec axisFDDTriggger{nBCsPerOrbit, -0.5f, nBCsPerOrbit - 0.5f}; - const AxisSpec axisFT0Triggger{nBCsPerOrbit, -0.5f, nBCsPerOrbit - 0.5f}; - const AxisSpec axisFV0Triggger{nBCsPerOrbit, -0.5f, nBCsPerOrbit - 0.5f}; + const AxisSpec axisTriggger{nBCsPerOrbit, -0.5f, nBCsPerOrbit - 0.5f}; // histo about triggers - histos.add("FDD/bcVertexTrigger", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcVertexTriggerCoincidence", "vertex trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcSCentralTrigger", "scentral trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcSCentralTriggerCoincidence", "scentral trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcVSCTrigger", "vertex and scentral trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcVSCTriggerCoincidence", "vertex and scentral trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcCentralTrigger", "central trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcCentralTriggerCoincidence", "central trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcVCTrigger", "vertex and central trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisFDDTriggger}); - histos.add("FDD/bcVCTriggerCoincidence", "vertex and central trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisFDDTriggger}); - - histos.add("FT0/bcVertexTrigger", "vertex trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - histos.add("FT0/bcSCentralTrigger", "Scentral trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - histos.add("FT0/bcVSCTrigger", "vertex and Scentral trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - histos.add("FT0/bcCentralTrigger", "central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - histos.add("FT0/bcVCTrigger", "vertex and central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - histos.add("FT0/bcSCentralCentralTrigger", "Scentral and central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisFT0Triggger}); - - histos.add("FV0/bcOutTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisFV0Triggger}); - histos.add("FV0/bcInTrigger", "In trigger per BC (FV0);BC in V0; counts", kTH1F, {axisFV0Triggger}); - histos.add("FV0/bcSCenTrigger", "SCen trigger per BC (FV0);BC in V0; counts", kTH1F, {axisFV0Triggger}); - histos.add("FV0/bcCenTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisFV0Triggger}); - histos.add("FV0/bcSCenCenTrigger", "SCen and Cen trigger per BC (FV0);BC in V0; counts", kTH1F, {axisFV0Triggger}); + histos.add("FDD/bcVertexTrigger", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcVertexTriggerCoincidence", "vertex trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcSCentralTrigger", "scentral trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcSCentralTriggerCoincidence", "scentral trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcVSCTrigger", "vertex and scentral trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcVSCTriggerCoincidence", "vertex and scentral trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcCentralTrigger", "central trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcCentralTriggerCoincidence", "central trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcVCTrigger", "vertex and central trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTriggger}); + histos.add("FDD/bcVCTriggerCoincidence", "vertex and central trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTriggger}); + + histos.add("FT0/bcVertexTrigger", "vertex trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + histos.add("FT0/bcSCentralTrigger", "Scentral trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + histos.add("FT0/bcVSCTrigger", "vertex and Scentral trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + histos.add("FT0/bcCentralTrigger", "central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + histos.add("FT0/bcVCTrigger", "vertex and central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + histos.add("FT0/bcSCentralCentralTrigger", "Scentral and central trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTriggger}); + + histos.add("FV0/bcOutTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTriggger}); + histos.add("FV0/bcInTrigger", "In trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTriggger}); + histos.add("FV0/bcSCenTrigger", "SCen trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTriggger}); + histos.add("FV0/bcCenTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTriggger}); + histos.add("FV0/bcSCenCenTrigger", "SCen and Cen trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTriggger}); } bool checkAnyCoincidence(const std::vector& channels) { - std::constexpr std::array, 4> channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; + constexpr std::pair pair0 = {0, 4}; + constexpr std::pair pair1 = {1, 5}; + constexpr std::pair pair2 = {2, 6}; + constexpr std::pair pair3 = {3, 7}; + constexpr std::array, 4> channelPairs = {pair0, pair1, pair2, pair3}; //std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; for (const auto& pair : channelPairs) { if (std::find(channels.begin(), channels.end(), pair.first) != channels.end() && @@ -76,10 +82,10 @@ struct lumiStabilityTask { return false; } - void processFDDFT0(aod::FT0s const& ft0s, aod::FDDs const& fdds, aod::BCsWithTimestamps const&) + void processFDDFT0(aod::FT0s const& ft0s, aod::FDDs const& fdds, BCsRun3 const& bcs) { for (auto const& fdd : fdds) { - auto bc = fdd.bc_as(); + auto bc = fdd.bc_as(); if (bc.timestamp() == 0) { continue; } @@ -87,6 +93,27 @@ struct lumiStabilityTask { Long64_t globalBC = bc.globalBC(); int localBC = globalBC % nBCsPerOrbit; + int deltaIndex = 0; // backward move counts + int deltaBC = 0; // current difference wrt globalBC + int maxDeltaBC = 5; // maximum difference + bool pastActivityFDD = false; + while (deltaBC < maxDeltaBC) { + if (bc.globalIndex() - deltaIndex < 0) { + break; + } + deltaIndex++; + const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); + deltaBC = globalBC = bc_past.globalBC(); + if(deltaBC < maxDeltaBC) { + pastActivityFDD |= bc_past.has_fdd(); + } + } + + if (pastActivityFDD == false) { + continue; + std::cout << "BC skipped!" << std::endl; + } + std::bitset<8> fddTriggers = fdd.triggerMask(); bool vertex = fddTriggers[o2::fdd::Triggers::bitVertex]; bool scentral = fddTriggers[o2::fdd::Triggers::bitSCen]; @@ -145,7 +172,7 @@ struct lumiStabilityTask { } // loop over FDD events for (auto const& ft0 : ft0s) { - auto bc = ft0.bc_as(); + auto bc = ft0.bc_as(); if (bc.timestamp() == false) { continue; } diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index eb8cdb17ed9..635929c6466 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -35,16 +35,35 @@ struct upcPhotonuclearAnalysis { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Declare configurables on events/collisions - Configurable cutMyPosZMin{"cutMyPosZMin", -20., {"My collision cut"}}; - Configurable cutMyPosZMax{"cutMyPosZMax", 20., {"My collision cut"}}; + Configurable cutMyPosZMin{"cutMyPosZMin", -10., {"My collision cut"}}; + Configurable cutMyPosZMax{"cutMyPosZMax", 10., {"My collision cut"}}; + Configurable cutMyTimeZNA{"cutMyTimeZNA", 2., {"My collision cut"}}; + Configurable cutMyTimeZNC{"cutMyTimeZNC", 2., {"My collision cut"}}; + // Declare configurables on side A gap + Configurable cutAGapMyEnergyZNA{"cutAGapMyEnergyZNA", 4., {"My collision cut. A Gap"}}; + Configurable cutAGapMyEnergyZNC{"cutAGapMyEnergyZNC", 4., {"My collision cut. A Gap"}}; + // Declare configurables on side C gap + Configurable cutCGapMyEnergyZNA{"cutCGapMyEnergyZNA", 4., {"My collision cut. C Gap"}}; + Configurable cutCGapMyEnergyZNC{"cutCGapMyEnergyZNC", 4., {"My collision cut. C Gap"}}; + // Declare configurables on both side gap + Configurable cutBothGapMyEnergyZNA{"cutBothGapMyEnergyZNA", 4., {"My collision cut. Both Gap"}}; + Configurable cutBothGapMyEnergyZNC{"cutBothGapMyEnergyZNC", 4., {"My collision cut. Both Gap"}}; // Declare configurables on tracks Configurable cutMyptMin{"cutMyptMin", 0.15, {"My Track cut"}}; Configurable cutMyptMax{"cutMyptMax", 10., {"My Track cut"}}; - Configurable cutMyetaMin{"cutMyetaMin", -1.0, {"My Track cut"}}; - Configurable cutMyetaMax{"cutMyetaMax", 1.0, {"My Track cut"}}; + Configurable cutMyetaMin{"cutMyetaMin", -0.9, {"My Track cut"}}; + Configurable cutMyetaMax{"cutMyetaMax", 0.9, {"My Track cut"}}; Configurable cutMydcaZmax{"cutMydcaZmax", 2.f, {"My Track cut"}}; Configurable cutMydcaXYmax{"cutMydcaXYmax", 1e0f, {"My Track cut"}}; Configurable cutMydcaXYusePt{"cutMydcaXYusePt", false, {"My Track cut"}}; + Configurable cutMyHasITS{"cutMyHasITS", true, {"My Track cut"}}; + Configurable cutMyITSNClsMin{"cutMyITSNClsMin", 1, {"My Track cut"}}; + Configurable cutMyITSChi2NClMax{"cutMyITSChi2NClMax", 36.f, {"My Track cut"}}; + Configurable cutMyHasTPC{"cutMyHasTPC", true, {"MyGlobalTrack cut"}}; + Configurable cutMyTPCNClsMin{"cutMyTPCNClsMin", 0, {"My Track cut"}}; + Configurable cutMyTPCNClsCrossedRowsMin{"cutMyTPCNClsCrossedRowsMin", 50, {"My Track cut"}}; + Configurable cutMyTPCNClsCrossedRowsOverNClsMin{"cutMyTPCNClsCrossedRowsOverNClsMin", 1.f, {"My Track cut"}}; + Configurable cutMyTPCChi2NclMax{"cutMyTPCChi2NclMax", 4.f, {"My Track cut"}}; using FullSGUDCollision = soa::Join::iterator; using FullUDTracks = soa::Join; @@ -54,11 +73,16 @@ struct upcPhotonuclearAnalysis { const AxisSpec axisCollision{4, -0.5, 3.5}; const AxisSpec axisZvtx{40, -20., 20.}; const AxisSpec axisPt{402, -0.05, 20.05}; + const AxisSpec axisTPCSignal{402, -0.05, 200.05}; const AxisSpec axisPhi{64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}; const AxisSpec axisEta{50, -1.2, 1.2}; + const AxisSpec axisRapidity{40, -10, 10}; const AxisSpec axisNch{101, -0.5, 100.5}; - const AxisSpec axisZNEnergy{1000, 0, 1000}; - const AxisSpec axisZNTime{40, -20, 20}; + const AxisSpec axisZNEnergy{1002, -0.5, 500.5}; + const AxisSpec axisZNTime{21, -10.5, 10.5}; + const AxisSpec axisNCls{201, -0.5, 200.5}; + const AxisSpec axisChi2NCls{100, 0, 50}; + const AxisSpec axisTPCNClsCrossedRowsMin{100, -0.05, 2.05}; histos.add("Events/hCountCollisions", "0 total - 1 side A - 2 side C - 3 both side; Number of analysed collision; counts", kTH1F, {axisCollision}); @@ -66,6 +90,15 @@ struct upcPhotonuclearAnalysis { histos.add("Tracks/SGsideA/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideA/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideA/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Tracks/SGsideA/hTrackRapidity", "#it{y} distribution; #it{y}; counts", kTH1F, {axisRapidity}); + histos.add("Tracks/SGsideA/hTrackITSNCls", "#it{N Clusters ITS} distribution; #it{N Clusters ITS}; counts", kTH1F, {axisNCls}); + histos.add("Tracks/SGsideA/hTrackITSChi2NCls", "#it{N Clusters Chi2 ITS} distribution; #it{N Clusters Chi2 ITS}; counts", kTH1F, {axisChi2NCls}); + histos.add("Tracks/SGsideA/hTrackTPCNCls", "#it{N Clusters TPC} distribution; #it{N Clusters TPC}; counts", kTH1F, {axisTPCNClsCrossedRowsMin}); + histos.add("Tracks/SGsideA/hTrackTPCNClsCrossedRows", "#it{Number of crossed TPC Rows} distribution; #it{Number of crossed TPC Rows}; counts", kTH1F, {axisNCls}); + histos.add("Tracks/SGsideA/hTrackTPCNClsFindable", "#it{Findable TPC clusters for this track} distribution; #it{Findable TPC clusters for this track}; counts", kTH1F, {axisNCls}); + histos.add("Tracks/SGsideA/hTrackTPCChi2NCls", "#it{N Clusters Chi2 TPC} distribution; #it{N Clusters Chi2 TPC}; counts", kTH1F, {axisChi2NCls}); + histos.add("Tracks/SGsideA/hTrackITSNClsTPCCls", "#it{ITS Clusters vs TPC Clusters}; #it{TPC Clusters}; #it{ITS Clusters}", kTH2F, {axisNCls, axisNCls}); + histos.add("Tracks/SGsideA/hTrackTPCSignnalP", "#it{TPC dE/dx vs p}; #it{TPC dE/dx}; #it{p}", kTH2F, {axisPt, axisTPCSignal}); histos.add("Events/SGsideA/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideA/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); @@ -81,6 +114,9 @@ struct upcPhotonuclearAnalysis { histos.add("Tracks/SGsideC/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideC/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideC/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Tracks/SGsideC/hTrackRapidity", "#it{y} distribution; #it{y}; counts", kTH1F, {axisRapidity}); + histos.add("Tracks/SGsideC/hTrackITSNClsTPCCls", "#it{ITS Clusters vs TPC Clusters}; #it{TPC Clusters}; #it{ITS Clusters}", kTH2F, {axisNCls, axisNCls}); + histos.add("Tracks/SGsideC/hTrackTPCSignnalP", "#it{TPC dE/dx vs p}; #it{TPC dE/dx}; #it{p}", kTH2F, {axisPt, axisTPCSignal}); histos.add("Events/SGsideC/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideC/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); @@ -96,6 +132,9 @@ struct upcPhotonuclearAnalysis { histos.add("Tracks/SGsideBoth/hTrackPt", "#it{p_{T}} distribution; #it{p_{T}}; counts", kTH1F, {axisPt}); histos.add("Tracks/SGsideBoth/hTrackPhi", "#it{#phi} distribution; #it{#phi}; counts", kTH1F, {axisPhi}); histos.add("Tracks/SGsideBoth/hTrackEta", "#it{#eta} distribution; #it{#eta}; counts", kTH1F, {axisEta}); + histos.add("Tracks/SGsideBoth/hTrackRapidity", "#it{y} distribution; #it{y}; counts", kTH1F, {axisRapidity}); + histos.add("Tracks/SGsideBoth/hTrackITSNClsTPCCls", "#it{ITS Clusters vs TPC Clusters}; #it{TPC Clusters}; #it{ITS Clusters}", kTH2F, {axisNCls, axisNCls}); + histos.add("Tracks/SGsideBoth/hTrackTPCSignnalP", "#it{TPC dE/dx vs p}; #it{TPC dE/dx}; #it{p}", kTH2F, {axisPt, axisTPCSignal}); histos.add("Events/SGsideBoth/hTrackZVtx", "vertex in z; z (cm); counts", kTH1F, {axisZvtx}); histos.add("Events/SGsideBoth/hNch", "#it{N_{ch}} distribution; #it{N_{ch}}; counts", kTH1F, {axisNch}); @@ -109,11 +148,36 @@ struct upcPhotonuclearAnalysis { } template - bool isCollisionCut(C const& collision){ - if ( collision.posZ() < || < collision.posZ() ) { + bool isGlobalCollisionCut(C const& collision){ + if ( collision.posZ() < cutMyPosZMin || cutMyPosZMax < collision.posZ() ) { return false; } - if ( ) + if ( (std::abs(collision.timeZNA()) < cutMyTimeZNA && std::abs(collision.timeZNC()) < cutMyTimeZNC) == false ) { + return false; + } + return true; + } + + template + bool isCollisionCutSG(CSG const& collision, int SideGap) { + switch (SideGap) { + case 0: // Gap in A side + if ( (collision.energyCommonZNA() < cutAGapMyEnergyZNA && collision.energyCommonZNC() > cutAGapMyEnergyZNC) == false ) { // 0n - A side && Xn - C Side + return false; + } + break; + case 1: // Gap in C side + if ( (collision.energyCommonZNA() > cutCGapMyEnergyZNA && collision.energyCommonZNC() < cutCGapMyEnergyZNC) == false ) { // Xn - A side && 0n - C Side + return false; + } + break; + case 2: // Gap in Both Sides + if ( (collision.energyCommonZNA() < cutBothGapMyEnergyZNA && collision.energyCommonZNC() < cutBothGapMyEnergyZNC) == false ) { // 0n - A side && 0n - C Side + return false; + } + break; + } + return true; } template @@ -138,6 +202,30 @@ struct upcPhotonuclearAnalysis { return false; } } + // Quality Track + // ITS + if (cutMyHasITS && !track.hasITS()) { + return false; // ITS refit + } + if (track.itsNCls() < cutMyITSNClsMin) { + return false; + } + if (track.itsChi2NCl() > cutMyITSChi2NClMax) { + return false; + } + // TPC + if (cutMyHasTPC && !track.hasTPC()) { + return false; // TPC refit + } + if (track.tpcNClsCrossedRows() < cutMyTPCNClsCrossedRowsMin) { + return false; + } + if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < cutMyTPCNClsMin) { + return false; // tpcNClsFound() + } + if (track.tpcChi2NCl() > cutMyTPCChi2NclMax) { + return false; // TPC chi2 + } return true; } @@ -148,8 +236,15 @@ struct upcPhotonuclearAnalysis { int nTracksCharged = 0; float sumPt = 0; + if (isGlobalCollisionCut(reconstructedCollision) == false) { + return; + } + switch (SGside) { case 0: // for side A + if (isCollisionCutSG(reconstructedCollision, 0) == false) { + return; + } histos.fill(HIST("Events/hCountCollisions"), 1); histos.fill(HIST("Events/SGsideA/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); histos.fill(HIST("Events/SGsideA/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); @@ -168,6 +263,16 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideA/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideA/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideA/hTrackEta"), eta(track.px(), track.py(), track.pz())); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); + //histos.fill(HIST("Tracks/SGsideA/hTrackRapidity"), track.rapidity()); + + histos.fill(HIST("Tracks/SGsideA/hTrackITSNCls"), track.itsNCls()); + histos.fill(HIST("Tracks/SGsideA/hTrackITSChi2NCls"), track.itsChi2NCl()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNCls"), (static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) ); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsCrossedRows"), track.tpcNClsCrossedRows()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsFindable"), track.tpcNClsFindable()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCChi2NCls"), track.tpcChi2NCl()); + histos.fill(HIST("Tracks/SGsideA/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); } } histos.fill(HIST("Events/SGsideA/hNch"), nTracksCharged); @@ -175,6 +280,9 @@ struct upcPhotonuclearAnalysis { nTracksCharged = sumPt = 0; break; case 1: // for side C + if (isCollisionCutSG(reconstructedCollision, 1) == false) { + return; + } histos.fill(HIST("Events/hCountCollisions"), 2); histos.fill(HIST("Events/SGsideC/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); histos.fill(HIST("Events/SGsideC/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); @@ -193,6 +301,10 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideC/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideC/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideC/hTrackEta"), eta(track.px(), track.py(), track.pz())); + //histos.fill(HIST("Tracks/SGsideC/hTrackRapidity"), track.rapidity()); + histos.fill(HIST("Tracks/SGsideC/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); + histos.fill(HIST("Tracks/SGsideC/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); + } } histos.fill(HIST("Events/SGsideC/hNch"), nTracksCharged); @@ -200,6 +312,9 @@ struct upcPhotonuclearAnalysis { nTracksCharged = sumPt = 0; break; case 2: // for both sides + if (isCollisionCutSG(reconstructedCollision, 2) == false) { + return; + } histos.fill(HIST("Events/hCountCollisions"), 3); histos.fill(HIST("Events/SGsideBoth/hEnergyZNA"), reconstructedCollision.energyCommonZNA()); histos.fill(HIST("Events/SGsideBoth/hEnergyZNC"), reconstructedCollision.energyCommonZNC()); @@ -218,6 +333,10 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); + //histos.fill(HIST("Tracks/SGsideBoth/hTrackRapidity"), track.rapidity()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); + histos.fill(HIST("Tracks/SGsideBoth/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); + } } histos.fill(HIST("Events/SGsideBoth/hNch"), nTracksCharged); From 498124517c876881aaf706075c777b86692bd969 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 18 Apr 2024 01:17:54 -0600 Subject: [PATCH 09/16] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 8 ++--- PWGMM/Mult/DataModel/ReducedTables.h | 2 +- PWGUD/Tasks/upcPhotonuclearAnalysis.cxx | 44 ++++++++++++------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 6bbcef8b096..ea6be926611 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -72,7 +72,7 @@ struct lumiStabilityTask { constexpr std::pair pair2 = {2, 6}; constexpr std::pair pair3 = {3, 7}; constexpr std::array, 4> channelPairs = {pair0, pair1, pair2, pair3}; - //std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; + // std::map channelPairs = {{0, 4}, {1, 5}, {2, 6}, {3, 7}}; for (const auto& pair : channelPairs) { if (std::find(channels.begin(), channels.end(), pair.first) != channels.end() && std::find(channels.begin(), channels.end(), pair.second) != channels.end()) { @@ -93,8 +93,8 @@ struct lumiStabilityTask { Long64_t globalBC = bc.globalBC(); int localBC = globalBC % nBCsPerOrbit; - int deltaIndex = 0; // backward move counts - int deltaBC = 0; // current difference wrt globalBC + int deltaIndex = 0; // backward move counts + int deltaBC = 0; // current difference wrt globalBC int maxDeltaBC = 5; // maximum difference bool pastActivityFDD = false; while (deltaBC < maxDeltaBC) { @@ -104,7 +104,7 @@ struct lumiStabilityTask { deltaIndex++; const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); deltaBC = globalBC = bc_past.globalBC(); - if(deltaBC < maxDeltaBC) { + if (deltaBC < maxDeltaBC) { pastActivityFDD |= bc_past.has_fdd(); } } diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 1325d52d87a..8fa23336434 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -34,7 +34,7 @@ namespace rcol { DECLARE_SOA_INDEX_COLUMN(RBC, rbc); DECLARE_SOA_COLUMN(MapEtaPhi, mapetaphi, std::vector); -} +} // namespace rcol #define Ccols o2::soa::Index<>, \ rcol::RBCId, \ diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx index 635929c6466..9b46b8ee040 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx @@ -148,31 +148,33 @@ struct upcPhotonuclearAnalysis { } template - bool isGlobalCollisionCut(C const& collision){ - if ( collision.posZ() < cutMyPosZMin || cutMyPosZMax < collision.posZ() ) { + bool isGlobalCollisionCut(C const& collision) + { + if (collision.posZ() < cutMyPosZMin || cutMyPosZMax < collision.posZ()) { return false; } - if ( (std::abs(collision.timeZNA()) < cutMyTimeZNA && std::abs(collision.timeZNC()) < cutMyTimeZNC) == false ) { + if ((std::abs(collision.timeZNA()) < cutMyTimeZNA && std::abs(collision.timeZNC()) < cutMyTimeZNC) == false) { return false; } return true; } template - bool isCollisionCutSG(CSG const& collision, int SideGap) { + bool isCollisionCutSG(CSG const& collision, int SideGap) + { switch (SideGap) { - case 0: // Gap in A side - if ( (collision.energyCommonZNA() < cutAGapMyEnergyZNA && collision.energyCommonZNC() > cutAGapMyEnergyZNC) == false ) { // 0n - A side && Xn - C Side + case 0: // Gap in A side + if ((collision.energyCommonZNA() < cutAGapMyEnergyZNA && collision.energyCommonZNC() > cutAGapMyEnergyZNC) == false) { // 0n - A side && Xn - C Side return false; } break; - case 1: // Gap in C side - if ( (collision.energyCommonZNA() > cutCGapMyEnergyZNA && collision.energyCommonZNC() < cutCGapMyEnergyZNC) == false ) { // Xn - A side && 0n - C Side + case 1: // Gap in C side + if ((collision.energyCommonZNA() > cutCGapMyEnergyZNA && collision.energyCommonZNC() < cutCGapMyEnergyZNC) == false) { // Xn - A side && 0n - C Side return false; } break; - case 2: // Gap in Both Sides - if ( (collision.energyCommonZNA() < cutBothGapMyEnergyZNA && collision.energyCommonZNC() < cutBothGapMyEnergyZNC) == false ) { // 0n - A side && 0n - C Side + case 2: // Gap in Both Sides + if ((collision.energyCommonZNA() < cutBothGapMyEnergyZNA && collision.energyCommonZNC() < cutBothGapMyEnergyZNC) == false) { // 0n - A side && 0n - C Side return false; } break; @@ -264,15 +266,15 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideA/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideA/hTrackEta"), eta(track.px(), track.py(), track.pz())); histos.fill(HIST("Tracks/SGsideA/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); - //histos.fill(HIST("Tracks/SGsideA/hTrackRapidity"), track.rapidity()); + // histos.fill(HIST("Tracks/SGsideA/hTrackRapidity"), track.rapidity()); - histos.fill(HIST("Tracks/SGsideA/hTrackITSNCls"), track.itsNCls()); - histos.fill(HIST("Tracks/SGsideA/hTrackITSChi2NCls"), track.itsChi2NCl()); - histos.fill(HIST("Tracks/SGsideA/hTrackTPCNCls"), (static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) ); - histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsCrossedRows"), track.tpcNClsCrossedRows()); - histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsFindable"), track.tpcNClsFindable()); - histos.fill(HIST("Tracks/SGsideA/hTrackTPCChi2NCls"), track.tpcChi2NCl()); - histos.fill(HIST("Tracks/SGsideA/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); + histos.fill(HIST("Tracks/SGsideA/hTrackITSNCls"), track.itsNCls()); + histos.fill(HIST("Tracks/SGsideA/hTrackITSChi2NCls"), track.itsChi2NCl()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNCls"), (static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable()))); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsCrossedRows"), track.tpcNClsCrossedRows()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCNClsFindable"), track.tpcNClsFindable()); + histos.fill(HIST("Tracks/SGsideA/hTrackTPCChi2NCls"), track.tpcChi2NCl()); + histos.fill(HIST("Tracks/SGsideA/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); } } histos.fill(HIST("Events/SGsideA/hNch"), nTracksCharged); @@ -301,10 +303,9 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideC/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideC/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideC/hTrackEta"), eta(track.px(), track.py(), track.pz())); - //histos.fill(HIST("Tracks/SGsideC/hTrackRapidity"), track.rapidity()); + // histos.fill(HIST("Tracks/SGsideC/hTrackRapidity"), track.rapidity()); histos.fill(HIST("Tracks/SGsideC/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); histos.fill(HIST("Tracks/SGsideC/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); - } } histos.fill(HIST("Events/SGsideC/hNch"), nTracksCharged); @@ -333,10 +334,9 @@ struct upcPhotonuclearAnalysis { histos.fill(HIST("Tracks/SGsideBoth/hTrackPt"), track.pt()); histos.fill(HIST("Tracks/SGsideBoth/hTrackPhi"), phi(track.px(), track.py())); histos.fill(HIST("Tracks/SGsideBoth/hTrackEta"), eta(track.px(), track.py(), track.pz())); - //histos.fill(HIST("Tracks/SGsideBoth/hTrackRapidity"), track.rapidity()); + // histos.fill(HIST("Tracks/SGsideBoth/hTrackRapidity"), track.rapidity()); histos.fill(HIST("Tracks/SGsideBoth/hTrackITSNClsTPCCls"), track.tpcNClsFindable(), track.itsNCls()); histos.fill(HIST("Tracks/SGsideBoth/hTrackTPCSignnalP"), momentum(track.px(), track.py(), track.pz()), track.tpcSignal()); - } } histos.fill(HIST("Events/SGsideBoth/hNch"), nTracksCharged); From 5203ef41e638d80fcdc072a7d282638976215b5d Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 13:04:59 -0600 Subject: [PATCH 10/16] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 126 +++++++++++++++++++++++++---- 1 file changed, 111 insertions(+), 15 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index ea6be926611..0beb05681d0 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -82,8 +82,9 @@ struct lumiStabilityTask { return false; } - void processFDDFT0(aod::FT0s const& ft0s, aod::FDDs const& fdds, BCsRun3 const& bcs) + void processMain(aod::FT0s const& ft0s, aod::FDDs const& fdds, aod::FV0As const& fv0s, BCsRun3 const& bcs) { + int CountNormal(0), CountPastProtec(0); for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); if (bc.timestamp() == 0) { @@ -98,21 +99,41 @@ struct lumiStabilityTask { int maxDeltaBC = 5; // maximum difference bool pastActivityFDD = false; while (deltaBC < maxDeltaBC) { + deltaIndex++; if (bc.globalIndex() - deltaIndex < 0) { break; } - deltaIndex++; const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); - deltaBC = globalBC = bc_past.globalBC(); + deltaBC = globalBC - bc_past.globalBC(); if (deltaBC < maxDeltaBC) { pastActivityFDD |= bc_past.has_fdd(); } } + deltaIndex = 0; + deltaBC = 0; - if (pastActivityFDD == false) { + bool futureActivityFDD = false; + while (deltaBC < maxDeltaBC) { + deltaIndex++; + if (bc.globalIndex() + deltaIndex >= bcs.size()) { + break; + } + const auto& bc_future = bcs.iteratorAt(bc.globalIndex() + deltaIndex); + deltaBC = bc_future.globalBC() - globalBC; + if (deltaBC < maxDeltaBC) { + futureActivityFDD |= bc_future.has_fdd(); + } + } + + CountNormal++; + if (pastActivityFDD == true || futureActivityFDD == true) { + CountPastProtec++; continue; - std::cout << "BC skipped!" << std::endl; } + /*if (pastActivityFDD == true) { + CountPastProtec++; + continue; + }*/ std::bitset<8> fddTriggers = fdd.triggerMask(); bool vertex = fddTriggers[o2::fdd::Triggers::bitVertex]; @@ -173,13 +194,51 @@ struct lumiStabilityTask { for (auto const& ft0 : ft0s) { auto bc = ft0.bc_as(); - if (bc.timestamp() == false) { + if (bc.timestamp() == 0) { continue; } Long64_t globalBC = bc.globalBC(); int localBC = globalBC % nBCsPerOrbit; + int deltaIndex = 0; // backward move counts + int deltaBC = 0; // current difference wrt globalBC + int maxDeltaBC = 5; // maximum difference + bool pastActivityFT0 = false; + while (deltaBC < maxDeltaBC) { + deltaIndex++; + if (bc.globalIndex() - deltaIndex < 0) { + break; + } + const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); + deltaBC = globalBC - bc_past.globalBC(); + if (deltaBC < maxDeltaBC) { + pastActivityFT0 |= bc_past.has_ft0(); + } + } + deltaIndex = 0; + deltaBC = 0; + + bool futureActivityFT0 = false; + while (deltaBC < maxDeltaBC) { + deltaIndex++; + if (bc.globalIndex() + deltaIndex >= bcs.size()) { + break; + } + const auto& bc_future = bcs.iteratorAt(bc.globalIndex() + deltaIndex); + deltaBC = bc_future.globalBC() - globalBC; + if (deltaBC < maxDeltaBC) { + futureActivityFT0 |= bc_future.has_ft0(); + } + } + + if (pastActivityFT0 == true || futureActivityFT0 == true) { + continue; + } + /*if (pastActivityFT0 == true) { + continue; + }*/ + std::bitset<8> fT0Triggers = ft0.triggerMask(); bool vertex = fT0Triggers[o2::fdd::Triggers::bitVertex]; @@ -207,21 +266,55 @@ struct lumiStabilityTask { } } } // loop over FT0 events - } // end processFDDFT0 - - PROCESS_SWITCH(lumiStabilityTask, processFDDFT0, "Process FDD and FT0 to lumi stability analysis", true); - void processV0(aod::FV0As const& fv0s, aod::BCsWithTimestamps const&) - { for (auto const& fv0 : fv0s) { - auto bc = fv0.bc_as(); - if (bc.timestamp() == false) { + auto bc = fv0.bc_as(); + if (bc.timestamp() == 0) { continue; } Long64_t globalBC = bc.globalBC(); int localBC = globalBC % nBCsPerOrbit; + int deltaIndex = 0; // backward move counts + int deltaBC = 0; // current difference wrt globalBC + int maxDeltaBC = 5; // maximum difference + bool pastActivityV0A = false; + while (deltaBC < maxDeltaBC) { + deltaIndex++; + if (bc.globalIndex() - deltaIndex < 0) { + break; + } + const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); + deltaBC = globalBC - bc_past.globalBC(); + if (deltaBC < maxDeltaBC) { + pastActivityV0A |= bc_past.has_fv0a(); + } + } + deltaIndex = 0; + deltaBC = 0; + + bool futureActivityV0A = false; + while (deltaBC < maxDeltaBC) { + deltaIndex++; + if (bc.globalIndex() + deltaIndex >= bcs.size()) { + break; + } + const auto& bc_future = bcs.iteratorAt(bc.globalIndex() + deltaIndex); + deltaBC = bc_future.globalBC() - globalBC; + if (deltaBC < maxDeltaBC) { + futureActivityV0A |= bc_future.has_fv0a(); + } + } + + if (pastActivityV0A == true || futureActivityV0A == true) { + continue; + } + + /*if (pastActivityV0A == true) { + continue; + }*/ + std::bitset<8> fv0Triggers = fv0.triggerMask(); bool aOut = fv0Triggers[o2::fdd::Triggers::bitAOut]; bool aIn = fv0Triggers[o2::fdd::Triggers::bitAIn]; @@ -247,9 +340,12 @@ struct lumiStabilityTask { } } } // loop over V0 events - } // end processV0 + std::cout << "************ >>>>>>>>>>>>>> " + << "Whithout Past Protection: " << CountNormal << " " + << "Avoided Whith Past Protection: " << CountPastProtec << "<<<<<<<<<<<< ********************" << std::endl; + } // end processMain - PROCESS_SWITCH(lumiStabilityTask, processV0, "Process V0 to lumi stability analysis", true); + PROCESS_SWITCH(lumiStabilityTask, processMain, "Process FDD and FT0 to lumi stability analysis", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From f89e1d1a6df735e10d87af367b8b5436401eac55 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 13:55:30 -0600 Subject: [PATCH 11/16] new changes --- PWGMM/Mult/DataModel/ReducedTables.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 1cda2f7e872..838a3a7a7b1 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -15,6 +15,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" +#include namespace o2::aod { From 5e8054ff214c698569950e7b49598a0d459d56c9 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 19:34:16 -0600 Subject: [PATCH 12/16] new changes --- PWGUD/Tasks/CMakeLists.txt | 2 +- ...tonuclearAnalysis.cxx => upcPhotonuclearAnalysisJMG.cxx} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename PWGUD/Tasks/{upcPhotonuclearAnalysis.cxx => upcPhotonuclearAnalysisJMG.cxx} (98%) diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index 9eff9d6eaf5..7c4e554b86c 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -93,7 +93,7 @@ o2physics_add_dpl_workflow(polarisation-rho PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGPIDSelector COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(upc-photonuclear +o2physics_add_dpl_workflow(upc-photonuclear-jmg SOURCES upcPhotonuclearAnalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis) diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx similarity index 98% rename from PWGUD/Tasks/upcPhotonuclearAnalysis.cxx rename to PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index 9b46b8ee040..bbec3c1dcda 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysis.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -30,7 +30,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct upcPhotonuclearAnalysis { +struct upcPhotonuclearAnalysisJMG { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -348,10 +348,10 @@ struct upcPhotonuclearAnalysis { break; } } - PROCESS_SWITCH(upcPhotonuclearAnalysis, processSG, "Process in UD tables", true); + PROCESS_SWITCH(upcPhotonuclearAnalysisJMG, processSG, "Process in UD tables", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"upcphotonuclear"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"upcphotonuclear"})}; } From ea1bffc4437df0cf3bbc89a3affda5e58643ded3 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 20:13:20 -0600 Subject: [PATCH 13/16] new changes --- PWGMM/Mult/DataModel/ReducedTables.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 838a3a7a7b1..126771f66fa 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -15,6 +15,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" + #include namespace o2::aod From 30f32d1c3b88e3d9f1c3bb76f0671a5284d11da1 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 21:12:55 -0600 Subject: [PATCH 14/16] new changes --- PWGMM/Mult/DataModel/ReducedTables.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 126771f66fa..1c868f52036 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -11,12 +11,13 @@ #ifndef PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ #define PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ +#include + #include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" -#include namespace o2::aod { From 52005572ac601cd07af5eb31d6d08d12df854d31 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 21:35:25 -0600 Subject: [PATCH 15/16] new changes --- PWGMM/Mult/DataModel/ReducedTables.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index 1c868f52036..8b9cdb45ba7 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -18,7 +18,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" - namespace o2::aod { From 552f07f51ae532feea1d52f9e4ae840d82d7bcc8 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 22 Apr 2024 22:03:24 -0600 Subject: [PATCH 16/16] new changes --- PWGUD/Tasks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index 7c4e554b86c..ab028384214 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -94,6 +94,6 @@ o2physics_add_dpl_workflow(polarisation-rho COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(upc-photonuclear-jmg - SOURCES upcPhotonuclearAnalysis.cxx + SOURCES upcPhotonuclearAnalysisJMG.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis)