From 6ceb2898d50d275a57733874c9166f5f55006cb1 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Thu, 18 Nov 2021 16:25:45 +0100 Subject: [PATCH 01/17] First version probably not working of analyseMFTTracks.cxx --- PWGMM/Tasks/analyseMFTTracks.cxx | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 PWGMM/Tasks/analyseMFTTracks.cxx diff --git a/PWGMM/Tasks/analyseMFTTracks.cxx b/PWGMM/Tasks/analyseMFTTracks.cxx new file mode 100644 index 00000000000..eeba4bcbbb1 --- /dev/null +++ b/PWGMM/Tasks/analyseMFTTracks.cxx @@ -0,0 +1,56 @@ +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" + +#include "TDatabasePDG.h" + +using namespace o2; +using namespace o2::framework; + +using Particles = aod::McParticles; + + + +//First approach to analysing an AO2D.root file +//written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html + + +HistogramRegistry registry +{ + "registry", + { + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // + } // + }; + +struct analyseMFTTracks : AnalysisTask +{ + //init()? + void process(o2::aod::MFTTracks const& tracks) + { + for (auto& track : tracks) + { + registry.fill(HIST("TracksPhiEta"), track.phi(), track.eta()); + } + + } + //end of process + + void processGen(Particles const& particles) + { + for (auto& particle : particles) + { + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + } + + } + //end of processGen +} +//end of MyTask + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From 26102f825bf63489f86363190837cae48ee57c01 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 29 Nov 2021 13:45:42 +0100 Subject: [PATCH 02/17] First version of analyse-mft-tracks, a task computing histograms for MFT tracks --- PWGMM/Tasks/CMakeLists.txt | 7 +- PWGMM/Tasks/analyse-mft-tracks.cxx | 127 +++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 PWGMM/Tasks/analyse-mft-tracks.cxx diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index ed61a3c5cdd..8e0f5a5dcaa 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -17,4 +17,9 @@ o2physics_add_dpl_workflow(run2-dndeta o2physics_add_dpl_workflow(dndeta SOURCES dndeta.cxx dndeta.h PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(analyse-mft-tracks + SOURCES analyse-mft-tracks.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx new file mode 100644 index 00000000000..2fee27ab028 --- /dev/null +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -0,0 +1,127 @@ +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" + +#include "TDatabasePDG.h" +#include "Common/Core/MC.h" + +using namespace o2; +using namespace o2::framework; + +using Particles = aod::McParticles; + + + +//First approach to analysing an AO2D.root file +//written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html + + + + +struct analyseMFTTracks +{ + int icoll = 0; + + HistogramRegistry registry + { + "registry", + { + {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // + } // + }; + + void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + { + + auto z = collision.posZ(); + registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + + for (auto& track : tracks) + { + registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Multiplicity"), icoll); + registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); + } + icoll++; + + } + //end of process + +//aod::McCollisions +}; +//end of MyTask + + +struct analyseGenTracks +{ + + HistogramRegistry registryGen + { + "registryGen", + { + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + } // + }; + + expressions::Filter posZFilterMC = (aod::mccollision::posZ < 15) && (aod::mccollision::posZ > -15); + + void process(soa::Filtered::iterator const& mcCollision, Particles const& particles) + { + int nChargedPrimaryParticles = 0; + auto z = mcCollision.posZ(); + + for (auto& particle : particles) + { + auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); + int charge = 0; + if (p == nullptr) + { + // unknown particles will be skipped + if (particle.pdgCode() > 1000000000) + { + // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); + // charge = x - std::trunc(x / 1000) * 1000; + LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) + } + else + { + LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); + } + } + else + { + charge = p->Charge(); + } + if (charge != 0 && particle.isPhysicalPrimary()) + { + registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + + + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + nChargedPrimaryParticles++; + } + } + + //registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + } +}; +//end of the gen task + + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + //adaptAnalysisTask(cfgc), + }; +} From 15d0f91569e90be6043e97ebf3a03f532eda7468 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 29 Nov 2021 13:53:39 +0100 Subject: [PATCH 03/17] First version of analyse-mft-tracks, a task computing histograms for MFT tracks- fixed --- PWGMM/Tasks/analyseMFTTracks.cxx | 56 -------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 PWGMM/Tasks/analyseMFTTracks.cxx diff --git a/PWGMM/Tasks/analyseMFTTracks.cxx b/PWGMM/Tasks/analyseMFTTracks.cxx deleted file mode 100644 index eeba4bcbbb1..00000000000 --- a/PWGMM/Tasks/analyseMFTTracks.cxx +++ /dev/null @@ -1,56 +0,0 @@ -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "TDatabasePDG.h" - -using namespace o2; -using namespace o2::framework; - -using Particles = aod::McParticles; - - - -//First approach to analysing an AO2D.root file -//written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html - - -HistogramRegistry registry -{ - "registry", - { - {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // - } // - }; - -struct analyseMFTTracks : AnalysisTask -{ - //init()? - void process(o2::aod::MFTTracks const& tracks) - { - for (auto& track : tracks) - { - registry.fill(HIST("TracksPhiEta"), track.phi(), track.eta()); - } - - } - //end of process - - void processGen(Particles const& particles) - { - for (auto& particle : particles) - { - registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - } - - } - //end of processGen -} -//end of MyTask - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc), - }; -} From 9a85f1b60eb337cd2b09cf72120245388c11b15e Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 29 Nov 2021 14:01:29 +0100 Subject: [PATCH 04/17] First version of analyse-mft-tracks, a task computing histograms for MFT tracks-clang fixed --- PWGMM/Tasks/analyse-mft-tracks.cxx | 157 ++++++++++++++--------------- 1 file changed, 73 insertions(+), 84 deletions(-) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx index 2fee27ab028..97de58b36ed 100644 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -1,3 +1,14 @@ +// 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. + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -9,115 +20,93 @@ using namespace o2::framework; using Particles = aod::McParticles; - - //First approach to analysing an AO2D.root file //written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html - - - -struct analyseMFTTracks -{ +struct analyseMFTTracks { int icoll = 0; - HistogramRegistry registry - { - "registry", - { - {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, - {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // - } // - }; - - void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + HistogramRegistry registry{ + "registry", { + {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // + } // + }; - auto z = collision.posZ(); - registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + { - for (auto& track : tracks) - { - registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Multiplicity"), icoll); - registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); - } - icoll++; + auto z = collision.posZ(); + registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + for (auto& track : tracks) { + registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Multiplicity"), icoll); + registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); } - //end of process + icoll++; + } + //end of process -//aod::McCollisions + //aod::McCollisions }; //end of MyTask +struct analyseGenTracks { -struct analyseGenTracks -{ - - HistogramRegistry registryGen - { - "registryGen", - { - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - } // - }; - - expressions::Filter posZFilterMC = (aod::mccollision::posZ < 15) && (aod::mccollision::posZ > -15); - - void process(soa::Filtered::iterator const& mcCollision, Particles const& particles) + HistogramRegistry registryGen{ + "registryGen", { - int nChargedPrimaryParticles = 0; - auto z = mcCollision.posZ(); - - for (auto& particle : particles) - { - auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); - int charge = 0; - if (p == nullptr) - { - // unknown particles will be skipped - if (particle.pdgCode() > 1000000000) - { - // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); - // charge = x - std::trunc(x / 1000) * 1000; - LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) - } - else - { - LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); - } - } - else - { - charge = p->Charge(); - } - if (charge != 0 && particle.isPhysicalPrimary()) - { - registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + } // + }; + expressions::Filter posZFilterMC = (aod::mccollision::posZ < 15) && (aod::mccollision::posZ > -15); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - nChargedPrimaryParticles++; + void process(soa::Filtered::iterator const& mcCollision, Particles const& particles) + { + int nChargedPrimaryParticles = 0; + auto z = mcCollision.posZ(); + + for (auto& particle : particles) { + auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); + int charge = 0; + if (p == nullptr) { + // unknown particles will be skipped + if (particle.pdgCode() > 1000000000) { + // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); + // charge = x - std::trunc(x / 1000) * 1000; + LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) + } else { + LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); } + } else { + charge = p->Charge(); } + if (charge != 0 && particle.isPhysicalPrimary()) { + registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - //registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + nChargedPrimaryParticles++; + } } + + //registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + } }; //end of the gen task - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ From 16209fa0df0bfff25a297864adbdd9540a894be6 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 29 Nov 2021 15:47:53 +0100 Subject: [PATCH 05/17] Change in processGen that runs --- PWGMM/Tasks/analyse-mft-tracks.cxx | 150 +++++++++++++++++------------ 1 file changed, 87 insertions(+), 63 deletions(-) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx index 97de58b36ed..aac4f6dbbb2 100644 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -9,6 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -20,97 +22,119 @@ using namespace o2::framework; using Particles = aod::McParticles; + + //First approach to analysing an AO2D.root file //written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html -struct analyseMFTTracks { + + + +struct analyseMFTTracks +{ int icoll = 0; - HistogramRegistry registry{ - "registry", - { - {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, - {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // - } // - }; + HistogramRegistry registry + { + "registry", + { + {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // + } // + }; void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) - { + { + + auto z = collision.posZ(); + registry.fill(HIST("NtrkZvtx"), tracks.size(), z); - auto z = collision.posZ(); - registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + for (auto& track : tracks) + { + registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Multiplicity"), icoll); + registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); + } + icoll++; - for (auto& track : tracks) { - registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Multiplicity"), icoll); - registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); } - icoll++; - } - //end of process + //end of process - //aod::McCollisions +//aod::McCollisions }; //end of MyTask -struct analyseGenTracks { - HistogramRegistry registryGen{ - "registryGen", +struct analyseGenTracks +{ + + HistogramRegistry registryGen + { + "registryGen", + { + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2*M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + } // + }; + + + + void process(aod::McCollisions::iterator const& mcCollision, Particles const& particles) { - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - } // - }; + int nChargedPrimaryParticles = 0; + auto z = mcCollision.posZ(); + + for (auto& particle : particles) + { + auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); + int charge = 0; + if (p == nullptr) + { + // unknown particles will be skipped + if (particle.pdgCode() > 1000000000) + { + // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); + // charge = x - std::trunc(x / 1000) * 1000; + LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) + } + else + { + LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); + } + } + else + { + charge = p->Charge(); + } + if (charge != 0 && particle.isPhysicalPrimary()) + { + registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - expressions::Filter posZFilterMC = (aod::mccollision::posZ < 15) && (aod::mccollision::posZ > -15); - void process(soa::Filtered::iterator const& mcCollision, Particles const& particles) - { - int nChargedPrimaryParticles = 0; - auto z = mcCollision.posZ(); - - for (auto& particle : particles) { - auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); - int charge = 0; - if (p == nullptr) { - // unknown particles will be skipped - if (particle.pdgCode() > 1000000000) { - // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); - // charge = x - std::trunc(x / 1000) * 1000; - LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) - } else { - LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + nChargedPrimaryParticles++; } - } else { - charge = p->Charge(); } - if (charge != 0 && particle.isPhysicalPrimary()) { - registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - nChargedPrimaryParticles++; - } + registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); } - - //registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); - } }; //end of the gen task + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc), - //adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From b4243b85ab0b4cb44e9cf7a055ac36a4bb8d9aa9 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 29 Nov 2021 15:50:35 +0100 Subject: [PATCH 06/17] Change in processGen that runs --- PWGMM/Tasks/analyse-mft-tracks.cxx | 148 ++++++++++++----------------- 1 file changed, 61 insertions(+), 87 deletions(-) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx index aac4f6dbbb2..7ddfec53747 100644 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -9,8 +9,6 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - - #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -22,115 +20,91 @@ using namespace o2::framework; using Particles = aod::McParticles; - - //First approach to analysing an AO2D.root file //written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html - - - -struct analyseMFTTracks -{ +struct analyseMFTTracks { int icoll = 0; - HistogramRegistry registry - { - "registry", - { - {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, - {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // - } // - }; - - void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + HistogramRegistry registry{ + "registry", { + {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // + } // + }; - auto z = collision.posZ(); - registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + { - for (auto& track : tracks) - { - registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Multiplicity"), icoll); - registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); - } - icoll++; + auto z = collision.posZ(); + registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + for (auto& track : tracks) { + registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Multiplicity"), icoll); + registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); } - //end of process + icoll++; + } + //end of process -//aod::McCollisions + //aod::McCollisions }; //end of MyTask +struct analyseGenTracks { -struct analyseGenTracks -{ - - HistogramRegistry registryGen - { - "registryGen", - { - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2*M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - } // - }; - - - - void process(aod::McCollisions::iterator const& mcCollision, Particles const& particles) + HistogramRegistry registryGen{ + "registryGen", { - int nChargedPrimaryParticles = 0; - auto z = mcCollision.posZ(); - - for (auto& particle : particles) - { - auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); - int charge = 0; - if (p == nullptr) - { - // unknown particles will be skipped - if (particle.pdgCode() > 1000000000) - { - // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); - // charge = x - std::trunc(x / 1000) * 1000; - LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) - } - else - { - LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); - } - } - else - { - charge = p->Charge(); - } - if (charge != 0 && particle.isPhysicalPrimary()) - { - registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // + } // + }; - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - nChargedPrimaryParticles++; + void process(aod::McCollisions::iterator const& mcCollision, Particles const& particles) + { + int nChargedPrimaryParticles = 0; + auto z = mcCollision.posZ(); + + for (auto& particle : particles) { + auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); + int charge = 0; + if (p == nullptr) { + // unknown particles will be skipped + if (particle.pdgCode() > 1000000000) { + // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); + // charge = x - std::trunc(x / 1000) * 1000; + LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) + } else { + LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); } + } else { + charge = p->Charge(); } + if (charge != 0 && particle.isPhysicalPrimary()) { + registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + nChargedPrimaryParticles++; + } } + + registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + } }; //end of the gen task - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ From 1c1ada25440fc4aa078c29ae3ec97b1ca9ef13c9 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Wed, 8 Dec 2021 12:59:32 +0100 Subject: [PATCH 07/17] My version of CMakeList adding mft-tracks-for-comparison --- PWGMM/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 8e0f5a5dcaa..dd9807b22b3 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -23,3 +23,8 @@ o2physics_add_dpl_workflow(analyse-mft-tracks SOURCES analyse-mft-tracks.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(mft-tracks-for-comparison + SOURCES mft-tracks-for-comparison.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From 6f811298bf045b5edb823d94ca6b8b89ec3b4ba8 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:28:22 +0100 Subject: [PATCH 08/17] The task analyse-mft-tracks with the wanted modifications --- PWGMM/Tasks/analyse-mft-tracks.cxx | 66 ++++++++++++------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx index 7ddfec53747..be0a64f7f7b 100644 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -20,64 +20,50 @@ using namespace o2::framework; using Particles = aod::McParticles; -//First approach to analysing an AO2D.root file -//written thanks to https://aliceo2group.github.io/analysis-framework/docs/tutorials/analysistask.html +//the task analyseMFTTracks loops over MFT tracks and generated particles and fills basic histograms struct analyseMFTTracks { int icoll = 0; - + Service pdg; HistogramRegistry registry{ "registry", { - {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, - {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEta", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - {"Multiplicity", "alibi_nightlies/O2DPG_pp_minbias_testbeam.sh/15-11-2021-18:00 - tf13; collisionID; N_{trk}^{MFT}", {HistType::kTH1F, {{101, 0., 100.}}}, true} // - } // + {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEta", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, // + {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + //{"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"NtrkEtaGen", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, // + } // }; - void process(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) + void processRec(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) { auto z = collision.posZ(); registry.fill(HIST("NtrkZvtx"), tracks.size(), z); + double zLastCls = 0; for (auto& track : tracks) { registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("Multiplicity"), icoll); - registry.fill(HIST("NtrkEta"), tracks.size(), track.eta()); + registry.fill(HIST("NtrkEta"), track.eta()); } icoll++; } - //end of process - - //aod::McCollisions -}; -//end of MyTask + //end of processRec + PROCESS_SWITCH(analyseMFTTracks, processRec, "Process rec level", true); -struct analyseGenTracks { - - HistogramRegistry registryGen{ - "registryGen", - { - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEtaGen", "; N_{trk}; #eta; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {35, -4.5, -1.}}}}, // - } // - }; - - void process(aod::McCollisions::iterator const& mcCollision, Particles const& particles) + void processGen(aod::McCollisions::iterator const& mcCollision, Particles const& particles) { + int nChargedPrimaryParticles = 0; auto z = mcCollision.posZ(); for (auto& particle : particles) { - auto p = TDatabasePDG::Instance()->GetParticle(particle.pdgCode()); + auto p = pdg->GetParticle(particle.pdgCode()); int charge = 0; if (p == nullptr) { // unknown particles will be skipped @@ -92,23 +78,25 @@ struct analyseGenTracks { charge = p->Charge(); } if (charge != 0 && particle.isPhysicalPrimary()) { - registryGen.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registryGen.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + registry.fill(HIST("NtrkEtaGen"), particle.eta()); nChargedPrimaryParticles++; } } - registryGen.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); + registry.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); } + + PROCESS_SWITCH(analyseMFTTracks, processGen, "Process gen level", true); }; -//end of the gen task +//end of the task analyseMFTTracks WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc), }; } From 24bc0df7609024d50059325809c8686715cc5fea Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:33:10 +0100 Subject: [PATCH 09/17] New CMakeLists with the task analyse-mft-tracks added --- PWGMM/Tasks/CMakeLists.txt | 48 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index dd9807b22b3..db704d41049 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -1,30 +1,32 @@ -# 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. +#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". +#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 +#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. -o2physics_add_dpl_workflow(run2-dndeta - SOURCES run2dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(run2 - dndeta + SOURCES run2dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dndeta - SOURCES dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(dndeta + SOURCES dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(analyse-mft-tracks - SOURCES analyse-mft-tracks.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(analyse - mft - tracks SOURCES analyse - mft - tracks.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(mft-tracks-for-comparison - SOURCES mft-tracks-for-comparison.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(ue - charged + SOURCES uecharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + + o2physics_add_dpl_workflow(lumi + SOURCES lumi.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From 08b88eb0f1382445ab5c6c1358af8b2a4584e0cc Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:41:02 +0100 Subject: [PATCH 10/17] The new task analyse-mft-tracks with wanted modifications --- PWGMM/Tasks/CMakeLists.txt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index c49bb4d0bad..db704d41049 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -19,17 +19,14 @@ o2physics_add_dpl_workflow(run2 - dndeta PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(analyse-mft-tracks - SOURCES analyse-mft-tracks.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(analyse - mft - tracks SOURCES analyse - mft - tracks.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(ue-charged - SOURCES uecharged.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(ue - charged + SOURCES uecharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(lumi - SOURCES lumi.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(lumi + SOURCES lumi.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From 6d1c20cbe3443e3a8338e6f5b305937964c29488 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:10:13 +0100 Subject: [PATCH 11/17] blabla --- PWGMM/Tasks/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index db704d41049..8295785a9c9 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -9,7 +9,7 @@ #granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(run2 - dndeta +o2physics_add_dpl_workflow(run2-dndeta SOURCES run2dndeta.cxx dndeta.h PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) @@ -19,9 +19,12 @@ o2physics_add_dpl_workflow(run2 - dndeta PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(analyse - mft - tracks SOURCES analyse - mft - tracks.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(analyse-mft-tracks + SOURCES analyse-mft-tracks.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(ue - charged + o2physics_add_dpl_workflow(ue-charged SOURCES uecharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) From 92e0acee0ac2b6bac5641303cdc5c85c57f2ecf6 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:52:19 +0100 Subject: [PATCH 12/17] updated CMakeLists.txt --- PWGMM/Tasks/CMakeLists.txt | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 8295785a9c9..0a3831602cb 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright 2019 - 2020 CERN and copyright holders of ALICE O2. +#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. # @@ -10,26 +10,26 @@ # or submit itself to any jurisdiction. o2physics_add_dpl_workflow(run2-dndeta - SOURCES run2dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES run2dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(dndeta - SOURCES dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(dndeta + SOURCES dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(analyse-mft-tracks - SOURCES analyse-mft-tracks.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(analyse-mft-tracks + SOURCES analyse-mft-tracks.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(ue-charged - SOURCES uecharged.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(ue-charged + SOURCES uecharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(lumi - SOURCES lumi.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(lumi + SOURCES lumi.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From 776cc9b63c1935f9dda572bb9a0f5413592bf437 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:07:36 +0100 Subject: [PATCH 13/17] Update CMakeLists.txt --- PWGMM/Tasks/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 0a3831602cb..6a022cd8ba1 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -1,13 +1,13 @@ -#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. +// 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. o2physics_add_dpl_workflow(run2-dndeta SOURCES run2dndeta.cxx dndeta.h From 1d48d4d3ee8a303e3e6d2a0b54b702411ea07874 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:08:26 +0100 Subject: [PATCH 14/17] Update CMakeLists.txt --- PWGMM/Tasks/CMakeLists.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 6a022cd8ba1..d7cc8067216 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -1,13 +1,14 @@ -// 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. +# 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. + o2physics_add_dpl_workflow(run2-dndeta SOURCES run2dndeta.cxx dndeta.h From bee9d9ef1112a4eae6f51d3778d3af267c35fa14 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:10:53 +0100 Subject: [PATCH 15/17] Update CMakeLists.txt --- PWGMM/Tasks/CMakeLists.txt | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index d7cc8067216..3a6b6cfdb3d 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -11,26 +11,26 @@ o2physics_add_dpl_workflow(run2-dndeta - SOURCES run2dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES run2dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dndeta - SOURCES dndeta.cxx dndeta.h - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES dndeta.cxx dndeta.h + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(analyse-mft-tracks - SOURCES analyse-mft-tracks.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES analyse-mft-tracks.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(ue-charged - SOURCES uecharged.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES uecharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(lumi - SOURCES lumi.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES lumi.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From 48d6ab295d6c7caa94d835210cc2c0339b0fde1d Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:11:23 +0100 Subject: [PATCH 16/17] Update CMakeLists.txt --- PWGMM/Tasks/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 3a6b6cfdb3d..c31665e0bb2 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -9,7 +9,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. - o2physics_add_dpl_workflow(run2-dndeta SOURCES run2dndeta.cxx dndeta.h PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore From 4a840534b9df61152166813c36fcbbb17b395895 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:42:38 +0100 Subject: [PATCH 17/17] Update analyse-mft-tracks.cxx Deleted unused variable --- PWGMM/Tasks/analyse-mft-tracks.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx index be0a64f7f7b..acf4e443254 100644 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ b/PWGMM/Tasks/analyse-mft-tracks.cxx @@ -44,7 +44,6 @@ struct analyseMFTTracks { auto z = collision.posZ(); registry.fill(HIST("NtrkZvtx"), tracks.size(), z); - double zLastCls = 0; for (auto& track : tracks) { registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta());