From 9306de3d9f2f07e7fc2ddd15db64526b54ed41ff Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Mon, 26 Feb 2024 01:35:40 +0530 Subject: [PATCH 01/19] removing use of material LUT --- PWGHF/TableProducer/candidateCreatorDstar.cxx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index b7c88135221..98525f0f811 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -64,7 +64,8 @@ struct HfCandidateCreatorDstar { Service ccdb; // From utilsBfieldCCDB.h o2::base::MatLayerCylSet* lut; // From MatLayercylSet.h - o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + // o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; + o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; // D0-prong vertex fitter o2::vertexing::DCAFitterN<2> df; int runNumber; @@ -108,8 +109,8 @@ struct HfCandidateCreatorDstar { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); // set the flag to check object validity before CCDB query // LOG(info) << "Retriving ccdb object"; - auto rectification = ccdb->get(ccdbPathLut); // retrieve an object of type T from CCDB as stored under path; will use the timestamp member - lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(rectification); + // auto rectification = ccdb->get(ccdbPathLut); // retrieve an object of type T from CCDB as stored under path; will use the timestamp member + // lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(rectification); // LOG(info) << "Successfully Retrived"; runNumber = 0; bz = 0; @@ -121,6 +122,7 @@ struct HfCandidateCreatorDstar { df.setMinRelChi2Change(minRelChi2Change); df.setUseAbsDCA(useAbsDCA); df.setWeightedFinalPCA(useWeightedFinalPCA); + df.setMatCorrType(noMatCorr); massPi = MassPiPlus; massK = MassKPlus; @@ -173,9 +175,18 @@ struct HfCandidateCreatorDstar { auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { // LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; - initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); // Sets up the grp object for magnetic field (w/o matCorr for propagation) + o2::parameters::GRPMagField* grpo = ccdb->getForTimeStamp(ccdbPathGrpMag, bc.timestamp()); + if (grpo == nullptr) { + LOGF(fatal, "Run 3 GRP object (type o2::parameters::GRPMagField) is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); + } + o2::base::Propagator::initFieldFromGRP(grpo); bz = o2::base::Propagator::Instance()->getNominalBz(); // LOG(info) << ">>>>>>>>>>>> Magnetic field: " << bz; + runNumber = bc.runNumber(); + + // initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); // Sets up the grp object for magnetic field (w/o matCorr for propagation) + // bz = o2::base::Propagator::Instance()->getNominalBz(); + // // LOG(info) << ">>>>>>>>>>>> Magnetic field: " << bz; } df.setBz(bz); From 1d3468c3c593d796022c5b86ac6686f9a9bd0a0e Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Mon, 26 Feb 2024 04:54:21 +0530 Subject: [PATCH 02/19] Adding data model for Dstar-hadron pair correlation --- PWGHF/HFC/DataModel/CorrelationTables.h | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index b92e6beb80f..82da6af6922 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -200,6 +200,47 @@ DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", //! D+-Hadrons p aod::hf_correlation_dplus_hadron::MD, aod::hf_correlation_dplus_hadron::SignalStatus); + +// definition of columns and tables for Dplus properties +namespace hf_dstar_meson +{ + DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); + DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); + DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); + DECLARE_SOA_COLUMN(MDstar, mDstar, float); + DECLARE_SOA_COLUMN(PoolBin, poolBin, int); + DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); + DECLARE_SOA_INDEX_COLUMN(Collision, collision); +}// hf_dstar_meson + +DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties + aod::hf_dstar_meson::PhiDstar, + aod::hf_dstar_meson::EtaDstar, + aod::hf_dstar_meson::PtDstar, + aod::hf_dstar_meson::MDstar, + aod::hf_dstar_meson::PoolBin, + aod::hf_dstar_meson::TimeStamp, + aod::hf_dstar_meson::CollisionId); + +// definition of columns and tables for Dstar-Hadron correlation pair +namespace hf_correlation_dstar_hadron +{ + DECLARE_SOA_COLUMN(DeltaPhiDstar, deltaPhiDstar, float); + DECLARE_SOA_COLUMN(DeltaEta, deltaEtaDstar, float); + DECLARE_SOA_COLUMN(SignalStatus, signalStatus, bool); +}// hf_correlation_dstar_hadron + +DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTARHPAIR", // D* Hadrons pairs Informations + aod::hf_correlation_dstar_hadron::DeltaPhiDstar, + aod::hf_correlation_dstar_hadron::DeltaEta, + aod::hf_dstar_meson::PtDstar, + aod::hf_assoc_tracks::PtH, + aod::hf_dstar_meson::PoolBin); + +DECLARE_SOA_TABLE(DstarHadronRecoInfo,"AOD","DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations + aod::hf_dstar_meson::MDstar, + aod::hf_correlation_dstar_hadron::SignalStatus); + // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision { From 953c778ef03d5f6610cd2b31cfa75933d0612ee2 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Mon, 26 Feb 2024 21:36:20 +0530 Subject: [PATCH 03/19] added incomplete version of dstar correlator table --- PWGHF/HFC/DataModel/CorrelationTables.h | 16 +++- .../TableProducer/correlatorDstarHadrons.cxx | 91 +++++++++++++++++++ 2 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 82da6af6922..e9265c44ff7 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -210,10 +210,11 @@ namespace hf_dstar_meson DECLARE_SOA_COLUMN(MDstar, mDstar, float); DECLARE_SOA_COLUMN(PoolBin, poolBin, int); DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); + DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); DECLARE_SOA_INDEX_COLUMN(Collision, collision); }// hf_dstar_meson -DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties +DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties (This table is not compatible with HfCandDstar & HfSelDstarToD0Pi) aod::hf_dstar_meson::PhiDstar, aod::hf_dstar_meson::EtaDstar, aod::hf_dstar_meson::PtDstar, @@ -227,7 +228,7 @@ namespace hf_correlation_dstar_hadron { DECLARE_SOA_COLUMN(DeltaPhiDstar, deltaPhiDstar, float); DECLARE_SOA_COLUMN(DeltaEta, deltaEtaDstar, float); - DECLARE_SOA_COLUMN(SignalStatus, signalStatus, bool); + DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); }// hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTARHPAIR", // D* Hadrons pairs Informations @@ -235,11 +236,18 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTARHPAIR", // D* Hadrons pairs Infor aod::hf_correlation_dstar_hadron::DeltaEta, aod::hf_dstar_meson::PtDstar, aod::hf_assoc_tracks::PtH, + aod::hf_dstar_meson::MDstar, aod::hf_dstar_meson::PoolBin); +// Why should we use these two tables below when +// we already have "HfCandDstarMcRec" & "HfCandDstarMcGen" in "CanidateReconstructionTables.h" DECLARE_SOA_TABLE(DstarHadronRecoInfo,"AOD","DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations - aod::hf_dstar_meson::MDstar, - aod::hf_correlation_dstar_hadron::SignalStatus); + aod::hf_dstar_meson::IsPrompt, + aod::hf_correlation_dstar_hadron::MatchingStatus); + +DECLARE_SOA_TABLE(DstarHadronGenInfo, "AOD","DSTARHGENINFO", // D* Hadrons pairs Generator level Informations + aod::hf_dstar_meson::IsPrompt, + aod::hf_correlation_dstar_hadron::MatchingStatus); // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx new file mode 100644 index 00000000000..7effdfc21c1 --- /dev/null +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -0,0 +1,91 @@ +// 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 correlatorDstarHadron.cxx +/// \author Deependra Sharma + +// O2 +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +// PWGHF +#include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// flaging a collision if D* meson is found. +struct HfCorrelatorDstarHadronCollisionSelector{ + Produces collisionWDstar; + + Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + + using DstarCandidates = soa::Join; + + SliceCache cache; + + // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" + Partition selectedDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + + + + void processCollisionSelWDstar(aod::Collision const& collision, + DstarCandidates const& candidates){ + bool isDstarFound = false; + if(selectedDstarCandidates.size() > 0){ + auto selectedDstarCandidatesGrouped = selectedDstarCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + for(const auto & selectedCandidate: selectedDstarCandidatesGrouped){ + auto yDstar = selectedCandidate.y(); + auto pTDstar = selectedCandidate.pt(); + if(yCandMax >= 0 && yDstar > yCandMax){ + continue; + } + if(ptCandMin >= 0 && pTDstar < ptCandMin){ + continue; + } + isDstarFound = true; + break; + } + } + collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) + } + PROCESS_SWITCH(HfCorrelatorDstarHadronCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", false); +}; + +struct HfCorrelatorDstarHadrons{ + Produces rowsDstarHadronPair; + + using CollisionsWMult = soa::Join; + using DstarCandidates = soa::Join; + + Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; + + + void processData(aod::BCsWithTimestamps::iterator const & bc, + soa::Filtered const & collisions, // only collisions who have altleast one D* + aod::TracksWDca const & tracks, + DstarCandidates const & candidates){ + auto timestamp = bc.timestamp(); + for(const auto & collision: collisions){ + + } + + + } + +}; + From 83339f7915368b0a272a3e36f19e431a64df4725 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Wed, 28 Feb 2024 19:57:56 +0530 Subject: [PATCH 04/19] added table producer --- .../DataModel/CandidateReconstructionTables.h | 1 + PWGHF/HFC/DataModel/CorrelationTables.h | 113 ++++++++++++------ .../TableProducer/correlatorDstarHadrons.cxx | 112 +++++++++++++++-- PWGHF/TableProducer/candidateCreatorDstar.cxx | 3 +- 4 files changed, 181 insertions(+), 48 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 86ac79a6aea..ad61fd86813 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1668,6 +1668,7 @@ DECLARE_SOA_TABLE(HfCandDstarBase, "AOD", "HFCANDDSTRBASE", // Two pronges of D0 hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, + hf_track_index::Prong0Id, hf_track_index::Prong1Id, // Dynamic hf_cand_dstar::PtSoftPi, hf_cand_dstar::PVecSoftPi, diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index e9265c44ff7..a0ad78fe7a8 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -16,7 +16,13 @@ #ifndef PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ #define PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ +// O2 #include "Framework/AnalysisDataModel.h" +//O2Physics +#include "Common/Core/RecoDecay.h" +// PWGCF +#include "PWGHF/DataModel/CandidateReconstructionTables.h" + namespace o2::aod { @@ -202,52 +208,87 @@ DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", //! D+-Hadrons p // definition of columns and tables for Dplus properties -namespace hf_dstar_meson +// namespace hf_dstar_meson +// { +// // DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); +// // DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); +// // DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); +// // DECLARE_SOA_COLUMN(MDstar, mDstar, float); +// // DECLARE_SOA_COLUMN(PoolBin, poolBin, int); +// // DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); +// // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); +// // DECLARE_SOA_INDEX_COLUMN(Collision, collision); +// // DECLARE_SOA_INDEX_COLUMN(Dstar,dstar); +// // DECLARE_SOA_INDEX_COLUMN(Track,track); +// }// hf_dstar_meson + +// DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties (This table is not compatible with HfCandDstar & HfSelDstarToD0Pi) +// aod::hf_dstar_meson::PhiDstar, +// aod::hf_dstar_meson::EtaDstar, +// aod::hf_dstar_meson::PtDstar, +// aod::hf_dstar_meson::MDstar, +// aod::hf_dstar_meson::PoolBin, +// aod::hf_dstar_meson::TimeStamp, +// aod::hf_dstar_meson::CollisionId); + +// definition of columns and tables for Dstar-Hadron correlation pair +using Dstars = HfCandDstar; +using Dstar = Dstars::iterator; +namespace hf_correlation_dstar_hadron { + DECLARE_SOA_INDEX_COLUMN(Collision, collision); + // Dstar candidate properties + DECLARE_SOA_INDEX_COLUMN(Dstar,dstar); DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); DECLARE_SOA_COLUMN(MDstar, mDstar, float); - DECLARE_SOA_COLUMN(PoolBin, poolBin, int); + // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables + // DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables + // Track properties + DECLARE_SOA_INDEX_COLUMN(Track,track); + DECLARE_SOA_COLUMN(PhiTrack,phiTrack, float); + DECLARE_SOA_COLUMN(EtaTrack,etaTrack, float); + DECLARE_SOA_COLUMN(PtTrack,ptTrack, float); + // common DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); - DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); - DECLARE_SOA_INDEX_COLUMN(Collision, collision); -}// hf_dstar_meson - -DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties (This table is not compatible with HfCandDstar & HfSelDstarToD0Pi) - aod::hf_dstar_meson::PhiDstar, - aod::hf_dstar_meson::EtaDstar, - aod::hf_dstar_meson::PtDstar, - aod::hf_dstar_meson::MDstar, - aod::hf_dstar_meson::PoolBin, - aod::hf_dstar_meson::TimeStamp, - aod::hf_dstar_meson::CollisionId); - -// definition of columns and tables for Dstar-Hadron correlation pair -namespace hf_correlation_dstar_hadron -{ - DECLARE_SOA_COLUMN(DeltaPhiDstar, deltaPhiDstar, float); - DECLARE_SOA_COLUMN(DeltaEta, deltaEtaDstar, float); - DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); + DECLARE_SOA_COLUMN(PoolBin, poolBin, int); + // Dynamic columns + DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate)->float{ return(etaTrack - etaCandidate); }); + DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack)->float{ return RecoDecay::constrainAngle(phiTrack,phiCandidate); }); }// hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTARHPAIR", // D* Hadrons pairs Informations - aod::hf_correlation_dstar_hadron::DeltaPhiDstar, - aod::hf_correlation_dstar_hadron::DeltaEta, - aod::hf_dstar_meson::PtDstar, - aod::hf_assoc_tracks::PtH, - aod::hf_dstar_meson::MDstar, - aod::hf_dstar_meson::PoolBin); - -// Why should we use these two tables below when -// we already have "HfCandDstarMcRec" & "HfCandDstarMcGen" in "CanidateReconstructionTables.h" + // D* only properties + hf_correlation_dstar_hadron::DstarId, + hf_correlation_dstar_hadron::PhiDstar, + hf_correlation_dstar_hadron::EtaDstar, + hf_correlation_dstar_hadron::PtDstar, + hf_correlation_dstar_hadron::MDstar, + + // Track only properties + hf_correlation_dstar_hadron::TrackId, + hf_correlation_dstar_hadron::PhiTrack, + hf_correlation_dstar_hadron::EtaTrack, + hf_correlation_dstar_hadron::PtTrack, + hf_correlation_dstar_hadron::PoolBin, + // common + hf_correlation_dstar_hadron::TimeStamp, + hf_correlation_dstar_hadron::PoolBin, + // common Dynamic + hf_correlation_dstar_hadron::DeltaPhi, + hf_correlation_dstar_hadron::DeltaEta, + ); + +// Tble for mc matched info +using RecoMatchingInfoDstars = HfCandDstarMcRec; +using RecoMatchingInfoDstar = RecoMatchingInfoDstars::iterator; + +namespace hf_correlation_dstar_hadron{ + DECLARE_SOA_INDEX_COLUMN(RecoMatchingInfoDstar,recoMatchingInfoDstar); +} DECLARE_SOA_TABLE(DstarHadronRecoInfo,"AOD","DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations - aod::hf_dstar_meson::IsPrompt, - aod::hf_correlation_dstar_hadron::MatchingStatus); - -DECLARE_SOA_TABLE(DstarHadronGenInfo, "AOD","DSTARHGENINFO", // D* Hadrons pairs Generator level Informations - aod::hf_dstar_meson::IsPrompt, - aod::hf_correlation_dstar_hadron::MatchingStatus); + hf_correlation_dstar_hadron::RecoMatchingInfoDstarId); // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 7effdfc21c1..11854426ede 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -10,12 +10,17 @@ // or submit itself to any jurisdiction. /// \file correlatorDstarHadron.cxx -/// \author Deependra Sharma +/// \author Deependra Sharma (IITB) // O2 +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" +// O2Physics +#include "Common/DataModel/Multiplicity.h" + // PWGHF #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -27,7 +32,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; // flaging a collision if D* meson is found. -struct HfCorrelatorDstarHadronCollisionSelector{ +struct HfCollisionSelector{ Produces collisionWDstar; Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; @@ -41,8 +46,6 @@ struct HfCorrelatorDstarHadronCollisionSelector{ // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" Partition selectedDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; - - void processCollisionSelWDstar(aod::Collision const& collision, DstarCandidates const& candidates){ bool isDstarFound = false; @@ -63,17 +66,49 @@ struct HfCorrelatorDstarHadronCollisionSelector{ } collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) } - PROCESS_SWITCH(HfCorrelatorDstarHadronCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", false); + PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", false); }; struct HfCorrelatorDstarHadrons{ Produces rowsDstarHadronPair; - using CollisionsWMult = soa::Join; - using DstarCandidates = soa::Join; + Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; - Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; + // Dstar candidate related configurable + Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; + Configurable pTMinDstar{"pTMinDstar",1.5,"min pT of dstar candidate"}; + Configurable pTMaxDstar{"pTMaxDstar",50,"max pT of dstar Candidate"}; + // Configurable etaAbsMaxDstar{"etaAbsMaxDstar",1.0,"max Abs(eta) cut on Dstar candidate"}; + Configurable yMaxDstar{"yMaxDstar", 0.8, "max. cand. rapidity"}; + // track related configurable + Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack",1.0,"max Abs(eta) cut on Associated Track"}; + Configurable dcaxyMinAssoTrack{"dcaxyMinAssoTrack",0.0,"min DCAxy of Associated Track"}; + Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack",0.003,"max DCAxy of Associated Track"}; + Configurable dcazMinAssoTrack{"dcazMinAssoTrack",0.0, "min DCAz of Associated Track"}; + Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack",0.003,"max DCAz of Associated Track"}; + Configurable pTMinAssoTrack{"pTMinAssoTrack",0.5,"min Pt of Associated Track"}; + Configurable pTMaxAssoTrack{"pTMaxAssoTrack",50.0,"max pT of Associated Track"}; + + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; + SliceCache cache; + ColumnBinningPolicy> binningScheme; + // ColumnBinningPolicy> binningScheme; + + using CollisionsWMult = soa::Join; + using DstarCandidates = soa::Join; // if we add two extra columns of prong0Id and prong1d then we need not to join HfD0FromDstar here. + + Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + + Partition selectedCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + Partition selectedTracks = nabs(aod::track::eta) < etaAbsMaxAssoTrack && aod::track::pt > pTMinAssoTrack && aod::track::pt < pTMaxAssoTrack && + aod::track::dcaXY > dcaxyMinAssoTrack && aod::track::dcaXY < dcaxyMaxAssoTrack && + aod::track::dcaZ > dcazMinAssoTrack && aod::track::dcaZ < dcazMaxAssoTrack; + + void init (InitContext&){ + binningScheme = {{binsZVtx, binsMultiplicity},true}; + } void processData(aod::BCsWithTimestamps::iterator const & bc, soa::Filtered const & collisions, // only collisions who have altleast one D* @@ -81,11 +116,66 @@ struct HfCorrelatorDstarHadrons{ DstarCandidates const & candidates){ auto timestamp = bc.timestamp(); for(const auto & collision: collisions){ + auto selectedCandidatesGrouped = selectedCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + auto selectedTracksGrouped = selectedTracks->sliceByCached(aod::track::collisionId,collision.globalIndex(),cache); - } - + if((selectedCandidatesGrouped.size() == 0) || (selectedTracksGrouped.size() == 0)){ + continue; + } - } + // pair creation + for(auto &[triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(selectedCandidatesGrouped,selectedTracksGrouped))){ + auto gItriggerParticle = triggerParticle.globalIndex(); + auto gIassocParticle = assocParticle.globalIndex(); + + //Track rejection based on daughter index + if((triggerParticle.prong0Id() == gIassocParticle) || (triggerParticle.prong1Id() == gIassocParticle) || (triggerParticle.prongPiId() == gIassocParticle)){ + continue; // rejected pair if associated particle is same as any of daughter particle + } + // Track rejection based on eta, pt cut. if partition works on expression column: remove this from here + if(assocParticle.eta() > etaAbsMaxAssoTrack || assocParticle.pt() < pTMinAssoTrack || assocParticle.pt() > pTMaxAssoTrack){ + continue; // reject pair of associated particle is not within kinematic range + } + // Trigger Particle Rejection + if(triggerParticle.pt() > pTMinDstar || triggerParticle.pt() < pTMaxDstar){ + continue; + } + auto yDstar = triggerParticle.y(constants::physics::MassDStar); + if(std::abs(yDstar) > yMaxDstar){ + continue; + } + auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + if(triggerParticle.signSoftPi() > 0){ + rowsDstarHadronPair(gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + binNumber); + }else { + rowsDstarHadronPair(gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassAntiDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + binNumber); + } + } // D-H pair loop + } // collision loop + } //processData + PROCESS_SWITCH(HfCorrelatorDstarHadrons,processData,"process data only", false); }; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc){ + return WorkflowSpec{adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; +} \ No newline at end of file diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 98525f0f811..06f92738f4a 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -282,7 +282,8 @@ struct HfCandidateCreatorDstar { signSoftPi, impactParameterPi.getY(), std::sqrt(impactParameterPi.getSigmaY2()), pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2], - pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]); + pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2], + prongD0.prong0Id(), prongD0.prong1Id()); // Fill candidate Table for D0 rowCandD0Base(collision.globalIndex(), primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), From b939a0d7e27f5ce07d5ee414d4d674a6e3335d61 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Wed, 28 Feb 2024 20:43:25 +0530 Subject: [PATCH 05/19] build success full --- PWGHF/HFC/DataModel/CorrelationTables.h | 7 +++--- PWGHF/HFC/TableProducer/CMakeLists.txt | 6 +++++ .../TableProducer/correlatorDstarHadrons.cxx | 22 ++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index a0ad78fe7a8..16cf6d52eb0 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -258,26 +258,25 @@ namespace hf_correlation_dstar_hadron DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack)->float{ return RecoDecay::constrainAngle(phiTrack,phiCandidate); }); }// hf_correlation_dstar_hadron -DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTARHPAIR", // D* Hadrons pairs Informations +DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTRHPAIR", // D* Hadrons pairs Informations + hf_correlation_dstar_hadron::CollisionId, // D* only properties hf_correlation_dstar_hadron::DstarId, hf_correlation_dstar_hadron::PhiDstar, hf_correlation_dstar_hadron::EtaDstar, hf_correlation_dstar_hadron::PtDstar, hf_correlation_dstar_hadron::MDstar, - // Track only properties hf_correlation_dstar_hadron::TrackId, hf_correlation_dstar_hadron::PhiTrack, hf_correlation_dstar_hadron::EtaTrack, hf_correlation_dstar_hadron::PtTrack, - hf_correlation_dstar_hadron::PoolBin, // common hf_correlation_dstar_hadron::TimeStamp, hf_correlation_dstar_hadron::PoolBin, // common Dynamic hf_correlation_dstar_hadron::DeltaPhi, - hf_correlation_dstar_hadron::DeltaEta, + hf_correlation_dstar_hadron::DeltaEta ); // Tble for mc matched info diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index 55c39530cd6..1df5ad365c8 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -49,6 +49,12 @@ o2physics_add_dpl_workflow(correlator-ds-hadrons PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(correlator-dstar-hadron + SOURCES correlatorDstarHadrons.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + + o2physics_add_dpl_workflow(correlator-lc-hadrons SOURCES correlatorLcHadrons.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 11854426ede..c2d6af8e0dd 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -52,7 +52,7 @@ struct HfCollisionSelector{ if(selectedDstarCandidates.size() > 0){ auto selectedDstarCandidatesGrouped = selectedDstarCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); for(const auto & selectedCandidate: selectedDstarCandidatesGrouped){ - auto yDstar = selectedCandidate.y(); + auto yDstar = selectedCandidate.y(constants::physics::MassDStar); auto pTDstar = selectedCandidate.pt(); if(yCandMax >= 0 && yDstar > yCandMax){ continue; @@ -66,7 +66,7 @@ struct HfCollisionSelector{ } collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) } - PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", false); + PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); }; struct HfCorrelatorDstarHadrons{ @@ -93,7 +93,7 @@ struct HfCorrelatorDstarHadrons{ ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; SliceCache cache; - ColumnBinningPolicy> binningScheme; + ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; // ColumnBinningPolicy> binningScheme; using CollisionsWMult = soa::Join; @@ -146,7 +146,8 @@ struct HfCorrelatorDstarHadrons{ } auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); if(triggerParticle.signSoftPi() > 0){ - rowsDstarHadronPair(gItriggerParticle, + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, triggerParticle.phi(), triggerParticle.eta(), triggerParticle.pt(), @@ -155,9 +156,12 @@ struct HfCorrelatorDstarHadrons{ assocParticle.phi(), assocParticle.eta(), assocParticle.pt(), - binNumber); + timestamp, + binNumber + ); }else { - rowsDstarHadronPair(gItriggerParticle, + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, triggerParticle.phi(), triggerParticle.eta(), triggerParticle.pt(), @@ -166,13 +170,15 @@ struct HfCorrelatorDstarHadrons{ assocParticle.phi(), assocParticle.eta(), assocParticle.pt(), - binNumber); + timestamp, + binNumber + ); } } // D-H pair loop } // collision loop } //processData - PROCESS_SWITCH(HfCorrelatorDstarHadrons,processData,"process data only", false); + PROCESS_SWITCH(HfCorrelatorDstarHadrons,processData,"process data only", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc){ From 8cad14891b15562f07c89e96e8b8b1d331fd19b9 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Thu, 29 Feb 2024 04:06:09 +0530 Subject: [PATCH 06/19] build Exception found HfCandDstar/fIndexCollisions not found --- .../TableProducer/correlatorDstarHadrons.cxx | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index c2d6af8e0dd..690be194e31 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -93,6 +93,7 @@ struct HfCorrelatorDstarHadrons{ ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; SliceCache cache; + ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; // ColumnBinningPolicy> binningScheme; @@ -101,28 +102,41 @@ struct HfCorrelatorDstarHadrons{ Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + // cabdidate partition Partition selectedCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + + // track partition Partition selectedTracks = nabs(aod::track::eta) < etaAbsMaxAssoTrack && aod::track::pt > pTMinAssoTrack && aod::track::pt < pTMaxAssoTrack && aod::track::dcaXY > dcaxyMinAssoTrack && aod::track::dcaXY < dcaxyMaxAssoTrack && aod::track::dcaZ > dcazMinAssoTrack && aod::track::dcaZ < dcazMaxAssoTrack; - + void init (InitContext&){ binningScheme = {{binsZVtx, binsMultiplicity},true}; } - void processData(aod::BCsWithTimestamps::iterator const & bc, - soa::Filtered const & collisions, // only collisions who have altleast one D* + void processData(soa::Filtered const & collisions, // only collisions who have altleast one D* aod::TracksWDca const & tracks, - DstarCandidates const & candidates){ - auto timestamp = bc.timestamp(); + DstarCandidates const & candidates, + aod::BCsWithTimestamps const & ){ + + LOG(info)<<"process data function called. Collision Table size = "<(); + auto timestamp = bc.timestamp(); + LOG(info)<<"timestamp = "<sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - auto selectedTracksGrouped = selectedTracks->sliceByCached(aod::track::collisionId,collision.globalIndex(),cache); + LOG(info)<< "selected candidates grouped according to current collision"; + auto selectedTracksGrouped = selectedTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); if((selectedCandidatesGrouped.size() == 0) || (selectedTracksGrouped.size() == 0)){ continue; } - + LOG(info)<<"pair creation starts"; // pair creation for(auto &[triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(selectedCandidatesGrouped,selectedTracksGrouped))){ auto gItriggerParticle = triggerParticle.globalIndex(); From e45a24e1cc4cae9320dabdc8023719a12e961e2b Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Fri, 1 Mar 2024 18:23:44 +0530 Subject: [PATCH 07/19] QA to be added. Execution error of Collision index solved --- .../TableProducer/correlatorDstarHadrons.cxx | 117 ++++++++++-------- 1 file changed, 62 insertions(+), 55 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 690be194e31..8cd08a20032 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -10,7 +10,8 @@ // or submit itself to any jurisdiction. /// \file correlatorDstarHadron.cxx -/// \author Deependra Sharma (IITB) +/// \author Deependra Sharma , IITB +/// \author Fabrizio Grosa , CERN // O2 #include "CommonConstants/PhysicsConstants.h" @@ -31,48 +32,45 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// flaging a collision if D* meson is found. -struct HfCollisionSelector{ - Produces collisionWDstar; - - Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; - Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; - Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - - using DstarCandidates = soa::Join; - - SliceCache cache; - - // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" - Partition selectedDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; - - void processCollisionSelWDstar(aod::Collision const& collision, - DstarCandidates const& candidates){ - bool isDstarFound = false; - if(selectedDstarCandidates.size() > 0){ - auto selectedDstarCandidatesGrouped = selectedDstarCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - for(const auto & selectedCandidate: selectedDstarCandidatesGrouped){ - auto yDstar = selectedCandidate.y(constants::physics::MassDStar); - auto pTDstar = selectedCandidate.pt(); - if(yCandMax >= 0 && yDstar > yCandMax){ - continue; - } - if(ptCandMin >= 0 && pTDstar < ptCandMin){ - continue; - } - isDstarFound = true; - break; - } - } - collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) - } - PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); -}; +// // flaging a collision if D* meson is found. +// struct HfCollisionSelector{ +// Produces collisionWDstar; +// Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; +// Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; +// Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; +// using DstarCandidates = soa::Join; +// SliceCache cache; +// // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" +// Partition selectedDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; +// void processCollisionSelWDstar(aod::Collision const& collision, +// DstarCandidates const& candidates){ +// bool isDstarFound = false; +// if(selectedDstarCandidates.size() > 0){ +// auto selectedDstarCandidatesGrouped = selectedDstarCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); +// for(const auto & selectedCandidate: selectedDstarCandidatesGrouped){ +// auto yDstar = selectedCandidate.y(constants::physics::MassDStar); +// auto pTDstar = selectedCandidate.pt(); +// if(yCandMax >= 0 && yDstar > yCandMax){ +// continue; +// } +// if(ptCandMin >= 0 && pTDstar < ptCandMin){ +// continue; +// } +// isDstarFound = true; +// break; +// } +// } +// LOG(info)<<"processCollisionSelWDstar: isDstarFound = "<< isDstarFound; +// collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) +// } +// PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); +// }; struct HfCorrelatorDstarHadrons{ Produces rowsDstarHadronPair; + Produces collisionWDstar; - Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; + // Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; // Dstar candidate related configurable Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; @@ -92,16 +90,18 @@ struct HfCorrelatorDstarHadrons{ ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - SliceCache cache; - ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; // ColumnBinningPolicy> binningScheme; - using CollisionsWMult = soa::Join; + using CollisionsWMult = soa::Join; using DstarCandidates = soa::Join; // if we add two extra columns of prong0Id and prong1d then we need not to join HfD0FromDstar here. - Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; - + // Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + + SliceCache cache; + Preslice perColCandidates = aod::hf_cand::collisionId; + Preslice perColTracks = aod::track::collisionId; + // cabdidate partition Partition selectedCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; @@ -114,29 +114,27 @@ struct HfCorrelatorDstarHadrons{ binningScheme = {{binsZVtx, binsMultiplicity},true}; } - void processData(soa::Filtered const & collisions, // only collisions who have altleast one D* + void processData(/*soa::Filtered*/ CollisionsWMult const & collisions, // only collisions who have altleast one D* aod::TracksWDca const & tracks, DstarCandidates const & candidates, aod::BCsWithTimestamps const & ){ - LOG(info)<<"process data function called. Collision Table size = "<sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); if((selectedCandidatesGrouped.size() == 0) || (selectedTracksGrouped.size() == 0)){ continue; } - LOG(info)<<"pair creation starts"; + // LOG(info)<<"pair creation starts"; // pair creation for(auto &[triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(selectedCandidatesGrouped,selectedTracksGrouped))){ auto gItriggerParticle = triggerParticle.globalIndex(); @@ -151,13 +149,19 @@ struct HfCorrelatorDstarHadrons{ continue; // reject pair of associated particle is not within kinematic range } // Trigger Particle Rejection - if(triggerParticle.pt() > pTMinDstar || triggerParticle.pt() < pTMaxDstar){ + if(triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar){ continue; } auto yDstar = triggerParticle.y(constants::physics::MassDStar); if(std::abs(yDstar) > yMaxDstar){ continue; } + + // if(!isDstarFound){ + // isDstarFound =true; + // } + isDstarFound =true; + auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); if(triggerParticle.signSoftPi() > 0){ rowsDstarHadronPair(collision.globalIndex(), @@ -188,7 +192,10 @@ struct HfCorrelatorDstarHadrons{ binNumber ); } - } // D-H pair loop + LOG(info)<<"pair table filled"; + } // D-H pair loop + collisionWDstar(isDstarFound); // filled collision by collision + LOG(info)<<"collision table of Dstar only filled"; } // collision loop } //processData @@ -196,6 +203,6 @@ struct HfCorrelatorDstarHadrons{ }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc){ - return WorkflowSpec{adaptAnalysisTask(cfgc), + return WorkflowSpec{/*adaptAnalysisTask(cfgc),*/ adaptAnalysisTask(cfgc)}; } \ No newline at end of file From d0f58af4fcbf588a3dccd72fcda78d3e01970429 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Wed, 6 Mar 2024 20:33:43 +0530 Subject: [PATCH 08/19] trying to add mixed function. for paring it require filtered track table. I Have to change partiton to filter --- .../TableProducer/correlatorDstarHadrons.cxx | 77 ++++++++++++++----- 1 file changed, 59 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 8cd08a20032..17f0f24b323 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -70,7 +70,7 @@ struct HfCorrelatorDstarHadrons{ Produces rowsDstarHadronPair; Produces collisionWDstar; - // Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; + // Dstar candidate related configurable Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; @@ -79,11 +79,11 @@ struct HfCorrelatorDstarHadrons{ // Configurable etaAbsMaxDstar{"etaAbsMaxDstar",1.0,"max Abs(eta) cut on Dstar candidate"}; Configurable yMaxDstar{"yMaxDstar", 0.8, "max. cand. rapidity"}; // track related configurable - Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack",1.0,"max Abs(eta) cut on Associated Track"}; + Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack",0.8,"max Abs(eta) cut on Associated Track"}; Configurable dcaxyMinAssoTrack{"dcaxyMinAssoTrack",0.0,"min DCAxy of Associated Track"}; - Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack",0.003,"max DCAxy of Associated Track"}; + Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack",10.0,"max DCAxy of Associated Track"}; Configurable dcazMinAssoTrack{"dcazMinAssoTrack",0.0, "min DCAz of Associated Track"}; - Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack",0.003,"max DCAz of Associated Track"}; + Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack",10.0,"max DCAz of Associated Track"}; Configurable pTMinAssoTrack{"pTMinAssoTrack",0.5,"min Pt of Associated Track"}; Configurable pTMaxAssoTrack{"pTMaxAssoTrack",50.0,"max pT of Associated Track"}; @@ -93,10 +93,9 @@ struct HfCorrelatorDstarHadrons{ ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; // ColumnBinningPolicy> binningScheme; - using CollisionsWMult = soa::Join; - using DstarCandidates = soa::Join; // if we add two extra columns of prong0Id and prong1d then we need not to join HfD0FromDstar here. + using CollisionsWMult = soa::Join; + using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id) - // Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; SliceCache cache; Preslice perColCandidates = aod::hf_cand::collisionId; @@ -106,23 +105,37 @@ struct HfCorrelatorDstarHadrons{ Partition selectedCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; // track partition - Partition selectedTracks = nabs(aod::track::eta) < etaAbsMaxAssoTrack && aod::track::pt > pTMinAssoTrack && aod::track::pt < pTMaxAssoTrack && - aod::track::dcaXY > dcaxyMinAssoTrack && aod::track::dcaXY < dcaxyMaxAssoTrack && - aod::track::dcaZ > dcazMinAssoTrack && aod::track::dcaZ < dcazMaxAssoTrack; + Partition selectedTracks = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && + aod::track::dcaXY >= dcaxyMinAssoTrack && aod::track::dcaXY <= dcaxyMaxAssoTrack && + aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; + HistogramRegistry registry + { + "registry", + { + {"hNPairsDH","Number of D-H Pairs",{HistType::kTH1F,{{1,0.0,1.0}}}}, + {"hNColWDstar","number of trigger collision",{HistType::kTH1F,{{1,0.0,1.0}}}}, + {"NTracks","Number of asso. tracks",{HistType::kTH1F,{{500,0.0,1000}}}}, + {"hNTracksPerTrigCol","Number of asso Tracks per trigger collision",{HistType::kTH1F,{{500,0,500}}}} + } + }; + void init (InitContext&){ binningScheme = {{binsZVtx, binsMultiplicity},true}; } - void processData(/*soa::Filtered*/ CollisionsWMult const & collisions, // only collisions who have altleast one D* + void processData(CollisionsWMult const & collisions, aod::TracksWDca const & tracks, DstarCandidates const & candidates, aod::BCsWithTimestamps const & ){ // LOG(info)<<"process data function called. Collision Table size = "<(); auto timestamp = bc.timestamp(); // LOG(info)<<"timestamp = "<sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); // LOG(info)<< "selected candidates grouped according to current collision"; auto selectedTracksGrouped = selectedTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + nTracks = selectedTracksGrouped.size(); + registry.fill(HIST("NTracks"), nTracks); if((selectedCandidatesGrouped.size() == 0) || (selectedTracksGrouped.size() == 0)){ + collisionWDstar(isDstarFound); // filled collision by collision continue; } // LOG(info)<<"pair creation starts"; @@ -144,10 +160,11 @@ struct HfCorrelatorDstarHadrons{ if((triggerParticle.prong0Id() == gIassocParticle) || (triggerParticle.prong1Id() == gIassocParticle) || (triggerParticle.prongPiId() == gIassocParticle)){ continue; // rejected pair if associated particle is same as any of daughter particle } - // Track rejection based on eta, pt cut. if partition works on expression column: remove this from here - if(assocParticle.eta() > etaAbsMaxAssoTrack || assocParticle.pt() < pTMinAssoTrack || assocParticle.pt() > pTMaxAssoTrack){ - continue; // reject pair of associated particle is not within kinematic range - } + + // // Track rejection based on eta, pt cut. if partition works on expression column: remove this from here + // if(assocParticle.eta() > etaAbsMaxAssoTrack || assocParticle.pt() < pTMinAssoTrack || assocParticle.pt() > pTMaxAssoTrack){ + // continue; // reject pair of associated particle is not within kinematic range + // } // Trigger Particle Rejection if(triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar){ continue; @@ -192,14 +209,38 @@ struct HfCorrelatorDstarHadrons{ binNumber ); } - LOG(info)<<"pair table filled"; + registry.fill(HIST("hNPairsDH"),0.5); + // LOG(info)<<"pair table filled"; } // D-H pair loop + collisionWDstar(isDstarFound); // filled collision by collision - LOG(info)<<"collision table of Dstar only filled"; + if(isDstarFound){ + registry.fill(HIST("hNColWDstar"),0.5); + nTracksPerTrigCol = selectedTracksGrouped.size(); + LOG(info)<<"nTracksPerTrigCol: "< selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; + Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + using CollisionsWDstar = soa::Join; + using TriggerCollision = soa::Filtered; + + void processDataWithMixedEvent(TriggerCollision const & collisions, // only collisions who have altleast one D* + aod::TracksWDca const & tracks, + DstarCandidates const & candidates, + aod::BCsWithTimestamps const &){ + + Pair + + } + }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc){ From cb40295f2a73943156737e891e1ca30af1dcdb81 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Thu, 7 Mar 2024 16:10:43 +0530 Subject: [PATCH 09/19] Added mixed event function --- .../TableProducer/correlatorDstarHadrons.cxx | 276 ++++++++++-------- 1 file changed, 152 insertions(+), 124 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 17f0f24b323..d712a873df4 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -32,47 +32,56 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// // flaging a collision if D* meson is found. -// struct HfCollisionSelector{ -// Produces collisionWDstar; -// Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; -// Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; -// Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; -// using DstarCandidates = soa::Join; -// SliceCache cache; -// // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" -// Partition selectedDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; -// void processCollisionSelWDstar(aod::Collision const& collision, -// DstarCandidates const& candidates){ -// bool isDstarFound = false; -// if(selectedDstarCandidates.size() > 0){ -// auto selectedDstarCandidatesGrouped = selectedDstarCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); -// for(const auto & selectedCandidate: selectedDstarCandidatesGrouped){ -// auto yDstar = selectedCandidate.y(constants::physics::MassDStar); -// auto pTDstar = selectedCandidate.pt(); -// if(yCandMax >= 0 && yDstar > yCandMax){ -// continue; -// } -// if(ptCandMin >= 0 && pTDstar < ptCandMin){ -// continue; -// } -// isDstarFound = true; -// break; -// } -// } -// LOG(info)<<"processCollisionSelWDstar: isDstarFound = "<< isDstarFound; -// collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) -// } -// PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); -// }; - -struct HfCorrelatorDstarHadrons{ - Produces rowsDstarHadronPair; +// flaging a collision if D* meson is found. +struct HfCollisionSelector{ Produces collisionWDstar; - + Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + + using DstarCandidates = soa::Join; + using FilteredCandidates = soa::Filtered; + + SliceCache cache; + Preslice perColDstarCand = aod::hf_cand::collisionId; + + // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" + Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + + void processCollisionSelWDstar(aod::Collisions const& collisions, + FilteredCandidates const& candidates){ + + for(const auto & collision:collisions){ + bool isDstarFound = false; + auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + if(!(candidatesPerCol.size()>0)){ + collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) + continue; + } + for(const auto & candidate : candidatesPerCol){ + auto yDstar = candidate.y(constants::physics::MassDStar); + auto ptDstar = candidate.pt(); + if(yCandMax >= 0 && std::abs(yDstar) > yCandMax){ + continue; + } + if(ptCandMin >= 0 && ptDstar < ptCandMin){ + continue; + } + isDstarFound = true; + break; + } // candidate loop + LOG(info)<<"processCollisionSelWDstar: isDstarFound = "<< isDstarFound; + collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) + }// collision loop + } + PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); +}; +struct HfCorrelatorDstarHadron{ + Produces rowsDstarHadronPair; // Dstar candidate related configurable + Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; Configurable pTMinDstar{"pTMinDstar",1.5,"min pT of dstar candidate"}; Configurable pTMaxDstar{"pTMaxDstar",50,"max pT of dstar Candidate"}; @@ -90,97 +99,78 @@ struct HfCorrelatorDstarHadrons{ ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; + // ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; // ColumnBinningPolicy> binningScheme; + using BinningType = ColumnBinningPolicy>; + BinningType binningScheme{{binsZVtx, binsMultiplicity},true}; - using CollisionsWMult = soa::Join; - using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id) - + //collision table + using CollisionsWDstar = soa::Join; + Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + using FilteredCollisions = soa::Filtered; - SliceCache cache; - Preslice perColCandidates = aod::hf_cand::collisionId; - Preslice perColTracks = aod::track::collisionId; + // candidate table + using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id), so no need to add table HfCandD0Fromdstar + Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + using FilteredCandidates = soa::Filtered; - // cabdidate partition - Partition selectedCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; - // track partition - Partition selectedTracks = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && + Filter trackFilter = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && aod::track::dcaXY >= dcaxyMinAssoTrack && aod::track::dcaXY <= dcaxyMaxAssoTrack && aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; - - HistogramRegistry registry - { - "registry", - { - {"hNPairsDH","Number of D-H Pairs",{HistType::kTH1F,{{1,0.0,1.0}}}}, - {"hNColWDstar","number of trigger collision",{HistType::kTH1F,{{1,0.0,1.0}}}}, - {"NTracks","Number of asso. tracks",{HistType::kTH1F,{{500,0.0,1000}}}}, - {"hNTracksPerTrigCol","Number of asso Tracks per trigger collision",{HistType::kTH1F,{{500,0,500}}}} - } - }; + using FilteredTracks = soa::Filtered; + void init (InitContext&){ binningScheme = {{binsZVtx, binsMultiplicity},true}; } - - void processData(CollisionsWMult const & collisions, - aod::TracksWDca const & tracks, - DstarCandidates const & candidates, - aod::BCsWithTimestamps const & ){ - // LOG(info)<<"process data function called. Collision Table size = "< perColCandidates = aod::hf_cand::collisionId; + Preslice perColCandidates = aod::hf_cand::collisionId; + // Preslice perColTracks = aod::track::collisionId; + Preslice perColTracks = aod::track::collisionId; + + void processDataSameEvent(FilteredCollisions const & collisions, // only collisions who have altleast one D* + FilteredTracks const & tracks, + FilteredCandidates const & candidates, + aod::BCsWithTimestamps const &){ + - for(const auto & collision: collisions){ - int nTracks = 0; // selected tracks in a collision - int nTracksPerTrigCol = 0; // selected tracks in triggered collision - bool isDstarFound =false; // flag whether D* particle is found in a collision auto bc = collision.bc_as(); auto timestamp = bc.timestamp(); - // LOG(info)<<"timestamp = "<sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - // LOG(info)<< "selected candidates grouped according to current collision"; - auto selectedTracksGrouped = selectedTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - nTracks = selectedTracksGrouped.size(); - registry.fill(HIST("NTracks"), nTracks); + auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId,collision.globalIndex(), cache); + auto tracksPerCol = tracks.sliceByCached(aod::track::collisionId,collision.globalIndex(), cache); - if((selectedCandidatesGrouped.size() == 0) || (selectedTracksGrouped.size() == 0)){ - collisionWDstar(isDstarFound); // filled collision by collision + if(candidatesPerCol.size() && tracksPerCol.size() == 0){ continue; - } - // LOG(info)<<"pair creation starts"; - // pair creation - for(auto &[triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(selectedCandidatesGrouped,selectedTracksGrouped))){ + }//endif + + // Pair creation + for(const auto & [triggerParticle, assocParticle]: soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol,tracksPerCol))){ auto gItriggerParticle = triggerParticle.globalIndex(); auto gIassocParticle = assocParticle.globalIndex(); //Track rejection based on daughter index if((triggerParticle.prong0Id() == gIassocParticle) || (triggerParticle.prong1Id() == gIassocParticle) || (triggerParticle.prongPiId() == gIassocParticle)){ continue; // rejected pair if associated particle is same as any of daughter particle - } + }//endif - // // Track rejection based on eta, pt cut. if partition works on expression column: remove this from here - // if(assocParticle.eta() > etaAbsMaxAssoTrack || assocParticle.pt() < pTMinAssoTrack || assocParticle.pt() > pTMaxAssoTrack){ - // continue; // reject pair of associated particle is not within kinematic range - // } // Trigger Particle Rejection if(triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar){ continue; - } + }//endif auto yDstar = triggerParticle.y(constants::physics::MassDStar); if(std::abs(yDstar) > yMaxDstar){ continue; - } - - // if(!isDstarFound){ - // isDstarFound =true; - // } - isDstarFound =true; + }//endif auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - if(triggerParticle.signSoftPi() > 0){ + + // Fill table + if(triggerParticle.signSoftPi() > 0){ // Fill Dstar candidate rowsDstarHadronPair(collision.globalIndex(), gItriggerParticle, triggerParticle.phi(), @@ -194,7 +184,7 @@ struct HfCorrelatorDstarHadrons{ timestamp, binNumber ); - }else { + }else { // Fill AntiDstar candidate rowsDstarHadronPair(collision.globalIndex(), gItriggerParticle, triggerParticle.phi(), @@ -208,42 +198,80 @@ struct HfCorrelatorDstarHadrons{ timestamp, binNumber ); - } - registry.fill(HIST("hNPairsDH"),0.5); - // LOG(info)<<"pair table filled"; - } // D-H pair loop - - collisionWDstar(isDstarFound); // filled collision by collision - if(isDstarFound){ - registry.fill(HIST("hNColWDstar"),0.5); - nTracksPerTrigCol = selectedTracksGrouped.size(); - LOG(info)<<"nTracksPerTrigCol: "< selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; - Filter CollisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; - using CollisionsWDstar = soa::Join; - using TriggerCollision = soa::Filtered; + }// processDataSameEvent + PROCESS_SWITCH(HfCorrelatorDstarHadron,processDataSameEvent,"process only same event data",true); - void processDataWithMixedEvent(TriggerCollision const & collisions, // only collisions who have altleast one D* - aod::TracksWDca const & tracks, - DstarCandidates const & candidates, + void processDataWithMixedEvent(FilteredCollisions const & collisions, // only collisions who have altleast one D* + FilteredTracks const & tracks, + FilteredCandidates const & candidates, aod::BCsWithTimestamps const &){ - - Pair - } + auto dstarHadronTuple = std::make_tuple(candidates,tracks); + Pair pairData{binningScheme,5,-1,collisions,dstarHadronTuple,&cache}; + + for(const auto& [c1, candidatesPerCol, c2, tracksPerCol] : pairData){ + + auto bc = c2.bc_as(); + auto timestamp = bc.timestamp(); + + for(const auto & [triggerParticle, assocParticle]: soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol,tracksPerCol))){ + + auto gItriggerParticle = triggerParticle.globalIndex(); + auto gIassocParticle = assocParticle.globalIndex(); + + auto yDstar = triggerParticle.y(constants::physics::MassDStar); + if(std::abs(yDstar) > yMaxDstar){ + continue; + }//endif + + int binNumber = binningScheme.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); + // Fill table + if(triggerParticle.signSoftPi() > 0){ // Fill Dstar candidate + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber + ); + }else { // Fill AntiDstar candidate + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassAntiDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber + ); + } // endif + + }// D-H loop + + } // Event Mixing loop + } // processDataWithMixedEvent + PROCESS_SWITCH(HfCorrelatorDstarHadron,processDataWithMixedEvent,"process only mixed events data",false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc){ - return WorkflowSpec{/*adaptAnalysisTask(cfgc),*/ - adaptAnalysisTask(cfgc)}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } \ No newline at end of file From a96cc2a0c7adf0934c27407eea93849f617d2b62 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Fri, 8 Mar 2024 03:50:24 +0530 Subject: [PATCH 10/19] writing correlation task --- PWGHF/HFC/DataModel/CorrelationTables.h | 4 +- .../TableProducer/correlatorDstarHadrons.cxx | 18 +++++-- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 52 +++++++++++++++++++ 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 16cf6d52eb0..fd513863b43 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -207,7 +207,7 @@ DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", //! D+-Hadrons p aod::hf_correlation_dplus_hadron::SignalStatus); -// definition of columns and tables for Dplus properties +// definition of columns and tables for Dstar properties // namespace hf_dstar_meson // { // // DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); @@ -279,7 +279,7 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTRHPAIR", // D* Hadrons pairs Inform hf_correlation_dstar_hadron::DeltaEta ); -// Tble for mc matched info +// Table for mc matched info using RecoMatchingInfoDstars = HfCandDstarMcRec; using RecoMatchingInfoDstar = RecoMatchingInfoDstars::iterator; diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index d712a873df4..b2b4a173c31 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -120,6 +120,13 @@ struct HfCorrelatorDstarHadron{ aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; using FilteredTracks = soa::Filtered; + HistogramRegistry registry{ + "registry", + { + {"hTriggerColCandPairCounts","Counts of Trigger Collision, Trigger Candidates and Pair Counts",{HistType::kTH1F,{{3,0.0,3.0}}}} + } + + }; void init (InitContext&){ binningScheme = {{binsZVtx, binsMultiplicity},true}; @@ -138,9 +145,10 @@ struct HfCorrelatorDstarHadron{ for(const auto & collision: collisions){ + registry.fill(HIST("hTriggerColCandPairCounts"),0); // counting trigger collision + auto bc = collision.bc_as(); auto timestamp = bc.timestamp(); - auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId,collision.globalIndex(), cache); auto tracksPerCol = tracks.sliceByCached(aod::track::collisionId,collision.globalIndex(), cache); @@ -148,6 +156,8 @@ struct HfCorrelatorDstarHadron{ continue; }//endif + registry.fill(HIST("hTriggerColCandPairCounts"),1); // counting number of trigger particle + // Pair creation for(const auto & [triggerParticle, assocParticle]: soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol,tracksPerCol))){ auto gItriggerParticle = triggerParticle.globalIndex(); @@ -167,6 +177,8 @@ struct HfCorrelatorDstarHadron{ continue; }//endif + registry.fill(HIST("hTriggerColCandPairCounts"),2); // counting number of pairs + auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); // Fill table @@ -233,7 +245,7 @@ struct HfCorrelatorDstarHadron{ int binNumber = binningScheme.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); // Fill table if(triggerParticle.signSoftPi() > 0){ // Fill Dstar candidate - rowsDstarHadronPair(collision.globalIndex(), + rowsDstarHadronPair(c2.globalIndex(), // taking c2, why not c1? gItriggerParticle, triggerParticle.phi(), triggerParticle.eta(), @@ -247,7 +259,7 @@ struct HfCorrelatorDstarHadron{ binNumber ); }else { // Fill AntiDstar candidate - rowsDstarHadronPair(collision.globalIndex(), + rowsDstarHadronPair(c2.globalIndex(), gItriggerParticle, triggerParticle.phi(), triggerParticle.eta(), diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx new file mode 100644 index 00000000000..c737156942c --- /dev/null +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -0,0 +1,52 @@ +// 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 correlatorDstarHadron.cxx +/// \author Deependra Sharma , IITB +/// \author Fabrizio Grosa , CERN +/// \author Shyam Kumar + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + + +// Dstar-Hadron correlation pair +struct HfTaskCorrelationDplusHadrons{ + + // string definitions, used for histogram axis labels + const TString stringPtD = "#it{p}_{T}^{D} (GeV/#it{c});"; + const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; + const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{D};"; + const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad);"; + const TString stringDHadron = "D,Hadron candidates "; + const TString stringSignal = "signal region;"; + const TString stringSideband = "sidebands;"; + + HistogramRegistry registry{ + "registry", + { + {"hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries",{HistType::kTHnSparseD,{}}}, + {"hCorrel2DPtIntSignalRegion"," ",{HistType::kTH2D,{}}}, + {"hDeltaEtaPtIntSignalRegion"," ",{HistType::kTH1D,{}}}, + {"hDeltaPhiPtIntSignalRegion"," ",{HistType::kTH1D,{}}}, + {"hCorrel2DVsPtSidebands"," ",{HistType::kTHnSparseD,{}}}, + {"hCorrel2DPtIntSidebands"," ",{HistType::kTH2D,{}}}, + {"hDeltaEtaPtIntSidebands"," ",{HistType::kTH1D,{}}}, + {"hDeltaPhiPtIntSidebands"," ",{HistType::kTH1D,{}}} + } + + }; + +}; From 6d98b8cfc2497f1ccd0f40d1c33b634bb8dcc9fd Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Thu, 14 Mar 2024 00:23:03 +0530 Subject: [PATCH 11/19] added correlation task for data only. Build Successful. Execution test is remaining --- PWGHF/HFC/Tasks/CMakeLists.txt | 5 + .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 157 ++++++++++++++++-- 2 files changed, 144 insertions(+), 18 deletions(-) diff --git a/PWGHF/HFC/Tasks/CMakeLists.txt b/PWGHF/HFC/Tasks/CMakeLists.txt index 9bc18f22359..9d66181013b 100644 --- a/PWGHF/HFC/Tasks/CMakeLists.txt +++ b/PWGHF/HFC/Tasks/CMakeLists.txt @@ -39,6 +39,11 @@ o2physics_add_dpl_workflow(task-correlation-ds-hadrons PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-correlation-dstar-hadrons + SOURCES taskCorrelationDstarHadrons.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(task-correlation-lc-hadrons SOURCES taskCorrelationLcHadrons.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index c737156942c..08c36a2cf54 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -9,44 +9,165 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file correlatorDstarHadron.cxx +/// \file taskCorrelationrDstarHadron.cxx /// \author Deependra Sharma , IITB /// \author Fabrizio Grosa , CERN /// \author Shyam Kumar +// Framework #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" +// PWGHF +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + + using namespace o2; +// using namespace o2::dstar; using namespace o2::framework; using namespace o2::framework::expressions; +// string definitions, used for histogram axis labels +const TString stringPtD = "#it{p}_{T}^{D} (GeV/#it{c});"; +const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; +const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{D};"; +const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad);"; +const TString stringDHadron = "D,Hadron candidates "; +const TString stringSignal = "signal region;"; +const TString stringSideband = "sidebands;"; +const TString stringPoolBin = "Pool Bin Number;"; + + + +namespace o2::dstar::correlation{ + const int nBinsPtCorrelation = 8; + + const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; + auto vecBinsPtCorrelations = std::vector{binsPtCorrelations, binsPtCorrelations + nBinsPtCorrelation + 1}; + + const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; + auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault , signalRegionLefBoundDefault + nBinsPtCorrelation }; + + const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; + auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation }; + + const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; + auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation }; + + const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; + auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault , sidebandLeftInnerDefault + nBinsPtCorrelation }; + + const double sidebandRightInnerDefault[nBinsPtCorrelation] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; + auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation }; + + const double sidebandRightOuterDefault[nBinsPtCorrelation] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; + auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault , sidebandRightOuterDefault + nBinsPtCorrelation }; + + const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::nBinsPt; + std::vector efficiencyDstar(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? +} + +using namespace o2::dstar; // Dstar-Hadron correlation pair -struct HfTaskCorrelationDplusHadrons{ +struct HfTaskCorrelationDstarHadron{ + + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; + // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_to_pi_k_pi (i.e. the mass pT bins), but can be redefined via json files + Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{correlation::vecBinsPtCorrelations}, "pT bin limits for correlation plots"}; + Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for efficiency"}; + Configurable> efficiencyDstar{"efficiencyDstar", std::vector{correlation::efficiencyDstar}, "efficiency values for Dstar vs pT bin"}; + + Configurable> signalRegionLefBound{"signalRegionLefBound",std::vector{correlation::vecSignalRegionLefBoundDefault},"left boundary of signal region vs pT"}; + Configurable> signalRegionRightBound{"signalRegionRightBound",std::vector{correlation::vecSignalRegionRightBoundDefault},"right boundary of signal region vs pT"}; + Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary",std::vector{correlation::vecSidebandLeftOuterDefault},"left sideband outer boundary vs pT"}; + Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault},"left sideband inner boundary vs pT"}; + Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary",std::vector{correlation::vecSidebandRightOuterDefault},"right sideband outer baoundary vs pT"}; + Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary",std::vector{correlation::vecSidebandRightInnerDefault},"right sideband inner boundary"}; + - // string definitions, used for histogram axis labels - const TString stringPtD = "#it{p}_{T}^{D} (GeV/#it{c});"; - const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; - const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{D};"; - const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad);"; - const TString stringDHadron = "D,Hadron candidates "; - const TString stringSignal = "signal region;"; - const TString stringSideband = "sidebands;"; HistogramRegistry registry{ "registry", { - {"hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries",{HistType::kTHnSparseD,{}}}, - {"hCorrel2DPtIntSignalRegion"," ",{HistType::kTH2D,{}}}, - {"hDeltaEtaPtIntSignalRegion"," ",{HistType::kTH1D,{}}}, - {"hDeltaPhiPtIntSignalRegion"," ",{HistType::kTH1D,{}}}, - {"hCorrel2DVsPtSidebands"," ",{HistType::kTHnSparseD,{}}}, - {"hCorrel2DPtIntSidebands"," ",{HistType::kTH2D,{}}}, - {"hDeltaEtaPtIntSidebands"," ",{HistType::kTH1D,{}}}, - {"hDeltaPhiPtIntSidebands"," ",{HistType::kTH1D,{}}} + // {"hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron +stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},{50,0.,50.},{11,0.,11.},{9,0.,9.}}}}, + // {"hCorrel2DPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi +stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}}, + // {"hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}}, + // {"hDeltaPhiPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}}, + // {"hCorrel2DVsPtSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},{50,0.,50.},{11,0.,11.},{9,0.,9.}}}}, + // {"hCorrel2DPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}}, + // {"hDeltaEtaPtIntSidebands",stringDHadron + stringSideband + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}}, + // {"hDeltaPhiPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}} } }; + + void init(InitContext &){ + + auto axisPtDstar = (std::vector)binsPtEfficiency; + AxisSpec axisSpecPtDstar = {axisPtDstar}; + + registry.add("hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron +stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},axisSpecPtDstar,{11,0.,11.},{9,0.,9.}}}, true); + registry.add("hCorrel2DPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi +stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}, true); + registry.add("hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}, true); + registry.add("hDeltaPhiPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}, true); + registry.add("hCorrel2DVsPtSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},axisSpecPtDstar,{11,0.,11.},{9,0.,9.}}}, true); + registry.add("hCorrel2DPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}, true); + registry.add("hDeltaEtaPtIntSidebands",stringDHadron + stringSideband + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}, true); + registry.add("hDeltaPhiPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}, true); + } + + void processData(aod::DstarHadronPair const & dstarHPairs){ + for(const auto & dstarHPair:dstarHPairs){ + float deltaPhi = dstarHPair.deltaPhi(); + float deltaEta = dstarHPair.deltaEta(); + float ptDstar = dstarHPair.ptDstar(); + float ptTrack = dstarHPair.ptTrack(); + int poolBin = dstarHPair.poolBin(); + float massDstar = dstarHPair.mDstar(); + + int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency,ptDstar); + int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations,ptDstar); + + // reject candidate if outside pT ranges of interst + if(corrBinPtDstar < 0 || effBinPtDstar < 0){ + continue; + } + if(ptTrack > 10.0){ + ptTrack = 10.5; + } + float netEfficiencyWeight = 1.0; + float efficiencyWeightTracks = 1.0; + + if(applyEfficiency){ + netEfficiencyWeight = 1.0 / (efficiencyDstar->at(effBinPtDstar) * efficiencyWeightTracks); + } + + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if(massDstar > signalRegionLefBound->at(ptDstar) && massDstar < signalRegionRightBound->at(ptDstar)){ + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegion"),deltaPhi, deltaEta, ptDstar , ptTrack, poolBin, netEfficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegion"),deltaPhi, deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, netEfficiencyWeight); + }else if((massDstar > leftSidebandOuterBoundary->at(ptDstar) && massDstar < leftSidebandInnerBoundary->at(ptDstar)) + ||(massDstar > rightSidebandInnerBoundary->at(ptDstar) && massDstar < rightSidebandOuterBoundary->at(ptDstar))){ + registry.fill(HIST("hCorrel2DVsPtSidebands"),deltaPhi, deltaEta, ptDstar , ptTrack, poolBin, netEfficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"),deltaPhi, deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"),deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"),deltaPhi, netEfficiencyWeight); + } + + } + + } + PROCESS_SWITCH(HfTaskCorrelationDstarHadron,processData," process data only", true); }; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 05353766e5ebd444963b4185e8aa040b2d9cc8ea Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Fri, 15 Mar 2024 16:33:57 +0530 Subject: [PATCH 12/19] impliment PWGHF specific guidelines --- PWGHF/HFC/DataModel/CorrelationTables.h | 88 ++-- .../TableProducer/correlatorDstarHadrons.cxx | 488 +++++++++--------- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 213 ++++---- 3 files changed, 371 insertions(+), 418 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index fd513863b43..2059823e095 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -18,12 +18,11 @@ // O2 #include "Framework/AnalysisDataModel.h" -//O2Physics +// O2Physics #include "Common/Core/RecoDecay.h" // PWGCF #include "PWGHF/DataModel/CandidateReconstructionTables.h" - namespace o2::aod { // definition of columns and tables for D-Dbar correlation pairs @@ -206,59 +205,34 @@ DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", //! D+-Hadrons p aod::hf_correlation_dplus_hadron::MD, aod::hf_correlation_dplus_hadron::SignalStatus); - -// definition of columns and tables for Dstar properties -// namespace hf_dstar_meson -// { -// // DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); -// // DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); -// // DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); -// // DECLARE_SOA_COLUMN(MDstar, mDstar, float); -// // DECLARE_SOA_COLUMN(PoolBin, poolBin, int); -// // DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); -// // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); -// // DECLARE_SOA_INDEX_COLUMN(Collision, collision); -// // DECLARE_SOA_INDEX_COLUMN(Dstar,dstar); -// // DECLARE_SOA_INDEX_COLUMN(Track,track); -// }// hf_dstar_meson - -// DECLARE_SOA_TABLE(Dstar, "AOD","DSTAR", //! D* meson properties (This table is not compatible with HfCandDstar & HfSelDstarToD0Pi) -// aod::hf_dstar_meson::PhiDstar, -// aod::hf_dstar_meson::EtaDstar, -// aod::hf_dstar_meson::PtDstar, -// aod::hf_dstar_meson::MDstar, -// aod::hf_dstar_meson::PoolBin, -// aod::hf_dstar_meson::TimeStamp, -// aod::hf_dstar_meson::CollisionId); - // definition of columns and tables for Dstar-Hadron correlation pair using Dstars = HfCandDstar; using Dstar = Dstars::iterator; namespace hf_correlation_dstar_hadron { - DECLARE_SOA_INDEX_COLUMN(Collision, collision); - // Dstar candidate properties - DECLARE_SOA_INDEX_COLUMN(Dstar,dstar); - DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); - DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); - DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); - DECLARE_SOA_COLUMN(MDstar, mDstar, float); - // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables - // DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables - // Track properties - DECLARE_SOA_INDEX_COLUMN(Track,track); - DECLARE_SOA_COLUMN(PhiTrack,phiTrack, float); - DECLARE_SOA_COLUMN(EtaTrack,etaTrack, float); - DECLARE_SOA_COLUMN(PtTrack,ptTrack, float); - // common - DECLARE_SOA_COLUMN(TimeStamp,timeStamp, int64_t); - DECLARE_SOA_COLUMN(PoolBin, poolBin, int); - // Dynamic columns - DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate)->float{ return(etaTrack - etaCandidate); }); - DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack)->float{ return RecoDecay::constrainAngle(phiTrack,phiCandidate); }); -}// hf_correlation_dstar_hadron - -DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTRHPAIR", // D* Hadrons pairs Informations +DECLARE_SOA_INDEX_COLUMN(Collision, collision); +// Dstar candidate properties +DECLARE_SOA_INDEX_COLUMN(Dstar, dstar); +DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); +DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); +DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); +DECLARE_SOA_COLUMN(MDstar, mDstar, float); +// DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables +// DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables +// Track properties +DECLARE_SOA_INDEX_COLUMN(Track, track); +DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); +DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); +DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); +// common +DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); +// Dynamic columns +DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate) -> float { return (etaTrack - etaCandidate); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack, phiCandidate); }); +} // namespace hf_correlation_dstar_hadron + +DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Informations hf_correlation_dstar_hadron::CollisionId, // D* only properties hf_correlation_dstar_hadron::DstarId, @@ -275,19 +249,19 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD","DSTRHPAIR", // D* Hadrons pairs Inform hf_correlation_dstar_hadron::TimeStamp, hf_correlation_dstar_hadron::PoolBin, // common Dynamic - hf_correlation_dstar_hadron::DeltaPhi, - hf_correlation_dstar_hadron::DeltaEta - ); + hf_correlation_dstar_hadron::DeltaPhi, + hf_correlation_dstar_hadron::DeltaEta); // Table for mc matched info using RecoMatchingInfoDstars = HfCandDstarMcRec; using RecoMatchingInfoDstar = RecoMatchingInfoDstars::iterator; -namespace hf_correlation_dstar_hadron{ - DECLARE_SOA_INDEX_COLUMN(RecoMatchingInfoDstar,recoMatchingInfoDstar); +namespace hf_correlation_dstar_hadron +{ +DECLARE_SOA_INDEX_COLUMN(RecoMatchingInfoDstar, recoMatchingInfoDstar); } -DECLARE_SOA_TABLE(DstarHadronRecoInfo,"AOD","DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations - hf_correlation_dstar_hadron::RecoMatchingInfoDstarId); +DECLARE_SOA_TABLE(DstarHadronRecoInfo, "AOD", "DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations + hf_correlation_dstar_hadron::RecoMatchingInfoDstarId); // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index b2b4a173c31..d1dbd87e1bf 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -27,259 +27,255 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; // flaging a collision if D* meson is found. -struct HfCollisionSelector{ - Produces collisionWDstar; - - Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; - Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; - Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - - using DstarCandidates = soa::Join; - using FilteredCandidates = soa::Filtered; - - SliceCache cache; - Preslice perColDstarCand = aod::hf_cand::collisionId; - - // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" - Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; - - void processCollisionSelWDstar(aod::Collisions const& collisions, - FilteredCandidates const& candidates){ - - for(const auto & collision:collisions){ - bool isDstarFound = false; - auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - if(!(candidatesPerCol.size()>0)){ - collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) - continue; - } - for(const auto & candidate : candidatesPerCol){ - auto yDstar = candidate.y(constants::physics::MassDStar); - auto ptDstar = candidate.pt(); - if(yCandMax >= 0 && std::abs(yDstar) > yCandMax){ - continue; - } - if(ptCandMin >= 0 && ptDstar < ptCandMin){ - continue; - } - isDstarFound = true; - break; - } // candidate loop - LOG(info)<<"processCollisionSelWDstar: isDstarFound = "<< isDstarFound; - collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) - }// collision loop - } - PROCESS_SWITCH(HfCollisionSelector,processCollisionSelWDstar,"process only data for dstar hadron correlation", true); -}; - -struct HfCorrelatorDstarHadron{ - Produces rowsDstarHadronPair; - // Dstar candidate related configurable - Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar",true," select on collisions which have atleast a Dstar candidate"}; - Configurable selectionFlagDstar{"selectionFlagDstar",true,"selection flag for Dstar"}; - Configurable pTMinDstar{"pTMinDstar",1.5,"min pT of dstar candidate"}; - Configurable pTMaxDstar{"pTMaxDstar",50,"max pT of dstar Candidate"}; - // Configurable etaAbsMaxDstar{"etaAbsMaxDstar",1.0,"max Abs(eta) cut on Dstar candidate"}; - Configurable yMaxDstar{"yMaxDstar", 0.8, "max. cand. rapidity"}; - // track related configurable - Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack",0.8,"max Abs(eta) cut on Associated Track"}; - Configurable dcaxyMinAssoTrack{"dcaxyMinAssoTrack",0.0,"min DCAxy of Associated Track"}; - Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack",10.0,"max DCAxy of Associated Track"}; - Configurable dcazMinAssoTrack{"dcazMinAssoTrack",0.0, "min DCAz of Associated Track"}; - Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack",10.0,"max DCAz of Associated Track"}; - Configurable pTMinAssoTrack{"pTMinAssoTrack",0.5,"min Pt of Associated Track"}; - Configurable pTMaxAssoTrack{"pTMaxAssoTrack",50.0,"max pT of Associated Track"}; - - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; - ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - - // ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; - // ColumnBinningPolicy> binningScheme; - using BinningType = ColumnBinningPolicy>; - BinningType binningScheme{{binsZVtx, binsMultiplicity},true}; - - //collision table - using CollisionsWDstar = soa::Join; - Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; - using FilteredCollisions = soa::Filtered; - - // candidate table - using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id), so no need to add table HfCandD0Fromdstar - Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; - using FilteredCandidates = soa::Filtered; - - - Filter trackFilter = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && - aod::track::dcaXY >= dcaxyMinAssoTrack && aod::track::dcaXY <= dcaxyMaxAssoTrack && - aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; - using FilteredTracks = soa::Filtered; - - HistogramRegistry registry{ - "registry", - { - {"hTriggerColCandPairCounts","Counts of Trigger Collision, Trigger Candidates and Pair Counts",{HistType::kTH1F,{{3,0.0,3.0}}}} +struct HfCollisionSelector { + Produces collisionWDstar; + + Configurable selectionFlagDstar{"selectionFlagDstar", true, "selection flag for Dstar"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + + using DstarCandidates = soa::Join; + using FilteredCandidates = soa::Filtered; + + SliceCache cache; + Preslice perColDstarCand = aod::hf_cand::collisionId; + + // candidates who passed the slection criteria defined in "CandidateSelectionTables.h" + Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + + void processCollisionSelWDstar(aod::Collisions const& collisions, + FilteredCandidates const& candidates) + { + + for (const auto& collision : collisions) { + bool isDstarFound = false; + auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + if (!(candidatesPerCol.size() > 0)) { + collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) + continue; + } + for (const auto& candidate : candidatesPerCol) { + auto yDstar = candidate.y(constants::physics::MassDStar); + auto ptDstar = candidate.pt(); + if (yCandMax >= 0 && std::abs(yDstar) > yCandMax) { + continue; } + if (ptCandMin >= 0 && ptDstar < ptCandMin) { + continue; + } + isDstarFound = true; + break; + } // candidate loop + LOG(info) << "processCollisionSelWDstar: isDstarFound = " << isDstarFound; + collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) + } // collision loop + } + PROCESS_SWITCH(HfCollisionSelector, processCollisionSelWDstar, "process only data for dstar hadron correlation", true); +}; - }; - - void init (InitContext&){ - binningScheme = {{binsZVtx, binsMultiplicity},true}; - } - - SliceCache cache; - // Preslice perColCandidates = aod::hf_cand::collisionId; - Preslice perColCandidates = aod::hf_cand::collisionId; - // Preslice perColTracks = aod::track::collisionId; - Preslice perColTracks = aod::track::collisionId; - - void processDataSameEvent(FilteredCollisions const & collisions, // only collisions who have altleast one D* - FilteredTracks const & tracks, - FilteredCandidates const & candidates, - aod::BCsWithTimestamps const &){ - - - for(const auto & collision: collisions){ - registry.fill(HIST("hTriggerColCandPairCounts"),0); // counting trigger collision - - auto bc = collision.bc_as(); - auto timestamp = bc.timestamp(); - auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId,collision.globalIndex(), cache); - auto tracksPerCol = tracks.sliceByCached(aod::track::collisionId,collision.globalIndex(), cache); - - if(candidatesPerCol.size() && tracksPerCol.size() == 0){ - continue; - }//endif - - registry.fill(HIST("hTriggerColCandPairCounts"),1); // counting number of trigger particle - - // Pair creation - for(const auto & [triggerParticle, assocParticle]: soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol,tracksPerCol))){ - auto gItriggerParticle = triggerParticle.globalIndex(); - auto gIassocParticle = assocParticle.globalIndex(); - - //Track rejection based on daughter index - if((triggerParticle.prong0Id() == gIassocParticle) || (triggerParticle.prong1Id() == gIassocParticle) || (triggerParticle.prongPiId() == gIassocParticle)){ - continue; // rejected pair if associated particle is same as any of daughter particle - }//endif - - // Trigger Particle Rejection - if(triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar){ - continue; - }//endif - auto yDstar = triggerParticle.y(constants::physics::MassDStar); - if(std::abs(yDstar) > yMaxDstar){ - continue; - }//endif - - registry.fill(HIST("hTriggerColCandPairCounts"),2); // counting number of pairs - - auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - - // Fill table - if(triggerParticle.signSoftPi() > 0){ // Fill Dstar candidate - rowsDstarHadronPair(collision.globalIndex(), - gItriggerParticle, - triggerParticle.phi(), - triggerParticle.eta(), - triggerParticle.pt(), - triggerParticle.invMassDstar(), - gIassocParticle, - assocParticle.phi(), - assocParticle.eta(), - assocParticle.pt(), - timestamp, - binNumber - ); - }else { // Fill AntiDstar candidate - rowsDstarHadronPair(collision.globalIndex(), - gItriggerParticle, - triggerParticle.phi(), - triggerParticle.eta(), - triggerParticle.pt(), - triggerParticle.invMassAntiDstar(), - gIassocParticle, - assocParticle.phi(), - assocParticle.eta(), - assocParticle.pt(), - timestamp, - binNumber - ); - } // endif - - }//D-H pair loop - - }// collision loop - - }// processDataSameEvent - PROCESS_SWITCH(HfCorrelatorDstarHadron,processDataSameEvent,"process only same event data",true); - - void processDataWithMixedEvent(FilteredCollisions const & collisions, // only collisions who have altleast one D* - FilteredTracks const & tracks, - FilteredCandidates const & candidates, - aod::BCsWithTimestamps const &){ - - auto dstarHadronTuple = std::make_tuple(candidates,tracks); - Pair pairData{binningScheme,5,-1,collisions,dstarHadronTuple,&cache}; - - for(const auto& [c1, candidatesPerCol, c2, tracksPerCol] : pairData){ - - auto bc = c2.bc_as(); - auto timestamp = bc.timestamp(); - - for(const auto & [triggerParticle, assocParticle]: soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol,tracksPerCol))){ - - auto gItriggerParticle = triggerParticle.globalIndex(); - auto gIassocParticle = assocParticle.globalIndex(); - - auto yDstar = triggerParticle.y(constants::physics::MassDStar); - if(std::abs(yDstar) > yMaxDstar){ - continue; - }//endif - - int binNumber = binningScheme.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); - // Fill table - if(triggerParticle.signSoftPi() > 0){ // Fill Dstar candidate - rowsDstarHadronPair(c2.globalIndex(), // taking c2, why not c1? - gItriggerParticle, - triggerParticle.phi(), - triggerParticle.eta(), - triggerParticle.pt(), - triggerParticle.invMassDstar(), - gIassocParticle, - assocParticle.phi(), - assocParticle.eta(), - assocParticle.pt(), - timestamp, - binNumber - ); - }else { // Fill AntiDstar candidate - rowsDstarHadronPair(c2.globalIndex(), - gItriggerParticle, - triggerParticle.phi(), - triggerParticle.eta(), - triggerParticle.pt(), - triggerParticle.invMassAntiDstar(), - gIassocParticle, - assocParticle.phi(), - assocParticle.eta(), - assocParticle.pt(), - timestamp, - binNumber - ); - } // endif - - }// D-H loop - - } // Event Mixing loop - - } // processDataWithMixedEvent - PROCESS_SWITCH(HfCorrelatorDstarHadron,processDataWithMixedEvent,"process only mixed events data",false); +struct HfCorrelatorDstarHadron { + Produces rowsDstarHadronPair; + // Dstar candidate related configurable + Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar", true, " select on collisions which have atleast a Dstar candidate"}; + Configurable selectionFlagDstar{"selectionFlagDstar", true, "selection flag for Dstar"}; + Configurable pTMinDstar{"pTMinDstar", 1.5, "min pT of dstar candidate"}; + Configurable pTMaxDstar{"pTMaxDstar", 50, "max pT of dstar Candidate"}; + // Configurable etaAbsMaxDstar{"etaAbsMaxDstar",1.0,"max Abs(eta) cut on Dstar candidate"}; + Configurable yMaxDstar{"yMaxDstar", 0.8, "max. cand. rapidity"}; + // track related configurable + Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack", 0.8, "max Abs(eta) cut on Associated Track"}; + Configurable dcaxyMinAssoTrack{"dcaxyMinAssoTrack", 0.0, "min DCAxy of Associated Track"}; + Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack", 10.0, "max DCAxy of Associated Track"}; + Configurable dcazMinAssoTrack{"dcazMinAssoTrack", 0.0, "min DCAz of Associated Track"}; + Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack", 10.0, "max DCAz of Associated Track"}; + Configurable pTMinAssoTrack{"pTMinAssoTrack", 0.5, "min Pt of Associated Track"}; + Configurable pTMaxAssoTrack{"pTMaxAssoTrack", 50.0, "max pT of Associated Track"}; + + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; + + // ColumnBinningPolicy> binningScheme{{binsZVtx, binsMultiplicity},true}; + // ColumnBinningPolicy> binningScheme; + using BinningType = ColumnBinningPolicy>; + BinningType binningScheme{{binsZVtx, binsMultiplicity}, true}; + + // Collision Table + using CollisionsWDstar = soa::Join; + using FilteredCollisions = soa::Filtered; + + // candidate table + using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id), so no need to add table HfCandD0Fromdstar + using FilteredCandidates = soa::Filtered; + + using FilteredTracks = soa::Filtered; + + // collision table filter + Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == selectOnlyCollisionWDstar; + // candidate filter + Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; + // track table filter + Filter trackFilter = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && + aod::track::dcaXY >= dcaxyMinAssoTrack && aod::track::dcaXY <= dcaxyMaxAssoTrack && + aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; + SliceCache cache; + // Preslice perColCandidates = aod::hf_cand::collisionId; + Preslice perColCandidates = aod::hf_cand::collisionId; + // Preslice perColTracks = aod::track::collisionId; + Preslice perColTracks = aod::track::collisionId; + + HistogramRegistry registry{ + "registry", + {{"hTriggerColCandPairCounts", "Counts of Trigger Collision, Trigger Candidates and Pair Counts", {HistType::kTH1F, {{3, 0.0, 3.0}}}}}}; + + void init(InitContext&) + { + binningScheme = {{binsZVtx, binsMultiplicity}, true}; + } + + void processDataSameEvent(FilteredCollisions const& collisions, // only collisions who have altleast one D* + FilteredTracks const& tracks, + FilteredCandidates const& candidates, + aod::BCsWithTimestamps const&) + { + + for (const auto& collision : collisions) { + registry.fill(HIST("hTriggerColCandPairCounts"), 0); // counting trigger collision + + auto bc = collision.bc_as(); + auto timestamp = bc.timestamp(); + auto candidatesPerCol = candidates.sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + auto tracksPerCol = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + if (candidatesPerCol.size() && tracksPerCol.size() == 0) { + continue; + } // endif + + registry.fill(HIST("hTriggerColCandPairCounts"), 1); // counting number of trigger particle + + // Pair creation + for (const auto& [triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol, tracksPerCol))) { + auto gItriggerParticle = triggerParticle.globalIndex(); + auto gIassocParticle = assocParticle.globalIndex(); + + // Track rejection based on daughter index + if ((triggerParticle.prong0Id() == gIassocParticle) || (triggerParticle.prong1Id() == gIassocParticle) || (triggerParticle.prongPiId() == gIassocParticle)) { + continue; // rejected pair if associated particle is same as any of daughter particle + } // endif + + // Trigger Particle Rejection + if (triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar) { + continue; + } // endif + auto yDstar = triggerParticle.y(constants::physics::MassDStar); + if (std::abs(yDstar) > yMaxDstar) { + continue; + } // endif + + registry.fill(HIST("hTriggerColCandPairCounts"), 2); // counting number of pairs + + auto binNumber = binningScheme.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + + // Fill table + if (triggerParticle.signSoftPi() > 0) { // Fill Dstar candidate + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber); + } else { // Fill AntiDstar candidate + rowsDstarHadronPair(collision.globalIndex(), + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassAntiDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber); + } // endif + + } // D-H pair loop + + } // collision loop + + } // processDataSameEvent + PROCESS_SWITCH(HfCorrelatorDstarHadron, processDataSameEvent, "process only same event data", true); + + void processDataWithMixedEvent(FilteredCollisions const& collisions, // only collisions who have altleast one D* + FilteredTracks const& tracks, + FilteredCandidates const& candidates, + aod::BCsWithTimestamps const&) + { + + auto dstarHadronTuple = std::make_tuple(candidates, tracks); + Pair pairData{binningScheme, 5, -1, collisions, dstarHadronTuple, &cache}; + + for (const auto& [c1, candidatesPerCol, c2, tracksPerCol] : pairData) { + + auto bc = c2.bc_as(); + auto timestamp = bc.timestamp(); + + for (const auto& [triggerParticle, assocParticle] : soa::combinations(soa::CombinationsFullIndexPolicy(candidatesPerCol, tracksPerCol))) { + + auto gItriggerParticle = triggerParticle.globalIndex(); + auto gIassocParticle = assocParticle.globalIndex(); + + auto yDstar = triggerParticle.y(constants::physics::MassDStar); + if (std::abs(yDstar) > yMaxDstar) { + continue; + } // endif + + int binNumber = binningScheme.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); + // Fill table + if (triggerParticle.signSoftPi() > 0) { // Fill Dstar candidate + rowsDstarHadronPair(c2.globalIndex(), // taking c2, why not c1? + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber); + } else { // Fill AntiDstar candidate + rowsDstarHadronPair(c2.globalIndex(), + gItriggerParticle, + triggerParticle.phi(), + triggerParticle.eta(), + triggerParticle.pt(), + triggerParticle.invMassAntiDstar(), + gIassocParticle, + assocParticle.phi(), + assocParticle.eta(), + assocParticle.pt(), + timestamp, + binNumber); + } // endif + + } // D-H loop + + } // Event Mixing loop + + } // processDataWithMixedEvent + PROCESS_SWITCH(HfCorrelatorDstarHadron, processDataWithMixedEvent, "process only mixed events data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 08c36a2cf54..0cafa965c60 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file taskCorrelationrDstarHadron.cxx +/// \file taskCorrelationrDstarHadron.cxx /// \author Deependra Sharma , IITB /// \author Fabrizio Grosa , CERN /// \author Shyam Kumar @@ -23,7 +23,6 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/Utils/utilsAnalysis.h" - using namespace o2; // using namespace o2::dstar; using namespace o2::framework; @@ -39,132 +38,116 @@ const TString stringSignal = "signal region;"; const TString stringSideband = "sidebands;"; const TString stringPoolBin = "Pool Bin Number;"; +namespace o2::dstar::correlation +{ +const int nBinsPtCorrelation = 8; +const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; +auto vecBinsPtCorrelations = std::vector{binsPtCorrelations, binsPtCorrelations + nBinsPtCorrelation + 1}; -namespace o2::dstar::correlation{ - const int nBinsPtCorrelation = 8; - - const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; - auto vecBinsPtCorrelations = std::vector{binsPtCorrelations, binsPtCorrelations + nBinsPtCorrelation + 1}; - - const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; - auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault , signalRegionLefBoundDefault + nBinsPtCorrelation }; +const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; +auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; - const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; - auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation }; +const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; +auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; - const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; - auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation }; +const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; +auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation}; - const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; - auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault , sidebandLeftInnerDefault + nBinsPtCorrelation }; +const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; +auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nBinsPtCorrelation}; - const double sidebandRightInnerDefault[nBinsPtCorrelation] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; - auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation }; +const double sidebandRightInnerDefault[nBinsPtCorrelation] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; +auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; - const double sidebandRightOuterDefault[nBinsPtCorrelation] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; - auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault , sidebandRightOuterDefault + nBinsPtCorrelation }; +const double sidebandRightOuterDefault[nBinsPtCorrelation] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; +auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; - const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::nBinsPt; - std::vector efficiencyDstar(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? -} +const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::nBinsPt; +std::vector efficiencyDstar(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? +} // namespace o2::dstar::correlation using namespace o2::dstar; // Dstar-Hadron correlation pair -struct HfTaskCorrelationDstarHadron{ - - Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; - // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_to_pi_k_pi (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{correlation::vecBinsPtCorrelations}, "pT bin limits for correlation plots"}; - Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for efficiency"}; - Configurable> efficiencyDstar{"efficiencyDstar", std::vector{correlation::efficiencyDstar}, "efficiency values for Dstar vs pT bin"}; - - Configurable> signalRegionLefBound{"signalRegionLefBound",std::vector{correlation::vecSignalRegionLefBoundDefault},"left boundary of signal region vs pT"}; - Configurable> signalRegionRightBound{"signalRegionRightBound",std::vector{correlation::vecSignalRegionRightBoundDefault},"right boundary of signal region vs pT"}; - Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary",std::vector{correlation::vecSidebandLeftOuterDefault},"left sideband outer boundary vs pT"}; - Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault},"left sideband inner boundary vs pT"}; - Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary",std::vector{correlation::vecSidebandRightOuterDefault},"right sideband outer baoundary vs pT"}; - Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary",std::vector{correlation::vecSidebandRightInnerDefault},"right sideband inner boundary"}; - - - - HistogramRegistry registry{ - "registry", - { - // {"hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron +stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},{50,0.,50.},{11,0.,11.},{9,0.,9.}}}}, - // {"hCorrel2DPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi +stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}}, - // {"hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}}, - // {"hDeltaPhiPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}}, - // {"hCorrel2DVsPtSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},{50,0.,50.},{11,0.,11.},{9,0.,9.}}}}, - // {"hCorrel2DPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}}, - // {"hDeltaEtaPtIntSidebands",stringDHadron + stringSideband + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}}, - // {"hDeltaPhiPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}} - } - - }; - - void init(InitContext &){ - - auto axisPtDstar = (std::vector)binsPtEfficiency; - AxisSpec axisSpecPtDstar = {axisPtDstar}; - - registry.add("hCorrel2DVsPtSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron +stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},axisSpecPtDstar,{11,0.,11.},{9,0.,9.}}}, true); - registry.add("hCorrel2DPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi +stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}, true); - registry.add("hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}, true); - registry.add("hDeltaPhiPtIntSignalRegion",stringDHadron + stringSignal + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}, true); - registry.add("hCorrel2DVsPtSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries",{HistType::kTHnSparseD,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2},axisSpecPtDstar,{11,0.,11.},{9,0.,9.}}}, true); - registry.add("hCorrel2DPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries",{HistType::kTH2D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf},{40,-2.,2}}}, true); - registry.add("hDeltaEtaPtIntSidebands",stringDHadron + stringSideband + stringDeltaEta + "entries",{HistType::kTH1D,{{40,-2.,2}}}, true); - registry.add("hDeltaPhiPtIntSidebands",stringDHadron + stringSideband + stringDeltaPhi + "entries",{HistType::kTH1D,{{64,-o2::constants::math::PIHalf, 3.*o2::constants::math::PIHalf}}}, true); +struct HfTaskCorrelationDstarHadron { + + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; + // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_to_pi_k_pi (i.e. the mass pT bins), but can be redefined via json files + Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{correlation::vecBinsPtCorrelations}, "pT bin limits for correlation plots"}; + Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for efficiency"}; + Configurable> efficiencyDstar{"efficiencyDstar", std::vector{correlation::efficiencyDstar}, "efficiency values for Dstar vs pT bin"}; + + Configurable> signalRegionLefBound{"signalRegionLefBound", std::vector{correlation::vecSignalRegionLefBoundDefault}, "left boundary of signal region vs pT"}; + Configurable> signalRegionRightBound{"signalRegionRightBound", std::vector{correlation::vecSignalRegionRightBoundDefault}, "right boundary of signal region vs pT"}; + Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary", std::vector{correlation::vecSidebandLeftOuterDefault}, "left sideband outer boundary vs pT"}; + Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; + Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{correlation::vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; + Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{correlation::vecSidebandRightInnerDefault}, "right sideband inner boundary"}; + + HistogramRegistry registry{ + "registry", + {}}; + + void init(InitContext&) + { + + auto axisPtDstar = (std::vector)binsPtEfficiency; + AxisSpec axisSpecPtDstar = {axisPtDstar}; + + registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}, axisSpecPtDstar, {11, 0., 11.}, {9, 0., 9.}}}, true); + registry.add("hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}}}, true); + registry.add("hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1D, {{40, -2., 2}}}, true); + registry.add("hDeltaPhiPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}}}, true); + registry.add("hCorrel2DVsPtSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}, axisSpecPtDstar, {11, 0., 11.}, {9, 0., 9.}}}, true); + registry.add("hCorrel2DPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}}}, true); + registry.add("hDeltaEtaPtIntSidebands", stringDHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1D, {{40, -2., 2}}}, true); + registry.add("hDeltaPhiPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}}}, true); + } + + void processData(aod::DstarHadronPair const& dstarHPairs) + { + for (const auto& dstarHPair : dstarHPairs) { + float deltaPhi = dstarHPair.deltaPhi(); + float deltaEta = dstarHPair.deltaEta(); + float ptDstar = dstarHPair.ptDstar(); + float ptTrack = dstarHPair.ptTrack(); + int poolBin = dstarHPair.poolBin(); + float massDstar = dstarHPair.mDstar(); + + int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency, ptDstar); + int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); + + // reject candidate if outside pT ranges of interst + if (corrBinPtDstar < 0 || effBinPtDstar < 0) { + continue; + } + if (ptTrack > 10.0) { + ptTrack = 10.5; + } + float netEfficiencyWeight = 1.0; + float efficiencyWeightTracks = 1.0; + + if (applyEfficiency) { + netEfficiencyWeight = 1.0 / (efficiencyDstar->at(effBinPtDstar) * efficiencyWeightTracks); + } + + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if (massDstar > signalRegionLefBound->at(ptDstar) && massDstar < signalRegionRightBound->at(ptDstar)) { + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptDstar, ptTrack, poolBin, netEfficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, netEfficiencyWeight); + } else if ((massDstar > leftSidebandOuterBoundary->at(ptDstar) && massDstar < leftSidebandInnerBoundary->at(ptDstar)) || (massDstar > rightSidebandInnerBoundary->at(ptDstar) && massDstar < rightSidebandOuterBoundary->at(ptDstar))) { + registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptDstar, ptTrack, poolBin, netEfficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, netEfficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, netEfficiencyWeight); + } } - - void processData(aod::DstarHadronPair const & dstarHPairs){ - for(const auto & dstarHPair:dstarHPairs){ - float deltaPhi = dstarHPair.deltaPhi(); - float deltaEta = dstarHPair.deltaEta(); - float ptDstar = dstarHPair.ptDstar(); - float ptTrack = dstarHPair.ptTrack(); - int poolBin = dstarHPair.poolBin(); - float massDstar = dstarHPair.mDstar(); - - int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency,ptDstar); - int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations,ptDstar); - - // reject candidate if outside pT ranges of interst - if(corrBinPtDstar < 0 || effBinPtDstar < 0){ - continue; - } - if(ptTrack > 10.0){ - ptTrack = 10.5; - } - float netEfficiencyWeight = 1.0; - float efficiencyWeightTracks = 1.0; - - if(applyEfficiency){ - netEfficiencyWeight = 1.0 / (efficiencyDstar->at(effBinPtDstar) * efficiencyWeightTracks); - } - - // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots - if(massDstar > signalRegionLefBound->at(ptDstar) && massDstar < signalRegionRightBound->at(ptDstar)){ - // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegion"),deltaPhi, deltaEta, ptDstar , ptTrack, poolBin, netEfficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSignalRegion"),deltaPhi, deltaEta, netEfficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, netEfficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, netEfficiencyWeight); - }else if((massDstar > leftSidebandOuterBoundary->at(ptDstar) && massDstar < leftSidebandInnerBoundary->at(ptDstar)) - ||(massDstar > rightSidebandInnerBoundary->at(ptDstar) && massDstar < rightSidebandOuterBoundary->at(ptDstar))){ - registry.fill(HIST("hCorrel2DVsPtSidebands"),deltaPhi, deltaEta, ptDstar , ptTrack, poolBin, netEfficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSidebands"),deltaPhi, deltaEta, netEfficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSidebands"),deltaEta, netEfficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSidebands"),deltaPhi, netEfficiencyWeight); - } - - } - - } - PROCESS_SWITCH(HfTaskCorrelationDstarHadron,processData," process data only", true); - + } + PROCESS_SWITCH(HfTaskCorrelationDstarHadron, processData, " process data only", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 666c9c7ff74407d5d515701a7c2b1039aea8e836 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Wed, 20 Mar 2024 16:38:53 +0530 Subject: [PATCH 13/19] corrected signalBand fill condition --- PWGHF/HFC/DataModel/CorrelationTables.h | 6 ++- .../TableProducer/correlatorDstarHadrons.cxx | 10 ++++- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 41 ++++++++++--------- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 2059823e095..4e013109313 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -217,6 +217,7 @@ DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); DECLARE_SOA_COLUMN(MDstar, mDstar, float); +DECLARE_SOA_COLUMN(MD0,mD0, float); // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables // DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables // Track properties @@ -230,6 +231,7 @@ DECLARE_SOA_COLUMN(PoolBin, poolBin, int); // Dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate) -> float { return (etaTrack - etaCandidate); }); DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack, phiCandidate); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0)-> float{ return (massDstar - massD0); }); } // namespace hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Informations @@ -240,6 +242,7 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Infor hf_correlation_dstar_hadron::EtaDstar, hf_correlation_dstar_hadron::PtDstar, hf_correlation_dstar_hadron::MDstar, + hf_correlation_dstar_hadron::MD0, // Track only properties hf_correlation_dstar_hadron::TrackId, hf_correlation_dstar_hadron::PhiTrack, @@ -250,7 +253,8 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Infor hf_correlation_dstar_hadron::PoolBin, // common Dynamic hf_correlation_dstar_hadron::DeltaPhi, - hf_correlation_dstar_hadron::DeltaEta); + hf_correlation_dstar_hadron::DeltaEta, + hf_correlation_dstar_hadron::DeltaM); // Table for mc matched info using RecoMatchingInfoDstars = HfCandDstarMcRec; diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index d1dbd87e1bf..732a6a057a2 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -71,7 +71,7 @@ struct HfCollisionSelector { isDstarFound = true; break; } // candidate loop - LOG(info) << "processCollisionSelWDstar: isDstarFound = " << isDstarFound; + // LOG(info) << "processCollisionSelWDstar: isDstarFound = " << isDstarFound; collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) } // collision loop } @@ -182,12 +182,17 @@ struct HfCorrelatorDstarHadron { // Fill table if (triggerParticle.signSoftPi() > 0) { // Fill Dstar candidate + + /////////////////////////////////////// + triggerParticle.invMassD0(); + /////////////////////////////////////// rowsDstarHadronPair(collision.globalIndex(), gItriggerParticle, triggerParticle.phi(), triggerParticle.eta(), triggerParticle.pt(), triggerParticle.invMassDstar(), + triggerParticle.invMassD0(), gIassocParticle, assocParticle.phi(), assocParticle.eta(), @@ -201,6 +206,7 @@ struct HfCorrelatorDstarHadron { triggerParticle.eta(), triggerParticle.pt(), triggerParticle.invMassAntiDstar(), + triggerParticle.invMassD0Bar(), gIassocParticle, assocParticle.phi(), assocParticle.eta(), @@ -249,6 +255,7 @@ struct HfCorrelatorDstarHadron { triggerParticle.eta(), triggerParticle.pt(), triggerParticle.invMassDstar(), + triggerParticle.invMassD0(), gIassocParticle, assocParticle.phi(), assocParticle.eta(), @@ -262,6 +269,7 @@ struct HfCorrelatorDstarHadron { triggerParticle.eta(), triggerParticle.pt(), triggerParticle.invMassAntiDstar(), + triggerParticle.invMassD0Bar(), gIassocParticle, assocParticle.phi(), assocParticle.eta(), diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 0cafa965c60..8b680ed085e 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -17,6 +17,7 @@ // Framework #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" // PWGHF #include "PWGHF/Core/SelectorCuts.h" @@ -42,25 +43,25 @@ namespace o2::dstar::correlation { const int nBinsPtCorrelation = 8; -const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; +const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; auto vecBinsPtCorrelations = std::vector{binsPtCorrelations, binsPtCorrelations + nBinsPtCorrelation + 1}; -const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; +const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144}; auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; -const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; +const double signalRegionRightBoundDefault[nBinsPtCorrelation] = {0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146, 0.146}; auto vecSignalRegionRightBoundDefault = std::vector{signalRegionRightBoundDefault, signalRegionRightBoundDefault + nBinsPtCorrelation}; -const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; -auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation}; +// const double sidebandLeftOuterDefault[nBinsPtCorrelation] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; +// auto vecSidebandLeftOuterDefault = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nBinsPtCorrelation}; -const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; -auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nBinsPtCorrelation}; +// const double sidebandLeftInnerDefault[nBinsPtCorrelation] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; +// auto vecSidebandLeftInnerDefault = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nBinsPtCorrelation}; -const double sidebandRightInnerDefault[nBinsPtCorrelation] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; +const double sidebandRightInnerDefault[nBinsPtCorrelation] = {0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147, 0.147}; auto vecSidebandRightInnerDefault = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nBinsPtCorrelation}; -const double sidebandRightOuterDefault[nBinsPtCorrelation] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; +const double sidebandRightOuterDefault[nBinsPtCorrelation] = {0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154, 0.154}; auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::nBinsPt; @@ -72,7 +73,7 @@ using namespace o2::dstar; // Dstar-Hadron correlation pair struct HfTaskCorrelationDstarHadron { - Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; + Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying efficiency weights"}; // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_to_pi_k_pi (i.e. the mass pT bins), but can be redefined via json files Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{correlation::vecBinsPtCorrelations}, "pT bin limits for correlation plots"}; Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for efficiency"}; @@ -80,14 +81,12 @@ struct HfTaskCorrelationDstarHadron { Configurable> signalRegionLefBound{"signalRegionLefBound", std::vector{correlation::vecSignalRegionLefBoundDefault}, "left boundary of signal region vs pT"}; Configurable> signalRegionRightBound{"signalRegionRightBound", std::vector{correlation::vecSignalRegionRightBoundDefault}, "right boundary of signal region vs pT"}; - Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary", std::vector{correlation::vecSidebandLeftOuterDefault}, "left sideband outer boundary vs pT"}; - Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; + // Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary", std::vector{correlation::vecSidebandLeftOuterDefault}, "left sideband outer boundary vs pT"}; + // Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{correlation::vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{correlation::vecSidebandRightInnerDefault}, "right sideband inner boundary"}; - HistogramRegistry registry{ - "registry", - {}}; + HistogramRegistry registry{"registry",{},OutputObjHandlingPolicy::AnalysisObject, true, true}; void init(InitContext&) { @@ -113,10 +112,12 @@ struct HfTaskCorrelationDstarHadron { float ptDstar = dstarHPair.ptDstar(); float ptTrack = dstarHPair.ptTrack(); int poolBin = dstarHPair.poolBin(); - float massDstar = dstarHPair.mDstar(); + float deltaM = dstarHPair.deltaM(); int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency, ptDstar); + LOG(info) << "efficiency index " << effBinPtDstar; int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); + LOG(info) << "correlation index " << corrBinPtDstar; // reject candidate if outside pT ranges of interst if (corrBinPtDstar < 0 || effBinPtDstar < 0) { @@ -129,17 +130,19 @@ struct HfTaskCorrelationDstarHadron { float efficiencyWeightTracks = 1.0; if (applyEfficiency) { - netEfficiencyWeight = 1.0 / (efficiencyDstar->at(effBinPtDstar) * efficiencyWeightTracks); + float efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); + LOG(info)<<"efficiencyWeightDstar "< signalRegionLefBound->at(ptDstar) && massDstar < signalRegionRightBound->at(ptDstar)) { + if (deltaM > signalRegionLefBound->at(corrBinPtDstar) && deltaM < signalRegionRightBound->at(corrBinPtDstar)) { // in signal region registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptDstar, ptTrack, poolBin, netEfficiencyWeight); registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, netEfficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, netEfficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, netEfficiencyWeight); - } else if ((massDstar > leftSidebandOuterBoundary->at(ptDstar) && massDstar < leftSidebandInnerBoundary->at(ptDstar)) || (massDstar > rightSidebandInnerBoundary->at(ptDstar) && massDstar < rightSidebandOuterBoundary->at(ptDstar))) { + } else if (/*(deltaM > leftSidebandOuterBoundary->at(corrBinPtDstar) && deltaM < leftSidebandInnerBoundary->at(corrBinPtDstar)) ||*/ (deltaM > rightSidebandInnerBoundary->at(corrBinPtDstar) && deltaM < rightSidebandOuterBoundary->at(corrBinPtDstar))) { registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptDstar, ptTrack, poolBin, netEfficiencyWeight); registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, netEfficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, netEfficiencyWeight); From 981279dbcdf814557477ecdabaf9773365c35bab Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 20 Mar 2024 11:11:01 +0000 Subject: [PATCH 14/19] Please consider the following formatting changes --- PWGHF/HFC/DataModel/CorrelationTables.h | 4 ++-- PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx | 4 ++-- PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 4e013109313..7db3702e5a0 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -217,7 +217,7 @@ DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); DECLARE_SOA_COLUMN(MDstar, mDstar, float); -DECLARE_SOA_COLUMN(MD0,mD0, float); +DECLARE_SOA_COLUMN(MD0, mD0, float); // DECLARE_SOA_COLUMN(IsPrompt,isPrompt,bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables // DECLARE_SOA_COLUMN(MatchingStatus, matchingStatus, bool); // although this also defined in (HfCandDstarMcRec HfCandDstarMcRec) tables // Track properties @@ -231,7 +231,7 @@ DECLARE_SOA_COLUMN(PoolBin, poolBin, int); // Dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate) -> float { return (etaTrack - etaCandidate); }); DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack, phiCandidate); }); -DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0)-> float{ return (massDstar - massD0); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0) -> float { return (massDstar - massD0); }); } // namespace hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Informations diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 732a6a057a2..eb3f4455f09 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -183,9 +183,9 @@ struct HfCorrelatorDstarHadron { // Fill table if (triggerParticle.signSoftPi() > 0) { // Fill Dstar candidate - /////////////////////////////////////// + /////////////////////////////////////// triggerParticle.invMassD0(); - /////////////////////////////////////// + /////////////////////////////////////// rowsDstarHadronPair(collision.globalIndex(), gItriggerParticle, triggerParticle.phi(), diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 8b680ed085e..f18337b1c2a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -86,7 +86,7 @@ struct HfTaskCorrelationDstarHadron { Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{correlation::vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{correlation::vecSidebandRightInnerDefault}, "right sideband inner boundary"}; - HistogramRegistry registry{"registry",{},OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; void init(InitContext&) { @@ -131,7 +131,7 @@ struct HfTaskCorrelationDstarHadron { if (applyEfficiency) { float efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); - LOG(info)<<"efficiencyWeightDstar "< Date: Mon, 25 Mar 2024 21:19:19 +0530 Subject: [PATCH 15/19] applying some naming convention first try --- .../TableProducer/dataCreatorDV0Reduced.cxx | 2 +- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 2 +- PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx | 4 +- .../DataModel/CandidateReconstructionTables.h | 3 +- PWGHF/HFC/DataModel/CorrelationTables.h | 25 ++----- PWGHF/HFC/TableProducer/CMakeLists.txt | 2 +- .../TableProducer/correlatorDstarHadrons.cxx | 56 +++++++------- .../HFC/Tasks/taskCorrelationDstarHadrons.cxx | 74 +++++++++---------- .../candidateSelectorDstarToD0Pi.cxx | 2 +- .../TableProducer/treeCreatorDstarToD0Pi.cxx | 4 +- 10 files changed, 81 insertions(+), 93 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorDV0Reduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorDV0Reduced.cxx index cc89b6beb5d..59ed956f087 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorDV0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorDV0Reduced.cxx @@ -106,7 +106,7 @@ struct HfDataCreatorDV0Reduced { bool isHfCandResoConfigFilled = false; using CandsDplusFiltered = soa::Filtered>; - using CandDstarFiltered = soa::Filtered>; + using CandDstarFiltered = soa::Filtered>; using BigTracksPID = soa::Join; Filter filterSelectDplus = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 5228e43d0b4..d90cc545b07 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -63,7 +63,7 @@ enum MassHyposLcToPKPi : uint8_t { } // namespace o2::aod struct TaskPolarisationCharmHadrons { - using CandDstarWSelFlag = soa::Join; + using CandDstarWSelFlag = soa::Join; using CandLcToPKPiWSelFlag = soa::Join; float massPi{0.f}; diff --git a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx index 2fcf7af88e9..ea11c0c8a98 100644 --- a/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx +++ b/PWGHF/D2H/Tasks/taskDstarToD0Pi.cxx @@ -36,10 +36,10 @@ struct HfTaskDstarToD0Pi { Configurable selectionFlagHfD0ToPiK{"selectionFlagHfD0ToPiK", true, "Selection Flag for HF flagged candidates"}; Configurable> ptBins{"ptBins", std::vector{hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for Dstar"}; - using CandDstarWSelFlag = soa::Join; + using CandDstarWSelFlag = soa::Join; /// @brief specially for MC data // full reconstructed Dstar candidate - using CandDstarWSelFlagMcRec = soa::Join; + using CandDstarWSelFlagMcRec = soa::Join; using CandDstarMcGen = soa::Join; Partition rowsSelectedCandDstar = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 58132303f1b..e4d8cefbc0f 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1750,7 +1750,8 @@ DECLARE_SOA_TABLE(HfCandDstarBase, "AOD", "HFCANDDSTRBASE", DECLARE_SOA_EXTENDED_TABLE_USER(HfCandDstarExt, HfCandDstarBase, "HFCANDDSTREXT", hf_cand_dstar::PxDstar, hf_cand_dstar::PyDstar, hf_cand_dstar::PzDstar); -using HfCandDstar = HfCandDstarExt; +using HfCandDstars = HfCandDstarExt; +using HfCandDstar = HfCandDstars::iterator; // table with results of reconstruction level MC matching DECLARE_SOA_TABLE(HfCandDstarMcRec, "AOD", "HFCANDDSTRMCREC", diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 4e013109313..b751604b623 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -16,11 +16,11 @@ #ifndef PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ #define PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ -// O2 +#include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisDataModel.h" -// O2Physics + #include "Common/Core/RecoDecay.h" -// PWGCF + #include "PWGHF/DataModel/CandidateReconstructionTables.h" namespace o2::aod @@ -206,13 +206,11 @@ DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", //! D+-Hadrons p aod::hf_correlation_dplus_hadron::SignalStatus); // definition of columns and tables for Dstar-Hadron correlation pair -using Dstars = HfCandDstar; -using Dstar = Dstars::iterator; namespace hf_correlation_dstar_hadron { DECLARE_SOA_INDEX_COLUMN(Collision, collision); // Dstar candidate properties -DECLARE_SOA_INDEX_COLUMN(Dstar, dstar); +DECLARE_SOA_INDEX_COLUMN(HfCandDstar, hfCandDstar); DECLARE_SOA_COLUMN(PhiDstar, phiDstar, float); DECLARE_SOA_COLUMN(EtaDstar, etaDstar, float); DECLARE_SOA_COLUMN(PtDstar, ptDstar, float); @@ -230,14 +228,14 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); DECLARE_SOA_COLUMN(PoolBin, poolBin, int); // Dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate) -> float { return (etaTrack - etaCandidate); }); -DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack, phiCandidate); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack - phiCandidate,-o2::constants::math::PIHalf); }); DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0)-> float{ return (massDstar - massD0); }); } // namespace hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Informations hf_correlation_dstar_hadron::CollisionId, // D* only properties - hf_correlation_dstar_hadron::DstarId, + hf_correlation_dstar_hadron::HfCandDstarId, hf_correlation_dstar_hadron::PhiDstar, hf_correlation_dstar_hadron::EtaDstar, hf_correlation_dstar_hadron::PtDstar, @@ -256,17 +254,6 @@ DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Infor hf_correlation_dstar_hadron::DeltaEta, hf_correlation_dstar_hadron::DeltaM); -// Table for mc matched info -using RecoMatchingInfoDstars = HfCandDstarMcRec; -using RecoMatchingInfoDstar = RecoMatchingInfoDstars::iterator; - -namespace hf_correlation_dstar_hadron -{ -DECLARE_SOA_INDEX_COLUMN(RecoMatchingInfoDstar, recoMatchingInfoDstar); -} -DECLARE_SOA_TABLE(DstarHadronRecoInfo, "AOD", "DSTARHRECOINFO", // D* Hadrons pairs Reconstructed Informations - hf_correlation_dstar_hadron::RecoMatchingInfoDstarId); - // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision { diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index 10858cd274a..f2291cf6ef4 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -44,7 +44,7 @@ o2physics_add_dpl_workflow(correlator-ds-hadrons PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(correlator-dstar-hadron +o2physics_add_dpl_workflow(correlator-dstar-hadrons SOURCES correlatorDstarHadrons.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 732a6a057a2..4d745690865 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file correlatorDstarHadron.cxx +/// \file correlatorDstarHadrons.cxx /// \author Deependra Sharma , IITB /// \author Fabrizio Grosa , CERN @@ -23,23 +23,23 @@ #include "Common/DataModel/Multiplicity.h" // PWGHF -#include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/HFC/DataModel/CorrelationTables.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; // flaging a collision if D* meson is found. -struct HfCollisionSelector { +struct HfCorrelatorDstarHadronsCollisionSelector { Produces collisionWDstar; Configurable selectionFlagDstar{"selectionFlagDstar", true, "selection flag for Dstar"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - using DstarCandidates = soa::Join; + using DstarCandidates = soa::Join; using FilteredCandidates = soa::Filtered; SliceCache cache; @@ -75,26 +75,26 @@ struct HfCollisionSelector { collisionWDstar(isDstarFound); // compatible with collision table (filled collision by collision) } // collision loop } - PROCESS_SWITCH(HfCollisionSelector, processCollisionSelWDstar, "process only data for dstar hadron correlation", true); + PROCESS_SWITCH(HfCorrelatorDstarHadronsCollisionSelector, processCollisionSelWDstar, "process only data for dstar hadron correlation", true); }; -struct HfCorrelatorDstarHadron { +struct HfCorrelatorDstarHadrons { Produces rowsDstarHadronPair; // Dstar candidate related configurable Configurable selectOnlyCollisionWDstar{"selectOnlyCollisionWDstar", true, " select on collisions which have atleast a Dstar candidate"}; Configurable selectionFlagDstar{"selectionFlagDstar", true, "selection flag for Dstar"}; - Configurable pTMinDstar{"pTMinDstar", 1.5, "min pT of dstar candidate"}; - Configurable pTMaxDstar{"pTMaxDstar", 50, "max pT of dstar Candidate"}; - // Configurable etaAbsMaxDstar{"etaAbsMaxDstar",1.0,"max Abs(eta) cut on Dstar candidate"}; - Configurable yMaxDstar{"yMaxDstar", 0.8, "max. cand. rapidity"}; + Configurable ptDstarMin{"ptDstarMin", 1.5, "min pT of dstar candidate"}; + Configurable ptDstarMax{"ptDstarMax", 50, "max pT of dstar Candidate"}; + // Configurable etaAbsDstarMax{"etaAbsDstarMax",1.0,"max Abs(eta) cut on Dstar candidate"}; + Configurable yAbsDstarMax{"yAbsDstarMax", 0.8, "max. cand. rapidity"}; // track related configurable - Configurable etaAbsMaxAssoTrack{"etaAbsMaxAssoTrack", 0.8, "max Abs(eta) cut on Associated Track"}; - Configurable dcaxyMinAssoTrack{"dcaxyMinAssoTrack", 0.0, "min DCAxy of Associated Track"}; - Configurable dcaxyMaxAssoTrack{"dcaxyMaxAssoTrack", 10.0, "max DCAxy of Associated Track"}; - Configurable dcazMinAssoTrack{"dcazMinAssoTrack", 0.0, "min DCAz of Associated Track"}; - Configurable dcazMaxAssoTrack{"dcazMaxAssoTrack", 10.0, "max DCAz of Associated Track"}; - Configurable pTMinAssoTrack{"pTMinAssoTrack", 0.5, "min Pt of Associated Track"}; - Configurable pTMaxAssoTrack{"pTMaxAssoTrack", 50.0, "max pT of Associated Track"}; + Configurable etaAbsAssoTrackMax{"etaAbsAssoTrackMax", 0.8, "max Abs(eta) cut on Associated Track"}; + Configurable dcaxyAssoTrackMin{"dcaxyAssoTrackMin", 0.0, "min DCAxy of Associated Track"}; + Configurable dcaxyAssoTrackMax{"dcaxyAssoTrackMax", 10.0, "max DCAxy of Associated Track"}; + Configurable dcazAssoTrackMin{"dcazAssoTrackMin", 0.0, "min DCAz of Associated Track"}; + Configurable dcazAssoTrackMax{"dcazAssoTrackMax", 10.0, "max DCAz of Associated Track"}; + Configurable ptAssoTrackMin{"ptAssoTrackMin", 0.5, "min Pt of Associated Track"}; + Configurable ptAssoTrackMax{"ptAssoTrackMax", 50.0, "max pT of Associated Track"}; ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; @@ -109,7 +109,7 @@ struct HfCorrelatorDstarHadron { using FilteredCollisions = soa::Filtered; // candidate table - using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id), so no need to add table HfCandD0Fromdstar + using DstarCandidates = soa::Join; // Added extra cloumns in HfCandDstar (Prong0Id, Prong1Id), so no need to add table HfCandD0Fromdstar using FilteredCandidates = soa::Filtered; using FilteredTracks = soa::Filtered; @@ -119,9 +119,9 @@ struct HfCorrelatorDstarHadron { // candidate filter Filter candidateFilter = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; // track table filter - Filter trackFilter = nabs(aod::track::eta) <= etaAbsMaxAssoTrack && aod::track::pt >= pTMinAssoTrack && aod::track::pt <= pTMaxAssoTrack && - aod::track::dcaXY >= dcaxyMinAssoTrack && aod::track::dcaXY <= dcaxyMaxAssoTrack && - aod::track::dcaZ >= dcazMinAssoTrack && aod::track::dcaZ <= dcazMaxAssoTrack; + Filter trackFilter = nabs(aod::track::eta) <= etaAbsAssoTrackMax && aod::track::pt >= ptAssoTrackMin && aod::track::pt <= ptAssoTrackMax && + aod::track::dcaXY >= dcaxyAssoTrackMin && aod::track::dcaXY <= dcaxyAssoTrackMax && + aod::track::dcaZ >= dcazAssoTrackMin && aod::track::dcaZ <= dcazAssoTrackMax; SliceCache cache; // Preslice perColCandidates = aod::hf_cand::collisionId; Preslice perColCandidates = aod::hf_cand::collisionId; @@ -168,11 +168,11 @@ struct HfCorrelatorDstarHadron { } // endif // Trigger Particle Rejection - if (triggerParticle.pt() > pTMaxDstar || triggerParticle.pt() < pTMinDstar) { + if (triggerParticle.pt() > ptDstarMax || triggerParticle.pt() < ptDstarMin) { continue; } // endif auto yDstar = triggerParticle.y(constants::physics::MassDStar); - if (std::abs(yDstar) > yMaxDstar) { + if (std::abs(yDstar) > yAbsDstarMax) { continue; } // endif @@ -220,7 +220,7 @@ struct HfCorrelatorDstarHadron { } // collision loop } // processDataSameEvent - PROCESS_SWITCH(HfCorrelatorDstarHadron, processDataSameEvent, "process only same event data", true); + PROCESS_SWITCH(HfCorrelatorDstarHadrons, processDataSameEvent, "process only same event data", true); void processDataWithMixedEvent(FilteredCollisions const& collisions, // only collisions who have altleast one D* FilteredTracks const& tracks, @@ -242,7 +242,7 @@ struct HfCorrelatorDstarHadron { auto gIassocParticle = assocParticle.globalIndex(); auto yDstar = triggerParticle.y(constants::physics::MassDStar); - if (std::abs(yDstar) > yMaxDstar) { + if (std::abs(yDstar) > yAbsDstarMax) { continue; } // endif @@ -283,11 +283,11 @@ struct HfCorrelatorDstarHadron { } // Event Mixing loop } // processDataWithMixedEvent - PROCESS_SWITCH(HfCorrelatorDstarHadron, processDataWithMixedEvent, "process only mixed events data", false); + PROCESS_SWITCH(HfCorrelatorDstarHadrons, processDataWithMixedEvent, "process only mixed events data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } \ No newline at end of file diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 8b680ed085e..358cfd015b5 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -9,15 +9,15 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file taskCorrelationrDstarHadron.cxx +/// \file taskCorrelationDstarHadrons.cxx /// \author Deependra Sharma , IITB /// \author Fabrizio Grosa , CERN /// \author Shyam Kumar // Framework #include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" #include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" // PWGHF #include "PWGHF/Core/SelectorCuts.h" @@ -25,7 +25,6 @@ #include "PWGHF/Utils/utilsAnalysis.h" using namespace o2; -// using namespace o2::dstar; using namespace o2::framework; using namespace o2::framework::expressions; @@ -39,12 +38,11 @@ const TString stringSignal = "signal region;"; const TString stringSideband = "sidebands;"; const TString stringPoolBin = "Pool Bin Number;"; -namespace o2::dstar::correlation -{ + const int nBinsPtCorrelation = 8; -const double binsPtCorrelations[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; -auto vecBinsPtCorrelations = std::vector{binsPtCorrelations, binsPtCorrelations + nBinsPtCorrelation + 1}; +const double binsPtCorrelationsDefault[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; +auto vecBinsPtCorrelationsDefault = std::vector{binsPtCorrelationsDefault, binsPtCorrelationsDefault + nBinsPtCorrelation + 1}; const double signalRegionLefBoundDefault[nBinsPtCorrelation] = {0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144, 0.144}; auto vecSignalRegionLefBoundDefault = std::vector{signalRegionLefBoundDefault, signalRegionLefBoundDefault + nBinsPtCorrelation}; @@ -65,26 +63,23 @@ const double sidebandRightOuterDefault[nBinsPtCorrelation] = {0.154, 0.154, 0.15 auto vecSidebandRightOuterDefault = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nBinsPtCorrelation}; const int npTBinsEfficiency = o2::analysis::hf_cuts_dstar_to_d0_pi::nBinsPt; -std::vector efficiencyDstar(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? -} // namespace o2::dstar::correlation - -using namespace o2::dstar; +std::vector vecEfficiencyDstarDefault(npTBinsEfficiency); // line # 76 in taskCorrelationDstarHadron.cxx; why (npTBinsEfficiency+1) ? // Dstar-Hadron correlation pair -struct HfTaskCorrelationDstarHadron { +struct HfTaskCorrelationDstarHadrons { Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying efficiency weights"}; // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_to_pi_k_pi (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{correlation::vecBinsPtCorrelations}, "pT bin limits for correlation plots"}; + Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelationsDefault}, "pT bin limits for correlation plots"}; Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_dstar_to_d0_pi::vecBinsPt}, "pT bin limits for efficiency"}; - Configurable> efficiencyDstar{"efficiencyDstar", std::vector{correlation::efficiencyDstar}, "efficiency values for Dstar vs pT bin"}; + Configurable> efficiencyDstar{"efficiencyDstar", std::vector{vecEfficiencyDstarDefault}, "efficiency values for Dstar vs pT bin"}; - Configurable> signalRegionLefBound{"signalRegionLefBound", std::vector{correlation::vecSignalRegionLefBoundDefault}, "left boundary of signal region vs pT"}; - Configurable> signalRegionRightBound{"signalRegionRightBound", std::vector{correlation::vecSignalRegionRightBoundDefault}, "right boundary of signal region vs pT"}; - // Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary", std::vector{correlation::vecSidebandLeftOuterDefault}, "left sideband outer boundary vs pT"}; - // Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{correlation::vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; - Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{correlation::vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; - Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{correlation::vecSidebandRightInnerDefault}, "right sideband inner boundary"}; + Configurable> signalRegionLefBound{"signalRegionLefBound", std::vector{vecSignalRegionLefBoundDefault}, "left boundary of signal region vs pT"}; + Configurable> signalRegionRightBound{"signalRegionRightBound", std::vector{vecSignalRegionRightBoundDefault}, "right boundary of signal region vs pT"}; + // Configurable> leftSidebandOuterBoundary{"leftSidebandOuterBoundary", std::vector{vecSidebandLeftOuterDefault}, "left sideband outer boundary vs pT"}; + // Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; + Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; + Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{vecSidebandRightInnerDefault}, "right sideband inner boundary"}; HistogramRegistry registry{"registry",{},OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -93,15 +88,19 @@ struct HfTaskCorrelationDstarHadron { auto axisPtDstar = (std::vector)binsPtEfficiency; AxisSpec axisSpecPtDstar = {axisPtDstar}; - - registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}, axisSpecPtDstar, {11, 0., 11.}, {9, 0., 9.}}}, true); - registry.add("hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}}}, true); - registry.add("hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1D, {{40, -2., 2}}}, true); - registry.add("hDeltaPhiPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}}}, true); - registry.add("hCorrel2DVsPtSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}, axisSpecPtDstar, {11, 0., 11.}, {9, 0., 9.}}}, true); - registry.add("hCorrel2DPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2}}}, true); - registry.add("hDeltaEtaPtIntSidebands", stringDHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1D, {{40, -2., 2}}}, true); - registry.add("hDeltaPhiPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1D, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}}}, true); + AxisSpec axisSpecDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; + AxisSpec axisSpecDeltaEta = {40,-2.,2.}; + AxisSpec axisSpecPtHadron = {11,0.,11}; + AxisSpec axisSpecPoolBin = {9,0.,9.}; + + registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {axisSpecDeltaPhi, axisSpecDeltaEta, axisSpecPtDstar, axisSpecPtHadron, axisSpecPoolBin}}, true); + registry.add("hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {axisSpecDeltaPhi, axisSpecDeltaEta}}, true); + registry.add("hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1D, {axisSpecDeltaEta}}, true); + registry.add("hDeltaPhiPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1D, {axisSpecDeltaPhi}}, true); + registry.add("hCorrel2DVsPtSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {axisSpecDeltaPhi, axisSpecDeltaEta, axisSpecPtDstar, axisSpecPtHadron, axisSpecPoolBin}}, true); + registry.add("hCorrel2DPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {axisSpecDeltaPhi, axisSpecDeltaEta}}, true); + registry.add("hDeltaEtaPtIntSidebands", stringDHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1D, {axisSpecDeltaEta}}, true); + registry.add("hDeltaPhiPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1D, {axisSpecDeltaPhi}}, true); } void processData(aod::DstarHadronPair const& dstarHPairs) @@ -115,23 +114,24 @@ struct HfTaskCorrelationDstarHadron { float deltaM = dstarHPair.deltaM(); int effBinPtDstar = o2::analysis::findBin(binsPtEfficiency, ptDstar); - LOG(info) << "efficiency index " << effBinPtDstar; + // LOG(info) << "efficiency index " << effBinPtDstar; int corrBinPtDstar = o2::analysis::findBin(binsPtCorrelations, ptDstar); - LOG(info) << "correlation index " << corrBinPtDstar; + // LOG(info) << "correlation index " << corrBinPtDstar; // reject candidate if outside pT ranges of interst if (corrBinPtDstar < 0 || effBinPtDstar < 0) { continue; } - if (ptTrack > 10.0) { - ptTrack = 10.5; - } + // Why the follwing condition in Dplus task? + // if (ptTrack > 10.0) { + // ptTrack = 10.5; + // } float netEfficiencyWeight = 1.0; float efficiencyWeightTracks = 1.0; if (applyEfficiency) { float efficiencyWeightDstar = efficiencyDstar->at(effBinPtDstar); - LOG(info)<<"efficiencyWeightDstar "<(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx index bd26eb4c97f..fdbb1e2dbbb 100644 --- a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx @@ -102,7 +102,7 @@ struct HfCandidateSelectorDstarToD0Pi { using TracksSel = soa::Join; // using TracksSel = soa::Join; - using HfFullDstarCandidate = soa::Join; + using HfFullDstarCandidate = soa::Join; AxisSpec axisBdtScore{100, 0.f, 1.f}; AxisSpec axisSelStatus{2, -0.5f, 1.5f}; diff --git a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx index c33d5733a6c..19ba358527e 100644 --- a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx @@ -251,8 +251,8 @@ struct HfTreeCreatorDstarToD0Pi { Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; - using CandDstarWSelFlag = soa::Filtered>; - using CandDstarWSelFlagMcRec = soa::Filtered>; + using CandDstarWSelFlag = soa::Filtered>; + using CandDstarWSelFlagMcRec = soa::Filtered>; using TracksWPid = soa::Join; using CandDstarMcGen = soa::Filtered>; From 34efd3c2e139f03dea2c2505940aac74f8a4c335 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Mon, 25 Mar 2024 22:53:22 +0530 Subject: [PATCH 16/19] added configurables axies --- PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index 022712f4bb7..f472355416e 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -80,6 +80,11 @@ struct HfTaskCorrelationDstarHadrons { // Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{vecSidebandRightInnerDefault}, "right sideband inner boundary"}; + Configurable nBinsDeltaPhi{"nBinsDeltaPhi",64,"number of bins in delta phi axis"}; + + ConfigurableAxis deltaEtaBinEdges{"deltaEtaBinEdges",{40,-2.,2.}," Delta Eta Bins of equal width"}; + ConfigurableAxis ptHadronBinsEdges{"ptHadronBinsEdges",{11,0.,11.},"pT Bins of equal width for Hadrons"}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -88,9 +93,9 @@ struct HfTaskCorrelationDstarHadrons { auto axisPtDstar = (std::vector)binsPtEfficiency; AxisSpec axisSpecPtDstar = {axisPtDstar}; - AxisSpec axisSpecDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; - AxisSpec axisSpecDeltaEta = {40,-2.,2.}; - AxisSpec axisSpecPtHadron = {11,0.,11}; + AxisSpec axisSpecDeltaPhi = {nBinsDeltaPhi, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; + AxisSpec axisSpecDeltaEta = {deltaEtaBinEdges}; + AxisSpec axisSpecPtHadron = {ptHadronBinsEdges}; AxisSpec axisSpecPoolBin = {9,0.,9.}; registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {axisSpecDeltaPhi, axisSpecDeltaEta, axisSpecPtDstar, axisSpecPtHadron, axisSpecPoolBin}}, true); From ca323f83a1112c9914c211786ce319bd45768332 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Wed, 27 Mar 2024 16:16:33 +0530 Subject: [PATCH 17/19] Formatting changes applied --- PWGHF/HFC/DataModel/CorrelationTables.h | 4 ++-- PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx | 2 +- PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 3df0746e838..44a095bb6c5 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -228,8 +228,8 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); DECLARE_SOA_COLUMN(PoolBin, poolBin, int); // Dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(DeltaEta, deltaEta, [](float etaTrack, float etaCandidate) -> float { return (etaTrack - etaCandidate); }); -DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack - phiCandidate,-o2::constants::math::PIHalf); }); -DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0)-> float{ return (massDstar - massD0); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaPhi, deltaPhi, [](float phiCandidate, float phiTrack) -> float { return RecoDecay::constrainAngle(phiTrack - phiCandidate, -o2::constants::math::PIHalf); }); +DECLARE_SOA_DYNAMIC_COLUMN(DeltaM, deltaM, [](float massDstar, float massD0) -> float { return (massDstar - massD0); }); } // namespace hf_correlation_dstar_hadron DECLARE_SOA_TABLE(DstarHadronPair, "AOD", "DSTRHPAIR", // D* Hadrons pairs Informations diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index c914c9001f8..3374fa5a600 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -290,4 +290,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index f472355416e..609f213ae3a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -38,7 +38,6 @@ const TString stringSignal = "signal region;"; const TString stringSideband = "sidebands;"; const TString stringPoolBin = "Pool Bin Number;"; - const int nBinsPtCorrelation = 8; const double binsPtCorrelationsDefault[nBinsPtCorrelation + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 100.}; @@ -80,11 +79,10 @@ struct HfTaskCorrelationDstarHadrons { // Configurable> leftSidebandInnerBoundary{"leftSidebandInnerBoundary", std::vector{vecSidebandLeftInnerDefault}, "left sideband inner boundary vs pT"}; Configurable> rightSidebandOuterBoundary{"rightSidebandOuterBoundary", std::vector{vecSidebandRightOuterDefault}, "right sideband outer baoundary vs pT"}; Configurable> rightSidebandInnerBoundary{"rightSidebandInnerBoundary", std::vector{vecSidebandRightInnerDefault}, "right sideband inner boundary"}; - Configurable nBinsDeltaPhi{"nBinsDeltaPhi",64,"number of bins in delta phi axis"}; - - ConfigurableAxis deltaEtaBinEdges{"deltaEtaBinEdges",{40,-2.,2.}," Delta Eta Bins of equal width"}; - ConfigurableAxis ptHadronBinsEdges{"ptHadronBinsEdges",{11,0.,11.},"pT Bins of equal width for Hadrons"}; + Configurable nBinsDeltaPhi{"nBinsDeltaPhi", 64, "number of bins in delta phi axis"}; + ConfigurableAxis deltaEtaBinEdges{"deltaEtaBinEdges", {40, -2., 2.}, " Delta Eta Bins of equal width"}; + ConfigurableAxis ptHadronBinsEdges{"ptHadronBinsEdges", {11, 0., 11.}, "pT Bins of equal width for Hadrons"}; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -96,7 +94,7 @@ struct HfTaskCorrelationDstarHadrons { AxisSpec axisSpecDeltaPhi = {nBinsDeltaPhi, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; AxisSpec axisSpecDeltaEta = {deltaEtaBinEdges}; AxisSpec axisSpecPtHadron = {ptHadronBinsEdges}; - AxisSpec axisSpecPoolBin = {9,0.,9.}; + AxisSpec axisSpecPoolBin = {9, 0., 9.}; registry.add("hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {axisSpecDeltaPhi, axisSpecDeltaEta, axisSpecPtDstar, axisSpecPtHadron, axisSpecPoolBin}}, true); registry.add("hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2D, {axisSpecDeltaPhi, axisSpecDeltaEta}}, true); From 8a7912fb304c3008d55a27ab92ccf26e6c1f4fbe Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Thu, 28 Mar 2024 17:54:52 +0530 Subject: [PATCH 18/19] added check to mutually exclusive process functions --- PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index 3374fa5a600..f22f18b9bfd 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -135,6 +135,11 @@ struct HfCorrelatorDstarHadrons { void init(InitContext&) { binningScheme = {{binsZVtx, binsMultiplicity}, true}; + + std::array processes = {doprocessDataSameEvent, doprocessDataWithMixedEvent}; + if (std::accumulate(processes.begin(), processes.end(), 0) != 1) { + LOGP(fatal, "One and only one process function must be enabled at a time."); + } } void processDataSameEvent(FilteredCollisions const& collisions, // only collisions who have altleast one D* From 9dafb819976d954765396e1d2d539af8dc9ea306 Mon Sep 17 00:00:00 2001 From: Deependra Sharma Date: Thu, 28 Mar 2024 18:07:44 +0530 Subject: [PATCH 19/19] modified init method, applied check firts in init method --- PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx index f22f18b9bfd..d5ba6a10efc 100644 --- a/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDstarHadrons.cxx @@ -134,12 +134,12 @@ struct HfCorrelatorDstarHadrons { void init(InitContext&) { - binningScheme = {{binsZVtx, binsMultiplicity}, true}; - std::array processes = {doprocessDataSameEvent, doprocessDataWithMixedEvent}; if (std::accumulate(processes.begin(), processes.end(), 0) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } + + binningScheme = {{binsZVtx, binsMultiplicity}, true}; } void processDataSameEvent(FilteredCollisions const& collisions, // only collisions who have altleast one D*