diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 45e4f7c26d7..e4faede5dec 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -36,7 +36,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -296,7 +295,6 @@ struct Pi0EtaToGammaGamma { std::vector occ_bin_edges; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb{}; int mRunNumber = -1; float d_bz = 0; o2::emcal::Geometry* emcalGeom = nullptr; @@ -445,11 +443,6 @@ struct Pi0EtaToGammaGamma { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 79c7b4308ae..55ea402f152 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -36,7 +36,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -268,7 +267,6 @@ struct Pi0EtaToGammaGammaMC { static constexpr std::array kParnames = {"Pi0/", "Eta/"}; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb{}; int mRunNumber = 0; float d_bz = 0; @@ -300,11 +298,6 @@ struct Pi0EtaToGammaGammaMC { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index e81d5e3ba9c..cee76082811 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -32,7 +32,6 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" -#include #include #include #include @@ -87,7 +86,6 @@ using MyEMCCluster = MyEMCClusters::iterator; template struct TaggingPi0 { - o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; @@ -222,7 +220,6 @@ struct TaggingPi0 { std::vector occ_bin_edges; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb{}; int mRunNumber = 0; float d_bz = 0; @@ -255,11 +252,6 @@ struct TaggingPi0 { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 4588f70182d..4daa005335a 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -33,7 +33,6 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" -#include #include #include #include @@ -91,7 +90,6 @@ using MyMCElectron = MyMCElectrons::iterator; template struct TaggingPi0MC { - o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; @@ -214,7 +212,6 @@ struct TaggingPi0MC { static constexpr std::array parnames = {"Pi0/", "Eta/"}; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb{}; int mRunNumber = 0; float d_bz = 0; TF1* f1fd_k0s_to_pi0 = nullptr; @@ -232,11 +229,6 @@ struct TaggingPi0MC { mRunNumber = 0; d_bz = 0; f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template diff --git a/PWGEM/PhotonMeson/DataModel/EventTables.h b/PWGEM/PhotonMeson/DataModel/EventTables.h index 93630002fc5..4ff479b4b78 100644 --- a/PWGEM/PhotonMeson/DataModel/EventTables.h +++ b/PWGEM/PhotonMeson/DataModel/EventTables.h @@ -18,6 +18,7 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TpcCCDBObjects.h" #include #include @@ -118,6 +119,11 @@ DECLARE_SOA_CCDB_COLUMN(BadChannelMap, badChannelMap, o2::emcal::BadChannelMap, DECLARE_SOA_TIMESTAMPED_TABLE(EmEmcalObjects, aod::PMEvents, o2::aod::timestamp::Timestamp, 0, "EMEMCALOBJECTS", //! em::ccdbEmcal::BadChannelMap); +/// TPC drift velocity for EmEvents. Reuses the shared column (same label and path). +/// Timestamp-uniform since the drift velocity changes within a run. +DECLARE_SOA_TIMESTAMPED_TABLE(EmTpcObjects, aod::PMEvents, o2::aod::timestamp::Timestamp, 0, "EMTPCOBJECTS", //! + ccdbTpc::VDriftTgl); + } // namespace o2::aod #endif // PWGEM_PHOTONMESON_DATAMODEL_EVENTTABLES_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.h b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.h index ed671564446..3a3fbd24ad6 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.h +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.h @@ -67,16 +67,16 @@ // using namespace o2::framework::expressions; // using namespace o2::constants::physics; -using o2::framework::AxisSpec; -using o2::framework::Configurable; -using o2::framework::ConfigurableGroup; -using o2::framework::HistType; -using o2::framework::kTH1D; -using o2::framework::kTH1F; -using o2::framework::kTH2F; -using o2::framework::kTHnSparseF; -using o2::framework::Preslice; -using o2::framework::Produces; +// using o2::framework::AxisSpec; +// using o2::framework::Configurable; +// using o2::framework::ConfigurableGroup; +// using o2::framework::HistType; +// using o2::framework::kTH1D; +// using o2::framework::kTH1F; +// using o2::framework::kTH2F; +// using o2::framework::kTHnSparseF; +// using o2::framework::Preslice; +// using o2::framework::Produces; using MyCollisions = o2::soa::Join; using MyCollisionsWithSWT = o2::soa::Join; @@ -110,15 +110,15 @@ template perCol = o2::aod::track::collisionId; + o2::framework::Preslice perCol = o2::aod::track::collisionId; o2::framework::PresliceOptional perTracksCollision = o2::aod::track::collisionId; - Preslice perCol_pcm = o2::aod::v0photonkf::collisionId; // o2::aod::V0PhotonsKF - Preslice trackIndicesPerCollision = o2::aod::track_association::collisionId; - Produces emprimaryelectrons; - Produces emprimaryelectronsDeDxMC; + o2::framework::Preslice perCol_pcm = o2::aod::v0photonkf::collisionId; // o2::aod::V0PhotonsKF + o2::framework::Preslice trackIndicesPerCollision = o2::aod::track_association::collisionId; + o2::framework::Produces emprimaryelectrons; + o2::framework::Produces emprimaryelectronsDeDxMC; o2::framework::Service mTOFResponse{}; - Produces emtofs; + o2::framework::Produces emtofs; enum class enumFillingMode { SingleTrack = 1, @@ -127,56 +127,53 @@ struct skimmerPrimaryElectronFromDalitzEE { }; // Configurables - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Operation and minimisation criteria - Configurable dBzInput{"dBzInput", -999, "bz field in kG, -999 is automatic"}; - Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) - 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_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 minchi2tpc{"minchi2tpc", 0.0, "min. chi2/NclsTPC"}; - Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; - Configurable minchi2its{"minchi2its", 0.0, "min. chi2/NclsITS"}; - Configurable maxchi2its{"maxchi2its", 36.0, "max. chi2/NclsITS"}; - Configurable minpt{"minpt", 0.05, "min pt for ITS-TPC track"}; - Configurable maxeta{"maxeta", 2.0, "max eta acceptance"}; - Configurable dca_xy_max{"dca_xy_max", 1, "max DCAxy in cm"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) - Configurable dca_z_max{"dca_z_max", 1, "max DCAz in cm"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) - Configurable dca_3d_sigma_max{"dca_3d_sigma_max", 2, "max DCA 3D in sigma"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) - Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -2.5, "min. TPC n sigma for electron inclusion"}; - Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", +3.5, "max. TPC n sigma for electron inclusion"}; - Configurable maxTPCNsigmaPi{"maxTPCNsigmaPi", 0.0, "max. TPC n sigma for pion exclusion"}; - Configurable minTPCNsigmaPi{"minTPCNsigmaPi", 0.0, "min. TPC n sigma for pion exclusion"}; - Configurable minTOFNsigmaEl{"minTOFNsigmaEl", -3.5, "min. TOF n sigma for electron inclusion"}; - Configurable maxTOFNsigmaEl{"maxTOFNsigmaEl", +3.5, "max. TOF n sigma for electron inclusion"}; - Configurable minTPCNsigmaKa{"minTPCNsigmaKa", -2.5, "min. TPC n sigma for kaon exclusion"}; - Configurable maxTPCNsigmaKa{"maxTPCNsigmaKa", 2.5, "max. TPC n sigma for kaon exclusion"}; - Configurable minTPCNsigmaPr{"minTPCNsigmaPr", -2.5, "min. TPC n sigma for proton exclusion"}; - Configurable maxTPCNsigmaPr{"maxTPCNsigmaPr", 2.5, "max. TPC n sigma for proton exclusion"}; - Configurable requireTOF{"requireTOF", false, "require TOF hit"}; - Configurable min_pin_for_pion_rejection{"min_pin_for_pion_rejection", 0.0, "pion rejection is applied above this pin"}; // this is used only in TOFreq - Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", 0.5, "pion rejection is applied below this pin"}; - Configurable minMee{"minMee", 0., "min. mee to store dalitz ee pairs"}; - Configurable maxMee{"maxMee", 0.5, "max. mee to store dalitz ee pairs"}; - Configurable minMeegamma{"minMeegamma", 0.3, "min. mee to store eegamma candidates"}; - Configurable maxMeegamma{"maxMeegamma", 0.8, "max. mee to store eegamma candidates"}; - Configurable photonsNeeded{"photonsNeeded", true, "require a minimum of one photons per collision"}; - Configurable fillLS{"fillLS", true, "flag to fill LS histograms for QA"}; - Configurable fillingMode{"fillingMode", 1, "Filling mode| 1: fill tracks without pair selection, 2: fill tracks from selected pairs, 3: fill tracks from selected pairs that can be combined with a photon"}; - Configurable fillWithEtaMassCut{"fillWithEtaMassCut", true, "only valid for fillingmode 3; true: filling tabled based on eta candidate selection with minMeegamma < M < maxMeegamma, false: fill identical to fillingmode 2"}; - Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks"}; - Configurable maxpt_itssa{"maxpt_itssa", 0.15, "max pt for ITSsa track"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) - Configurable maxMeanITSClusterSize{"maxMeanITSClusterSize", 16, "max x cos(lambda)"}; - Configurable slope{"slope", 0.0185, "slope for m vs. phiv"}; - Configurable intercept{"intercept", -0.0380, "intercept for m vs. phiv"}; - Configurable useTOFNSigmaDeltaBC{"useTOFNSigmaDeltaBC", false, "Flag to shift delta BC for TOF n sigma (only with TTCA)"}; - Configurable storeOnlyTrueElectronMC{"storeOnlyTrueElectronMC", false, "Flag to store only true electron in MC"}; + o2::framework::Configurable dBzInput{"dBzInput", -999, "bz field in kG, -999 is automatic"}; + o2::framework::Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) + o2::framework::Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; + o2::framework::Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; + o2::framework::Configurable max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable min_ncluster_its{"min_ncluster_its", 4, "min ncluster its"}; + o2::framework::Configurable min_ncluster_itsib{"min_ncluster_itsib", 1, "min ncluster itsib"}; + o2::framework::Configurable minchi2tpc{"minchi2tpc", 0.0, "min. chi2/NclsTPC"}; + o2::framework::Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; + o2::framework::Configurable minchi2its{"minchi2its", 0.0, "min. chi2/NclsITS"}; + o2::framework::Configurable maxchi2its{"maxchi2its", 36.0, "max. chi2/NclsITS"}; + o2::framework::Configurable minpt{"minpt", 0.05, "min pt for ITS-TPC track"}; + o2::framework::Configurable maxeta{"maxeta", 2.0, "max eta acceptance"}; + o2::framework::Configurable dca_xy_max{"dca_xy_max", 1, "max DCAxy in cm"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) + o2::framework::Configurable dca_z_max{"dca_z_max", 1, "max DCAz in cm"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) + o2::framework::Configurable dca_3d_sigma_max{"dca_3d_sigma_max", 2, "max DCA 3D in sigma"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) + o2::framework::Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -2.5, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", +3.5, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable maxTPCNsigmaPi{"maxTPCNsigmaPi", 0.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable minTPCNsigmaPi{"minTPCNsigmaPi", 0.0, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable minTOFNsigmaEl{"minTOFNsigmaEl", -3.5, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable maxTOFNsigmaEl{"maxTOFNsigmaEl", +3.5, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable minTPCNsigmaKa{"minTPCNsigmaKa", -2.5, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable maxTPCNsigmaKa{"maxTPCNsigmaKa", 2.5, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable minTPCNsigmaPr{"minTPCNsigmaPr", -2.5, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable maxTPCNsigmaPr{"maxTPCNsigmaPr", 2.5, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable requireTOF{"requireTOF", false, "require TOF hit"}; + o2::framework::Configurable min_pin_for_pion_rejection{"min_pin_for_pion_rejection", 0.0, "pion rejection is applied above this pin"}; // this is used only in TOFreq + o2::framework::Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", 0.5, "pion rejection is applied below this pin"}; + o2::framework::Configurable minMee{"minMee", 0., "min. mee to store dalitz ee pairs"}; + o2::framework::Configurable maxMee{"maxMee", 0.5, "max. mee to store dalitz ee pairs"}; + o2::framework::Configurable minMeegamma{"minMeegamma", 0.3, "min. mee to store eegamma candidates"}; + o2::framework::Configurable maxMeegamma{"maxMeegamma", 0.8, "max. mee to store eegamma candidates"}; + o2::framework::Configurable photonsNeeded{"photonsNeeded", true, "require a minimum of one photons per collision"}; + o2::framework::Configurable fillLS{"fillLS", true, "flag to fill LS histograms for QA"}; + o2::framework::Configurable fillingMode{"fillingMode", 1, "Filling mode| 1: fill tracks without pair selection, 2: fill tracks from selected pairs, 3: fill tracks from selected pairs that can be combined with a photon"}; + o2::framework::Configurable fillWithEtaMassCut{"fillWithEtaMassCut", true, "only valid for fillingmode 3; true: filling tabled based on eta candidate selection with minMeegamma < M < maxMeegamma, false: fill identical to fillingmode 2"}; + o2::framework::Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks"}; + o2::framework::Configurable maxpt_itssa{"maxpt_itssa", 0.15, "max pt for ITSsa track"}; // o2-linter: disable=name/function-variable (renaming configs would mess up hyperloop) + o2::framework::Configurable maxMeanITSClusterSize{"maxMeanITSClusterSize", 16, "max x cos(lambda)"}; + o2::framework::Configurable slope{"slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable intercept{"intercept", -0.0380, "intercept for m vs. phiv"}; + o2::framework::Configurable useTOFNSigmaDeltaBC{"useTOFNSigmaDeltaBC", false, "Flag to shift delta BC for TOF n sigma (only with TTCA)"}; + o2::framework::Configurable storeOnlyTrueElectronMC{"storeOnlyTrueElectronMC", false, "Flag to store only true electron in MC"}; o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::array DileptonSigns = {"uls/", "lspp/", "lsmm/"}; @@ -205,55 +202,55 @@ struct skimmerPrimaryElectronFromDalitzEE { mTOFResponse->initSetup(ccdb, initContext); LOGF(info, "after TOF initSetup"); - fRegistry.add("Track/hPt", "pT;p_{T} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false); - fRegistry.add("Track/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{180, 0, o2::constants::math::TwoPI}, {400, -2.0f, 2.0f}}, false); - fRegistry.add("Track/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{400, -20, 20}}, false); - fRegistry.add("Track/hRelDeltaPt", "pT resolution;p_{T} (GeV/c);#Deltap_{T}/p_{T}", kTH2F, {{1000, 0, 10}, {100, 0, 0.1}}, false); - fRegistry.add("Track/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.0f, 1.0f}}, false); - fRegistry.add("Track/hDCAxy_Pt", "DCA_{xy} vs. pT;p_{T} (GeV/c);DCA_{xy} (cm)", kTH2F, {{200, 0, 10}, {200, -1, 1}}, false); - fRegistry.add("Track/hDCAz_Pt", "DCA_{z} vs. pT;p_{T} (GeV/c);DCA_{z} (cm)", kTH2F, {{200, 0, 10}, {200, -1, 1}}, false); - fRegistry.add("Track/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/hPt", "pT;p_{T} (GeV/c)", o2::framework::kTH1F, {{1000, 0.0f, 10}}, false); + fRegistry.add("Track/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", o2::framework::kTH2F, {{180, 0, o2::constants::math::TwoPI}, {400, -2.0f, 2.0f}}, false); + fRegistry.add("Track/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{400, -20, 20}}, false); + fRegistry.add("Track/hRelDeltaPt", "pT resolution;p_{T} (GeV/c);#Deltap_{T}/p_{T}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 0.1}}, false); + fRegistry.add("Track/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.0f, 1.0f}}, false); + fRegistry.add("Track/hDCAxy_Pt", "DCA_{xy} vs. pT;p_{T} (GeV/c);DCA_{xy} (cm)", o2::framework::kTH2F, {{200, 0, 10}, {200, -1, 1}}, false); + fRegistry.add("Track/hDCAz_Pt", "DCA_{z} vs. pT;p_{T} (GeV/c);DCA_{z} (cm)", o2::framework::kTH2F, {{200, 0, 10}, {200, -1, 1}}, false); + fRegistry.add("Track/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); // TPC - fRegistry.add("Track/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); - fRegistry.add("Track/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); - fRegistry.add("Track/hChi2TPC", "chi2/number of TPC clusters", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/hTPCNcr2Nf", "TPC Ncr/Nfindable", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/hTPCNcls2Nf", "TPC Ncls/Nfindable", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - 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/hTPCdEdxMC", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, 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/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hNclsTPC", "number of TPC clusters", o2::framework::kTH1F, {{161, -0.5, 160.5}}, false); + fRegistry.add("Track/hNcrTPC", "number of TPC crossed rows", o2::framework::kTH1F, {{161, -0.5, 160.5}}, false); + fRegistry.add("Track/hChi2TPC", "chi2/number of TPC clusters", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/hTPCNcr2Nf", "TPC Ncr/Nfindable", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/hTPCNcls2Nf", "TPC Ncls/Nfindable", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/hTPCdEdxMC", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); // ITS - fRegistry.add("Track/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{400, 0, 40}}, false); - fRegistry.add("Track/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); - fRegistry.add("Track/hMeanClusterSizeITSib", "mean cluster size ITSib;p_{pv} (GeV/c); #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); - fRegistry.add("Track/hMeanClusterSizeITSob", "mean cluster size ITSob;p_{pv} (GeV/c); #times cos(#lambda)", kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); + fRegistry.add("Track/hNclsITS", "number of ITS clusters", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", o2::framework::kTH1F, {{400, 0, 40}}, false); + fRegistry.add("Track/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); + fRegistry.add("Track/hMeanClusterSizeITSib", "mean cluster size ITSib;p_{pv} (GeV/c); #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); + fRegistry.add("Track/hMeanClusterSizeITSob", "mean cluster size ITSob;p_{pv} (GeV/c); #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0, 10}, {150, 0, 15}}, false); // TOF - fRegistry.add("Track/hChi2TOF", "chi2 of TOF", kTH1F, {{100, 0, 10}}, 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/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hChi2TOF", "chi2 of TOF", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/hTOFbeta", "TOF beta;p_{pv} (GeV/c);#beta", o2::framework::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}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); // pair - fRegistry.add("Pair/uls/hTrackMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); - fRegistry.add("Pair/uls/hCheckEMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); - fRegistry.add("Pair/uls/hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); - fRegistry.add("Pair/uls/hMCutMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); - fRegistry.add("Pair/uls/hMPhiCutMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); - - fRegistry.add("Pair/uls/hTrackMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); - fRegistry.add("Pair/uls/hCheckEMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); - fRegistry.add("Pair/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); - fRegistry.add("Pair/uls/hMCutMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); - fRegistry.add("Pair/uls/hMPhiCutMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); + fRegistry.add("Pair/uls/hTrackMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", o2::framework::kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); + fRegistry.add("Pair/uls/hCheckEMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", o2::framework::kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); + fRegistry.add("Pair/uls/hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", o2::framework::kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); + fRegistry.add("Pair/uls/hMCutMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", o2::framework::kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); + fRegistry.add("Pair/uls/hMPhiCutMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", o2::framework::kTH2F, {{100, 0, 0.1}, {200, 0, 2}}, false); + + fRegistry.add("Pair/uls/hTrackMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); + fRegistry.add("Pair/uls/hCheckEMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); + fRegistry.add("Pair/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); + fRegistry.add("Pair/uls/hMCutMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); + fRegistry.add("Pair/uls/hMPhiCutMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{180, 0, o2::constants::math::PI}, {100, 0, 0.1}}, false); fRegistry.addClone("Pair/uls/", "Pair/lspp/"); fRegistry.addClone("Pair/uls/", "Pair/lsmm/"); diff --git a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx index 035cf6b905e..974cda1e481 100644 --- a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx +++ b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx @@ -14,14 +14,15 @@ /// \author daiki.sekihata@cern.ch felix.schlepper@cern.ch /// \dependencies: o2-analysis-lf-lambdakzeromcfinder +#include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/mcV0Tables.h" #include "PWGEM/PhotonMeson/Utils/TrackSelection.h" // #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/DataModel/GloCCDBObjects.h" #include "Common/DataModel/TrackSelectionTables.h" -#include #include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include #include using namespace o2; @@ -91,6 +91,7 @@ struct CheckMCV0 { using FilteredTracksMC = soa::Filtered; using CollisionsMC = soa::Join; using V0s = aod::V0Datas; + using BCsWithCCDB = soa::Join; // Histogram Parameters Configurable tglNBins{"tglNBins", 500, "nBins for tgl"}; @@ -164,16 +165,8 @@ struct CheckMCV0 { }; static_assert(checkV0legLabels.size() == checkV0legEnum::MINCROSSEDROWSTPC); - // CCDB - Configurable mCCDBPath{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; - Configurable mGRPMagPath{"grpmagPath", "GLO/Config/GRPMagField", "path to the GRPMagField object"}; - Configurable mLUTPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; - Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; - Configurable mCCDBUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Service mCCDB{}; + // Only needed to avoid re-installing the magnetic field, which is global state int mRunNumber{-1}; - o2::base::MatLayerCylSet* mLUT{nullptr}; - o2::parameters::GRPMagField* mGRPMagField{nullptr}; // params std::array mcPosXYZEtaTglPtProp{}; @@ -186,12 +179,6 @@ struct CheckMCV0 { void init(InitContext const& /*unused*/) { - // setup CCDB - mCCDB->setURL(mCCDBUrl); - mCCDB->setCaching(true); - mCCDB->setLocalObjectValidityChecking(); - mLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(mCCDB->get(mLUTPath)); - // maybe logarithmic if (ptLogAxis) { axisPt.makeLogarithmic(); @@ -247,11 +234,11 @@ struct CheckMCV0 { } Preslice perCollision = aod::v0data::collisionId; - void processMCV0(CollisionsMC const& collisions, V0s const& v0s, FilteredTracksMC const& /*unused*/, aod::McParticles const& /*unused*/, aod::McCollisions const& /*unused*/, aod::BCsWithTimestamps const& /*unused*/) + void processMCV0(CollisionsMC const& collisions, V0s const& v0s, FilteredTracksMC const& /*unused*/, aod::McParticles const& /*unused*/, aod::McCollisions const& /*unused*/, BCsWithCCDB const& /*unused*/) { // Check for new ccdb parameters for (auto& collision : collisions) { - const auto bc = collision.template bc_as(); + const auto bc = collision.template bc_as(); initCCDB(bc); // Get the V0 candidates belonging to the current collision @@ -505,12 +492,12 @@ struct CheckMCV0 { template inline void initCCDB(BC const& bc) { + // pointer store only; refreshed every time since the column buffer may be relocated + o2::base::Propagator::Instance()->setMatLUT(&bc.matLUT()); if (mRunNumber == bc.runNumber()) { return; } - mGRPMagField = mCCDB->getForTimeStamp(mGRPMagPath, bc.timestamp()); - o2::base::Propagator::initFieldFromGRP(mGRPMagField); - o2::base::Propagator::Instance()->setMatLUT(mLUT); + o2::base::Propagator::initFieldFromGRP(&bc.grpMagField()); mRunNumber = bc.runNumber(); } }; diff --git a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx index f6a6bad2c2e..ae07980c83d 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -27,7 +27,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -112,7 +111,6 @@ enum class MapLevel { struct CalibTaskEmc { // configurable for flow Configurable centEstimator{"centEstimator", 2, "Centrality estimation (FT0A: 1, FT0C: 2, FT0M: 3)"}; - Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable cfgEMCalMapLevelBackground{"cfgEMCalMapLevelBackground", 4, "Different levels of correction for the background, the smaller number includes the level of the higher number (4: none, 3: only inside EMCal, 2: exclude bad channels, 1: remove edges)"}; Configurable cfgEMCalMapLevelSameEvent{"cfgEMCalMapLevelSameEvent", 4, "Different levels of correction for the same event, the smaller number includes the level of the higher number (4: none, 3: only inside EMCal, 2: exclude bad channels, 1: remove edges)"}; Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; @@ -229,16 +227,15 @@ struct CalibTaskEmc { } correctionConfig; SliceCache cache; - o2::framework::Service ccdb{}; int runNow = 0; int runBefore = -1; Filter collisionFilter = (nabs(aod::collision::posZ) <= eventcuts.cfgZvtxMax) && (aod::evsel::ft0cOccupancyInTimeRange <= eventcuts.cfgFT0COccupancyMax) && (aod::evsel::ft0cOccupancyInTimeRange >= eventcuts.cfgFT0COccupancyMin); using EMCalPhotons = soa::Join; using PCMPhotons = soa::Join; - using FilteredCollsWithQvecs = soa::Filtered>; - using CollsWithQvecs = soa::Join; - using Colls = soa::Join; + using FilteredCollsWithQvecs = soa::Filtered>; + using CollsWithQvecs = soa::Join; + using Colls = soa::Join; PresliceOptional perCollisionEMC = o2::aod::emccluster::pmeventId; PresliceOptional perCollisionPCM = aod::v0photonkf::pmeventId; @@ -248,7 +245,6 @@ struct CalibTaskEmc { HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; o2::emcal::Geometry* emcalGeom{}; - o2::emcal::BadChannelMap* mBadChannels{}; // Constants for eta and phi ranges for the look up table static constexpr double EtaMin = -0.75, etaMax = 0.75; static constexpr int NBinsEta = 150; // 150 bins for eta @@ -425,11 +421,6 @@ struct CalibTaskEmc { registry.add("mesonQA/hAlphaPtMixed", "Histo of meson asymmetry vs pT for mixed event", HistType::kTH2D, {thAxisAlpha, thnAxisPtCalib}); } - ccdb->setURL(ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - }; // end init /// Change radians to degree @@ -519,14 +510,11 @@ struct CalibTaskEmc { return false; } - bool isCellMasked(int cellID) + template + bool isCellMasked(int cellID, TCollision const& collision) { - bool masked = false; - if (mBadChannels) { - auto maskStatus = mBadChannels->getChannelStatus(cellID); - masked = (maskStatus != o2::emcal::BadChannelMap::MaskType_t::GOOD_CELL); - } - return masked; + auto maskStatus = collision.badChannelMap().getChannelStatus(cellID); + return maskStatus != o2::emcal::BadChannelMap::MaskType_t::GOOD_CELL; } template @@ -534,8 +522,6 @@ struct CalibTaskEmc { { // Load EMCal geometry emcalGeom = o2::emcal::Geometry::GetInstanceFromRunNumber(collision.runNumber()); - // Load Bad Channel map - mBadChannels = ccdb->getForTimeStamp("EMC/Calib/BadChannelMap", collision.timestamp()); lookupTable1D.fill(-1); double binWidthEta = (etaMax - EtaMin) / NBinsEta; double binWidthPhi = (phiMax - PhiMin) / NBinsPhi; @@ -555,7 +541,7 @@ struct CalibTaskEmc { // Check conditions for the cell if (isTooCloseToEdge(cellID, 1)) { lookupTable1D[getIndex(iEta, iPhi)] = 2; // Edge - } else if (isCellMasked(cellID)) { + } else if (isCellMasked(cellID, collision)) { lookupTable1D[getIndex(iEta, iPhi)] = 1; // Bad } else { lookupTable1D[getIndex(iEta, iPhi)] = 0; // Good diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index 43f82e92041..edb255853fb 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -24,12 +24,9 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include #include #include #include -#include #include #include #include @@ -62,7 +59,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; using MyTracks = soa::Join; @@ -70,10 +67,6 @@ using MyTrack = MyTracks::iterator; struct DalitzEEQC { // Configurables - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; @@ -130,8 +123,6 @@ struct DalitzEEQC { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; - o2::ccdb::CcdbApi ccdbApi; - Service ccdb{}; int mRunNumber = 0; float d_bz = 0; @@ -146,11 +137,6 @@ struct DalitzEEQC { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template @@ -159,6 +145,7 @@ struct DalitzEEQC { if (mRunNumber == collision.runNumber()) { return; } + mRunNumber = collision.runNumber(); // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { @@ -167,30 +154,12 @@ struct DalitzEEQC { if (std::fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } - mRunNumber = collision.runNumber(); return; } - auto run3grp_timestamp = collision.timestamp(); - o2::parameters::GRPObject* grpo = nullptr; - o2::parameters::GRPMagField* grpmag = nullptr; - if (!skipGRPOquery) { - grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); - } - if (grpo) { - // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; - } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); - if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; - } - // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; - } - mRunNumber = collision.runNumber(); + // Fetch magnetic field from ccdb for current collision + d_bz = collision.grpMagField().getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << collision.timestamp() << " with magnetic field of " << d_bz << " kZG"; } ~DalitzEEQC() = default; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index c0dd75f3545..dbce25d3dae 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -26,12 +26,9 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include -#include #include #include #include -#include #include #include #include @@ -66,7 +63,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::dilepton::utils::mcutil; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; using MyMCTracks = soa::Join; @@ -75,10 +72,6 @@ using MyMCTrack = MyMCTracks::iterator; struct DalitzEEQCMC { // Configurables - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; @@ -136,8 +129,6 @@ struct DalitzEEQCMC { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; - o2::ccdb::CcdbApi ccdbApi; - Service ccdb{}; int mRunNumber = 0; float d_bz = 0; @@ -221,11 +212,6 @@ struct DalitzEEQCMC { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template @@ -234,6 +220,7 @@ struct DalitzEEQCMC { if (mRunNumber == collision.runNumber()) { return; } + mRunNumber = collision.runNumber(); // In case override, don't proceed, please - no CCDB access required if (d_bz_input > -990) { @@ -242,30 +229,12 @@ struct DalitzEEQCMC { if (std::fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } - mRunNumber = collision.runNumber(); return; } - auto run3grp_timestamp = collision.timestamp(); - o2::parameters::GRPObject* grpo = nullptr; - o2::parameters::GRPMagField* grpmag = nullptr; - if (!skipGRPOquery) { - grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); - } - if (grpo) { - // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; - } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); - if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; - } - // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; - } - mRunNumber = collision.runNumber(); + // Fetch magnetic field from ccdb for current collision + d_bz = collision.grpMagField().getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << collision.timestamp() << " with magnetic field of " << d_bz << " kZG"; } void DefineEMEventCut() diff --git a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx index d2d05d32ae5..8b45a85ca32 100644 --- a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx @@ -26,7 +26,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -72,8 +71,8 @@ namespace pairutil = o2::aod::pwgem::photonmeson::utils::pairutil; // ─── Event Information Tables ──────────────────────────────────────────── -using MyCollisions = soa::Join; -using MyCollisionsMC = soa::Join; +using MyCollisions = soa::Join; +using MyCollisionsMC = soa::Join; // ─── Photon Tables ──────────────────────────────────────────── @@ -160,8 +159,6 @@ struct PairQCTask { bool evaluated{false}; }; - Service ccdb{}; - Configurable cfgCcdbUrl{"cfgCcdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; Configurable cfgBzOverrideT{"cfgBzOverrideT", -999.f, "Bz in Tesla; used instead of CCDB if > -100"}; struct : ConfigurableGroup { @@ -385,9 +382,6 @@ struct PairQCTask { mDedupCfg.maxLegDeDxAsym = dedup.cfgDupMaxLegDeDxAsym.value; mDedupCfg.maxDVtx3D = dedup.cfgDupMaxDVtx3D.value; mDedupCfg.requireBothLegs = dedup.cfgDupRequireBothLegs.value; - ccdb->setURL(cfgCcdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); fRegistry.add("Photon/hPtEtaPhi", "selected V0 photons;p_{T} (GeV/c);#eta;#varphi (rad)", kTH3F, {{100, 0.f, 2.f}, {40, -0.8f, 0.8f}, {72, 0.f, 6.2832f}}, true); // o2-linter: disable=magic-number (axis definition) @@ -418,8 +412,7 @@ struct PairQCTask { mBzT = cfgBzOverrideT.value; return; } - auto grpmag = ccdb->getForRun("GLO/Config/GRPMagField", mRunNumber); - mBzT = 0.1f * static_cast(grpmag->getNominalL3Field()); // o2-linter: disable=magic-number (kGauss -> Tesla) + mBzT = 0.1f * static_cast(collision.grpMagField().getNominalL3Field()); // o2-linter: disable=magic-number (kGauss -> Tesla) LOGF(info, "pairQC: run %d, Bz = %.2f T", mRunNumber, mBzT); } diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 496cf7a8067..c2756d1ae80 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -47,7 +47,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -233,7 +232,6 @@ struct PCMQC { } recoQASettingsGroup; o2::ccdb::CcdbApi ccdbApi; - o2::framework::Service ccdb{}; int mRunNumber = 0; float d_bz = 0; static constexpr std::array event_types = {"before/", "after/"}; @@ -250,11 +248,6 @@ struct PCMQC { mRunNumber = 0; d_bz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } template diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index a51c8533f95..859fe63b2bb 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -26,7 +26,6 @@ #include "Common/Core/RecoDecay.h" -#include #include #include #include @@ -77,8 +76,6 @@ enum class MapLevel { }; struct PhotonResoTask { - o2::framework::Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; // configurable axis ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {400, 0.0, 0.8}, "invariant mass axis for the neutral meson"}; @@ -194,7 +191,6 @@ struct PhotonResoTask { HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - o2::framework::Service ccdb{}; int mRunNumber{-1}; float dBz{0.f}; @@ -273,11 +269,6 @@ struct PhotonResoTask { mRunNumber = 0; dBz = 0; - ccdb->setURL(ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - defineEMEventCut(); defineEMCCut(); fEMCCut.addQAHistograms(®istry); diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 1bbaab29506..725510cd4fc 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -28,7 +28,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -93,8 +92,8 @@ using namespace o2::pwgem::photonmeson; // ─── Event Information Tables ──────────────────────────────────────────── -using MyCollisions = soa::Join; -using MyCollisionsMC = soa::Join; +using MyCollisions = soa::Join; +using MyCollisionsMC = soa::Join; using MyCollision = MyCollisions::iterator; // ─── Photon Tables ──────────────────────────────────────────── @@ -339,11 +338,9 @@ struct Photonhbt { // CONFIGURABLES /*************************************************/ - Service ccdb{}; - Configurable cfgCcdbUrl{"cfgCcdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; Configurable cfgBzOverrideT{"cfgBzOverrideT", -999.f, "Bz in Tesla; used instead of CCDB if > -100"}; float mBzT{0.f}; // signed, Tesla - float mVDriftCmPerNs{0.f}; // TPC drift velocity from CCDB; 0 = unavailable + float mVDriftCmPerNs{0.f}; // TPC drift velocity from CCDB // ─── Configurables: QA flags ─────────────────────────────────────────────── struct : ConfigurableGroup { @@ -717,9 +714,6 @@ struct Photonhbt { std::random_device seedGen; engine = std::mt19937(seedGen()); dist01 = std::uniform_int_distribution(0, 1); - ccdb->setURL(cfgCcdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); const float worst = selfTestLegHelix(); constexpr float kSelfTestTol = 1.e-4f; @@ -765,28 +759,23 @@ struct Photonhbt { template void initCCDB(TCollision const& collision) { + // the drift velocity can change within a run, so it is read for every collision + const auto& vd = collision.vdriftTgl(); + mVDriftCmPerNs = vd.refVDrift * vd.corrFact * 1e-3f; // o2-linter: disable=magic-number (cm/us -> cm/ns) + if (mRunNumber == collision.runNumber()) { return; } mRunNumber = collision.runNumber(); - - auto vd = ccdb->getForRun("TPC/Calib/VDriftTgl", mRunNumber); - if (vd != nullptr) { - mVDriftCmPerNs = vd->refVDrift * vd->corrFact * 1e-3f; // o2-linter: disable=magic-number (cm/us -> cm/ns) - LOGF(info, "photonhbt: run %d, TPC vdrift = %.6f cm/ns (%.4f cm/us); 1 cm in z = %.0f ns", - mRunNumber, mVDriftCmPerNs, 1e3f * mVDriftCmPerNs, - (mVDriftCmPerNs > 0.f) ? 1.f / mVDriftCmPerNs : -1.f); - } else { - mVDriftCmPerNs = 0.f; - LOGF(warn, "photonhbt: no TPC VDrift object for run %d -- the z scale stays in cm", mRunNumber); - } + LOGF(info, "photonhbt: run %d, TPC vdrift = %.6f cm/ns (%.4f cm/us); 1 cm in z = %.0f ns", + mRunNumber, mVDriftCmPerNs, 1e3f * mVDriftCmPerNs, + (mVDriftCmPerNs > 0.f) ? 1.f / mVDriftCmPerNs : -1.f); if (cfgBzOverrideT.value > -100.f) { // o2-linter: disable=magic-number (number in case B-field is overridden in case not fetched from CCDB) mBzT = cfgBzOverrideT.value; return; } - auto grpmag = ccdb->getForRun("GLO/Config/GRPMagField", mRunNumber); - mBzT = 0.1f * static_cast(grpmag->getNominalL3Field()); + mBzT = 0.1f * static_cast(collision.grpMagField().getNominalL3Field()); LOGF(info, "photonhbt: run %d, Bz = %.2f T", mRunNumber, mBzT); } diff --git a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx index 8c1b1ed5bcb..74f0ab08e83 100644 --- a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx +++ b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx @@ -24,7 +24,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include #include #include #include @@ -75,7 +74,6 @@ struct prefilterPhoton { Produces pfb_ele_derived; // Configurables - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; @@ -178,7 +176,6 @@ struct prefilterPhoton { HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; o2::ccdb::CcdbApi ccdbApi; - Service ccdb{}; int mRunNumber = 0; float dBz = 0; @@ -190,11 +187,6 @@ struct prefilterPhoton { mRunNumber = 0; dBz = 0; - - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); } ~prefilterPhoton() = default; diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index df0c4ac6456..8bb2bc5e0c1 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -177,6 +178,8 @@ struct TaskPi0FlowEMC { Configurable useEMCal{"useEMCal", false, "flag to use EMCal clusters"}; Configurable useDCal{"useDCal", false, "flag to use DCal clusters"}; Configurable useCrosspairs{"useCrosspairs", true, "flag to allow pairing of EMCal with DCal clusters. If this is set, useEMCal and useDCal are ignored!"}; + Configurable useAsymmetricEnergyCut{"useAsymmetricEnergyCut", false, "flag to turn on the asymmetric cluster energy cut: max(E1,E2) > asymmetricMinEnergy. Only for EMCal EMCal cluster pairing, not to be used for PCM EMCal pairing."}; + Configurable asymmetricMinEnergy{"asymmetricMinEnergy", 0.9f, "cut value for max(E1,E2) > asymmetricMinEnergy. Will only be used of useAsymmetricEnergyCut is set to true!"}; } emccuts; V0PhotonCut fV0PhotonCut; @@ -1064,6 +1067,11 @@ struct TaskPi0FlowEMC { continue; } } + + if (emccuts.useAsymmetricEnergyCut && std::max(g1.corrE(), g2.corrE()) < emccuts.asymmetricMinEnergy) { + continue; + } + ROOT::Math::PtEtaPhiMVector v1(g1.corrPt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.corrPt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2; @@ -1212,6 +1220,10 @@ struct TaskPi0FlowEMC { continue; } + if (emccuts.useAsymmetricEnergyCut && std::max(g1.corrE(), g2.corrE()) < emccuts.asymmetricMinEnergy) { + continue; + } + // Cut edge clusters away, similar to rotation method to ensure same acceptance is used if (cfgDistanceToEdge.value > 0) { if (checkEtaPhi1D(g1.eta(), RecoDecay::constrainAngle(g1.phi())) >= cfgEMCalMapLevelBackground.value) {