From a540b5b75f442b6122e3cd4561fcaff97144f59a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 4 Dec 2022 15:40:19 -0300 Subject: [PATCH 1/7] Create propagatorQa.cxx --- Common/Tasks/propagatorQa.cxx | 95 +++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Common/Tasks/propagatorQa.cxx diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx new file mode 100644 index 00000000000..b0ccc64224a --- /dev/null +++ b/Common/Tasks/propagatorQa.cxx @@ -0,0 +1,95 @@ +// 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. + +// +// Task producing QA histograms to study track (pre-)propagation +// + +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "ReconstructionDataFormats/Track.h" +#include "Common/Core/trackUtilities.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +#include "Framework/runDataProcessing.h" + +struct propagatorQa { + Configurable windowDCA{"windowDCA", 50, "windowDCA"}; + Configurable Nbins{"Nbins", 10000, "Nbins"}; + + //Momentum distribution + OutputObj hPtBeforeXcut{TH1F("hPtBeforeXcut", "hPtBeforeXcut", Nbins, 0, 10)}; + OutputObj hPt{TH1F("hPt", "hPt", Nbins, 0, 10)}; + OutputObj hPtusedInSVertexer{TH1F("hPtusedInSVertexer", "hPtusedInSVertexer", Nbins, 0, 10)}; + + //IU radii + OutputObj hUpdateRadii{TH1F("hUpdateRadii", "hUpdateRadii", 5000, 0, 100)}; + OutputObj hUpdateRadiiusedInSVertexer{TH1F("hUpdateRadiiusedInSVertexer", "hUpdateRadii", 5000, 0, 100)}; + + //DCA + OutputObj hdcaXYall{TH1F("hdcaXYall", "hdcaXYall", Nbins, -windowDCA, windowDCA)}; + OutputObj hdcaXYusedInSVertexer{TH1F("hdcaXYusedInSVertexer", "hdcaXYusedInSVertexer", Nbins, -windowDCA, windowDCA)}; + + o2::track::TrackPar lTrackParametrization; + + void process(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks) + { + for (auto& track : tracks) { + hPtBeforeXcut->Fill(track.pt()); + + float maxXtoConsider = o2::constants::geom::XTPCInnerRef + 0.1; + if ( track.trackType() != aod::track::TrackIU && track.x() > maxXtoConsider ) continue; + + std::array pos; + lTrackParametrization = getTrackPar(track); + lTrackParametrization.getXYZGlo(pos); + float lRadiusOfLastUpdate = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]); + + hUpdateRadii->Fill(lRadiusOfLastUpdate); + + // fill kinematic variables + hPt->Fill(track.pt()); + + float lDCA = track.dcaXY(); + + hdcaXYall->Fill(lDCA); + + //determine if track was used in svertexer + bool usedInSVertexer = false; + bool lPosUsed, lNegUsed, lBachUsed; + for (auto& V0 : V0s) { + lPosUsed = ( V0.posTrackId() == track.globalIndex() ); + lNegUsed = ( V0.negTrackId() == track.globalIndex() ); + } + for (auto& cascade : cascades) { + lBachUsed = ( cascade.bachelorId() == track.globalIndex() ); + } + if( lPosUsed || lNegUsed || lBachUsed ) usedInSVertexer = true; + + if( usedInSVertexer ) hUpdateRadiiusedInSVertexer->Fill(lRadiusOfLastUpdate); + if( usedInSVertexer ) hdcaXYusedInSVertexer->Fill(lDCA); + if( usedInSVertexer ) hPtusedInSVertexer->Fill(track.pt()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 06d23d4e6ad3dbd9c30459335c4e538573f98a35 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 4 Dec 2022 15:40:53 -0300 Subject: [PATCH 2/7] Update CMakeLists.txt --- Common/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common/Tasks/CMakeLists.txt b/Common/Tasks/CMakeLists.txt index 02665cbcf52..9f0151adf12 100644 --- a/Common/Tasks/CMakeLists.txt +++ b/Common/Tasks/CMakeLists.txt @@ -13,6 +13,11 @@ o2physics_add_dpl_workflow(trackqa SOURCES trackqa.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(propagatorqa + SOURCES propagatorQa.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(validation SOURCES validation.cxx From dbab5ad2376407d13c6e56a4ed9fa0ff27aee3df Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 4 Dec 2022 18:41:43 +0000 Subject: [PATCH 3/7] Please consider the following formatting changes --- Common/Tasks/propagatorQa.cxx | 57 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index b0ccc64224a..0f1455af650 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -31,59 +31,64 @@ using namespace o2::framework::expressions; struct propagatorQa { Configurable windowDCA{"windowDCA", 50, "windowDCA"}; Configurable Nbins{"Nbins", 10000, "Nbins"}; - - //Momentum distribution + + // Momentum distribution OutputObj hPtBeforeXcut{TH1F("hPtBeforeXcut", "hPtBeforeXcut", Nbins, 0, 10)}; OutputObj hPt{TH1F("hPt", "hPt", Nbins, 0, 10)}; OutputObj hPtusedInSVertexer{TH1F("hPtusedInSVertexer", "hPtusedInSVertexer", Nbins, 0, 10)}; - - //IU radii + + // IU radii OutputObj hUpdateRadii{TH1F("hUpdateRadii", "hUpdateRadii", 5000, 0, 100)}; OutputObj hUpdateRadiiusedInSVertexer{TH1F("hUpdateRadiiusedInSVertexer", "hUpdateRadii", 5000, 0, 100)}; - - //DCA + + // DCA OutputObj hdcaXYall{TH1F("hdcaXYall", "hdcaXYall", Nbins, -windowDCA, windowDCA)}; OutputObj hdcaXYusedInSVertexer{TH1F("hdcaXYusedInSVertexer", "hdcaXYusedInSVertexer", Nbins, -windowDCA, windowDCA)}; - + o2::track::TrackPar lTrackParametrization; - + void process(aod::Collision const& collision, aod::V0s const& V0s, aod::Cascades const& cascades, soa::Join const& tracks) { for (auto& track : tracks) { hPtBeforeXcut->Fill(track.pt()); - + float maxXtoConsider = o2::constants::geom::XTPCInnerRef + 0.1; - if ( track.trackType() != aod::track::TrackIU && track.x() > maxXtoConsider ) continue; - + if (track.trackType() != aod::track::TrackIU && track.x() > maxXtoConsider) + continue; + std::array pos; lTrackParametrization = getTrackPar(track); lTrackParametrization.getXYZGlo(pos); - float lRadiusOfLastUpdate = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]); - + float lRadiusOfLastUpdate = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1]); + hUpdateRadii->Fill(lRadiusOfLastUpdate); - + // fill kinematic variables hPt->Fill(track.pt()); - + float lDCA = track.dcaXY(); - + hdcaXYall->Fill(lDCA); - - //determine if track was used in svertexer + + // determine if track was used in svertexer bool usedInSVertexer = false; bool lPosUsed, lNegUsed, lBachUsed; for (auto& V0 : V0s) { - lPosUsed = ( V0.posTrackId() == track.globalIndex() ); - lNegUsed = ( V0.negTrackId() == track.globalIndex() ); + lPosUsed = (V0.posTrackId() == track.globalIndex()); + lNegUsed = (V0.negTrackId() == track.globalIndex()); } for (auto& cascade : cascades) { - lBachUsed = ( cascade.bachelorId() == track.globalIndex() ); + lBachUsed = (cascade.bachelorId() == track.globalIndex()); } - if( lPosUsed || lNegUsed || lBachUsed ) usedInSVertexer = true; - - if( usedInSVertexer ) hUpdateRadiiusedInSVertexer->Fill(lRadiusOfLastUpdate); - if( usedInSVertexer ) hdcaXYusedInSVertexer->Fill(lDCA); - if( usedInSVertexer ) hPtusedInSVertexer->Fill(track.pt()); + if (lPosUsed || lNegUsed || lBachUsed) + usedInSVertexer = true; + + if (usedInSVertexer) + hUpdateRadiiusedInSVertexer->Fill(lRadiusOfLastUpdate); + if (usedInSVertexer) + hdcaXYusedInSVertexer->Fill(lDCA); + if (usedInSVertexer) + hPtusedInSVertexer->Fill(track.pt()); } } }; From 2bca460ab1a77c86829a08f463a2ebdc4fd8fb4a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 4 Dec 2022 15:46:35 -0300 Subject: [PATCH 4/7] re-trigger checks... --- Common/Tasks/propagatorQa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index 0f1455af650..3780c121acf 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -37,7 +37,7 @@ struct propagatorQa { OutputObj hPt{TH1F("hPt", "hPt", Nbins, 0, 10)}; OutputObj hPtusedInSVertexer{TH1F("hPtusedInSVertexer", "hPtusedInSVertexer", Nbins, 0, 10)}; - // IU radii + // IU radii, also from svertexer OutputObj hUpdateRadii{TH1F("hUpdateRadii", "hUpdateRadii", 5000, 0, 100)}; OutputObj hUpdateRadiiusedInSVertexer{TH1F("hUpdateRadiiusedInSVertexer", "hUpdateRadii", 5000, 0, 100)}; From 254e2bdced6d9cb98571e2640569e20c26419402 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 4 Dec 2022 15:47:42 -0300 Subject: [PATCH 5/7] Extra whitepace removal --- Common/Tasks/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Tasks/CMakeLists.txt b/Common/Tasks/CMakeLists.txt index 9f0151adf12..c320e9ab807 100644 --- a/Common/Tasks/CMakeLists.txt +++ b/Common/Tasks/CMakeLists.txt @@ -13,7 +13,7 @@ o2physics_add_dpl_workflow(trackqa SOURCES trackqa.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) - + o2physics_add_dpl_workflow(propagatorqa SOURCES propagatorQa.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore From c937b2c4320ffd4a66f915151ca2892eccbd57af Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 4 Dec 2022 16:00:18 -0300 Subject: [PATCH 6/7] Bugfix --- Common/Tasks/propagatorQa.cxx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index 3780c121acf..3acf5a1c7d5 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -70,18 +70,26 @@ struct propagatorQa { hdcaXYall->Fill(lDCA); - // determine if track was used in svertexer + //determine if track was used in svertexer bool usedInSVertexer = false; - bool lPosUsed, lNegUsed, lBachUsed; + bool lUsedByV0 = false, lUsedByCascade = false; for (auto& V0 : V0s) { - lPosUsed = (V0.posTrackId() == track.globalIndex()); - lNegUsed = (V0.negTrackId() == track.globalIndex()); + if( V0.posTrackId() == track.globalIndex() ){ + lUsedByV0 = true; + break; + } + if( V0.negTrackId() == track.globalIndex() ){ + lUsedByV0 = true; + break; + } } for (auto& cascade : cascades) { - lBachUsed = (cascade.bachelorId() == track.globalIndex()); + if( cascade.bachelorId() == track.globalIndex() ){ + lUsedByCascade = true; + break; + } } - if (lPosUsed || lNegUsed || lBachUsed) - usedInSVertexer = true; + if( lUsedByV0 || lUsedByCascade ) usedInSVertexer = true; if (usedInSVertexer) hUpdateRadiiusedInSVertexer->Fill(lRadiusOfLastUpdate); From eda6dda03004b88d60f3f8f65f517053f548ea90 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 4 Dec 2022 19:00:40 +0000 Subject: [PATCH 7/7] Please consider the following formatting changes --- Common/Tasks/propagatorQa.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Common/Tasks/propagatorQa.cxx b/Common/Tasks/propagatorQa.cxx index 3acf5a1c7d5..9b9279666c9 100644 --- a/Common/Tasks/propagatorQa.cxx +++ b/Common/Tasks/propagatorQa.cxx @@ -70,26 +70,27 @@ struct propagatorQa { hdcaXYall->Fill(lDCA); - //determine if track was used in svertexer + // determine if track was used in svertexer bool usedInSVertexer = false; bool lUsedByV0 = false, lUsedByCascade = false; for (auto& V0 : V0s) { - if( V0.posTrackId() == track.globalIndex() ){ + if (V0.posTrackId() == track.globalIndex()) { lUsedByV0 = true; break; } - if( V0.negTrackId() == track.globalIndex() ){ + if (V0.negTrackId() == track.globalIndex()) { lUsedByV0 = true; break; } } for (auto& cascade : cascades) { - if( cascade.bachelorId() == track.globalIndex() ){ + if (cascade.bachelorId() == track.globalIndex()) { lUsedByCascade = true; break; } } - if( lUsedByV0 || lUsedByCascade ) usedInSVertexer = true; + if (lUsedByV0 || lUsedByCascade) + usedInSVertexer = true; if (usedInSVertexer) hUpdateRadiiusedInSVertexer->Fill(lRadiusOfLastUpdate);