From b8c9784b75b3d97bfecba874e94d6b08760119c8 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Tue, 18 Nov 2025 12:01:40 +0100 Subject: [PATCH] [PWGEM,PhotonMeson] Clean up clang-tidy errors, Add secondary track matching for EMCal - Remove unused mesonTables header file - Fix `abs()` function calls using integer version istead of float - Fix missing includes - Fix uninitialized field in `HNMUtilities.h` in `GammaGammaPair` - Add secondary track matching to skimmerGammaCalo, usuable with spacial process function - Add version 001 of `SkimEMCClusters_001` to enable storage of matched secondary tracks - Add converter for `SkimEMCClusters_000` -> `SkimEMCClusters_001` - Add secondary track matching cut into the EMCPhotonCut library - Remove std::function from EMCPhotonCut for easier, more readable and faster code - Adapted changes of EMCPhotonCut library in all tasks where it is used - Add FV0A as possible QVector in EMCal Pi0 Flow task --- PWGEM/PhotonMeson/Core/CutsLibrary.cxx | 54 +++--- PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx | 38 ++-- PWGEM/PhotonMeson/Core/EMCPhotonCut.h | 168 +++++++++++++++--- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 16 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 13 +- PWGEM/PhotonMeson/Core/TaggingPi0.h | 69 ++++--- PWGEM/PhotonMeson/Core/TaggingPi0MC.h | 103 ++++++----- PWGEM/PhotonMeson/DataModel/gammaTables.h | 23 ++- PWGEM/PhotonMeson/DataModel/mesonTables.h | 46 ----- .../TableProducer/skimmerDalitzEE.cxx | 39 ++-- .../TableProducer/skimmerGammaCalo.cxx | 73 ++++++-- PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx | 47 ++--- .../Tasks/Converters/CMakeLists.txt | 5 + .../Converters/skimEmcClusterConverter.cxx | 62 +++++++ PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx | 17 +- PWGEM/PhotonMeson/Tasks/SinglePhotonMC.cxx | 16 +- PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx | 32 ++-- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 28 +-- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 75 ++++++-- PWGEM/PhotonMeson/Utils/ClusterHistograms.h | 22 +-- PWGEM/PhotonMeson/Utils/HNMUtilities.h | 2 +- PWGEM/PhotonMeson/Utils/PairUtilities.h | 9 +- 22 files changed, 583 insertions(+), 374 deletions(-) delete mode 100644 PWGEM/PhotonMeson/DataModel/mesonTables.h create mode 100644 PWGEM/PhotonMeson/Tasks/Converters/skimEmcClusterConverter.cxx diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index d8475e550e9..aaf16551ba6 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -9,12 +9,28 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// Contact: daiki.sekihata@cern.ch -// +/// \file CutsLibrary.cxx +/// \brief Source of class for EM photon selection. +/// \author daiki.sekihata@cern.ch + +#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" + +#include "PWGEM/PhotonMeson/Core/DalitzEECut.h" +#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/PairCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" + +#include + +#include + +#include +#include +#include #include #include -#include -#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" //_______________________________________________ int customAtoi(const std::string& str) @@ -511,12 +527,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName) cut->SetM02Range(0.1f, 0.7f); cut->SetTimeRange(-20.f, 25.f); - cut->SetTrackMatchingEta([](float pT) { - return 0.01f + pow(pT + 4.07f, -2.5f); - }); - cut->SetTrackMatchingPhi([](float pT) { - return 0.015f + pow(pT + 3.65f, -2.f); - }); + cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f); + cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f); + cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f); + cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f); cut->SetMinEoverP(1.75f); cut->SetUseExoticCut(true); return cut; @@ -527,12 +541,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName) cut->SetM02Range(0.0f, 1000.f); cut->SetTimeRange(-500.f, 500.f); - cut->SetTrackMatchingEta([](float /*pT*/) { - return -1.f; - }); - cut->SetTrackMatchingPhi([](float /*pT*/) { - return -1.f; - }); + cut->SetTrackMatchingEtaParams(-1.f, 0.f, 0.f); + cut->SetTrackMatchingPhiParams(-1.f, 0.f, 0.f); + cut->SetSecTrackMatchingEtaParams(-1.f, 0.f, 0.f); + cut->SetSecTrackMatchingPhiParams(-1.f, 0.f, 0.f); cut->SetMinEoverP(0.f); cut->SetUseExoticCut(false); return cut; @@ -543,12 +555,10 @@ EMCPhotonCut* o2::aod::pwgem::photon::emccuts::GetCut(const char* cutName) cut->SetM02Range(0.1f, 0.7f); cut->SetTimeRange(-20.f, 25.f); - cut->SetTrackMatchingEta([](float pT) { - return 0.01f + pow(pT + 4.07f, -2.5f); - }); - cut->SetTrackMatchingPhi([](float pT) { - return 0.015f + pow(pT + 3.65f, -2.f); - }); + cut->SetTrackMatchingEtaParams(0.01f, 4.07f, -2.5f); + cut->SetTrackMatchingPhiParams(0.015f, 3.65f, -2.0f); + cut->SetSecTrackMatchingEtaParams(0.01f, 4.07f, -2.5f); + cut->SetSecTrackMatchingPhiParams(0.015f, 3.65f, -2.0f); cut->SetMinEoverP(1.75f); cut->SetUseExoticCut(true); return cut; diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx index 199da171c11..1ccca2a2be7 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx @@ -9,77 +9,79 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// -// Class for EMCal cluster selection -// +/// \file EMCPhotonCut.cxx +/// \brief source of class for emcal photon selection. +/// \author M. Hemmer, marvin.hemmer@cern.ch; N. Strangmann, nicolas.strangmann@cern.ch #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" - +// #include "PWGJE/DataModel/EMCALClusters.h" -#include "Framework/Logger.h" +#include #include -#include #include ClassImp(EMCPhotonCut); -const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"}; +const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "SecTrackMatching", "Exotic"}; void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString) { mDefinition = static_cast(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString)); LOG(info) << "EMCal Photon Cut, set cluster definition to: " << mDefinition << " (" << clusterDefinitionString << ")"; } + void EMCPhotonCut::SetMinE(float min) { mMinE = min; LOG(info) << "EMCal Photon Cut, set minimum cluster energy: " << mMinE; } + void EMCPhotonCut::SetMinNCell(int min) { mMinNCell = min; LOG(info) << "EMCal Photon Cut, set minimum number of cells per cluster: " << mMinNCell; } + void EMCPhotonCut::SetM02Range(float min, float max) { mMinM02 = min; mMaxM02 = max; LOG(info) << "EMCal Photon Cut, set minimum and maximum M02: " << mMinM02 << " <= M02 <= " << mMaxM02; } + void EMCPhotonCut::SetTimeRange(float min, float max) { mMinTime = min; mMaxTime = max; LOG(info) << "EMCal Photon Cut, set cluster time range in ns: " << mMinTime << " <= t <= " << mMaxTime; } -void EMCPhotonCut::SetTrackMatchingEta(std::function funcTM) -{ - mTrackMatchingEta = funcTM; - LOG(info) << "EMCal Photon Cut, set max dEta for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingEta(1.4); -} -void EMCPhotonCut::SetTrackMatchingPhi(std::function funcTM) -{ - mTrackMatchingPhi = funcTM; - LOG(info) << "EMCal Photon Cut, set max dPhi for TM (e.g. track pT == 1.4 GeV): " << mTrackMatchingPhi(1.4); -} + void EMCPhotonCut::SetMinEoverP(float min) { mMinEoverP = min; } + void EMCPhotonCut::SetUseExoticCut(bool flag) { mUseExoticCut = flag; LOG(info) << "EMCal Photon Cut, set usage of exotic cluster cut to: " << mUseExoticCut; } + void EMCPhotonCut::SetUseTM(bool flag) { mUseTM = flag; LOG(info) << "EM Photon Cluster Cut, using TM cut is set to : " << mUseTM; } +void EMCPhotonCut::SetUseSecondaryTM(bool flag) +{ + mUseSecondaryTM = flag; + LOG(info) << "EM Photon Cluster Cut, using secondary TM cut is set to : " << mUseTM; +} + void EMCPhotonCut::print() const { LOG(info) << "EMCal Photon Cut:"; @@ -100,7 +102,7 @@ void EMCPhotonCut::print() const case EMCPhotonCuts::kTiming: LOG(info) << mCutNames[i] << " in [" << mMinTime << ", " << mMaxTime << "]"; break; - // currently unsure how to do this in a nice way + // TODO: find a nice way to print TM cuts // case EMCPhotonCuts::kTM: // LOG(info) << mCutNames[i] << " > " << mMinNCrossedRowsOverFindableClustersTPC; // break; diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 8719fa83626..e7becec48b5 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -21,9 +21,14 @@ #include #include -#include #include +struct TrackMatchingParams { + float a{0.01f}; + float b{4.07f}; + float c{-2.5f}; +}; + class EMCPhotonCut : public TNamed { public: @@ -38,13 +43,16 @@ class EMCPhotonCut : public TNamed kM02, kTiming, kTM, + kSecondaryTM, kExotic, kNCuts }; static const char* mCutNames[static_cast(EMCPhotonCuts::kNCuts)]; - // Temporary function to check if cluster passes selection criteria. To be replaced by framework filters. + /// \brief check if given cluster survives all cuts + /// \param cluster cluster to check + /// \return true if cluster survives all cuts else false template bool IsSelected(Cluster const& cluster) const { @@ -66,13 +74,19 @@ class EMCPhotonCut : public TNamed if (mUseTM && (!IsSelectedEMCal(EMCPhotonCuts::kTM, cluster))) { return false; } + if (mUseSecondaryTM && (!IsSelectedEMCal(EMCPhotonCuts::kSecondaryTM, cluster))) { + return false; + } if (!IsSelectedEMCal(EMCPhotonCuts::kExotic, cluster)) { return false; } return true; } - // Returns true if a cluster survives the cuts! + /// \brief check if given cluster survives a given cut + /// \param cut enum of the cluster cut to check + /// \param cluster cluster to check + /// \return true if cluster survives cut else false template bool IsSelectedEMCal(const EMCPhotonCuts& cut, Cluster const& cluster) const { @@ -101,13 +115,29 @@ class EMCPhotonCut : public TNamed for (int itr = 0; itr < ntrack; itr++) { float dEta = std::fabs(dEtas[itr]); float dPhi = std::fabs(dPhis[itr]); - bool result = (dEta > mTrackMatchingEta(trackspt[itr])) || (dPhi > mTrackMatchingPhi(trackspt[itr])) || (cluster.e() / tracksp[itr] >= mMinEoverP); + bool result = (dEta > GetTrackMatchingEta(trackspt[itr])) || (dPhi > GetTrackMatchingPhi(trackspt[itr])) || (cluster.e() / tracksp[itr] >= mMinEoverP); if (!result) { return false; } } return true; // when we don't have any tracks the cluster should always survive the TM cut! } + case EMCPhotonCuts::kSecondaryTM: { + auto dEtas = cluster.deltaEtaSec(); // std:vector + auto dPhis = cluster.deltaPhiSec(); // std:vector + auto trackspt = cluster.trackptSec(); // std:vector + auto tracksp = cluster.trackpSec(); // std:vector + int ntrack = tracksp.size(); + for (int itr = 0; itr < ntrack; itr++) { + float dEta = std::fabs(dEtas[itr]); + float dPhi = std::fabs(dPhis[itr]); + bool result = (dEta > GetSecTrackMatchingEta(trackspt[itr])) || (dPhi > GetSecTrackMatchingPhi(trackspt[itr])); + if (!result) { + return false; + } + } + return true; // when we don't have any secondary tracks the cluster should always survive the secondary TM cut! + } case EMCPhotonCuts::kExotic: return mUseExoticCut ? !cluster.isExotic() : true; @@ -118,37 +148,131 @@ class EMCPhotonCut : public TNamed } // Setters + /// \brief Set clusterizer + /// \param clusterDefinitionString name of the clusterizer void SetClusterizer(std::string clusterDefinitionString = "kV3Default"); + + /// \brief Set minimum cluster energy + /// \param min minimum cluster energy void SetMinE(float min = 0.7f); + + /// \brief Set minimum number of cells per cluster + /// \param min minimum number of cells per cluster void SetMinNCell(int min = 1); + + /// \brief Set cluster M02 range to select + /// \param min minimum allowed cluster M02 + /// \param max maximum allowed cluster M02 void SetM02Range(float min = 0.1f, float max = 0.7f); + + /// \brief Set cluster time range to select + /// \param min minimum allowed cluster time + /// \param max maximum allowed cluster time void SetTimeRange(float min = -20.f, float max = 25.f); - void SetTrackMatchingEta(std::function funcTM); - void SetTrackMatchingPhi(std::function funcTM); + + /// \brief Set minimum cluster E over track momentum for track matching + /// \param min minimum allowed E/p void SetMinEoverP(float min = 0.7f); + + /// \brief Set flag to reject exotic cluster + /// \param flag flag to reject exotic cluster void SetUseExoticCut(bool flag = true); + + /// \brief Set flag to use track matching + /// \param flag flag to use track matching void SetUseTM(bool flag = true); - /// @brief Print the cluster selection + /// \brief Set flag to use secondary track matching + /// \param flag flag to use secondary track matching + void SetUseSecondaryTM(bool flag = false); + + /// \brief Set parameters for track matching delta eta = a + (pT + b)^c + /// \param a a in a + (pT + b)^c + /// \param b b in a + (pT + b)^c + /// \param c c in a + (pT + b)^c + void SetTrackMatchingEtaParams(float a, float b, float c) + { + mTrackMatchingEtaParams = {a, b, c}; + } + + /// \brief Set parameters for track matching delta phi = a + (pT + b)^c + /// \param a a in a + (pT + b)^c + /// \param b b in a + (pT + b)^c + /// \param c c in a + (pT + b)^c + void SetTrackMatchingPhiParams(float a, float b, float c) + { + mTrackMatchingPhiParams = {a, b, c}; + } + + /// \brief Set parameters for secondary track matching delta eta = a + (pT + b)^c + /// \param a a in a + (pT + b)^c + /// \param b b in a + (pT + b)^c + /// \param c c in a + (pT + b)^c + void SetSecTrackMatchingEtaParams(float a, float b, float c) + { + mSecTrackMatchingEtaParams = {a, b, c}; + } + + /// \brief Set parameters for secondary track matching delta phi = a + (pT + b)^c + /// \param a a in a + (pT + b)^c + /// \param b b in a + (pT + b)^c + /// \param c c in a + (pT + b)^c + void SetSecTrackMatchingPhiParams(float a, float b, float c) + { + mSecTrackMatchingPhiParams = {a, b, c}; + } + + /// \brief calculate delta eta for track matching at given track pT + /// \param pT track pT + float GetTrackMatchingEta(float pT) const + { + return mTrackMatchingEtaParams.a + std::pow(pT + mTrackMatchingEtaParams.b, mTrackMatchingEtaParams.c); + } + + /// \brief calculate delta phi for track matching at given track pT + /// \param pT track pT + float GetTrackMatchingPhi(float pT) const + { + return mTrackMatchingPhiParams.a + std::pow(pT + mTrackMatchingPhiParams.b, mTrackMatchingPhiParams.c); + } + + /// \brief calculate delta eta for secondary track matching at given track pT + /// \param pT track pT + float GetSecTrackMatchingEta(float pT) const + { + return mSecTrackMatchingEtaParams.a + std::pow(pT + mSecTrackMatchingEtaParams.b, mSecTrackMatchingEtaParams.c); + } + + /// \brief calculate delta phi for secondary track matching at given track pT + /// \param pT track pT + float GetSecTrackMatchingPhi(float pT) const + { + return mSecTrackMatchingPhiParams.a + std::pow(pT + mSecTrackMatchingPhiParams.b, mSecTrackMatchingPhiParams.c); + } + + /// \brief Print the cluster selection void print() const; private: // EMCal cluster cuts - int mDefinition{10}; ///< clusterizer definition - float mMinE{0.7f}; ///< minimum energy - int mMinNCell{1}; ///< minimum number of cells per cluster - float mMinM02{0.1f}; ///< minimum M02 for a cluster - float mMaxM02{0.7f}; ///< maximum M02 for a cluster - float mMinTime{-20.f}; ///< minimum cluster timing - float mMaxTime{25.f}; ///< maximum cluster timing - float mMinEoverP{1.75f}; ///< minimum cluster energy over track momentum ratio needed for the pair to be considered matched - bool mUseExoticCut{true}; ///< flag to decide if the exotic cluster cut is to be checked or not - bool mUseTM{true}; ///< flag to decide if track matching cut is to be checek or not - - std::function mTrackMatchingEta{}; ///< function to get check if a pre matched track and cluster pair is considered an actual match for eta - std::function mTrackMatchingPhi{}; ///< function to get check if a pre matched track and cluster pair is considered an actual match for phi - - ClassDef(EMCPhotonCut, 1); + int mDefinition{10}; ///< clusterizer definition + float mMinE{0.7f}; ///< minimum energy + int mMinNCell{1}; ///< minimum number of cells per cluster + float mMinM02{0.1f}; ///< minimum M02 for a cluster + float mMaxM02{0.7f}; ///< maximum M02 for a cluster + float mMinTime{-20.f}; ///< minimum cluster timing + float mMaxTime{25.f}; ///< maximum cluster timing + float mMinEoverP{1.75f}; ///< minimum cluster energy over track momentum ratio needed for the pair to be considered matched + bool mUseExoticCut{true}; ///< flag to decide if the exotic cluster cut is to be checked or not + bool mUseTM{true}; ///< flag to decide if track matching cut is to be checek or not + bool mUseSecondaryTM{false}; ///< flag to decide if seconary track matching cut is to be checek or not + + TrackMatchingParams mTrackMatchingEtaParams = {-1.f, 0.f, 0.f}; + TrackMatchingParams mTrackMatchingPhiParams = {-1.f, 0.f, 0.f}; + TrackMatchingParams mSecTrackMatchingEtaParams = {-1.f, 0.f, 0.f}; + TrackMatchingParams mSecTrackMatchingPhiParams = {-1.f, 0.f, 0.f}; + + ClassDef(EMCPhotonCut, 2); }; #endif // PWGEM_PHOTONMESON_CORE_EMCPHOTONCUT_H_ diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index b9315dbd898..882bafb912e 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -68,8 +67,6 @@ #include #include -#include - template struct Pi0EtaToGammaGamma { o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -397,15 +394,6 @@ struct Pi0EtaToGammaGamma { void DefineEMCCut() { - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); - - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); fEMCCut.SetClusterizer(emccuts.clusterDefinition); @@ -414,8 +402,8 @@ struct Pi0EtaToGammaGamma { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.EMC_TM_Eta->at(0), emccuts.EMC_TM_Eta->at(1), emccuts.EMC_TM_Eta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.EMC_TM_Phi->at(0), emccuts.EMC_TM_Phi->at(1), emccuts.EMC_TM_Phi->at(2)); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 674e663e03c..2dfd0494c1d 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -356,15 +356,6 @@ struct Pi0EtaToGammaGammaMC { void DefineEMCCut() { - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); - - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); fEMCCut.SetClusterizer(emccuts.clusterDefinition); @@ -373,8 +364,8 @@ struct Pi0EtaToGammaGammaMC { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.EMC_TM_Eta->at(0), emccuts.EMC_TM_Eta->at(1), emccuts.EMC_TM_Eta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.EMC_TM_Phi->at(0), emccuts.EMC_TM_Phi->at(1), emccuts.EMC_TM_Phi->at(2)); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index 462708a5087..322ce516eaf 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -8,19 +8,15 @@ // 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 TaggingPi0.h /// \brief This code loops over photons and makes pairs for direct photon analysis. -/// /// \author D. Sekihata, daiki.sekihata@cern.ch #ifndef PWGEM_PHOTONMESON_CORE_TAGGINGPI0_H_ #define PWGEM_PHOTONMESON_CORE_TAGGINGPI0_H_ #include "PWGEM/Dilepton/Utils/EMTrack.h" -#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/EventMixingHandler.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" @@ -31,27 +27,39 @@ #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep +#include +#include #include -#include -#include -#include +#include +#include #include #include +#include #include +#include #include #include @@ -101,7 +109,7 @@ struct TaggingPi0 { Configurable ndepth{"ndepth", 100, "depth for event mixing"}; ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {VARIABLE_WIDTH, -M_PI / 2, -M_PI / 4, 0.0f, +M_PI / 4, +M_PI / 2}, "Mixing bins - event plane angle"}; + ConfigurableAxis ConfEPBins{"ConfEPBins", {VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; @@ -327,7 +335,7 @@ struct TaggingPi0 { const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); - fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, 2 * M_PI}, {40, -1, +1}}, true); + fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", kTH2D, {axis_m, axis_pt}, true); fRegistry.addClone("Pair/same/", "Pair/mix/"); fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); @@ -413,15 +421,6 @@ struct TaggingPi0 { void DefineEMCCut() { - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); - - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); fEMCCut.SetClusterizer(emccuts.clusterDefinition); @@ -430,8 +429,8 @@ struct TaggingPi0 { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.EMC_TM_Eta->at(0), emccuts.EMC_TM_Eta->at(1), emccuts.EMC_TM_Eta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.EMC_TM_Phi->at(0), emccuts.EMC_TM_Phi->at(1), emccuts.EMC_TM_Phi->at(2)); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); @@ -547,7 +546,7 @@ struct TaggingPi0 { auto ele1 = g1.template negTrack_as(); ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.); fRegistry.fill(HIST("Photon/hPt"), v_gamma.Pt(), weight); - fRegistry.fill(HIST("Photon/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight); + fRegistry.fill(HIST("Photon/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index a8d325426b7..5178c3e9164 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -17,35 +17,49 @@ #ifndef PWGEM_PHOTONMESON_CORE_TAGGINGPI0MC_H_ #define PWGEM_PHOTONMESON_CORE_TAGGINGPI0MC_H_ -#include -#include -#include - -#include "TF1.h" -#include "TString.h" -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" - -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" - -#include "Common/Core/RecoDecay.h" -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" -#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" -#include "PWGEM/PhotonMeson/Utils/NMHistograms.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" +#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -#include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" +#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" + +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep +#include +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::aod; @@ -290,13 +304,13 @@ struct TaggingPi0MC { const AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, 2 * M_PI}, {40, -1, +1}}, true); // for purity - fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, 2 * M_PI}, {40, -1, +1}}, true); // for purity - fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator + fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness @@ -383,15 +397,6 @@ struct TaggingPi0MC { void DefineEMCCut() { - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); - - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); fEMCCut.SetClusterizer(emccuts.clusterDefinition); @@ -400,8 +405,8 @@ struct TaggingPi0MC { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.EMC_TM_Eta->at(0), emccuts.EMC_TM_Eta->at(1), emccuts.EMC_TM_Eta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.EMC_TM_Phi->at(0), emccuts.EMC_TM_Phi->at(1), emccuts.EMC_TM_Phi->at(2)); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); @@ -466,7 +471,7 @@ struct TaggingPi0MC { ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.f); fRegistry.fill(HIST("Photon/candidate/hPt"), v_gamma.Pt(), weight); - fRegistry.fill(HIST("Photon/candidate/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight); + fRegistry.fill(HIST("Photon/candidate/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); auto pos1 = g1.template posTrack_as(); auto ele1 = g1.template negTrack_as(); @@ -484,12 +489,12 @@ struct TaggingPi0MC { if (g1mc.isPhysicalPrimary() || g1mc.producedByGenerator()) { fRegistry.fill(HIST("Photon/primary/hPt"), v_gamma.Pt(), weight); - fRegistry.fill(HIST("Photon/primary/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight); + fRegistry.fill(HIST("Photon/primary/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); if (g1mc.has_mothers()) { auto mp = g1mc.template mothers_first_as(); if (std::abs(mp.pdgCode()) == 111) { fRegistry.fill(HIST("Photon/fromPi0/hPt"), v_gamma.Pt(), weight); - fRegistry.fill(HIST("Photon/fromPi0/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight); + fRegistry.fill(HIST("Photon/fromPi0/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } } } else if (IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { @@ -500,10 +505,10 @@ struct TaggingPi0MC { weight = f1fd_k0s_to_pi0->Eval(str_had.pt()); } fRegistry.fill(HIST("Photon/fromWD/hPt"), v_gamma.Pt(), weight * weight); - fRegistry.fill(HIST("Photon/fromWD/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight * weight); + fRegistry.fill(HIST("Photon/fromWD/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight * weight); } else { fRegistry.fill(HIST("Photon/fromHS/hPt"), v_gamma.Pt(), weight); - fRegistry.fill(HIST("Photon/fromHS/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + 2 * M_PI, v_gamma.Eta(), weight); + fRegistry.fill(HIST("Photon/fromHS/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index b10f56a2299..d4652c4864e 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -576,19 +576,26 @@ DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, std::vector); DECLARE_SOA_COLUMN(DeltaEta, deltaEta, std::vector); //! eta values of the matched tracks DECLARE_SOA_COLUMN(TrackP, trackp, std::vector); //! momentum values of the matched tracks DECLARE_SOA_COLUMN(TrackPt, trackpt, std::vector); //! pt values of the matched tracks +DECLARE_SOA_COLUMN(DeltaPhiSec, deltaPhiSec, std::vector); //! phi values of the matched secondary tracks +DECLARE_SOA_COLUMN(DeltaEtaSec, deltaEtaSec, std::vector); //! eta values of the matched secondary tracks +DECLARE_SOA_COLUMN(TrackPSec, trackpSec, std::vector); //! momentum values of the matched secondary tracks +DECLARE_SOA_COLUMN(TrackPtSec, trackptSec, std::vector); //! pt values of the matched secondary tracks DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float e, float eta, float m = 0) -> float { return sqrt(e * e - m * m) / cosh(eta); }); //! cluster pt, mass to be given as argument when getter is called! } // namespace emccluster -DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTER", //! table of skimmed EMCal clusters - o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, - skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::DeltaPhi, - emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt); -using SkimEMCCluster = SkimEMCClusters::iterator; - -DECLARE_SOA_TABLE_VERSIONED(SkimEMCClusters_001, "AOD", "SKIMEMCCLUSTER", 1, //! table of skimmed EMCal clusters +DECLARE_SOA_TABLE_VERSIONED(SkimEMCClusters_000, "AOD", "SKIMEMCCLUSTER", 0, //! table of skimmed EMCal clusters o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::DeltaPhi, emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt); -using SkimEMCCluster = SkimEMCClusters::iterator; + +DECLARE_SOA_TABLE_VERSIONED(SkimEMCClusters_001, "AOD", "SKIMEMCCLUSTER", 1, //! table of skimmed EMCal clusters version 002 - including secondary matched tracks + o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, + skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, + emccluster::DeltaPhi, emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, + emccluster::DeltaPhiSec, emccluster::DeltaEtaSec, emccluster::TrackPSec, emccluster::TrackPtSec, + emccluster::Pt); + +using SkimEMCClusters = SkimEMCClusters_001; +using SkimEMCCluster = SkimEMCClusters_001::iterator; DECLARE_SOA_TABLE(EMCEMEventIds, "AOD", "EMCEMEVENTID", emccluster::EMEventId); // To be joined with SkimEMCClusters table at analysis level. // iterators diff --git a/PWGEM/PhotonMeson/DataModel/mesonTables.h b/PWGEM/PhotonMeson/DataModel/mesonTables.h deleted file mode 100644 index 54daaa3a512..00000000000 --- a/PWGEM/PhotonMeson/DataModel/mesonTables.h +++ /dev/null @@ -1,46 +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 "Framework/AnalysisDataModel.h" - -#ifndef PWGEM_PHOTONMESON_DATAMODEL_MESONTABLES_H_ -#define PWGEM_PHOTONMESON_DATAMODEL_MESONTABLES_H_ - -namespace o2::aod -{ -namespace calomeson -{ -DECLARE_SOA_INDEX_COLUMN(Collision, - collision); //! Collision to which this meson belongs -DECLARE_SOA_INDEX_COLUMN_FULL(DaugtherPhotonOne, daugtherPhotonOne, int, - SkimEMCClusters, - "_One"); //! 1st daughter if this meson -DECLARE_SOA_INDEX_COLUMN_FULL(DaugtherPhotonTwo, daugtherPhotonTwo, int, - SkimEMCClusters, - "_Two"); //! 2nd daughter of this meson -DECLARE_SOA_COLUMN(Oa, oa, float); //! opening angle between the two daugthers -DECLARE_SOA_COLUMN(Px, px, float); //! px -DECLARE_SOA_COLUMN(Py, py, float); //! py -DECLARE_SOA_COLUMN(Pz, pz, float); //! pz -DECLARE_SOA_COLUMN(E, e, float); //! E -DECLARE_SOA_COLUMN(Alpha, - alpha, float); //! energy asymmertry of the two daughter particles -DECLARE_SOA_COLUMN(Minv, minv, float); //! invariant mass of the meson -DECLARE_SOA_COLUMN(Eta, eta, float); //! pseudorapidity of the meson -DECLARE_SOA_COLUMN(Phi, phi, float); //! phi angle of the meson -DECLARE_SOA_COLUMN(Pt, pt, float); //! pT of the meson -} // namespace calomeson -DECLARE_SOA_TABLE(CaloMeson, "AOD", "CALOMESON", //! - o2::soa::Index<>, calomeson::CollisionId, calomeson::DaugtherPhotonOneId, calomeson::DaugtherPhotonTwoId, - calomeson::Oa, calomeson::Px, calomeson::Py, calomeson::Pz, calomeson::E, calomeson::Alpha, - calomeson::Minv, calomeson::Eta, calomeson::Phi, calomeson::Pt); -} // namespace o2::aod -#endif // PWGEM_PHOTONMESON_DATAMODEL_MESONTABLES_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx index 5eb1bfeb069..c27bd6e64ab 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx @@ -12,19 +12,24 @@ /// \brief write relevant information for dalitz ee analysis to an AO2D.root file. This file is then the only necessary input to perform pcm analysis. /// \author daiki.sekihata@cern.ch -#include "Math/Vector4D.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "CommonConstants/PhysicsConstants.h" -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" +#include // IWYU pragma: keep + +#include +#include +#include +#include using namespace o2; using namespace o2::soa; @@ -235,13 +240,13 @@ struct skimmerDalitzEE { if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { return false; } - if (applyPiRej_TPC && abs(track.tpcNSigmaPi()) < maxTPCNsigmaPi) { + if (applyPiRej_TPC && std::abs(track.tpcNSigmaPi()) < maxTPCNsigmaPi) { return false; } - if (applyKaRej_TPC && abs(track.tpcNSigmaKa()) < maxTPCNsigmaKa) { + if (applyKaRej_TPC && std::abs(track.tpcNSigmaKa()) < maxTPCNsigmaKa) { return false; } - if (applyPrRej_TPC && abs(track.tpcNSigmaPr()) < maxTPCNsigmaPr) { + if (applyPrRej_TPC && std::abs(track.tpcNSigmaPr()) < maxTPCNsigmaPr) { return false; } @@ -251,10 +256,10 @@ struct skimmerDalitzEE { template bool isElectron_TOFrequire(TTrack const& track) { - if (applyPiRej_TPC && abs(track.tpcNSigmaPi()) < maxTPCNsigmaPi) { + if (applyPiRej_TPC && std::abs(track.tpcNSigmaPi()) < maxTPCNsigmaPi) { return false; } - return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && abs(track.tofNSigmaEl()) < maxTOFNsigmaEl; + return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && std::abs(track.tofNSigmaEl()) < maxTOFNsigmaEl; } template @@ -290,7 +295,7 @@ struct skimmerDalitzEE { fRegistry.fill(HIST("hNpairs"), static_cast(pairtype)); npair++; - } // end of pairing loop + } // end of pairing loop } else { // LS for (auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(tracks1, tracks2))) { if (!checkTrack(t1) || !checkTrack(t2)) { diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx index 5ef60cb26e9..5e66a1e6b0d 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx @@ -47,8 +47,9 @@ struct SkimmerGammaCalo { Preslice psCellperCluster = o2::aod::emcalclustercell::emcalclusterId; Preslice psMTperCluster = o2::aod::emcalclustercell::emcalclusterId; + Preslice psMSperCluster = o2::aod::emcalclustercell::emcalclusterId; - Produces tableGammaEMCReco; + Produces tableGammaEMCReco; Produces tableEMCClusterMCLabels; Produces tableCellEMCReco; @@ -63,6 +64,8 @@ struct SkimmerGammaCalo { Configurable maxdEta{"maxdEta", 0.1, "Set a maximum difference in eta for tracks and cluster to still count as matched"}; Configurable maxdPhi{"maxdPhi", 0.1, "Set a maximum difference in phi for tracks and cluster to still count as matched"}; Configurable maxEoverP{"maxEoverP", 1.5, "Set a maximum for cluster E / track p for track matching."}; + Configurable maxdEtaSec{"maxdEtaSec", 0.1, "Set a maximum difference in eta for secondary tracks and cluster to still count as matched"}; + Configurable maxdPhiSec{"maxdPhiSec", 0.1, "Set a maximum difference in phi for secondary tracks and cluster to still count as matched"}; Configurable needEMCTrigger{"needEMCTrigger", false, "flag to only save events which have kTVXinEMC trigger bit. To reduce PbPb derived data size"}; HistogramRegistry historeg{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -75,6 +78,8 @@ struct SkimmerGammaCalo { historeg.add("EOut", "Energy of clusters after cuts", gHistoSpecClusterE); historeg.add("MTEtaPhiBeforeTM", "Eta phi of matched tracks before TM cuts", gHistoSpecClusterTMdEtadPhi); historeg.add("MTEtaPhiAfterTM", "Eta phi of matched tracks after TM cuts", gHistoSpecClusterTMdEtadPhi); + historeg.add("MSTEtaPhiBeforeTM", "Eta phi of matched secondary tracks before TM cuts", gHistoSpecClusterTMdEtadPhi); + historeg.add("MSTEtaPhiAfterTM", "Eta phi of matched secondary tracks after TM cuts", gHistoSpecClusterTMdEtadPhi); historeg.add("Eoverp", "E/p for cluster E and track p", gHistoSpecTMEoverP); historeg.add("M02In", "Shape of cluster before cuts;#bf{#it{M}_{02}};#bf{#it{N}_{clusters}}", HistType::kTH1F, {{200, 0, 2}}); historeg.add("M02Out", "Shape of cluster after cuts;#bf{#it{M}_{02}};#bf{#it{N}_{clusters}}", HistType::kTH1F, {{200, 0, 2}}); @@ -96,6 +101,12 @@ struct SkimmerGammaCalo { hCaloTrackFilter->GetXaxis()->SetBinLabel(3, "E/p cut"); hCaloTrackFilter->GetXaxis()->SetBinLabel(4, "out"); + auto hCaloSecondaryTrackFilter = historeg.add("hCaloSecondaryTrackFilter", "hCaloSecondaryTrackFilter", kTH1I, {{4, 0, 4}}); + hCaloSecondaryTrackFilter->GetXaxis()->SetBinLabel(1, "in"); + hCaloSecondaryTrackFilter->GetXaxis()->SetBinLabel(2, "#Delta#eta #Delta#varphi"); + hCaloSecondaryTrackFilter->GetXaxis()->SetBinLabel(3, "E/p cut"); + hCaloSecondaryTrackFilter->GetXaxis()->SetBinLabel(4, "out"); + LOG(info) << "| EMCal cluster cuts for skimming:"; LOG(info) << "| Timing cut: " << minTime << " < t < " << maxTime; LOG(info) << "| M02 cut: " << minM02 << " < M02 < " << maxM02; @@ -105,7 +116,11 @@ struct SkimmerGammaCalo { LOG(info) << "| TM - E/p cut: E/p < " << maxEoverP; } - void processRec(soa::Join::iterator const& collision, aod::EMCALClusters const& emcclusters, aod::EMCALClusterCells const& emcclustercells, aod::EMCALMatchedTracks const& emcmatchedtracks, aod::FullTracks const&) + template + static constexpr bool HasSecondaries = !std::is_same_v; + + template + void runAnalysis(TCollision const& collision, TClusters const& emcclusters, TClusterCells const& emcclustercells, TMatchedTracks const& emcmatchedtracks, TTracks const& /*tracks*/, TMatchedSecondaries const& secondaries = nullptr) { if (!collision.isSelected()) { return; @@ -155,13 +170,11 @@ struct SkimmerGammaCalo { } // Skimmed matched tracks table - std::vector vTrackIds; std::vector vEta; std::vector vPhi; std::vector vP; std::vector vPt; auto groupedMTs = emcmatchedtracks.sliceBy(psMTperCluster, emccluster.globalIndex()); - vTrackIds.reserve(groupedMTs.size()); vEta.reserve(groupedMTs.size()); vPhi.reserve(groupedMTs.size()); vP.reserve(groupedMTs.size()); @@ -173,18 +186,44 @@ struct SkimmerGammaCalo { historeg.fill(HIST("hCaloTrackFilter"), 1); continue; } - historeg.fill(HIST("Eoverp"), emccluster.energy(), emccluster.energy() / emcmatchedtrack.track_as().p()); - if (emccluster.energy() / emcmatchedtrack.track_as().p() > maxEoverP) { + historeg.fill(HIST("Eoverp"), emccluster.energy(), emccluster.energy() / emcmatchedtrack.template track_as().p()); + if (emccluster.energy() / emcmatchedtrack.template track_as().p() > maxEoverP) { historeg.fill(HIST("hCaloTrackFilter"), 2); continue; } historeg.fill(HIST("hCaloTrackFilter"), 3); historeg.fill(HIST("MTEtaPhiAfterTM"), emcmatchedtrack.deltaEta(), emcmatchedtrack.deltaPhi()); - vTrackIds.emplace_back(emcmatchedtrack.trackId()); vEta.emplace_back(emcmatchedtrack.deltaEta()); vPhi.emplace_back(emcmatchedtrack.deltaPhi()); - vP.emplace_back(emcmatchedtrack.track_as().p()); - vPt.emplace_back(emcmatchedtrack.track_as().pt()); + vP.emplace_back(emcmatchedtrack.template track_as().p()); + vPt.emplace_back(emcmatchedtrack.template track_as().pt()); + } + + std::vector vEtaSecondaries = {}; + std::vector vPhiSecondaries = {}; + std::vector vPSecondaries = {}; + std::vector vPtSecondaries = {}; + + if constexpr (HasSecondaries) { + auto groupedMatchedSecondaries = secondaries.sliceBy(psMSperCluster, emccluster.globalIndex()); + vEta.reserve(groupedMatchedSecondaries.size()); + vPhi.reserve(groupedMatchedSecondaries.size()); + vP.reserve(groupedMatchedSecondaries.size()); + vPt.reserve(groupedMatchedSecondaries.size()); + for (const auto& emcMatchedSecondary : groupedMatchedSecondaries) { + historeg.fill(HIST("hCaloSecondaryTrackFilter"), 0); + historeg.fill(HIST("MSTEtaPhiBeforeTM"), emcMatchedSecondary.deltaEta(), emcMatchedSecondary.deltaPhi()); + if (std::abs(emcMatchedSecondary.deltaEta()) >= maxdEtaSec || std::abs(emcMatchedSecondary.deltaPhi()) >= maxdPhiSec) { + historeg.fill(HIST("hCaloSecondaryTrackFilter"), 1); + continue; + } + historeg.fill(HIST("hCaloSecondaryTrackFilter"), 3); + historeg.fill(HIST("MSTEtaPhiAfterTM"), emcMatchedSecondary.deltaEta(), emcMatchedSecondary.deltaPhi()); + vEta.emplace_back(emcMatchedSecondary.deltaEta()); + vPhi.emplace_back(emcMatchedSecondary.deltaPhi()); + vP.emplace_back(emcMatchedSecondary.template track_as().p()); + vPt.emplace_back(emcMatchedSecondary.template track_as().pt()); + } } historeg.fill(HIST("DefinitionOut"), emccluster.definition()); @@ -193,9 +232,22 @@ struct SkimmerGammaCalo { historeg.fill(HIST("TimeOut"), emccluster.time()); tableGammaEMCReco(emccluster.collisionId(), emccluster.definition(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(), - emccluster.nCells(), emccluster.time(), emccluster.isExotic(), vPhi, vEta, vP, vPt); + emccluster.nCells(), emccluster.time(), emccluster.isExotic(), vPhi, vEta, vP, vPt, vPhiSecondaries, vEtaSecondaries, vPSecondaries, vPtSecondaries); } } + + void processRec(soa::Join::iterator const& collision, aod::EMCALClusters const& emcclusters, aod::EMCALClusterCells const& emcclustercells, aod::EMCALMatchedTracks const& emcmatchedtracks, aod::FullTracks const& tracks) + { + runAnalysis(collision, emcclusters, emcclustercells, emcmatchedtracks, tracks); + } + PROCESS_SWITCH(SkimmerGammaCalo, processRec, "process only reconstructed info", true); + + void processRecWithSecondaries(soa::Join::iterator const& collision, aod::EMCALClusters const& emcclusters, aod::EMCALClusterCells const& emcclustercells, aod::EMCALMatchedTracks const& emcmatchedtracks, aod::FullTracks const& tracks, aod::EMCMatchSecs const& emcmatchedsecondaries) + { + runAnalysis(collision, emcclusters, emcclustercells, emcmatchedtracks, tracks, emcmatchedsecondaries); + } + PROCESS_SWITCH(SkimmerGammaCalo, processRecWithSecondaries, "process reconstructed info with secondary track matching.", false); + void processMC(soa::Join::iterator const& collision, soa::Join const& emcclusters, aod::McParticles const&) { if (!collision.isSelected()) { @@ -236,7 +288,6 @@ struct SkimmerGammaCalo { mcLabels.clear(); } } - PROCESS_SWITCH(SkimmerGammaCalo, processRec, "process only reconstructed info", true); PROCESS_SWITCH(SkimmerGammaCalo, processMC, "process MC info", false); // Run this in addition to processRec for MCs to copy the cluster mc labels from the EMCALMCClusters to the skimmed EMCClusterMCLabels table void processDummy(aod::Collision const&) diff --git a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx index 912e2ffc07a..5002de0a133 100644 --- a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx +++ b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx @@ -9,27 +9,34 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file CheckMCV0.cxx /// \brief check the v0 phase-space -/// \dependencies: o2-analysis-lf-lambdakzeromcfinder /// \author daiki.sekihata@cern.ch felix.schlepper@cern.ch +/// \dependencies: o2-analysis-lf-lambdakzeromcfinder -#include "TDatabasePDG.h" -#include "TMath.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/Track.h" -#include "DetectorsBase/Propagator.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGEM/PhotonMeson/DataModel/mcV0Tables.h" #include "PWGEM/PhotonMeson/Utils/TrackSelection.h" +// #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGEM/PhotonMeson/DataModel/mcV0Tables.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" + +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; @@ -343,7 +350,7 @@ struct CheckMCV0 { return; } } else if constexpr (idxCut == 2) { - if (!(abs(pos.z()) > 38.f && abs(pos.z()) < 46.f) && !(abs(ele.z()) > 38.f && abs(ele.z()) < 46.f)) { + if (!(std::abs(pos.z()) > 38.f && std::abs(pos.z()) < 46.f) && !(std::abs(ele.z()) > 38.f && std::abs(ele.z()) < 46.f)) { return; } } @@ -419,15 +426,15 @@ struct CheckMCV0 { registry.fill(HIST("CheckV0Leg"), checkV0legEnum::PTMAX); return false; } - if (abs(track.eta()) > maxeta) { + if (std::abs(track.eta()) > maxeta) { registry.fill(HIST("CheckV0Leg"), checkV0legEnum::MAXETA); return false; } - if (abs(track.dcaXY()) < dcamin) { + if (std::abs(track.dcaXY()) < dcamin) { registry.fill(HIST("CheckV0Leg"), checkV0legEnum::DCAMIN); return false; } - if (abs(track.dcaXY()) > dcamax) { + if (std::abs(track.dcaXY()) > dcamax) { registry.fill(HIST("CheckV0Leg"), checkV0legEnum::DCAMAX); return false; } diff --git a/PWGEM/PhotonMeson/Tasks/Converters/CMakeLists.txt b/PWGEM/PhotonMeson/Tasks/Converters/CMakeLists.txt index 89aceb70f98..b7fcf739373 100644 --- a/PWGEM/PhotonMeson/Tasks/Converters/CMakeLists.txt +++ b/PWGEM/PhotonMeson/Tasks/Converters/CMakeLists.txt @@ -18,3 +18,8 @@ o2physics_add_dpl_workflow(electron-from-dalitz-converter1 SOURCES electronFromDalitzConverter1.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(skim-emc-cluste-converter + SOURCES skimEmcClusterConverter.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGEM/PhotonMeson/Tasks/Converters/skimEmcClusterConverter.cxx b/PWGEM/PhotonMeson/Tasks/Converters/skimEmcClusterConverter.cxx new file mode 100644 index 00000000000..d1809162bbc --- /dev/null +++ b/PWGEM/PhotonMeson/Tasks/Converters/skimEmcClusterConverter.cxx @@ -0,0 +1,62 @@ +// 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 skimEmcClusterConverter.cxx +/// \brief Converter task to convert SkimEMCClusters +/// \author M. Hemmer, marvin.hemmer@cern.ch + +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" + +#include +#include +#include +#include + +#include +#include +#include + +using namespace o2; +using namespace o2::framework; + +void convertSpanToVector(std::vector& destData, const gsl::span& srcData) +{ + destData.reserve(srcData.size()); + std::copy(srcData.begin(), srcData.end(), destData.begin()); +} + +// Converts SkimEMCClusters_000 into SkimEMCClusters_001 +struct SkimEmcClusterConverter { + Produces tableGammaEMCReco001; + + void process(aod::SkimEMCClusters_000 const& emcClusters) + { + std::vector vDummy = {}; + std::vector vPhi, vEta, vPt, vP; + for (const auto& emcCluster : emcClusters) { + // using convertSpanToVector is just a temporal solution, since right now tables return gsl::span + // while filling a table needs std::span which can not be transformed. So going over std::vector + // as a middle point is the current solution + convertSpanToVector(vPhi, emcCluster.deltaPhi()); + convertSpanToVector(vEta, emcCluster.deltaEta()); + convertSpanToVector(vP, emcCluster.trackp()); + convertSpanToVector(vPt, emcCluster.trackpt()); + tableGammaEMCReco001(emcCluster.collisionId(), emcCluster.definition(), emcCluster.e(), emcCluster.eta(), emcCluster.phi(), emcCluster.m02(), emcCluster.nCells(), emcCluster.time(), emcCluster.isExotic(), vPhi, vEta, vP, vPt, vDummy, vDummy, vDummy, vDummy); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} diff --git a/PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx b/PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx index d00c2e9732f..f897e3dc5cb 100644 --- a/PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx +++ b/PWGEM/PhotonMeson/Tasks/SinglePhoton.cxx @@ -214,15 +214,6 @@ struct SinglePhoton { void DefineEMCCuts() { - const float a = EMC_TM_Eta->at(0); - const float b = EMC_TM_Eta->at(1); - const float c = EMC_TM_Eta->at(2); - - const float d = EMC_TM_Phi->at(0); - const float e = EMC_TM_Phi->at(1); - const float f = EMC_TM_Phi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - TString cutNamesStr = fConfigEMCCuts.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); @@ -236,12 +227,8 @@ struct SinglePhoton { custom_cut->SetM02Range(EMC_minM02, EMC_maxM02); custom_cut->SetTimeRange(EMC_minTime, EMC_maxTime); - custom_cut->SetTrackMatchingEta([a, b, c](float pT) { - return a + pow(pT + b, c); - }); - custom_cut->SetTrackMatchingPhi([d, e, f](float pT) { - return d + pow(pT + e, f); - }); + custom_cut->SetTrackMatchingEtaParams(EMC_TM_Eta->at(0), EMC_TM_Eta->at(1), EMC_TM_Eta->at(2)); + custom_cut->SetTrackMatchingPhiParams(EMC_TM_Phi->at(0), EMC_TM_Phi->at(1), EMC_TM_Phi->at(2)); custom_cut->SetMinEoverP(EMC_Eoverp); custom_cut->SetUseExoticCut(EMC_UseExoticCut); diff --git a/PWGEM/PhotonMeson/Tasks/SinglePhotonMC.cxx b/PWGEM/PhotonMeson/Tasks/SinglePhotonMC.cxx index dd09bc17c4a..4284adb98e7 100644 --- a/PWGEM/PhotonMeson/Tasks/SinglePhotonMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/SinglePhotonMC.cxx @@ -215,14 +215,6 @@ struct SinglePhotonMC { // // void DefineEMCCuts() // { - // const float a = EMC_TM_Eta->at(0); - // const float b = EMC_TM_Eta->at(1); - // const float c = EMC_TM_Eta->at(2); - // - // const float d = EMC_TM_Phi->at(0); - // const float e = EMC_TM_Phi->at(1); - // const float f = EMC_TM_Phi->at(2); - // LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); // // TString cutNamesStr = fConfigEMCCuts.value; // if (!cutNamesStr.IsNull()) { @@ -237,12 +229,8 @@ struct SinglePhotonMC { // custom_cut->SetM02Range(EMC_minM02, EMC_maxM02); // custom_cut->SetTimeRange(EMC_minTime, EMC_maxTime); // - // custom_cut->SetTrackMatchingEta([&a, &b, &c](float pT) { - // return a + pow(pT + b, c); - // }); - // custom_cut->SetTrackMatchingPhi([&d, &e, &f](float pT) { - // return d + pow(pT + e, f); - // }); + // custom_cut->SetTrackMatchingEtaParams(EMC_TM_Eta->at(0), EMC_TM_Eta->at(1), EMC_TM_Eta->at(2)); + // custom_cut->SetTrackMatchingPhiParams(EMC_TM_Phi->at(0), EMC_TM_Phi->at(1), EMC_TM_Phi->at(2)); // // custom_cut->SetMinEoverP(EMC_Eoverp); // custom_cut->SetUseExoticCut(EMC_UseExoticCut); diff --git a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx index 4df49aad167..0e444fbdb76 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -25,7 +25,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" #include #include @@ -54,7 +53,6 @@ #include #include #include -#include #include #include @@ -73,15 +71,6 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::photon; -enum QvecEstimator { - FT0M = 0, - FT0A = 1, - FT0C, - TPCPos, - TPCNeg, - TPCTot -}; - enum CentralityEstimator { None = 0, CFT0A = 1, @@ -157,9 +146,12 @@ struct CalibTaskEmc { Configurable cfgEMCminNCell{"cfgEMCminNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; Configurable> cfgEMCTMEta{"cfgEMCTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable> cfgEMCTMPhi{"cfgEMCTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> emcSecTMEta{"emcSecTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> emcSecTMPhi{"emcSecTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable cfgEMCEoverp{"cfgEMCEoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; Configurable cfgEMCUseExoticCut{"cfgEMCUseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; Configurable cfgEMCUseTM{"cfgEMCUseTM", true, "flag to use EMCal track matching cut or not"}; + Configurable emcUseSecondaryTM{"emcUseSecondaryTM", false, "flag to use EMCal secondary track matching cut or not"}; Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } emccuts; @@ -292,16 +284,11 @@ struct CalibTaskEmc { void defineEMCCut() { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); - const float a = emccuts.cfgEMCTMEta->at(0); - const float b = emccuts.cfgEMCTMEta->at(1); - const float c = emccuts.cfgEMCTMEta->at(2); - - const float d = emccuts.cfgEMCTMPhi->at(0); - const float e = emccuts.cfgEMCTMPhi->at(1); - const float f = emccuts.cfgEMCTMPhi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.cfgEMCTMEta->at(0), emccuts.cfgEMCTMEta->at(1), emccuts.cfgEMCTMEta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.cfgEMCTMPhi->at(0), emccuts.cfgEMCTMPhi->at(1), emccuts.cfgEMCTMPhi->at(2)); + + fEMCCut.SetSecTrackMatchingEtaParams(emccuts.emcSecTMEta->at(0), emccuts.emcSecTMEta->at(1), emccuts.emcSecTMEta->at(2)); + fEMCCut.SetSecTrackMatchingPhiParams(emccuts.emcSecTMPhi->at(0), emccuts.emcSecTMPhi->at(1), emccuts.emcSecTMPhi->at(2)); fEMCCut.SetMinEoverP(emccuts.cfgEMCEoverp); fEMCCut.SetMinE(emccuts.cfgEMCminE); @@ -310,6 +297,8 @@ struct CalibTaskEmc { fEMCCut.SetTimeRange(emccuts.cfgEMCminTime, emccuts.cfgEMCmaxTime); fEMCCut.SetUseExoticCut(emccuts.cfgEMCUseExoticCut); fEMCCut.SetClusterizer(emccuts.clusterDefinition); + fEMCCut.SetUseTM(emccuts.cfgEMCUseTM.value); // disables or enables TM + fEMCCut.SetUseSecondaryTM(emccuts.emcUseSecondaryTM.value); // disables or enables secondary TM } void DefinePCMCut() @@ -347,7 +336,6 @@ struct CalibTaskEmc { { defineEMEventCut(); defineEMCCut(); - fEMCCut.SetUseTM(emccuts.cfgEMCUseTM); // disables TM o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index 6f298546c30..3acb75216f9 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -8,19 +8,14 @@ // 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. -// -/// EMCAL QC Task -/// + /// \file emcalQC.cxx -/// /// \brief Task that runs basic EMCal cluster QA for derived data in the EM format -/// /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) Goethe University Frankfurt /// -#include "EMPhotonEventCut.h" - #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/ClusterHistograms.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" @@ -114,23 +109,14 @@ struct EmcalQC { void defineEMCCut() { - const float a = emccuts.tmEta->at(0); - const float b = emccuts.tmEta->at(1); - const float c = emccuts.tmEta->at(2); - - const float d = emccuts.tmPhi->at(0); - const float e = emccuts.tmPhi->at(1); - const float f = emccuts.tmPhi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.minClusterE); fEMCCut.SetMinNCell(emccuts.minNCell); fEMCCut.SetM02Range(emccuts.minM02, emccuts.maxM02); fEMCCut.SetTimeRange(emccuts.minClusterTime, emccuts.maxClusterTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEtaParams(emccuts.tmEta->at(0), emccuts.tmEta->at(1), emccuts.tmEta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.tmPhi->at(0), emccuts.tmPhi->at(1), emccuts.tmPhi->at(2)); fEMCCut.SetMinEoverP(emccuts.tmEoverP); fEMCCut.SetUseExoticCut(emccuts.useExoticCut); @@ -216,10 +202,10 @@ struct EmcalQC { bool survivesIsSelectedEMCalCuts = true; // Survives "manual" cuts listed in this task bool survivesIsSelectedCuts = fEMCCut.IsSelected(cluster); // Survives the cutlist defines in EMCPhotonCut.h, which is also used in the Pi0Eta task - for (int icut = 1; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables, start at 1 to ignore ClusterDefinition + for (int icut = 0; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables EMCPhotonCut::EMCPhotonCuts specificcut = static_cast(icut); if (!fEMCCut.IsSelectedEMCal(specificcut, cluster)) { // Check whether cluster passes this cluster requirement, if not, fill why in the next row - fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut, cluster.e(), collision.weight()); + fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut + 1, cluster.e(), collision.weight()); survivesIsSelectedEMCalCuts = false; } } @@ -230,7 +216,7 @@ struct EmcalQC { if (survivesIsSelectedCuts) { o2::aod::pwgem::photonmeson::utils::clusterhistogram::fillClusterHistograms<1>(&fRegistry, cluster, cfgDo2DQA, collision.weight()); - fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), 7., cluster.e(), collision.weight()); + fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1., cluster.e(), collision.weight()); ngAfter++; } } diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index 44b3c616264..d067806fa84 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -76,7 +76,8 @@ enum QvecEstimator { FT0C, TPCPos, TPCNeg, - TPCTot + TPCTot, + FV0A }; enum CentralityEstimator { @@ -111,9 +112,9 @@ struct TaskPi0FlowEMC { // configurable for flow Configurable harmonic{"harmonic", 2, "harmonic number"}; - Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5)"}; - Configurable qvecSubADetector{"qvecSubADetector", 3, "Sub A Detector for Q vector estimation for resolution (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5)"}; - Configurable qvecSubBDetector{"qvecSubBDetector", 4, "Sub B Detector for Q vector estimation for resolution (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5)"}; + Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5, FV0A: 6)"}; + Configurable qvecSubADetector{"qvecSubADetector", 3, "Sub A Detector for Q vector estimation for resolution (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5, FV0A: 6)"}; + Configurable qvecSubBDetector{"qvecSubBDetector", 4, "Sub B Detector for Q vector estimation for resolution (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5, FV0A: 6)"}; Configurable centEstimator{"centEstimator", 2, "Centrality estimation (FT0A: 1, FT0C: 2, FT0M: 3)"}; Configurable saveEpResoHisto{"saveEpResoHisto", false, "Flag to save event plane resolution histogram"}; Configurable saveSPResoHist{"saveSPResoHist", false, "Flag to save scalar product resolution histogram"}; @@ -173,9 +174,12 @@ struct TaskPi0FlowEMC { Configurable cfgEMCminNCell{"cfgEMCminNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; Configurable> cfgEMCTMEta{"cfgEMCTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable> cfgEMCTMPhi{"cfgEMCTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> emcSecTMEta{"emcSecTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> emcSecTMPhi{"emcSecTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable cfgEMCEoverp{"cfgEMCEoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; Configurable cfgEMCUseExoticCut{"cfgEMCUseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; Configurable cfgEMCUseTM{"cfgEMCUseTM", false, "flag to use EMCal track matching cut or not"}; + Configurable emcUseSecondaryTM{"emcUseSecondaryTM", false, "flag to use EMCal secondary track matching cut or not"}; Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } emccuts; @@ -281,16 +285,12 @@ struct TaskPi0FlowEMC { void defineEMCCut() { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); - const float a = emccuts.cfgEMCTMEta->at(0); - const float b = emccuts.cfgEMCTMEta->at(1); - const float c = emccuts.cfgEMCTMEta->at(2); - - const float d = emccuts.cfgEMCTMPhi->at(0); - const float e = emccuts.cfgEMCTMPhi->at(1); - const float f = emccuts.cfgEMCTMPhi->at(2); - LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + + fEMCCut.SetTrackMatchingEtaParams(emccuts.cfgEMCTMEta->at(0), emccuts.cfgEMCTMEta->at(1), emccuts.cfgEMCTMEta->at(2)); + fEMCCut.SetTrackMatchingPhiParams(emccuts.cfgEMCTMPhi->at(0), emccuts.cfgEMCTMPhi->at(1), emccuts.cfgEMCTMPhi->at(2)); + + fEMCCut.SetSecTrackMatchingEtaParams(emccuts.emcSecTMEta->at(0), emccuts.emcSecTMEta->at(1), emccuts.emcSecTMEta->at(2)); + fEMCCut.SetSecTrackMatchingPhiParams(emccuts.emcSecTMPhi->at(0), emccuts.emcSecTMPhi->at(1), emccuts.emcSecTMPhi->at(2)); fEMCCut.SetMinEoverP(emccuts.cfgEMCEoverp); fEMCCut.SetMinE(emccuts.cfgEMCminE); @@ -299,6 +299,8 @@ struct TaskPi0FlowEMC { fEMCCut.SetTimeRange(emccuts.cfgEMCminTime, emccuts.cfgEMCmaxTime); fEMCCut.SetUseExoticCut(emccuts.cfgEMCUseExoticCut); fEMCCut.SetClusterizer(emccuts.clusterDefinition); + fEMCCut.SetUseTM(emccuts.cfgEMCUseTM.value); // disables or enables TM + fEMCCut.SetUseSecondaryTM(emccuts.emcUseSecondaryTM.value); // disables or enables secondary TM } void init(InitContext&) @@ -309,7 +311,6 @@ struct TaskPi0FlowEMC { defineEMEventCut(); defineEMCCut(); - fEMCCut.SetUseTM(emccuts.cfgEMCUseTM); // disables TM o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; @@ -381,10 +382,17 @@ struct TaskPi0FlowEMC { registry.add("spReso/hSpResoFT0mTPCneg", "hSpResoFT0mTPCneg; centrality; Q_{FT0m} #bullet Q_{TPCneg}", HistType::kTProfile, {thnAxisCent}); registry.add("spReso/hSpResoFT0mTPCtot", "hSpResoFT0mTPCtot; centrality; Q_{FT0m} #bullet Q_{TPCtot}", HistType::kTProfile, {thnAxisCent}); registry.add("spReso/hSpResoTPCposTPCneg", "hSpResoTPCposTPCneg; centrality; Q_{TPCpos} #bullet Q_{TPCneg}", HistType::kTProfile, {thnAxisCent}); + registry.add("spReso/hSpResoFV0aFT0c", "hSpResoFV0aFT0c; centrality; Q_{FV0a} #bullet Q_{FT0c}", HistType::kTProfile, {thnAxisCent}); + registry.add("spReso/hSpResoFV0aTPCpos", "hSpResoFV0aTPCpos; centrality; Q_{FV0a} #bullet Q_{TPCpos}", HistType::kTProfile, {thnAxisCent}); + registry.add("spReso/hSpResoFV0aTPCneg", "hSpResoFV0aTPCneg; centrality; Q_{FV0a} #bullet Q_{TPCneg}", HistType::kTProfile, {thnAxisCent}); + registry.add("spReso/hSpResoFV0aTPCtot", "hSpResoFV0aTPCtot; centrality; Q_{FV0a} #bullet Q_{TPCtot}", HistType::kTProfile, {thnAxisCent}); } if (saveEpResoHisto.value) { + registry.add("hEventPlaneAngleFT0C", "hEventPlaneAngleFT0C", HistType::kTH2D, {thnAxisCent, thAxisPsi}); + registry.add("hEventPlaneAngleFT0A", "hEventPlaneAngleFT0A", HistType::kTH2D, {thnAxisCent, thAxisPsi}); registry.add("hEventPlaneAngleFT0M", "hEventPlaneAngleFT0M", HistType::kTH2D, {thnAxisCent, thAxisPsi}); + registry.add("hEventPlaneAngleFV0A", "hEventPlaneAngleFV0A", HistType::kTH2D, {thnAxisCent, thAxisPsi}); registry.add("hEventPlaneAngleTPCpos", "hEventPlaneAngleTPCpos", HistType::kTH2D, {thnAxisCent, thAxisPsi}); registry.add("hEventPlaneAngleTPCneg", "hEventPlaneAngleTPCneg", HistType::kTH2D, {thnAxisCent, thAxisPsi}); registry.add("epReso/hEpResoFT0cFT0a", "hEpResoFT0cFT0a; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); @@ -398,10 +406,16 @@ struct TaskPi0FlowEMC { registry.add("epReso/hEpResoFT0mTPCneg", "hEpResoFT0mTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoFT0mTPCtot", "hEpResoFT0mTPCtot; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoTPCposTPCneg", "hEpResoTPCposTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpResoFV0aFT0c", "hEpResoFV0aFT0c; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpResoFV0aTPCpos", "hEpResoFV0aTPCpos; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpResoFV0aTPCneg", "hEpResoFV0aTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpResoFV0aTPCtot", "hEpResoFV0aTPCtot; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpCosCoefficientsFT0c", "hEpCosCoefficientsFT0c; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); registry.add("epReso/hEpSinCoefficientsFT0c", "hEpSinCoefficientsFT0c; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); registry.add("epReso/hEpCosCoefficientsFT0a", "hEpCosCoefficientsFT0a; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); registry.add("epReso/hEpSinCoefficientsFT0a", "hEpSinCoefficientsFT0a; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsFV0a", "hEpCosCoefficientsFV0a; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFV0a", "hEpSinCoefficientsFV0a; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); registry.add("epReso/hEpCosCoefficientsFT0m", "hEpCosCoefficientsFT0m; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); registry.add("epReso/hEpSinCoefficientsFT0m", "hEpSinCoefficientsFT0m; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); registry.add("epReso/hEpCosCoefficientsTPCpos", "hEpCosCoefficientsTPCpos; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); @@ -413,6 +427,7 @@ struct TaskPi0FlowEMC { registry.add("QVector/hQVecMeanRVsPhiFT0a", "hQVecMeanRVsPhiFT0a; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); registry.add("QVector/hQVecMeanRVsPhiFT0c", "hQVecMeanRVsPhiFT0c; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); registry.add("QVector/hQVecMeanRVsPhiFT0m", "hQVecMeanRVsPhiFT0m; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); + registry.add("QVector/hQVecMeanRVsPhiFV0a", "hQVecMeanRVsPhiFV0a; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); registry.add("QVector/hQVecMeanRVsPhiTPCpos", "hQVecMeanRVsPhiTPCpos; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); registry.add("QVector/hQVecMeanRVsPhiTPCneg", "hQVecMeanRVsPhiTPCneg; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); registry.add("QVector/hQVecMeanRVsPhiTPCTot", "hQVecMeanRVsPhiTPCTot; centrality; #it{#varphi} (rad), <#it{r}> (a.u.)", HistType::kTProfile2D, {thnAxisCent, thAxisAzimuth}); @@ -591,6 +606,15 @@ struct TaskPi0FlowEMC { yQVec = collision.q3ybtot(); } break; + case QvecEstimator::FV0A: + if (harmonic == kElliptic) { + xQVec = collision.q2xfv0a(); + yQVec = collision.q2yfv0a(); + } else if (harmonic == kTriangluar) { + xQVec = collision.q3xfv0a(); + yQVec = collision.q3yfv0a(); + } + break; default: LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; if (harmonic == kElliptic) { @@ -1181,6 +1205,8 @@ struct TaskPi0FlowEMC { float yQVecBNeg = -999.f; float xQVecBTot = -999.f; float yQVecBTot = -999.f; + float xQVecFV0a = -999.f; + float yQVecFV0a = -999.f; if (harmonic == kElliptic) { xQVecFT0a = collision.q2xft0a(); yQVecFT0a = collision.q2yft0a(); @@ -1194,6 +1220,8 @@ struct TaskPi0FlowEMC { yQVecBNeg = collision.q2ybneg(); xQVecBTot = collision.q2xbtot(); yQVecBTot = collision.q2ybtot(); + xQVecFV0a = collision.q2xfv0a(); + yQVecFV0a = collision.q2yfv0a(); } else if (harmonic == kTriangluar) { xQVecFT0a = collision.q3xft0a(); yQVecFT0a = collision.q3yft0a(); @@ -1207,6 +1235,8 @@ struct TaskPi0FlowEMC { yQVecBNeg = collision.q3ybneg(); xQVecBTot = collision.q3xbtot(); yQVecBTot = collision.q3ybtot(); + xQVecFV0a = collision.q3xfv0a(); + yQVecFV0a = collision.q3yfv0a(); } if (saveSPResoHist) { @@ -1221,6 +1251,10 @@ struct TaskPi0FlowEMC { registry.fill(HIST("spReso/hSpResoFT0mTPCneg"), centrality, xQVecFT0m * xQVecBNeg + yQVecFT0m * yQVecBNeg); registry.fill(HIST("spReso/hSpResoFT0mTPCtot"), centrality, xQVecFT0m * xQVecBTot + yQVecFT0m * yQVecBTot); registry.fill(HIST("spReso/hSpResoTPCposTPCneg"), centrality, xQVecBPos * xQVecBNeg + yQVecBPos * yQVecBNeg); + registry.fill(HIST("spReso/hSpResoFV0aFT0c"), centrality, xQVecFV0a * xQVecFT0c + yQVecFV0a * yQVecFT0c); + registry.fill(HIST("spReso/hSpResoFV0aTPCpos"), centrality, xQVecFV0a * xQVecBPos + yQVecFV0a * yQVecBPos); + registry.fill(HIST("spReso/hSpResoFV0aTPCneg"), centrality, xQVecFV0a * xQVecBNeg + yQVecFV0a * yQVecBNeg); + registry.fill(HIST("spReso/hSpResoFV0aTPCtot"), centrality, xQVecFV0a * xQVecBTot + yQVecFV0a * yQVecBTot); } if (saveEpResoHisto) { @@ -1230,10 +1264,14 @@ struct TaskPi0FlowEMC { float epBPoss = epHelper.GetEventPlane(xQVecBPos, yQVecBPos, harmonic); float epBNegs = epHelper.GetEventPlane(xQVecBNeg, yQVecBNeg, harmonic); float epBTots = epHelper.GetEventPlane(xQVecBTot, yQVecBTot, harmonic); + float epFV0a = epHelper.GetEventPlane(xQVecFV0a, yQVecFV0a, harmonic); registry.fill(HIST("hEventPlaneAngleFT0M"), centrality, epFT0m); + registry.fill(HIST("hEventPlaneAngleFT0A"), centrality, epFT0c); + registry.fill(HIST("hEventPlaneAngleFT0C"), centrality, epFT0a); registry.fill(HIST("hEventPlaneAngleTPCpos"), centrality, epBPoss); registry.fill(HIST("hEventPlaneAngleTPCneg"), centrality, epBNegs); + registry.fill(HIST("hEventPlaneAngleFV0A"), centrality, epFV0a); registry.fill(HIST("QVector/hQVecMeanRVsPhiFT0a"), centrality, std::atan2(yQVecFT0a, xQVecFT0a), std::hypot(xQVecFT0a, yQVecFT0a)); registry.fill(HIST("QVector/hQVecMeanRVsPhiFT0c"), centrality, std::atan2(yQVecFT0c, xQVecFT0c), std::hypot(xQVecFT0c, yQVecFT0c)); @@ -1241,6 +1279,7 @@ struct TaskPi0FlowEMC { registry.fill(HIST("QVector/hQVecMeanRVsPhiTPCpos"), centrality, std::atan2(yQVecBPos, xQVecBPos), std::hypot(xQVecBPos, yQVecBPos)); registry.fill(HIST("QVector/hQVecMeanRVsPhiTPCneg"), centrality, std::atan2(yQVecBNeg, xQVecBNeg), std::hypot(xQVecBNeg, yQVecBNeg)); registry.fill(HIST("QVector/hQVecMeanRVsPhiTPCTot"), centrality, std::atan2(yQVecBTot, xQVecBTot), std::hypot(xQVecBTot, yQVecBTot)); + registry.fill(HIST("QVector/hQVecMeanRVsPhiFV0a"), centrality, std::atan2(yQVecFV0a, xQVecFV0a), std::hypot(xQVecFV0a, yQVecFV0a)); registry.fill(HIST("epReso/hEpResoFT0cFT0a"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0c, epFT0a))); registry.fill(HIST("epReso/hEpResoFT0cTPCpos"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0c, epBPoss))); @@ -1253,6 +1292,10 @@ struct TaskPi0FlowEMC { registry.fill(HIST("epReso/hEpResoFT0mTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBNegs))); registry.fill(HIST("epReso/hEpResoFT0mTPCtot"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBTots))); registry.fill(HIST("epReso/hEpResoTPCposTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epBPoss, epBNegs))); + registry.fill(HIST("epReso/hEpResoFV0aFT0c"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFV0a, epFT0c))); + registry.fill(HIST("epReso/hEpResoFV0aTPCpos"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFV0a, epBPoss))); + registry.fill(HIST("epReso/hEpResoFV0aTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFV0a, epBNegs))); + registry.fill(HIST("epReso/hEpResoFV0aTPCtot"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFV0a, epBTots))); for (int n = 1; n <= kOctagonal; n++) { registry.fill(HIST("epReso/hEpCosCoefficientsFT0c"), centrality, n, std::cos(n * harmonic * epFT0c)); registry.fill(HIST("epReso/hEpSinCoefficientsFT0c"), centrality, n, std::sin(n * harmonic * epFT0c)); @@ -1266,6 +1309,8 @@ struct TaskPi0FlowEMC { registry.fill(HIST("epReso/hEpSinCoefficientsTPCneg"), centrality, n, std::sin(n * harmonic * epBNegs)); registry.fill(HIST("epReso/hEpCosCoefficientsTPCTots"), centrality, n, std::cos(n * harmonic * epBTots)); registry.fill(HIST("epReso/hEpSinCoefficientsTPCTots"), centrality, n, std::sin(n * harmonic * epBTots)); + registry.fill(HIST("epReso/hEpCosCoefficientsFV0a"), centrality, n, std::cos(n * harmonic * epFV0a)); + registry.fill(HIST("epReso/hEpSinCoefficientsFV0a"), centrality, n, std::sin(n * harmonic * epFV0a)); } } } diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index 71337021f38..d4826f80ccb 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -16,6 +16,8 @@ #ifndef PWGEM_PHOTONMESON_UTILS_CLUSTERHISTOGRAMS_H_ #define PWGEM_PHOTONMESON_UTILS_CLUSTERHISTOGRAMS_H_ +#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" + #include #include #include @@ -25,8 +27,6 @@ #include #include -#include - namespace o2::aod::pwgem::photonmeson::utils::clusterhistogram { inline void addClusterHistograms(o2::framework::HistogramRegistry* fRegistry, bool do2DQA) @@ -52,15 +52,17 @@ inline void addClusterHistograms(o2::framework::HistogramRegistry* fRegistry, bo fRegistry->add("Cluster/before/hTrackEOverP", "Energy of cluster divided by momentum of matched tracks;#it{E}_{cluster}/#it{p}_{track} (#it{c})", o2::framework::kTH1F, {{200, 0., 5.}}, true); } - auto hClusterQualityCuts = fRegistry->add("Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::kTH2F, {{8, -0.5, 7.5}, {500, 0, 50}}, true); + auto hClusterQualityCuts = fRegistry->add("Cluster/hClusterQualityCuts", "Energy at which clusters are removed by a given cut;;#it{E} (GeV)", o2::framework::kTH2F, {{static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 2, -0.5, static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts) + 1.5}, {500, 0, 50}}, true); hClusterQualityCuts->GetXaxis()->SetBinLabel(1, "In"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(2, "Energy"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(3, "NCell"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(4, "M02"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(5, "Timing"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(6, "Track matching"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(7, "Exotic"); - hClusterQualityCuts->GetXaxis()->SetBinLabel(8, "Out"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(2, "Definition"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(3, "Energy"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(4, "NCell"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(5, "M02"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(6, "Timing"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(7, "TM"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(8, "Sec. TM"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(9, "Exotic"); + hClusterQualityCuts->GetXaxis()->SetBinLabel(10, "Out"); fRegistry->addClone("Cluster/before/", "Cluster/after/"); } diff --git a/PWGEM/PhotonMeson/Utils/HNMUtilities.h b/PWGEM/PhotonMeson/Utils/HNMUtilities.h index e4d71bab8f1..9a3c7494c07 100644 --- a/PWGEM/PhotonMeson/Utils/HNMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/HNMUtilities.h @@ -76,7 +76,7 @@ struct GammaGammaPair { bool isPi0 = false; bool isEta = false; - ushort reconstructionType; + ushort reconstructionType = photonpair::kNpair; void setReconstructionType(ushort type) { reconstructionType = type; } float m() const { return vGG.M(); } diff --git a/PWGEM/PhotonMeson/Utils/PairUtilities.h b/PWGEM/PhotonMeson/Utils/PairUtilities.h index 86ac4f0eb16..02b6b548dca 100644 --- a/PWGEM/PhotonMeson/Utils/PairUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PairUtilities.h @@ -15,7 +15,10 @@ #ifndef PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ #define PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ -#include +#include "Common/Core/RecoDecay.h" + +#include + #include namespace o2::aod::pwgem::photonmeson::utils::pairutil @@ -58,10 +61,10 @@ template bool DoesV0LegMatchWithCluster(TV0Leg const& v0leg, TCluster const& cluster, const float max_deta, const float max_dphi, const float max_Ep_width) { float deta = v0leg.eta() - cluster.eta(); - float dphi = TVector2::Phi_mpi_pi(TVector2::Phi_0_2pi(v0leg.phi()) - TVector2::Phi_0_2pi(cluster.phi())); + float dphi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(v0leg.phi()) - RecoDecay::constrainAngle(cluster.phi()), -o2::constants::math::PI); // float dR = sqrt(deta * deta + dphi * dphi); float Ep = cluster.e() / v0leg.p(); - return (pow(deta / max_deta, 2) + pow(dphi / max_dphi, 2) < 1) && (abs(Ep - 1) < max_Ep_width); + return (std::pow(deta / max_deta, 2.f) + std::pow(dphi / max_dphi, 2.f) < 1.f) && (std::abs(Ep - 1.f) < max_Ep_width); } } // namespace o2::aod::pwgem::photonmeson::photonpair