From 5880c77959d1e2ddcc5a66827dc2fdc0742451ec Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Wed, 25 Dec 2024 19:30:02 +0900 Subject: [PATCH] [PWGEM/Dilepton] update table producers (#9127) --- .../TableProducer/createEMEventDilepton.cxx | 118 ------------------ .../TableProducer/filterDielectronEvent.cxx | 37 ++---- .../TableProducer/skimmerPrimaryElectron.cxx | 109 ++++++++-------- PWGEM/Dilepton/Tasks/eventQC.cxx | 37 ++++-- 4 files changed, 95 insertions(+), 206 deletions(-) diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index 9d60b093bb0..5d57b999491 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -329,128 +329,10 @@ struct AssociateDileptonToEMEvent { PROCESS_SWITCH(AssociateDileptonToEMEvent, processFwdMuon, "process forward muon indexing", false); PROCESS_SWITCH(AssociateDileptonToEMEvent, processDummy, "process dummy", true); }; -struct EMEventPropertyTask { - SliceCache cache; - Preslice perCollision = aod::track::collisionId; - using Run3Tracks = soa::Join; - - Configurable fillQAHistogram{"fillQAHistogram", false, "flag to fill QA histograms"}; - - Produces evprop; - struct : ConfigurableGroup { - std::string prefix = "spherocity_cutgroup"; - Configurable require_isPVContributor{"require_isPVContributor", false, "require tracks to be PV contributors"}; - Configurable min_ntrack{"min_ntrack", 3, "min. number of tracks"}; - Configurable min_pt{"min_pt", 0.15, "min. pT of track in GeV/c"}; - Configurable min_eta{"min_eta", -0.8, "min. eta of track"}; - Configurable max_eta{"max_eta", +0.8, "max. eta of track"}; - Configurable max_dcaxy{"max_dcaxy", 2.4, "max. DCAxy of track in cm"}; - Configurable max_dcaz{"max_dcaz", 3.2, "max. DCAz of track in cm"}; - Configurable min_ncluster_tpc{"min_ncluster_tpc", 50, "min. number of TPC clusters"}; - Configurable max_chi2tpc{"max_chi2tpc", 4.0, "max. chi2/ncls TPC"}; - } spherocity_cuts; - - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - void init(InitContext&) - { - if (fillQAHistogram) { - fRegistry.add("Spherocity/hPt", "pT;p_{T} (GeV/c)", kTH1F, {{200, 0.0f, 10}}, false); - fRegistry.add("Spherocity/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{180, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false); - fRegistry.add("Spherocity/hSpherocity_ptweighted", "spherocity;Number of used tracks;spherocity", kTH2F, {{101, -0.5, 100.5}, {100, 0.0f, 1}}, false); - fRegistry.add("Spherocity/hSpherocity_ptunweighted", "spherocity;Number of used tracks;spherocity", kTH2F, {{101, -0.5, 100.5}, {100, 0.0f, 1}}, false); - } - } - - template - int getSpherocity(TTracks const& tracks, float& spherocity_ptweighted, float& spherocity_ptunweighted) - { - // Reference for spherocity : https://arxiv.org/pdf/1905.07208, https://arxiv.org/abs/2310.20406, https://arxiv.org/abs/1205.3963 - int used_ntrack_spherocity = 0; - float sum_pt = 0.f, sum_ntrack = 0.f; - - for (auto const& track : tracks) { - if (spherocity_cuts.require_isPVContributor && !track.isPVContributor()) { - continue; - } - if (track.tpcNClsFound() < spherocity_cuts.min_ncluster_tpc) { - continue; - } - - sum_pt += track.pt(); - sum_ntrack += 1.f; - - if (fillQAHistogram) { - fRegistry.fill(HIST("Spherocity/hPt"), track.pt()); - fRegistry.fill(HIST("Spherocity/hEtaPhi"), track.phi(), track.eta()); - } - used_ntrack_spherocity++; - } // end of track loop per collision - - float tempSph = 1.f, tempSph_pt1 = 1.f; - for (int i = 0; i < 360 / 0.1; i++) { - float nx = std::cos(M_PI / 180.f * i * 0.1); - float ny = std::sin(M_PI / 180.f * i * 0.1); - float sum_crossprod = 0.f, sum_crossprod_pt1 = 0.f; - for (auto const& track : tracks) { - if (spherocity_cuts.require_isPVContributor && !track.isPVContributor()) { - continue; - } - if (track.tpcNClsFound() < spherocity_cuts.min_ncluster_tpc) { - continue; - } - float px = track.px(); - float py = track.py(); - sum_crossprod += abs(px * ny - py * nx); - sum_crossprod_pt1 += abs(std::cos(track.phi()) * ny - std::sin(track.phi()) * nx); - } - float sph = std::pow(sum_crossprod / sum_pt, 2); - float sph_pt1 = std::pow(sum_crossprod_pt1 / sum_ntrack, 2); - if (sph < tempSph) { - tempSph = sph; - } - if (sph_pt1 < tempSph_pt1) { - tempSph_pt1 = sph_pt1; - } - } // end of track loop per collision - spherocity_ptweighted = std::pow(M_PI_2, 2) * tempSph; - spherocity_ptunweighted = std::pow(M_PI_2, 2) * tempSph_pt1; - if (used_ntrack_spherocity < spherocity_cuts.min_ntrack) { - spherocity_ptweighted = -1.f; - spherocity_ptunweighted = -1.f; - } - return used_ntrack_spherocity; - } - - Partition tracks_for_spherocity = spherocity_cuts.min_pt < aod::track::pt && spherocity_cuts.min_eta < o2::aod::track::eta && o2::aod::track::eta < spherocity_cuts.max_eta && nabs(o2::aod::track::dcaXY) < spherocity_cuts.max_dcaxy && nabs(o2::aod::track::dcaZ) < spherocity_cuts.max_dcaz && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC) == true && o2::aod::track::tpcChi2NCl < spherocity_cuts.max_chi2tpc; // ITS-TPC matched tracks - - void processProp(aod::EMEvents const& collisions, Run3Tracks const&) - { - for (auto& collision : collisions) { - auto tracks_for_spherocity_per_collision = tracks_for_spherocity->sliceByCached(o2::aod::track::collisionId, collision.collisionId(), cache); - float spherocity_ptweighted = -1.f, spherocity_ptunweighted = -1.f; - int ntrack = getSpherocity(tracks_for_spherocity_per_collision, spherocity_ptweighted, spherocity_ptunweighted); - if (fillQAHistogram) { - fRegistry.fill(HIST("Spherocity/hSpherocity_ptweighted"), ntrack, spherocity_ptweighted); - fRegistry.fill(HIST("Spherocity/hSpherocity_ptunweighted"), ntrack, spherocity_ptunweighted); - } - evprop(spherocity_ptweighted, spherocity_ptunweighted, ntrack); - } // end of collision loop - } - PROCESS_SWITCH(EMEventPropertyTask, processProp, "process event property", true); - - void processDummy(aod::EMEvents const& collisions) - { - for (int i = 0; i < collisions.size(); i++) { - evprop(-1.f, -1.f, 0); - } // end of collision loop - } - PROCESS_SWITCH(EMEventPropertyTask, processDummy, "process dummy", false); -}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc, TaskName{"create-emevent-dilepton"}), adaptAnalysisTask(cfgc, TaskName{"associate-dilepton-to-emevent"}), - adaptAnalysisTask(cfgc, TaskName{"emevent-property"}), }; } diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index 3377fe4f3f6..202149c86c5 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -74,10 +74,10 @@ struct filterDielectronEvent { Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; Configurable mincrossedrows{"mincrossedrows", 80, "min. crossed rows"}; Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; - Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda)"}; - Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0, "its cluster size cut is applied below this p"}; - Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", -1, "pion rejection is applied below this pin"}; - Configurable minitsncls{"minitsncls", 4, "min. number of ITS clusters"}; + Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", 1e+10, "pion rejection is applied below this pin"}; + Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + Configurable min_ncluster_its{"min_ncluster_its", 4, "min ncluster its"}; + Configurable min_ncluster_itsib{"min_ncluster_itsib", 1, "min ncluster itsib"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; Configurable maxchi2its{"maxchi2its", 6.0, "max. chi2/NclsITS"}; Configurable minpt{"minpt", 0.15, "min pt for track"}; @@ -102,8 +102,6 @@ struct filterDielectronEvent { HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - std::pair> itsRequirement = {1, {0, 1, 2}}; // any hits on 3 ITS ib layers. - int mRunNumber; float d_bz; Service ccdb; @@ -220,25 +218,10 @@ struct filterDielectronEvent { if (!track.hasITS() || !track.hasTPC()) { return false; } - if (track.itsNCls() < minitsncls) { + if (track.itsNCls() < min_ncluster_its) { return false; } - - auto hits = std::count_if(itsRequirement.second.begin(), itsRequirement.second.end(), [&](auto&& requiredLayer) { return track.itsClusterMap() & (1 << requiredLayer); }); - if (hits < itsRequirement.first) { - return false; - } - - uint32_t itsClusterSizes = track.itsClusterSizes(); - int total_cluster_size = 0, nl = 0; - for (unsigned int layer = 0; layer < 7; layer++) { - int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf; - if (cluster_size_per_layer > 0) { - nl++; - } - total_cluster_size += cluster_size_per_layer; - } - if (static_cast(total_cluster_size) / static_cast(nl) * std::cos(std::atan(track.tgl())) > max_mean_its_cluster_size && track.p() < max_p_for_its_cluster_size) { + if (track.itsNClsInnerBarrel() < min_ncluster_itsib) { return false; } @@ -254,6 +237,10 @@ struct filterDielectronEvent { return false; } + if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) { + return false; + } + gpu::gpustd::array dcaInfo; auto track_par_cov_recalc = getTrackParCov(track); track_par_cov_recalc.setPID(o2::track::PID::Electron); @@ -298,7 +285,7 @@ struct filterDielectronEvent { if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { return false; } - if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi && track.tpcInnerParam() < max_pin_for_pion_rejection) { return false; } if (minTPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < maxTPCNsigmaKa) { @@ -316,7 +303,7 @@ struct filterDielectronEvent { template bool isElectron_TOFreq(TTrack const& track) { - if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi && track.tpcInnerParam() < max_pin_for_pion_rejection) { return false; } return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index e132db33c06..18a0cb8c988 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -13,6 +13,10 @@ /// \author daiki.sekihata@cern.ch #include +#include +#include +#include + #include "Math/Vector4D.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -64,13 +68,12 @@ struct skimmerPrimaryElectron { Configurable min_ncluster_tpc{"min_ncluster_tpc", 10, "min ncluster tpc"}; Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; - Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda)"}; // this is to suppress random combination. default 4 + 1 for skimming. - Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0.0, "its cluster size cut is applied below this p"}; - Configurable minitsncls{"minitsncls", 4, "min. number of ITS clusters"}; + Configurable min_ncluster_its{"min_ncluster_its", 4, "min ncluster its"}; + Configurable min_ncluster_itsib{"min_ncluster_itsib", 1, "min ncluster itsib"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; Configurable maxchi2its{"maxchi2its", 6.0, "max. chi2/NclsITS"}; Configurable minpt{"minpt", 0.15, "min pt for track"}; - Configurable maxeta{"maxeta", 0.8, "eta acceptance"}; + Configurable maxeta{"maxeta", 0.9, "eta acceptance"}; Configurable dca_xy_max{"dca_xy_max", 1.0f, "max DCAxy in cm"}; Configurable dca_z_max{"dca_z_max", 1.0f, "max DCAz in cm"}; Configurable dca_3d_sigma_max{"dca_3d_sigma_max", 1e+10, "max DCA 3D in sigma"}; @@ -84,11 +87,11 @@ struct skimmerPrimaryElectron { Configurable maxTPCNsigmaPr{"maxTPCNsigmaPr", 2.5, "max. TPC n sigma for proton exclusion"}; Configurable minTPCNsigmaPr{"minTPCNsigmaPr", -2.5, "min. TPC n sigma for proton exclusion"}; Configurable requireTOF{"requireTOF", false, "require TOF hit"}; + Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", 1e+10, "pion rejection is applied below this pin"}; + Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - std::pair> itsRequirement = {1, {0, 1, 2}}; // any hits on 3 ITS ib layers. - int mRunNumber; float d_bz; Service ccdb; @@ -203,25 +206,10 @@ struct skimmerPrimaryElectron { if (!track.hasITS() || !track.hasTPC()) { return false; } - if (track.itsNCls() < minitsncls) { - return false; - } - - auto hits = std::count_if(itsRequirement.second.begin(), itsRequirement.second.end(), [&](auto&& requiredLayer) { return track.itsClusterMap() & (1 << requiredLayer); }); - if (hits < itsRequirement.first) { + if (track.itsNCls() < min_ncluster_its) { return false; } - - uint32_t itsClusterSizes = track.itsClusterSizes(); - int total_cluster_size = 0, nl = 0; - for (unsigned int layer = 0; layer < 7; layer++) { - int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf; - if (cluster_size_per_layer > 0) { - nl++; - } - total_cluster_size += cluster_size_per_layer; - } - if (static_cast(total_cluster_size) / static_cast(nl) * std::cos(std::atan(track.tgl())) > max_mean_its_cluster_size && track.p() < max_p_for_its_cluster_size) { + if (track.itsNClsInnerBarrel() < min_ncluster_itsib) { return false; } @@ -237,6 +225,10 @@ struct skimmerPrimaryElectron { return false; } + if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) { + return false; + } + if (track.hasTOF() && (maxTOFNsigmaEl < fabs(track.tofNSigmaEl()))) { return false; } @@ -285,7 +277,7 @@ struct skimmerPrimaryElectron { if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { return false; } - if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi && track.tpcInnerParam() < max_pin_for_pion_rejection) { return false; } if (minTPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < maxTPCNsigmaKa) { @@ -303,7 +295,7 @@ struct skimmerPrimaryElectron { template bool isElectron_TOFreq(TTrack const& track) { - if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi && track.tpcInnerParam() < max_pin_for_pion_rejection) { return false; } return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; @@ -404,7 +396,7 @@ struct skimmerPrimaryElectron { Preslice trackIndicesPerCollision = aod::track_association::collisionId; std::vector> stored_trackIds; Filter trackFilter = o2::aod::track::pt > minpt&& nabs(o2::aod::track::eta) < maxeta&& o2::aod::track::tpcChi2NCl < maxchi2tpc&& o2::aod::track::itsChi2NCl < maxchi2its&& ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC) == true; - Filter pidFilter = minTPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < maxTPCNsigmaEl && (o2::aod::pidtpc::tpcNSigmaPi < minTPCNsigmaPi || maxTPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); + Filter pidFilter = minTPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < maxTPCNsigmaEl; using MyFilteredTracks = soa::Filtered; Partition posTracks = o2::aod::track::signed1Pt > 0.f; @@ -615,13 +607,18 @@ struct prefilterPrimaryElectron { // Operation and minimisation criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable max_pt_itsonly{"max_pt_itsonly", 0.15, "max pT for ITSonly tracks at PV"}; - Configurable min_dcatopv{"min_dcatopv", -1.f, "DCAxy To PV"}; - Configurable minpt{"minpt", 0.05, "min pt for track for loose track sample"}; + Configurable max_dcaxy{"max_dcaxy", 0.3, "DCAxy To PV for loose track sample"}; + Configurable max_dcaz{"max_dcaz", 0.3, "DCAz To PV for loose track sample"}; + Configurable minpt{"minpt", 0.1, "min pt for track for loose track sample"}; Configurable maxeta{"maxeta", 1.2, "eta acceptance for loose track sample"}; - Configurable mincrossedrows{"mincrossedrows", 40, "min crossed rows"}; + Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; + Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; + Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max chi2/NclsTPC"}; Configurable maxchi2its{"maxchi2its", 6.0, "max chi2/NclsITS"}; + Configurable min_ncluster_its{"min_ncluster_its", 4, "min ncluster its"}; + Configurable min_ncluster_itsib{"min_ncluster_itsib", 1, "min ncluster itsib"}; Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -3.0, "min. TPC n sigma for electron inclusion"}; Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 3.0, "max. TPC n sigma for electron inclusion"}; Configurable slope{"slope", 0.0185, "slope for m vs. phiv"}; @@ -693,12 +690,6 @@ struct prefilterPrimaryElectron { o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - template - bool isITSonlyTrack(TTrack const& track) - { - return track.hasITS() && !track.hasTPC() && !track.hasTRD() && !track.hasTOF(); - } - template bool checkTrack(TCollision const& collision, TTrack const& track) { @@ -708,18 +699,33 @@ struct prefilterPrimaryElectron { if (track.itsChi2NCl() > maxchi2its) { return false; } + if (track.itsNCls() < min_ncluster_its) { + return false; + } + if (track.itsNClsInnerBarrel() < min_ncluster_itsib) { + return false; + } - if (track.hasTPC()) { - if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { - return false; - } - if (track.tpcNClsCrossedRows() < mincrossedrows) { - return false; - } - - if (track.tpcChi2NCl() > maxchi2its) { - return false; - } + if (!track.hasTPC()) { + return false; + } + if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { + return false; + } + if (track.tpcNClsFound() < min_ncluster_tpc) { + return false; + } + if (track.tpcNClsCrossedRows() < mincrossedrows) { + return false; + } + if (track.tpcCrossedRowsOverFindableCls() < min_tpc_cr_findable_ratio) { + return false; + } + if (track.tpcFractionSharedCls() > max_frac_shared_clusters_tpc) { + return false; + } + if (track.tpcChi2NCl() > maxchi2its) { + return false; } gpu::gpustd::array dcaInfo; @@ -728,14 +734,11 @@ struct prefilterPrimaryElectron { o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, track_par_cov_recalc, 2.f, matCorr, &dcaInfo); getPxPyPz(track_par_cov_recalc, pVec_recalc); - if (fabs(dcaInfo[0]) < min_dcatopv) { + if (fabs(dcaInfo[0]) > max_dcaxy || fabs(dcaInfo[1]) > max_dcaz) { return false; } - if (isITSonlyTrack(track) && track_par_cov_recalc.getPt() > max_pt_itsonly) { - return false; - } - if (fabs(track_par_cov_recalc.getEta()) > maxeta) { + if (track_par_cov_recalc.getPt() < minpt || fabs(track_par_cov_recalc.getEta()) > maxeta) { return false; } @@ -786,7 +789,7 @@ struct prefilterPrimaryElectron { Preslice trackIndicesPerCollision = aod::track_association::collisionId; - Filter trackFilter = o2::aod::track::pt > minpt&& nabs(o2::aod::track::eta) < maxeta&& ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true; + Filter trackFilter = o2::aod::track::pt > minpt&& nabs(o2::aod::track::eta) < maxeta&& ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) == true && ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC) == true; using MyFilteredTracks = soa::Filtered; Partition posTracks = o2::aod::track::signed1Pt > 0.f; Partition negTracks = o2::aod::track::signed1Pt < 0.f; diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index f7b7784d2e3..830a17cda4a 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -32,6 +32,7 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Qvectors.h" #include "Common/DataModel/PIDResponse.h" +// #include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/TrackSelectionTables.h" #include "CCDB/BasicCCDBManager.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -65,8 +66,8 @@ struct eventQC { Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; ConfigurableAxis ConfPtBins{"ConfPtBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pT bins for output histograms"}; - Configurable cfgNbinsEta{"cfgNbinsEta", 40, "number of eta bins for output histograms"}; - Configurable cfgNbinsPhi{"cfgNbinsPhi", 360, "number of phi bins for output histograms"}; + Configurable cfgNbinsEta{"cfgNbinsEta", 20, "number of eta bins for output histograms"}; + Configurable cfgNbinsPhi{"cfgNbinsPhi", 36, "number of phi bins for output histograms"}; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -99,7 +100,7 @@ struct eventQC { Configurable cfg_min_ncrossedrows_tpc{"cfg_min_ncrossedrows_tpc", 80, "min ncrossed rows"}; Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncluster_itsib{"cfg_min_ncluster_itsib", 1, "min ncluster its"}; + Configurable cfg_min_ncluster_itsib{"cfg_min_ncluster_itsib", 1, "min ncluster itsib"}; Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2/NclsTOF"}; @@ -288,18 +289,25 @@ struct eventQC { if (cfgFillPID) { fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.add("Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); fRegistry.add("Track/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + // fRegistry.add("Track/hITSNsigmaEl", "ITS n sigma el;p_{in} (GeV/c);n #sigma_{e}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/hITSNsigmaMu", "ITS n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/hITSNsigmaPi", "ITS n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/hITSNsigmaKa", "ITS n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/hITSNsigmaPr", "ITS n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); } } @@ -352,19 +360,27 @@ struct eventQC { for (int il = 0; il < 7; il++) { nsize += track.itsClsSizeInLayer(il); } + fRegistry.fill(HIST("Track/hTPCdEdx"), track.tpcInnerParam(), track.tpcSignal()); - fRegistry.fill(HIST("Track/hTOFbeta"), track.p(), track.beta()); - fRegistry.fill(HIST("Track/hMeanClusterSizeITS"), track.p(), static_cast(nsize) / static_cast(track.itsNCls()) * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); fRegistry.fill(HIST("Track/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); + + fRegistry.fill(HIST("Track/hTOFbeta"), track.p(), track.beta()); fRegistry.fill(HIST("Track/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); fRegistry.fill(HIST("Track/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); + + fRegistry.fill(HIST("Track/hMeanClusterSizeITS"), track.p(), static_cast(nsize) / static_cast(track.itsNCls()) * std::cos(std::atan(track.tgl()))); + // fRegistry.fill(HIST("Track/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); + // fRegistry.fill(HIST("Track/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); + // fRegistry.fill(HIST("Track/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); + // fRegistry.fill(HIST("Track/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); + // fRegistry.fill(HIST("Track/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); } } @@ -820,10 +836,7 @@ struct eventQC { // for V0 PID if constexpr (doV0s) { - auto v0photons_per_coll = v0photons.sliceBy(perCol_pcm, collision.globalIndex()); auto v0hadrons_per_coll = v0strhadrons.sliceBy(perCol_v0, collision.globalIndex()); - // LOGF(info, "v0photons_per_coll.size() = %d, v0hadrons_per_coll.size() = %d", v0photons_per_coll.size(), v0hadrons_per_coll.size()); - for (auto& v0hadron : v0hadrons_per_coll) { fRegistry.fill(HIST("V0/hAP"), v0hadron.alpha(), v0hadron.qtarm()); fRegistry.fill(HIST("V0/hPCA"), v0hadron.dcaV0daughters()); @@ -856,6 +869,7 @@ struct eventQC { } } // end of v0hadron loop + auto v0photons_per_coll = v0photons.sliceBy(perCol_pcm, collision.globalIndex()); for (auto& v0photon : v0photons_per_coll) { fRegistry.fill(HIST("V0/Photon/hMass"), v0photon.mGamma(), v0photon.pt()); fRegistry.fill(HIST("V0/Photon/hXY"), v0photon.vx(), v0photon.vy()); @@ -884,12 +898,14 @@ struct eventQC { void processEventQC(FilteredMyCollisions const& collisions, FilteredMyTracks const& tracks) { + // auto tracksWithITSPid = soa::Attach(tracks); runQC(collisions, tracks, nullptr, nullptr, nullptr); } PROCESS_SWITCH(eventQC, processEventQC, "event QC", true); void processEventQC_Cent_Qvec(FilteredMyCollisions_Qvec const& collisions, FilteredMyTracks const& tracks) { + // auto tracksWithITSPid = soa::Attach(tracks); runQC(collisions, tracks, nullptr, nullptr, nullptr); } PROCESS_SWITCH(eventQC, processEventQC_Cent_Qvec, "event QC + q vector", false); @@ -900,6 +916,7 @@ struct eventQC { void processEventQC_V0_PID(FilteredMyCollisions const& collisions, FilteredMyTracks const& tracks, aod::V0PhotonsKF const& v0photons, aod::V0Legs const& v0legs, filteredV0s const& v0strhadrons) { + // auto tracksWithITSPid = soa::Attach(tracks); runQC(collisions, tracks, v0photons, v0legs, v0strhadrons); } PROCESS_SWITCH(eventQC, processEventQC_V0_PID, "event QC + V0 PID", false);