diff --git a/ALICE3/Core/ALICE3CoreLinkDef.h b/ALICE3/Core/ALICE3CoreLinkDef.h index 076c21f8a79..bdd3c955d51 100644 --- a/ALICE3/Core/ALICE3CoreLinkDef.h +++ b/ALICE3/Core/ALICE3CoreLinkDef.h @@ -13,6 +13,5 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::pid::tof::TOFResoALICE3 + ; #pragma link C++ class std::vector < std::vector < unsigned int>> + ; #pragma link C++ class std::vector < std::vector < std::uint32_t>> + ; diff --git a/ALICE3/Core/CMakeLists.txt b/ALICE3/Core/CMakeLists.txt index 159ee735f92..11d4ecdf299 100644 --- a/ALICE3/Core/CMakeLists.txt +++ b/ALICE3/Core/CMakeLists.txt @@ -10,8 +10,7 @@ # or submit itself to any jurisdiction. o2physics_add_library(ALICE3Core - SOURCES TOFResoALICE3.cxx - TrackUtilities.cxx + SOURCES TrackUtilities.cxx FlatLutEntry.cxx FlatTrackSmearer.cxx GeometryContainer.cxx @@ -19,8 +18,7 @@ o2physics_add_library(ALICE3Core O2Physics::AnalysisCore) o2physics_target_root_dictionary(ALICE3Core - HEADERS TOFResoALICE3.h - TrackUtilities.h + HEADERS TrackUtilities.h FlatLutEntry.h GeometryContainer.h LINKDEF ALICE3CoreLinkDef.h) diff --git a/ALICE3/Core/TOFResoALICE3.cxx b/ALICE3/Core/TOFResoALICE3.cxx deleted file mode 100644 index 6d3bdd40383..00000000000 --- a/ALICE3/Core/TOFResoALICE3.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file TOFResoALICE3.h -/// \author Nicolo' Jacazio -/// \since 11/03/2021 -/// \brief Implementation for the TOF PID response of the expected times resolution -/// - -#include "ALICE3/Core/TOFResoALICE3.h" - -#include - -#include - -namespace o2::pid::tof -{ - -float TOFResoALICE3Param(const float& momentum, const float& momentumError, const float& evtimereso, const float& length, const float& mass, const Parameters& parameters) -{ - if (momentum <= 0) { - return -999.f; - } - - const float p2 = momentum * momentum; - const float Lc = length / 0.0299792458f; - const float mass2 = mass * mass; - const float ep = momentumError * momentum; - // const float ep = momentumError * p2; - const float etexp = Lc * mass2 / p2 / sqrt(mass2 + p2) * ep; - return sqrt(etexp * etexp + parameters[0] * parameters[0] + evtimereso * evtimereso); -} - -} // namespace o2::pid::tof diff --git a/ALICE3/Core/TOFResoALICE3.h b/ALICE3/Core/TOFResoALICE3.h deleted file mode 100644 index e392d120ecf..00000000000 --- a/ALICE3/Core/TOFResoALICE3.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file TOFResoALICE3.h -/// \author Nicolo' Jacazio -/// \since 11/03/2021 -/// \brief Implementation for the TOF PID response of the expected times resolution -/// - -#ifndef ALICE3_CORE_TOFRESOALICE3_H_ -#define ALICE3_CORE_TOFRESOALICE3_H_ - -#include -#include - -#include - -#include -#include - -#include - -namespace o2::pid::tof -{ - -class TOFResoALICE3 : public Parametrization -{ - public: - TOFResoALICE3() : Parametrization("TOFResoALICE3", 1){}; - ~TOFResoALICE3() override = default; - float operator()(const float* x) const override - { - const float p = abs(x[0]); - if (p <= 0) { - return -999; - } - - /** get info **/ - // const float time = x[1]; - const float evtimereso = x[2]; - const float mass = x[3]; - const float L = x[4]; - const float p2 = p * p; - // const float ep = x[5] * x[6]; - const float ep = x[5] * p2; - const float Lc = L / 0.0299792458f; - // const float Lc = L / 29.9792458f; - - const float mass2 = mass * mass; - const float etexp = Lc * mass2 / p2 / sqrt(mass2 + p2) * ep; - return sqrt(etexp * etexp + mParameters[0] * mParameters[0] + evtimereso * evtimereso); - } - ClassDef(TOFResoALICE3, 1); -}; - -float TOFResoALICE3Param(const float& momentum, const float& momentumError, const float& evtimereso, const float& length, const float& mass, const Parameters& parameters); - -template -float TOFResoALICE3ParamTrack(const T& track, const Parameters& parameters) -{ - const float BETA = tan(0.25f * static_cast(M_PI) - 0.5f * atan(track.tgl())); - const float sigmaP = sqrt(track.pt() * track.pt() * track.sigma1Pt() * track.sigma1Pt() + (BETA * BETA - 1.f) / (BETA * (BETA * BETA + 1.f)) * (track.tgl() / sqrt(track.tgl() * track.tgl() + 1.f) - 1.f) * track.sigmaTgl() * track.sigmaTgl()); - // const float sigmaP = std::sqrt( track.getSigma1Pt2() ) * track.pt(); - return TOFResoALICE3Param(track.p(), sigmaP, track.collision().collisionTimeRes() * 1000.f, track.length(), o2::track::pid_constants::sMasses2Z[id], parameters); - // return TOFResoALICE3Param(track.p(), track.sigma1Pt(), collision.collisionTimeRes() * 1000.f, track.length(), o2::track::pid_constants::sMasses[id], parameters); -} - -} // namespace o2::pid::tof - -#endif // ALICE3_CORE_TOFRESOALICE3_H_ diff --git a/ALICE3/DataModel/ECAL.h b/ALICE3/DataModel/ECAL.h deleted file mode 100644 index 9ef1e8a3391..00000000000 --- a/ALICE3/DataModel/ECAL.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file ECAL.h -/// \author Nicolo' Jacazio -/// \since 14/09/2021 -/// \brief Set of tables for the ALICE3 ECAL information -/// - -#ifndef ALICE3_DATAMODEL_ECAL_H_ -#define ALICE3_DATAMODEL_ECAL_H_ - -#include - -namespace o2::aod -{ -namespace alice3ecal -{ -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! Index to travel from ECAL to collision -DECLARE_SOA_INDEX_COLUMN(Track, track); //! Index to travel from ECAL to track -DECLARE_SOA_INDEX_COLUMN(McParticle, mcparticle); //! Index to travel from ECAL to particle -DECLARE_SOA_COLUMN(E, e, double); //! Signal in ECAL -DECLARE_SOA_COLUMN(Px, px, double); //! Px -DECLARE_SOA_COLUMN(Py, py, double); //! Py -DECLARE_SOA_COLUMN(Pz, pz, double); //! Pz -DECLARE_SOA_COLUMN(PosZ, posZ, float); //! Position in Z -DECLARE_SOA_COLUMN(PosPhi, posPhi, float); //! Position in phi -} // namespace alice3ecal - -DECLARE_SOA_TABLE(ECALs, "AOD", "A3ECAL", //! Table for the ALICE3 ECAL detector - o2::soa::Index<>, - alice3ecal::CollisionId, - alice3ecal::TrackId, - alice3ecal::McParticleId, - alice3ecal::E, - alice3ecal::Px, - alice3ecal::Py, - alice3ecal::Pz, - alice3ecal::PosPhi, - alice3ecal::PosZ); - -using ECAL = ECALs::iterator; - -} // namespace o2::aod - -#endif // ALICE3_DATAMODEL_ECAL_H_ diff --git a/ALICE3/DataModel/FTOF.h b/ALICE3/DataModel/FTOF.h deleted file mode 100644 index 3d047c21fd5..00000000000 --- a/ALICE3/DataModel/FTOF.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file FTOF.h -/// \author Nicolo' Jacazio -/// \since 27/05/2021 -/// \brief Set of tables for the ALICE3 FTOF information -/// - -#ifndef ALICE3_DATAMODEL_FTOF_H_ -#define ALICE3_DATAMODEL_FTOF_H_ - -#include - -namespace o2::aod -{ -namespace alice3ftof -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); //! -DECLARE_SOA_COLUMN(FTOFLength, ftofLength, float); //! -DECLARE_SOA_COLUMN(FTOFSignal, ftofSignal, float); //! -DECLARE_SOA_COLUMN(FTOFDeltaEl, ftofDeltaEl, float); //! -DECLARE_SOA_COLUMN(FTOFDeltaMu, ftofDeltaMu, float); //! -DECLARE_SOA_COLUMN(FTOFDeltaPi, ftofDeltaPi, float); //! -DECLARE_SOA_COLUMN(FTOFDeltaKa, ftofDeltaKa, float); //! -DECLARE_SOA_COLUMN(FTOFDeltaPr, ftofDeltaPr, float); //! -DECLARE_SOA_COLUMN(FTOFNsigmaEl, ftofNsigmaEl, float); //! -DECLARE_SOA_COLUMN(FTOFNsigmaMu, ftofNsigmaMu, float); //! -DECLARE_SOA_COLUMN(FTOFNsigmaPi, ftofNsigmaPi, float); //! -DECLARE_SOA_COLUMN(FTOFNsigmaKa, ftofNsigmaKa, float); //! -DECLARE_SOA_COLUMN(FTOFNsigmaPr, ftofNsigmaPr, float); //! -} // namespace alice3ftof - -DECLARE_SOA_TABLE(FTOFs, "AOD", "FTOF", //! - o2::soa::Index<>, - alice3ftof::TrackId, - alice3ftof::FTOFLength, - alice3ftof::FTOFSignal, - alice3ftof::FTOFDeltaEl, - alice3ftof::FTOFDeltaMu, - alice3ftof::FTOFDeltaPi, - alice3ftof::FTOFDeltaKa, - alice3ftof::FTOFDeltaPr, - alice3ftof::FTOFNsigmaEl, - alice3ftof::FTOFNsigmaMu, - alice3ftof::FTOFNsigmaPi, - alice3ftof::FTOFNsigmaKa, - alice3ftof::FTOFNsigmaPr); - -using FTOF = FTOFs::iterator; - -} // namespace o2::aod - -#endif // ALICE3_DATAMODEL_FTOF_H_ diff --git a/ALICE3/DataModel/MID.h b/ALICE3/DataModel/MID.h deleted file mode 100644 index 7357e689eda..00000000000 --- a/ALICE3/DataModel/MID.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file MID.h -/// \author Vít Kučera -/// \note Based on RICH.h -/// \brief Set of tables for the ALICE3 MID information -/// - -#ifndef ALICE3_DATAMODEL_MID_H_ -#define ALICE3_DATAMODEL_MID_H_ - -#include - -#include - -namespace o2::aod -{ -namespace alice3mid -{ -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(Track, track); //! -DECLARE_SOA_COLUMN(MIDIsMuon, midIsMuon, uint8_t); //! FIXME: To be changed to bool once bool columns are groupable. -} // namespace alice3mid - -DECLARE_SOA_TABLE(MIDs, "AOD", "MID", //! - o2::soa::Index<>, - alice3mid::CollisionId, - alice3mid::TrackId, - alice3mid::MIDIsMuon); - -using MID = MIDs::iterator; - -} // namespace o2::aod - -#endif // ALICE3_DATAMODEL_MID_H_ diff --git a/ALICE3/DataModel/RICH.h b/ALICE3/DataModel/RICH.h deleted file mode 100644 index a1fc7c7c692..00000000000 --- a/ALICE3/DataModel/RICH.h +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file RICH.h -/// \author Nicolo' Jacazio -/// \since 25/02/2021 -/// \brief Set of tables for the ALICE3 RICH information -/// - -#ifndef ALICE3_DATAMODEL_RICH_H_ -#define ALICE3_DATAMODEL_RICH_H_ - -#include -#include - -namespace o2::aod -{ -namespace alice3rich -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); //! Index to travel from track to RICH -DECLARE_SOA_COLUMN(RICHSignal, richSignal, float); //! Signal in RICH -DECLARE_SOA_COLUMN(RICHSignalError, richSignalError, float); //! Error on the RICH signal -DECLARE_SOA_COLUMN(RICHDeltaEl, richDeltaEl, float); //! signal - exp. signal for electrons -DECLARE_SOA_COLUMN(RICHDeltaMu, richDeltaMu, float); //! signal - exp. signal for muons -DECLARE_SOA_COLUMN(RICHDeltaPi, richDeltaPi, float); //! signal - exp. signal for pions -DECLARE_SOA_COLUMN(RICHDeltaKa, richDeltaKa, float); //! signal - exp. signal for kaons -DECLARE_SOA_COLUMN(RICHDeltaPr, richDeltaPr, float); //! signal - exp. signal for protons -DECLARE_SOA_COLUMN(RICHNsigmaEl, richNsigmaEl, float); //! nsigma separation for electrons -DECLARE_SOA_COLUMN(RICHNsigmaMu, richNsigmaMu, float); //! nsigma separation for muons -DECLARE_SOA_COLUMN(RICHNsigmaPi, richNsigmaPi, float); //! nsigma separation for pions -DECLARE_SOA_COLUMN(RICHNsigmaKa, richNsigmaKa, float); //! nsigma separation for kaons -DECLARE_SOA_COLUMN(RICHNsigmaPr, richNsigmaPr, float); //! nsigma separation for protons -DECLARE_SOA_DYNAMIC_COLUMN(RICHDelta, richDelta, //! Delta separation with the RICH detector for the combined species - [](const float& El, const float& Mu, const float& Pi, - const float& Ka, const float& Pr, const o2::track::PID::ID& index) -> float { - switch (index) { - case o2::track::PID::Electron: - return El; - case o2::track::PID::Muon: - return Mu; - case o2::track::PID::Pion: - return Pi; - case o2::track::PID::Kaon: - return Ka; - case o2::track::PID::Proton: - return Pr; - default: - return -999.f; - } - }); -DECLARE_SOA_DYNAMIC_COLUMN(RICHNsigma, richNsigma, //! Nsigma separation with the RICH detector for the combined species - [](const float& El, const float& Mu, const float& Pi, - const float& Ka, const float& Pr, const o2::track::PID::ID& index) -> float { - switch (index) { - case o2::track::PID::Electron: - return El; - case o2::track::PID::Muon: - return Mu; - case o2::track::PID::Pion: - return Pi; - case o2::track::PID::Kaon: - return Ka; - case o2::track::PID::Proton: - return Pr; - default: - return -999.f; - } - }); -} // namespace alice3rich - -namespace alice3frich -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); //! Index to travel from track to FRICH -DECLARE_SOA_COLUMN(FRICHSignal, frichSignal, float); //! Signal in RICH -DECLARE_SOA_COLUMN(FRICHSignalError, frichSignalError, float); //! Error on the RICH signal -DECLARE_SOA_COLUMN(FRICHDeltaEl, frichDeltaEl, float); //! signal - exp. signal for electrons -DECLARE_SOA_COLUMN(FRICHDeltaMu, frichDeltaMu, float); //! signal - exp. signal for muons -DECLARE_SOA_COLUMN(FRICHDeltaPi, frichDeltaPi, float); //! signal - exp. signal for pions -DECLARE_SOA_COLUMN(FRICHDeltaKa, frichDeltaKa, float); //! signal - exp. signal for kaons -DECLARE_SOA_COLUMN(FRICHDeltaPr, frichDeltaPr, float); //! signal - exp. signal for protons -DECLARE_SOA_COLUMN(FRICHNsigmaEl, frichNsigmaEl, float); //! nsigma separation for electrons -DECLARE_SOA_COLUMN(FRICHNsigmaMu, frichNsigmaMu, float); //! nsigma separation for muons -DECLARE_SOA_COLUMN(FRICHNsigmaPi, frichNsigmaPi, float); //! nsigma separation for pions -DECLARE_SOA_COLUMN(FRICHNsigmaKa, frichNsigmaKa, float); //! nsigma separation for kaons -DECLARE_SOA_COLUMN(FRICHNsigmaPr, frichNsigmaPr, float); //! nsigma separation for protons -DECLARE_SOA_DYNAMIC_COLUMN(FRICHDelta, frichDelta, //! Delta separation with the FRICH detector for the combined species - [](const float& El, const float& Mu, const float& Pi, - const float& Ka, const float& Pr, const o2::track::PID::ID& index) -> float { - switch (index) { - case o2::track::PID::Electron: - return El; - case o2::track::PID::Muon: - return Mu; - case o2::track::PID::Pion: - return Pi; - case o2::track::PID::Kaon: - return Ka; - case o2::track::PID::Proton: - return Pr; - default: - return -999.f; - } - }); -DECLARE_SOA_DYNAMIC_COLUMN(FRICHNsigma, frichNsigma, //! Nsigma separation with the FRICH detector for the combined species - [](const float& El, const float& Mu, const float& Pi, - const float& Ka, const float& Pr, const o2::track::PID::ID& index) -> float { - switch (index) { - case o2::track::PID::Electron: - return El; - case o2::track::PID::Muon: - return Mu; - case o2::track::PID::Pion: - return Pi; - case o2::track::PID::Kaon: - return Ka; - case o2::track::PID::Proton: - return Pr; - default: - return -999.f; - } - }); -} // namespace alice3frich - -DECLARE_SOA_TABLE(RICHs, "AOD", "RICH", //! Table for the ALICE3 RICH detector - o2::soa::Index<>, - alice3rich::TrackId, - alice3rich::RICHSignal, - alice3rich::RICHSignalError, - alice3rich::RICHDeltaEl, - alice3rich::RICHDeltaMu, - alice3rich::RICHDeltaPi, - alice3rich::RICHDeltaKa, - alice3rich::RICHDeltaPr, - alice3rich::RICHNsigmaEl, - alice3rich::RICHNsigmaMu, - alice3rich::RICHNsigmaPi, - alice3rich::RICHNsigmaKa, - alice3rich::RICHNsigmaPr, - alice3rich::RICHDelta, - alice3rich::RICHNsigma); -using RICH = RICHs::iterator; - -DECLARE_SOA_TABLE(FRICHs, "AOD", "FRICH", //! Table for the ALICE3 Forward RICH detector - o2::soa::Index<>, - alice3frich::TrackId, - alice3frich::FRICHSignal, - alice3frich::FRICHSignalError, - alice3frich::FRICHDeltaEl, - alice3frich::FRICHDeltaMu, - alice3frich::FRICHDeltaPi, - alice3frich::FRICHDeltaKa, - alice3frich::FRICHDeltaPr, - alice3frich::FRICHNsigmaEl, - alice3frich::FRICHNsigmaMu, - alice3frich::FRICHNsigmaPi, - alice3frich::FRICHNsigmaKa, - alice3frich::FRICHNsigmaPr, - alice3frich::FRICHDelta, - alice3frich::FRICHNsigma); - -using FRICH = FRICHs::iterator; - -} // namespace o2::aod - -#endif // ALICE3_DATAMODEL_RICH_H_ diff --git a/ALICE3/Tasks/CMakeLists.txt b/ALICE3/Tasks/CMakeLists.txt index 822d407221f..8af7d1d1815 100644 --- a/ALICE3/Tasks/CMakeLists.txt +++ b/ALICE3/Tasks/CMakeLists.txt @@ -24,21 +24,6 @@ o2physics_add_dpl_workflow(alice3-lutmaker PUBLIC_LINK_LIBRARIES O2::Framework FairRoot::Base O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(alice3-pid-rich-qa - SOURCES pidRICHqa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(alice3-ecal-qa - SOURCES ECALqa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(alice3-pid-ftof-qa - SOURCES pidFTOFqa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(alice3-pid-separation-power SOURCES alice3SeparationPower.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/ALICE3/Tasks/ECALqa.cxx b/ALICE3/Tasks/ECALqa.cxx deleted file mode 100644 index 73a73ca32a3..00000000000 --- a/ALICE3/Tasks/ECALqa.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file ECALqa.cxx -/// \author Nicolo' Jacazio -/// \since 14/09/2021 -/// \brief Task to use the ALICE3 ECAL table -/// - -#include "ALICE3/DataModel/ECAL.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -namespace o2::aod -{ - -namespace indices -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); -DECLARE_SOA_INDEX_COLUMN(ECAL, ecal); - -DECLARE_SOA_INDEX_COLUMN(McParticle, mcparticle); - -} // namespace indices - -DECLARE_SOA_INDEX_TABLE_USER(ECALTracksIndex, Tracks, "ECALTRK", indices::TrackId, indices::ECALId); -DECLARE_SOA_INDEX_TABLE_USER(ECALMcPartIndex, McParticles, "ECALPART", indices::McParticleId, indices::ECALId); -} // namespace o2::aod - -struct ecalIndexBuilder { // Builder of the ECAL-track index linkage - Builds ind; - Builds indPart; - void init(o2::framework::InitContext&) - { - } -}; - -struct ecalQaMc { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject}; - - void init(o2::framework::InitContext&) - { - histos.add("energy", ";Energy (GeV/#it{c});Entries", HistType::kTH1F, {{100, 0, 100}}); - histos.add("energyVsp", ";Energy (GeV/#it{c});#it{p} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("ecalpVsp", ";#it{p}_{ECAL} (GeV/#it{c});#it{p} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("ecalpxVspx", ";#it{p}_{ECAL x} (GeV/#it{c});#it{p} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("ecalpyVspy", ";#it{p}_{ECAL y} (GeV/#it{c});#it{p} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("ecalpzVspz", ";#it{p}_{ECAL z} (GeV/#it{c});#it{p} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("energyVsecalp", ";Energy (GeV/#it{c});#it{p}_{ECAL} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("energyVsecalpx", ";Energy (GeV/#it{c});#it{p}_{ECAL x} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("energyVsecalpy", ";Energy (GeV/#it{c});#it{p}_{ECAL y} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("energyVsecalpz", ";Energy (GeV/#it{c});#it{p}_{ECAL z} (GeV/#it{c});Entries", HistType::kTH2F, {{100, 0, 100}, {100, 0, 100}}); - histos.add("PDGs", "Particle PDGs;PDG Code", kTH1D, {{100, 0.f, 100.f}}); - } - - using Trks = soa::Join; - void process(const soa::Join& mcParticles, - const Trks&, - const aod::McTrackLabels&, - const aod::ECALs&, - const aod::Collisions&) - { - for (auto& particle : mcParticles) { - if (!particle.has_ecal()) - continue; - histos.fill(HIST("energy"), particle.ecal().e()); - const float ecalp = std::sqrt(particle.ecal().px() * particle.ecal().px() + particle.ecal().py() * particle.ecal().py() + particle.ecal().pz() * particle.ecal().pz()); - histos.fill(HIST("energyVsp"), particle.ecal().e(), particle.p()); - histos.fill(HIST("ecalpVsp"), ecalp, particle.p()); - histos.fill(HIST("ecalpxVspx"), particle.ecal().px(), particle.px()); - histos.fill(HIST("ecalpyVspy"), particle.ecal().py(), particle.py()); - histos.fill(HIST("ecalpzVspz"), particle.ecal().pz(), particle.pz()); - histos.fill(HIST("energyVsecalp"), particle.ecal().e(), ecalp); - histos.fill(HIST("energyVsecalpx"), particle.ecal().e(), particle.ecal().px()); - histos.fill(HIST("energyVsecalpy"), particle.ecal().e(), particle.ecal().py()); - histos.fill(HIST("energyVsecalpz"), particle.ecal().e(), particle.ecal().pz()); - histos.get(HIST("PDGs"))->Fill(Form("%i", particle.pdgCode()), 1.f); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfg) -{ - auto workflow = WorkflowSpec{adaptAnalysisTask(cfg)}; - workflow.push_back(adaptAnalysisTask(cfg)); - return workflow; -} diff --git a/ALICE3/Tasks/pidFTOFqa.cxx b/ALICE3/Tasks/pidFTOFqa.cxx deleted file mode 100644 index ba899e4dc85..00000000000 --- a/ALICE3/Tasks/pidFTOFqa.cxx +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -#include "ALICE3/DataModel/FTOF.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -namespace o2::aod -{ - -namespace indices -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); -DECLARE_SOA_INDEX_COLUMN(FTOF, ftof); -} // namespace indices - -DECLARE_SOA_INDEX_TABLE_USER(FTOFTracksIndex, Tracks, "FTOFTRK", indices::TrackId, indices::FTOFId); -} // namespace o2::aod - -struct ftofIndexBuilder { - Builds ind; - void init(o2::framework::InitContext&) - { - } -}; - -struct ftofPidQaMC { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject}; - Configurable pdgCode{"pdgCode", 0, "pdg code of the particles to accept"}; - Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", 1, - "Whether to use only physical primary particles."}; - Configurable minLength{"minLength", 0, "Minimum length of accepted tracks (cm)"}; - Configurable maxLength{"maxLength", 1000, "Maximum length of accepted tracks (cm)"}; - Configurable minEta{"minEta", -1.4, "Minimum eta of accepted tracks"}; - Configurable maxEta{"maxEta", 1.4, "Maximum eta of accepted tracks"}; - Configurable nBinsP{"nBinsP", 500, "Number of momentum bins"}; - Configurable minP{"minP", 0.01, "Minimum momentum plotted (GeV/c)"}; - Configurable maxP{"maxP", 100, "Maximum momentum plotted (GeV/c)"}; - Configurable nBinsNsigma{"nBinsNsigma", 600, "Number of Nsigma bins"}; - Configurable minNsigma{"minNsigma", -100.f, "Minimum Nsigma plotted"}; - Configurable maxNsigma{"maxNsigma", 100.f, "Maximum Nsigma plotted"}; - Configurable nBinsDelta{"nBinsDelta", 100, "Number of delta bins"}; - Configurable minDelta{"minDelta", -1.f, "Minimum delta plotted"}; - Configurable maxDelta{"maxDelta", 1.f, "Maximum delta plotted"}; - Configurable logAxis{"logAxis", 1, "Flag to use a log momentum axis"}; - - void init(o2::framework::InitContext&) - { - AxisSpec momAxis{nBinsP, minP, maxP}; - if (logAxis) { - momAxis.makeLogarithmic(); - } - const AxisSpec nsigmaAxis{nBinsNsigma, minNsigma, maxNsigma}; - const AxisSpec deltaAxis{nBinsDelta, minDelta, maxDelta}; - - histos.add("event/vertexz", ";Vtx_{z} (cm);Entries", kTH1F, {{100, -20, 20}}); - histos.add("event/length", ";FTOF length (cm)", kTH1F, {{100, 0, 100}}); - histos.add("event/eta", ";#it{#eta}", kTH1F, {{100, -10, 10}}); - histos.add("p/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {momAxis}); - histos.add("p/Prim", "Primaries;#it{p} (GeV/#it{c})", kTH1F, {momAxis}); - histos.add("p/Sec", "Secondaries;#it{p} (GeV/#it{c})", kTH1F, {momAxis}); - histos.add("pt/Unselected", "Unselected;#it{p} (GeV/#it{c})", kTH1F, {momAxis}); - histos.add("qa/length", ";FTOF length (cm)", kTH1F, {{100, 0, 100}}); - histos.add("qa/signal", ";FTOF signal (ps)", kTH1F, {{100, 0, 1000}}); - histos.add("qa/signalvsP", ";#it{p} (GeV/#it{c});FTOF signal (ps)", kTH2F, {momAxis, {1000, 0, 0.3}}); - histos.add("qa/deltaEl", ";#it{p} (GeV/#it{c});#Delta(e) (ps)", kTH2F, {momAxis, deltaAxis}); - histos.add("qa/deltaMu", ";#it{p} (GeV/#it{c});#Delta(#mu) (ps)", kTH2F, {momAxis, deltaAxis}); - histos.add("qa/deltaPi", ";#it{p} (GeV/#it{c});#Delta(#pi) (ps)", kTH2F, {momAxis, deltaAxis}); - histos.add("qa/deltaKa", ";#it{p} (GeV/#it{c});#Delta(K) (ps)", kTH2F, {momAxis, deltaAxis}); - histos.add("qa/deltaPr", ";#it{p} (GeV/#it{c});#Delta(p) (ps)", kTH2F, {momAxis, deltaAxis}); - histos.add("qa/nsigmaEl", ";#it{p} (GeV/#it{c});N_{#sigma}^{FTOF}(e)", kTH2F, {momAxis, nsigmaAxis}); - histos.add("qa/nsigmaMu", ";#it{p} (GeV/#it{c});N_{#sigma}^{FTOF}(#mu)", kTH2F, {momAxis, nsigmaAxis}); - histos.add("qa/nsigmaPi", ";#it{p} (GeV/#it{c});N_{#sigma}^{FTOF}(#pi)", kTH2F, {momAxis, nsigmaAxis}); - histos.add("qa/nsigmaKa", ";#it{p} (GeV/#it{c});N_{#sigma}^{FTOF}(K)", kTH2F, {momAxis, nsigmaAxis}); - histos.add("qa/nsigmaPr", ";#it{p} (GeV/#it{c});N_{#sigma}^{FTOF}(p)", kTH2F, {momAxis, nsigmaAxis}); - } - - using Trks = soa::Join; - void process(const Trks& tracks, - const aod::McTrackLabels& labels, - const aod::FTOFs&, - const aod::McParticles_000&, - const aod::Collisions& colls) - { - for (const auto& col : colls) { - histos.fill(HIST("event/vertexz"), col.posZ()); - } - for (const auto& track : tracks) { - histos.fill(HIST("event/length"), track.ftof().ftofLength()); - histos.fill(HIST("event/eta"), track.eta()); - if (!track.has_ftof()) { - continue; - } - if (track.ftof().ftofLength() < minLength) { - continue; - } - if (track.ftof().ftofLength() > maxLength) { - continue; - } - if (track.eta() > maxEta || track.eta() < minEta) { - continue; - } - const auto mcParticle = labels.iteratorAt(track.globalIndex()).mcParticle_as(); - if (pdgCode != 0 && abs(mcParticle.pdgCode()) != pdgCode) { - continue; - } - if (useOnlyPhysicsPrimary == 1 && !mcParticle.isPhysicalPrimary()) { // Selecting primaries - histos.fill(HIST("p/Sec"), track.p()); - continue; - } - histos.fill(HIST("p/Prim"), track.p()); - histos.fill(HIST("p/Unselected"), track.p()); - histos.fill(HIST("pt/Unselected"), track.pt()); - histos.fill(HIST("qa/length"), track.ftof().ftofLength()); - histos.fill(HIST("qa/signal"), track.ftof().ftofSignal()); - histos.fill(HIST("qa/signalvsP"), track.p(), track.ftof().ftofSignal()); - histos.fill(HIST("qa/deltaEl"), track.p(), track.ftof().ftofDeltaEl()); - histos.fill(HIST("qa/deltaMu"), track.p(), track.ftof().ftofDeltaMu()); - histos.fill(HIST("qa/deltaPi"), track.p(), track.ftof().ftofDeltaPi()); - histos.fill(HIST("qa/deltaKa"), track.p(), track.ftof().ftofDeltaKa()); - histos.fill(HIST("qa/deltaPr"), track.p(), track.ftof().ftofDeltaPr()); - histos.fill(HIST("qa/nsigmaEl"), track.p(), track.ftof().ftofNsigmaEl()); - histos.fill(HIST("qa/nsigmaMu"), track.p(), track.ftof().ftofNsigmaMu()); - histos.fill(HIST("qa/nsigmaPi"), track.p(), track.ftof().ftofNsigmaPi()); - histos.fill(HIST("qa/nsigmaKa"), track.p(), track.ftof().ftofNsigmaKa()); - histos.fill(HIST("qa/nsigmaPr"), track.p(), track.ftof().ftofNsigmaPr()); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfg) -{ - return WorkflowSpec{adaptAnalysisTask(cfg), adaptAnalysisTask(cfg)}; -} diff --git a/ALICE3/Tasks/pidRICHqa.cxx b/ALICE3/Tasks/pidRICHqa.cxx deleted file mode 100644 index 4a420ffe34f..00000000000 --- a/ALICE3/Tasks/pidRICHqa.cxx +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// -/// \file qaTOFMC.cxx -/// \author Nicolò Jacazio -/// \brief Task to produce QA output of the PID with ALICE3 RICH running on the MC. -/// - -#include "ALICE3/DataModel/RICH.h" -#include "Common/DataModel/PIDResponseTOF.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -using namespace o2; -using namespace o2::track; -using namespace o2::framework; -using namespace o2::framework::expressions; - -void customize(std::vector& workflowOptions) -{ - std::vector options{ - {"qa-el", VariantType::Int, 1, {"Produce PID information for the electron mass hypothesis"}}, - {"qa-mu", VariantType::Int, 1, {"Produce PID information for the muon mass hypothesis"}}, - {"qa-pikapr", VariantType::Int, 1, {"Produce PID information for the Pion, Kaon, Proton mass hypothesis"}}}; - std::swap(workflowOptions, options); -} - -#include - -namespace o2::aod -{ - -namespace indices -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); -DECLARE_SOA_INDEX_COLUMN(RICH, rich); -DECLARE_SOA_INDEX_COLUMN(FRICH, frich); -} // namespace indices - -DECLARE_SOA_INDEX_TABLE_USER(RICHTracksIndex, Tracks, "RICHTRK", indices::TrackId, indices::RICHId); -DECLARE_SOA_INDEX_TABLE_USER(FRICHTracksIndex, Tracks, "FRICHTRK", indices::TrackId, indices::FRICHId); -} // namespace o2::aod - -struct richIndexBuilder { // Builder of the RICH-track index linkage - Builds indB; - Builds indF; - void init(o2::framework::InitContext&) - { - } -}; - -template -struct richPidQaMc { - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject}; - Configurable pdgCode{"pdgCode", 0, "pdg code of the particles to accept"}; - Configurable useOnlyPhysicsPrimary{"useOnlyPhysicsPrimary", 1, - "Whether to use only physical primary particles."}; - Configurable useTOF{"useTOF", 0, - "Whether to use the TOF information"}; - Configurable minLength{"minLength", 0, "Minimum length of accepted tracks (cm)"}; - Configurable maxLength{"maxLength", 1000, "Maximum length of accepted tracks (cm)"}; - Configurable minEta{"minEta", -1.4, "Minimum eta of accepted tracks"}; - Configurable maxEta{"maxEta", 1.4, "Maximum eta of accepted tracks"}; - Configurable nBinsP{"nBinsP", 500, "Number of momentum bins"}; - Configurable minP{"minP", -2, "Minimum momentum plotted (GeV/c)"}; - Configurable maxP{"maxP", 2, "Maximum momentum plotted (GeV/c)"}; - Configurable nBinsNsigma{"nBinsNsigma", 600, "Number of Nsigma bins"}; - Configurable minNsigma{"minNsigma", -100.f, "Minimum Nsigma plotted"}; - Configurable maxNsigma{"maxNsigma", 100.f, "Maximum Nsigma plotted"}; - Configurable nBinsDelta{"nBinsDelta", 600, "Number of delta bins"}; - Configurable minDelta{"minDelta", -0.4f, "Minimum delta plotted (rad)"}; - Configurable maxDelta{"maxDelta", 0.4f, "Maximum delta plotted (rad)"}; - Configurable logAxis{"logAxis", 1, "Flag to use a log momentum axis"}; - Configurable nSigmaNorm{"nSigmaNorm", 0.7071067811865475f, "Normalization for the combined Nsigma"}; - - static constexpr int Np = 5; - static constexpr std::string_view hbRICHDelta[Np] = {"bRICH/delta/El", "bRICH/delta/Mu", "bRICH/delta/Pi", "bRICH/delta/Ka", "bRICH/delta/Pr"}; - static constexpr std::string_view hbRICHNSigma[Np] = {"bRICH/nsigma/El", "bRICH/nsigma/Mu", "bRICH/nsigma/Pi", "bRICH/nsigma/Ka", "bRICH/nsigma/Pr"}; - static constexpr std::string_view hbRICHNSigmaPrm[Np] = {"bRICH/nsigmaprm/El", "bRICH/nsigmaprm/Mu", "bRICH/nsigmaprm/Pi", "bRICH/nsigmaprm/Ka", "bRICH/nsigmaprm/Pr"}; - static constexpr std::string_view hbRICHNSigmaSec[Np] = {"bRICH/nsigmasec/El", "bRICH/nsigmasec/Mu", "bRICH/nsigmasec/Pi", "bRICH/nsigmasec/Ka", "bRICH/nsigmasec/Pr"}; - static constexpr std::string_view hbRICHNSigmaMC[Np] = {"bRICH/nsigmaMC/El", "bRICH/nsigmaMC/Mu", "bRICH/nsigmaMC/Pi", "bRICH/nsigmaMC/Ka", "bRICH/nsigmaMC/Pr"}; - static constexpr std::string_view hbRICHNSigmaMCSec[Np] = {"bRICH/nsigmaMCsec/El", "bRICH/nsigmaMCsec/Mu", "bRICH/nsigmaMCsec/Pi", "bRICH/nsigmaMCsec/Ka", "bRICH/nsigmaMCsec/Pr"}; - static constexpr std::string_view hbRICHNSigmaMCPrm[Np] = {"bRICH/nsigmaMCprm/El", "bRICH/nsigmaMCprm/Mu", "bRICH/nsigmaMCprm/Pi", "bRICH/nsigmaMCprm/Ka", "bRICH/nsigmaMCprm/Pr"}; - - static constexpr std::string_view hfRICHDelta[Np] = {"fRICH/delta/El", "fRICH/delta/Mu", "fRICH/delta/Pi", "fRICH/delta/Ka", "fRICH/delta/Pr"}; - static constexpr std::string_view hfRICHNSigma[Np] = {"fRICH/nsigma/El", "fRICH/nsigma/Mu", "fRICH/nsigma/Pi", "fRICH/nsigma/Ka", "fRICH/nsigma/Pr"}; - static constexpr std::string_view hfRICHNSigmaPrm[Np] = {"fRICH/nsigmaprm/El", "fRICH/nsigmaprm/Mu", "fRICH/nsigmaprm/Pi", "fRICH/nsigmaprm/Ka", "fRICH/nsigmaprm/Pr"}; - static constexpr std::string_view hfRICHNSigmaSec[Np] = {"fRICH/nsigmasec/El", "fRICH/nsigmasec/Mu", "fRICH/nsigmasec/Pi", "fRICH/nsigmasec/Ka", "fRICH/nsigmasec/Pr"}; - static constexpr std::string_view hfRICHNSigmaMC[Np] = {"fRICH/nsigmaMC/El", "fRICH/nsigmaMC/Mu", "fRICH/nsigmaMC/Pi", "fRICH/nsigmaMC/Ka", "fRICH/nsigmaMC/Pr"}; - static constexpr std::string_view hfRICHNSigmaMCSec[Np] = {"fRICH/nsigmaMCsec/El", "fRICH/nsigmaMCsec/Mu", "fRICH/nsigmaMCsec/Pi", "fRICH/nsigmaMCsec/Ka", "fRICH/nsigmaMCsec/Pr"}; - static constexpr std::string_view hfRICHNSigmaMCPrm[Np] = {"fRICH/nsigmaMCprm/El", "fRICH/nsigmaMCprm/Mu", "fRICH/nsigmaMCprm/Pi", "fRICH/nsigmaMCprm/Ka", "fRICH/nsigmaMCprm/Pr"}; - static constexpr std::string_view hfRICHNSigmaVsp[Np] = {"fRICH/nsigmavsp/El", "fRICH/nsigmavsp/Mu", "fRICH/nsigmavsp/Pi", "fRICH/nsigmavsp/Ka", "fRICH/nsigmavsp/Pr"}; - static constexpr std::string_view hfRICHNSigmaMCVsp[Np] = {"fRICH/nsigmaMCvsp/El", "fRICH/nsigmaMCvsp/Mu", "fRICH/nsigmaMCvsp/Pi", "fRICH/nsigmaMCvsp/Ka", "fRICH/nsigmaMCvsp/Pr"}; - static constexpr std::string_view hfRICHNSigmaMCSecVsp[Np] = {"fRICH/nsigmaMCsecvsp/El", "fRICH/nsigmaMCsecvsp/Mu", "fRICH/nsigmaMCsecvsp/Pi", "fRICH/nsigmaMCsecvsp/Ka", "fRICH/nsigmaMCsecvsp/Pr"}; - static constexpr std::string_view hfRICHNSigmaMCPrmVsp[Np] = {"fRICH/nsigmaMCprmvsp/El", "fRICH/nsigmaMCprmvsp/Mu", "fRICH/nsigmaMCprmvsp/Pi", "fRICH/nsigmaMCprmvsp/Ka", "fRICH/nsigmaMCprmvsp/Pr"}; - - static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p"}; - static constexpr int PDGs[Np] = {11, 13, 211, 321, 2212}; - template - void addParticleHistos() - { - AxisSpec pAxis{nBinsP, minP, maxP, "#it{p} (GeV/#it{c})"}; - AxisSpec ptAxis{nBinsP, minP, maxP, "#it{p}_{T} (GeV/#it{c})"}; - if (logAxis) { - pAxis.makeLogarithmic(); - ptAxis.makeLogarithmic(); - } - const AxisSpec nsigmaAxis{nBinsNsigma, minNsigma, maxNsigma, Form("N_{#sigma}^{RICH}(%s)", pT[pid_type])}; - - TString tit = Form("%s", pT[i]); - if (useTOF) { - tit = Form("TOF Selected %s", pT[i]); - } - // NSigma - histos.add(hbRICHNSigmaMC[i].data(), "True " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hbRICHNSigmaMCPrm[i].data(), "True Primary " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hbRICHNSigmaMCSec[i].data(), "True Secondary " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - - histos.add(hfRICHNSigmaMC[i].data(), "True " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaMCPrm[i].data(), "True Primary " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaMCSec[i].data(), "True Secondary " + tit, HistType::kTH2F, {ptAxis, nsigmaAxis}); - - histos.add(hfRICHNSigmaMCVsp[i].data(), "True " + tit, HistType::kTH2F, {pAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaMCPrmVsp[i].data(), "True Primary " + tit, HistType::kTH2F, {pAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaMCSecVsp[i].data(), "True Secondary " + tit, HistType::kTH2F, {pAxis, nsigmaAxis}); - } - - void init(o2::framework::InitContext&) - { - AxisSpec pAxis{nBinsP, minP, maxP, "#it{p} (GeV/#it{c})"}; - AxisSpec ptAxis{nBinsP, minP, maxP, "#it{p}_{T} (GeV/#it{c})"}; - if (logAxis) { - pAxis.makeLogarithmic(); - ptAxis.makeLogarithmic(); - } - - const AxisSpec sigAxis{1000, 0, 0.3, "Cherenkov angle (rad)"}; - const AxisSpec lengthAxis{1000, 0, 3000, "Track length (cm)"}; - const AxisSpec sigErrAxis{100, 0, 1, "Cherenkov angle error (rad)"}; - const char* detName = useTOF ? "TOF-RICH" : "RICH"; - const AxisSpec nsigmaAxis{nBinsNsigma, minNsigma, maxNsigma, Form("N_{#sigma}^{%s}(%s)", detName, pT[pid_type])}; - const AxisSpec deltaAxis{nBinsDelta, minDelta, maxDelta, Form("#Delta(%s) (rad)", pT[pid_type])}; - const AxisSpec etaAxis{100, -4, 4, "#it{#eta}"}; - - histos.add("event/vertexz", ";Vtx_{z} (cm);Entries", kTH1F, {{100, -20, 20}}); - histos.add("particle/p", "", kTH1F, {pAxis}); - histos.add("particle/pt", "", kTH1F, {ptAxis}); - histos.add("particle/eta", "", kTH1F, {etaAxis}); - histos.add("tracks/p", "", kTH1F, {pAxis}); - histos.add("tracks/pt", "", kTH1F, {ptAxis}); - histos.add("tracks/eta", "", kTH1F, {etaAxis}); - histos.add("tracks/length", "", kTH1F, {lengthAxis}); - -#define MakeRICHHistos(rich) \ - histos.add(rich "/TrackSelection", "", kTH1F, {{10, 0.5, 10.5}}); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(1, "Tracks read"); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(2, "Passed RICH"); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(3, "Passed TOF"); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(4, Form("Passed minLength %.2f", minLength.value)); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(5, Form("Passed maxLength %.2f", maxLength.value)); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(6, Form("Passed minEta %.2f", minEta.value)); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(7, Form("Passed maxEta %.2f", maxEta.value)); \ - histos.get(HIST(rich "/TrackSelection"))->GetXaxis()->SetBinLabel(8, "Passed PDG"); \ - histos.add(rich "/pt", "Unselected", kTH1F, {ptAxis}); \ - histos.add(rich "/ptPrm", "Primaries", kTH1F, {ptAxis}); \ - histos.add(rich "/ptSec", "Secondaries", kTH1F, {ptAxis}); \ - histos.add(rich "/p", "Unselected", kTH1F, {pAxis}); \ - histos.add(rich "/pPrm", "Primaries", kTH1F, {pAxis}); \ - histos.add(rich "/pSec", "Secondaries", kTH1F, {pAxis}); \ - histos.add(rich "/signal", "", kTH1F, {sigAxis}); \ - histos.add(rich "/eta", "", kTH1F, {etaAxis}); \ - histos.add(rich "/signalerror", "", kTH1F, {sigErrAxis}); \ - histos.add(rich "/signalvsP", "Unselected", kTH2F, {pAxis, sigAxis}); \ - histos.add(rich "/signalvsPPrm", "Primaries", kTH2F, {pAxis, sigAxis}); \ - histos.add(rich "/signalvsPSec", "Secondaries", kTH2F, {pAxis, sigAxis}); - - MakeRICHHistos("bRICH"); - MakeRICHHistos("fRICH"); - -#undef MakeRICHHistos - - histos.add(hbRICHDelta[pid_type].data(), "", kTH2F, {pAxis, deltaAxis}); - histos.add(hbRICHNSigma[pid_type].data(), "", HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hbRICHNSigmaPrm[pid_type].data(), "Primary", HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hbRICHNSigmaSec[pid_type].data(), "Secondary", HistType::kTH2F, {ptAxis, nsigmaAxis}); - - histos.add(hfRICHDelta[pid_type].data(), "", kTH2F, {pAxis, deltaAxis}); - histos.add(hfRICHNSigma[pid_type].data(), "", HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaPrm[pid_type].data(), "Primary", HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaSec[pid_type].data(), "Secondary", HistType::kTH2F, {ptAxis, nsigmaAxis}); - histos.add(hfRICHNSigmaVsp[pid_type].data(), "", HistType::kTH2F, {pAxis, nsigmaAxis}); - - addParticleHistos<0>(); - addParticleHistos<1>(); - addParticleHistos<2>(); - addParticleHistos<3>(); - addParticleHistos<4>(); - } - - template - void fillNsigma(const T& track, const TT& particle, const float& nsigma) - { - if (abs(particle.pdgCode()) != PDGs[pidIndex]) { - return; - } - histos.fill(HIST(hbRICHNSigmaMC[pidIndex]), track.pt(), nsigma); - - if (particle.isPhysicalPrimary()) { // Selecting primaries - histos.fill(HIST(hbRICHNSigmaMCPrm[pidIndex]), track.pt(), nsigma); - } else { - histos.fill(HIST(hbRICHNSigmaMCSec[pidIndex]), track.pt(), nsigma); - } - } - - template - void fillNsigmafRICH(const T& track, const TT& particle, const float& nsigma) - { - if (abs(particle.pdgCode()) != PDGs[pidIndex]) { - return; - } - histos.fill(HIST(hfRICHNSigmaMC[pidIndex]), track.pt(), nsigma); - histos.fill(HIST(hfRICHNSigmaMCVsp[pidIndex]), track.p(), nsigma); - - if (particle.isPhysicalPrimary()) { // Selecting primaries - histos.fill(HIST(hfRICHNSigmaMCPrm[pidIndex]), track.pt(), nsigma); - histos.fill(HIST(hfRICHNSigmaMCPrmVsp[pidIndex]), track.p(), nsigma); - } else { - histos.fill(HIST(hfRICHNSigmaMCSec[pidIndex]), track.pt(), nsigma); - histos.fill(HIST(hfRICHNSigmaMCSecVsp[pidIndex]), track.p(), nsigma); - } - } - - using Trks = soa::Join; - using TrksfRICH = soa::Join; - void process(const Trks& tracks, - const aod::McParticles_000& mcParticles, - const TrksfRICH& tracksfrich, - const aod::RICHs&, - const aod::FRICHs&, - const aod::Collisions& colls) - { - for (const auto& col : colls) { - histos.fill(HIST("event/vertexz"), col.posZ()); - } - for (const auto& p : mcParticles) { - if (pdgCode != 0 && abs(p.pdgCode()) != pdgCode) { - continue; - } - histos.fill(HIST("particle/p"), p.p()); - histos.fill(HIST("particle/pt"), p.pt()); - histos.fill(HIST("particle/eta"), p.eta()); - } - - for (const auto& t : tracks) { - histos.fill(HIST("tracks/p"), t.p()); - histos.fill(HIST("tracks/pt"), t.pt()); - histos.fill(HIST("tracks/eta"), t.eta()); - histos.fill(HIST("tracks/length"), t.length()); - } - - auto rejectTrack = [&](const auto& t, auto h) { - if (t.length() < minLength) { - return true; - } - histos.fill(h, 4); - if (t.length() > maxLength) { - return true; - } - histos.fill(h, 5); - if (t.eta() < minEta) { - return true; - } - histos.fill(h, 6); - if (t.eta() > maxEta) { - return true; - } - histos.fill(h, 7); - const auto mcParticle = t.template mcParticle_as(); - if (pdgCode != 0 && abs(mcParticle.pdgCode()) != pdgCode) { - return true; - } - histos.fill(h, 8); - return false; - }; - - for (const auto& track : tracks) { // Barrel RICH - histos.fill(HIST("bRICH/TrackSelection"), 1); - if (!track.has_rich()) { - continue; - } - histos.fill(HIST("bRICH/TrackSelection"), 2); - if (useTOF && !track.hasTOF()) { - continue; - } - histos.fill(HIST("bRICH/TrackSelection"), 3); - if (rejectTrack(track, HIST("bRICH/TrackSelection"))) { - continue; - } - - const float delta = track.rich().richDelta(pid_type); - float nsigma = track.rich().richNsigma(pid_type); - if (useTOF) { - if constexpr (pid_type == 0) { // Electron - nsigma += track.tofNSigmaEl(); - } else if constexpr (pid_type == 1) { // Muon - nsigma += track.tofNSigmaMu(); - } else if constexpr (pid_type == 2) { // Pion - nsigma += track.tofNSigmaPi(); - } else if constexpr (pid_type == 3) { // Kaon - nsigma += track.tofNSigmaKa(); - } else if constexpr (pid_type == 4) { // Proton - nsigma += track.tofNSigmaPr(); - } - nsigma *= nSigmaNorm; // Normalize to 1 - } - - histos.fill(HIST("bRICH/p"), track.p()); - histos.fill(HIST("bRICH/pt"), track.pt()); - histos.fill(HIST("bRICH/eta"), track.eta()); - histos.fill(HIST("bRICH/signal"), track.rich().richSignal()); - histos.fill(HIST("bRICH/signalerror"), track.rich().richSignalError()); - histos.fill(HIST("bRICH/signalvsP"), track.p(), track.rich().richSignal()); - - histos.fill(HIST(hbRICHNSigma[pid_type]), track.pt(), nsigma); - histos.fill(HIST(hbRICHDelta[pid_type]), track.p(), delta); - // const auto mcParticle = labels.iteratorAt(track.globalIndex()).mcParticle_as(); - const auto mcParticle = track.mcParticle_as(); - if (mcParticle.isPhysicalPrimary()) { // Selecting primaries - histos.fill(HIST(hbRICHNSigmaPrm[pid_type]), track.pt(), nsigma); - histos.fill(HIST("bRICH/signalvsPPrm"), track.p(), track.rich().richSignal()); - histos.fill(HIST("bRICH/pPrm"), track.p()); - histos.fill(HIST("bRICH/ptPrm"), track.pt()); - } else { - histos.fill(HIST(hbRICHNSigmaSec[pid_type]), track.pt(), nsigma); - histos.fill(HIST("bRICH/signalvsPSec"), track.p(), track.rich().richSignal()); - histos.fill(HIST("bRICH/pSec"), track.p()); - histos.fill(HIST("bRICH/ptSec"), track.pt()); - } - fillNsigma<0>(track, mcParticle, nsigma); - fillNsigma<1>(track, mcParticle, nsigma); - fillNsigma<2>(track, mcParticle, nsigma); - fillNsigma<3>(track, mcParticle, nsigma); - fillNsigma<4>(track, mcParticle, nsigma); - } - - for (const auto& track : tracksfrich) { // Forward RICH - histos.fill(HIST("fRICH/TrackSelection"), 1); - if (!track.has_frich()) { - continue; - } - histos.fill(HIST("fRICH/TrackSelection"), 2); - if (rejectTrack(track, HIST("fRICH/TrackSelection"))) { - continue; - } - - const float delta = track.frich().frichDelta(pid_type); - const float nsigma = track.frich().frichNsigma(pid_type); - - histos.fill(HIST("fRICH/p"), track.p()); - histos.fill(HIST("fRICH/pt"), track.pt()); - histos.fill(HIST("fRICH/eta"), track.eta()); - histos.fill(HIST("fRICH/signal"), track.frich().frichSignal()); - histos.fill(HIST("fRICH/signalerror"), track.frich().frichSignalError()); - histos.fill(HIST("fRICH/signalvsP"), track.p(), track.frich().frichSignal()); - - histos.fill(HIST(hfRICHNSigma[pid_type]), track.pt(), nsigma); - histos.fill(HIST(hfRICHDelta[pid_type]), track.p(), delta); - const auto mcParticle = track.mcParticle_as(); - if (mcParticle.isPhysicalPrimary()) { // Selecting primaries - histos.fill(HIST(hfRICHNSigmaPrm[pid_type]), track.pt(), nsigma); - histos.fill(HIST("fRICH/signalvsPPrm"), track.p(), track.frich().frichSignal()); - histos.fill(HIST("fRICH/pPrm"), track.p()); - histos.fill(HIST("fRICH/ptPrm"), track.pt()); - } else { - histos.fill(HIST(hfRICHNSigmaSec[pid_type]), track.pt(), nsigma); - histos.fill(HIST("fRICH/signalvsPSec"), track.p(), track.frich().frichSignal()); - histos.fill(HIST("fRICH/pSec"), track.p()); - histos.fill(HIST("fRICH/ptSec"), track.pt()); - } - fillNsigmafRICH<0>(track, mcParticle, nsigma); - fillNsigmafRICH<1>(track, mcParticle, nsigma); - fillNsigmafRICH<2>(track, mcParticle, nsigma); - fillNsigmafRICH<3>(track, mcParticle, nsigma); - fillNsigmafRICH<4>(track, mcParticle, nsigma); - } - } -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfg) -{ - auto workflow = WorkflowSpec{adaptAnalysisTask(cfg)}; - if (cfg.options().get("qa-el")) { - workflow.push_back(adaptAnalysisTask>(cfg, TaskName{"pidRICH-qa-El"})); - } - if (cfg.options().get("qa-mu")) { - workflow.push_back(adaptAnalysisTask>(cfg, TaskName{"pidRICH-qa-Mu"})); - } - if (cfg.options().get("qa-pikapr")) { - workflow.push_back(adaptAnalysisTask>(cfg, TaskName{"pidRICH-qa-Pi"})); - workflow.push_back(adaptAnalysisTask>(cfg, TaskName{"pidRICH-qa-Ka"})); - workflow.push_back(adaptAnalysisTask>(cfg, TaskName{"pidRICH-qa-Pr"})); - } - return workflow; -} diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 02c0e0b297b..46931f96988 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -23,7 +23,7 @@ // #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "ALICE3/DataModel/ECAL.h" +// #include "ALICE3/DataModel/ECAL.h" #include "Common/Core/RecoDecay.h" #include @@ -1732,65 +1732,65 @@ DECLARE_SOA_TABLE(HfCandXicResid, "AOD", "HFCANDXICRESID", hf_cand_xic_to_xi_pi_pi::ZSvPull); // specific chic candidate properties -namespace hf_cand_chic -{ -DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfCand2Prong, "_0"); // Jpsi index -DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, ECALs, "_1"); -DECLARE_SOA_COLUMN(JpsiToMuMuMass, jpsiToMuMuMass, float); // Jpsi mass -} // namespace hf_cand_chic - -// declare dedicated chi_c candidate table -DECLARE_SOA_TABLE(HfCandChicBase, "AOD", "HFCANDCHICBASE", - // general columns - HFCAND_COLUMNS, - // 2-prong specific columns - hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, - hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, - hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, - hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, - hf_cand_chic::Prong0Id, hf_cand_chic::Prong1Id, - hf_track_index::HFflag, hf_cand_chic::JpsiToMuMuMass, - /* dynamic columns */ - hf_cand_2prong::M, - hf_cand_2prong::M2, - /* prong 2 */ - // hf_cand::PtProng1, - // hf_cand::Pt2Prong1, - // hf_cand::PVectorProng1, - /* dynamic columns that use candidate momentum components */ - hf_cand::Pt, - hf_cand::Pt2, - hf_cand::P, - hf_cand::P2, - hf_cand::PVector, - hf_cand::Cpa, - hf_cand::CpaXY, - hf_cand::Ct, - hf_cand::ImpactParameterXY, - hf_cand_2prong::MaxNormalisedDeltaIP, - hf_cand::Eta, - hf_cand::Phi, - hf_cand::Y, - hf_cand::E, - hf_cand::E2); - -// extended table with expression columns that can be used as arguments of dynamic columns -DECLARE_SOA_EXTENDED_TABLE_USER(HfCandChicExt, HfCandChicBase, "HFCANDCHICEXT", - hf_cand_2prong::Px, hf_cand_2prong::Py, hf_cand_2prong::Pz); - -using HfCandChic = HfCandChicExt; - -// table with results of reconstruction level MC matching -DECLARE_SOA_TABLE(HfCandChicMcRec, "AOD", "HFCANDCHICMCREC", //! - hf_cand_mc_flag::FlagMcMatchRec, - hf_cand_mc_flag::OriginMcRec, - hf_cand_mc_flag::FlagMcDecayChanRec); - -// table with results of generator level MC matching -DECLARE_SOA_TABLE(HfCandChicMcGen, "AOD", "HFCANDCHICMCGEN", //! - hf_cand_mc_flag::FlagMcMatchGen, - hf_cand_mc_flag::OriginMcGen, - hf_cand_mc_flag::FlagMcDecayChanGen); +// namespace hf_cand_chic +// { +// DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfCand2Prong, "_0"); // Jpsi index +// DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, ECALs, "_1"); +// DECLARE_SOA_COLUMN(JpsiToMuMuMass, jpsiToMuMuMass, float); // Jpsi mass +// } // namespace hf_cand_chic + +// // declare dedicated chi_c candidate table +// DECLARE_SOA_TABLE(HfCandChicBase, "AOD", "HFCANDCHICBASE", +// // general columns +// HFCAND_COLUMNS, +// // 2-prong specific columns +// hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, +// hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, +// hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, +// hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, +// hf_cand_chic::Prong0Id, hf_cand_chic::Prong1Id, +// hf_track_index::HFflag, hf_cand_chic::JpsiToMuMuMass, +// /* dynamic columns */ +// hf_cand_2prong::M, +// hf_cand_2prong::M2, +// /* prong 2 */ +// // hf_cand::PtProng1, +// // hf_cand::Pt2Prong1, +// // hf_cand::PVectorProng1, +// /* dynamic columns that use candidate momentum components */ +// hf_cand::Pt, +// hf_cand::Pt2, +// hf_cand::P, +// hf_cand::P2, +// hf_cand::PVector, +// hf_cand::Cpa, +// hf_cand::CpaXY, +// hf_cand::Ct, +// hf_cand::ImpactParameterXY, +// hf_cand_2prong::MaxNormalisedDeltaIP, +// hf_cand::Eta, +// hf_cand::Phi, +// hf_cand::Y, +// hf_cand::E, +// hf_cand::E2); + +// // extended table with expression columns that can be used as arguments of dynamic columns +// DECLARE_SOA_EXTENDED_TABLE_USER(HfCandChicExt, HfCandChicBase, "HFCANDCHICEXT", +// hf_cand_2prong::Px, hf_cand_2prong::Py, hf_cand_2prong::Pz); + +// using HfCandChic = HfCandChicExt; + +// // table with results of reconstruction level MC matching +// DECLARE_SOA_TABLE(HfCandChicMcRec, "AOD", "HFCANDCHICMCREC", //! +// hf_cand_mc_flag::FlagMcMatchRec, +// hf_cand_mc_flag::OriginMcRec, +// hf_cand_mc_flag::FlagMcDecayChanRec); + +// // table with results of generator level MC matching +// DECLARE_SOA_TABLE(HfCandChicMcGen, "AOD", "HFCANDCHICMCGEN", //! +// hf_cand_mc_flag::FlagMcMatchGen, +// hf_cand_mc_flag::OriginMcGen, +// hf_cand_mc_flag::FlagMcDecayChanGen); // specific Lb candidate properties namespace hf_cand_lb