From 0193e08fb8502350fe1346593c74b8292c865bc4 Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Mon, 12 Dec 2022 18:01:37 +0100 Subject: [PATCH 01/10] PWGEM/PhotonMeson Code Cleanup --- .../TableProducer/skimmerGammaConversions.cxx | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 131a3fd2329..52d9d7f68cb 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -17,17 +17,6 @@ // *****revision history*****: // // added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// -// added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// // adding accesing to ccdb objects for 2022 data taking on 30.11.22 by A. Marin (a.marin@gsi.de) // // ************************** @@ -53,24 +42,23 @@ #include "ReconstructionDataFormats/TrackFwd.h" #include "Common/Core/trackUtilities.h" -#include // for ATan2, Cos, Sin, Sqrt -#include "TVector2.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// using collisionEvSelIt = soa::Join::iterator; using tracksAndTPCInfo = soa::Join; using tracksAndTPCInfoMC = soa::Join; struct skimmerGammaConversions { //configurables for CCDB access - Configurable path{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbPath{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "path to the GRPMagField object"}; + Configurable ccdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; HistogramRegistry fRegistry{ "fRegistry", @@ -130,14 +118,12 @@ struct skimmerGammaConversions { lXaxis->SetBinLabel(lPairIt.first + 1, lPairIt.second.data()); } - // This is added in order to access the ccdb - - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); // no idea wether this is useful or not, there is no documentation + ccdb->setLocalObjectValidityChecking(); // Not later than now, will be replaced by the value of the train creation // This avoids that users can replace objects **while** a train is running - ccdb->setCreatedNotAfter(nolaterthan.value); // was like that in the tutorial efficiencyPerRun + ccdb->setCreatedNotAfter(ccdbNoLaterThan); ccdb->setFatalWhenNull(false); } @@ -147,20 +133,26 @@ struct skimmerGammaConversions { if (runNumber == bc.runNumber()) { return; } + auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(path.value, bc.timestamp()); - o2::parameters::GRPMagField* grpmag = 0x0; + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(ccdbPath, run3grp_timestamp); + o2::parameters::GRPMagField* grpmag = nullptr; - if (grpo) { + if(grpo) { o2::base::Propagator::initFieldFromGRP(grpo); - } else { + } + else { grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << path << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << ccdbPath << " of object GRPObject for timestamp " << run3grp_timestamp; + } + else + { + LOG(info) << "Magnetic field initialized from GRPMagField"; } o2::base::Propagator::initFieldFromGRP(grpmag); } - //o2::base::Propagator::Instance()->setMatLUT(lut); + runNumber = bc.runNumber(); } @@ -393,7 +385,6 @@ struct skimmerGammaConversions { void Vtx_recalculation(T lTrackPos, T lTrackNeg, float* conversionPosition) { o2::base::Propagator* prop = o2::base::Propagator::Instance(); //This singleton propagator requires some initialisation of the CCDB object. - float bz = prop->getNominalBz(); //******************************************************* From ac57fe57712f75e8227af473c7adb763ca9c3341 Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Fri, 16 Dec 2022 17:53:08 +0100 Subject: [PATCH 02/10] PWGEM/PhotonMeson Added potential storage for KFParticle Chi2 Added additional histogram (XY) --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 20 ++++++++++++------- .../TableProducer/skimmerGammaConversions.cxx | 5 +++-- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 6 ++++-- .../PhotonMeson/Utils/gammaConvDefinitions.h | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index eb4a17c49f4..971fd9f5ecc 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -173,19 +173,25 @@ DECLARE_SOA_INDEX_COLUMN(V0DaughterMcParticle, v0DaughterMcParticle); // DECLARE_SOA_INDEX_TABLE_USER(MCTrackIndex, V0MCDaughterParticles, "MCTRACKINDEX", MCParticleTrueIndex::V0DaughterTrackId); DECLARE_SOA_TABLE(MCParticleIndex, "AOD", "MCPARTICLEINDEX", MCParticleTrueIndex::V0DaughterMcParticleId); -namespace gammarecalculated +namespace v0Recalculations { DECLARE_SOA_COLUMN(RecalculatedVtxX, recalculatedVtxX, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxY, recalculatedVtxY, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxZ, recalculatedVtxZ, float); //! Recalculated conversion point DECLARE_SOA_DYNAMIC_COLUMN(RecalculatedVtxR, recalculatedVtxR, [](float x, float y) { return TMath::Sqrt(x * x + y * y); }); -} // namespace gammarecalculated +} // namespace v0RecalculationsAndKF -DECLARE_SOA_TABLE(V0Recalculated, "AOD", "V0RECALCULATED", - gammarecalculated::RecalculatedVtxX, - gammarecalculated::RecalculatedVtxY, - gammarecalculated::RecalculatedVtxZ, - gammarecalculated::RecalculatedVtxR); +namespace v0KFParticle +{ +DECLARE_SOA_COLUMN(ChiSquare, chiSquare, float); // Chi2 of the reconstructed V0 +} // namespace v0KFParticle + +DECLARE_SOA_TABLE(V0RecalculationAndKF, "AOD", "V0RECALCANDKF", + v0Recalculations::RecalculatedVtxX, + v0Recalculations::RecalculatedVtxY, + v0Recalculations::RecalculatedVtxZ, + v0Recalculations::RecalculatedVtxR, + v0KFParticle::ChiSquare); namespace gammamctrue { diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 52d9d7f68cb..8884792948f 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -96,7 +96,7 @@ struct skimmerGammaConversions { Produces fFuncTableV0DaughterTracks; Produces fFuncTableMcGammasFromConfirmedV0s; - Produces fFuncTableV0Recalculated; + Produces fFuncTableV0Recalculated; Produces fFuncTableMCTrackInformation; Produces fIndexTableMCTrackIndex; @@ -181,7 +181,8 @@ struct skimmerGammaConversions { fFuncTableV0Recalculated( recalculatedVtx[0], recalculatedVtx[1], - recalculatedVtx[2]); + recalculatedVtx[2], + 0.0); // temporarily add 0 } template diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 7327bfb82ba..67b23481d92 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -29,7 +29,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using V0DatasAdditional = soa::Join; +using V0DatasAdditional = soa::Join; using V0DaughterTracksWithMC = soa::Join; // using collisionEvSelIt = soa::Join::iterator; @@ -146,6 +146,7 @@ struct GammaConversions { {"hPsiPt", "hPsiPt;#Psi;p_{T} (GeV/c)", {HistType::kTH2F, {gAxis_eta, gAxis_pT}}}, {"hCosPAngle", "hCosPAngle;CosPAngle;counts", {HistType::kTH1F, {{800, 0.99f, 1.005f}}}}, {"hRVsZ", "hRVsZ;R (cm);z (cm)", {HistType::kTH2F, {gAxis_r, gAxis_xyz}}}, + {"hXVsY", "hXVsY;conversion x (cm);conversion y (cm)", {HistType::kTH2F, {gAxis_z2d, gAxis_z2d}}}, {"hpeDivpGamma", "hpeDivpGamma;p_{T} (GeV/c);p_{T, e}/p_{T, #gamma};counts", {HistType::kTH2F, {gAxis_pT, {220, 0.f, 1.1f}}}}}; // recalculated conversion Point for V0, only Rec and MCVal need this @@ -732,7 +733,8 @@ struct GammaConversions { fillTH2(theContainer, "hArmenteros", theV0.alpha(), theV0.qtarm()); fillTH2(theContainer, "hinvestigationOfQtCut", theV0.qtarm(), theV0.pt()); fillTH2(theContainer, "hPsiPt", theV0.psipair(), theV0.pt()); - fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.z()); // as long as z recalculation is not fixed use this + fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.recalculatedVtxZ()); + fillTH2(theContainer, "hXVsY", theV0.recalculatedVtxX(), theV0.recalculatedVtxY()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracpos()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracneg()); } diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index bb847f68557..056109d7744 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -27,7 +27,7 @@ AxisSpec const gAxis_r{800, 0.f, 200.f}; AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; AxisSpec const gAxis_dr{200, -100.f, 100.f}; AxisSpec const gAxis_r2d{400, 0.f, 250.f}; -AxisSpec const gAxis_z2d{400, -250.f, 250.f}; +AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; AxisSpec const gAxis_TPCdEdxSig{800, -10.f, 10.f}; AxisSpec const gAxis_radRes{800, -PI, PI}; AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; From 4b02017d8a386bcff087da29e0f3388a8058177f Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Mon, 12 Dec 2022 18:01:37 +0100 Subject: [PATCH 03/10] PWGEM/PhotonMeson Code Cleanup --- .../TableProducer/skimmerGammaConversions.cxx | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 131a3fd2329..52d9d7f68cb 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -17,17 +17,6 @@ // *****revision history*****: // // added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// -// added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// // adding accesing to ccdb objects for 2022 data taking on 30.11.22 by A. Marin (a.marin@gsi.de) // // ************************** @@ -53,24 +42,23 @@ #include "ReconstructionDataFormats/TrackFwd.h" #include "Common/Core/trackUtilities.h" -#include // for ATan2, Cos, Sin, Sqrt -#include "TVector2.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// using collisionEvSelIt = soa::Join::iterator; using tracksAndTPCInfo = soa::Join; using tracksAndTPCInfoMC = soa::Join; struct skimmerGammaConversions { //configurables for CCDB access - Configurable path{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbPath{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "path to the GRPMagField object"}; + Configurable ccdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; HistogramRegistry fRegistry{ "fRegistry", @@ -130,14 +118,12 @@ struct skimmerGammaConversions { lXaxis->SetBinLabel(lPairIt.first + 1, lPairIt.second.data()); } - // This is added in order to access the ccdb - - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); // no idea wether this is useful or not, there is no documentation + ccdb->setLocalObjectValidityChecking(); // Not later than now, will be replaced by the value of the train creation // This avoids that users can replace objects **while** a train is running - ccdb->setCreatedNotAfter(nolaterthan.value); // was like that in the tutorial efficiencyPerRun + ccdb->setCreatedNotAfter(ccdbNoLaterThan); ccdb->setFatalWhenNull(false); } @@ -147,20 +133,26 @@ struct skimmerGammaConversions { if (runNumber == bc.runNumber()) { return; } + auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(path.value, bc.timestamp()); - o2::parameters::GRPMagField* grpmag = 0x0; + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(ccdbPath, run3grp_timestamp); + o2::parameters::GRPMagField* grpmag = nullptr; - if (grpo) { + if(grpo) { o2::base::Propagator::initFieldFromGRP(grpo); - } else { + } + else { grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << path << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << ccdbPath << " of object GRPObject for timestamp " << run3grp_timestamp; + } + else + { + LOG(info) << "Magnetic field initialized from GRPMagField"; } o2::base::Propagator::initFieldFromGRP(grpmag); } - //o2::base::Propagator::Instance()->setMatLUT(lut); + runNumber = bc.runNumber(); } @@ -393,7 +385,6 @@ struct skimmerGammaConversions { void Vtx_recalculation(T lTrackPos, T lTrackNeg, float* conversionPosition) { o2::base::Propagator* prop = o2::base::Propagator::Instance(); //This singleton propagator requires some initialisation of the CCDB object. - float bz = prop->getNominalBz(); //******************************************************* From 3a0462df83d883855f15939ab82f9d7ef747d1b6 Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Fri, 16 Dec 2022 17:53:08 +0100 Subject: [PATCH 04/10] PWGEM/PhotonMeson Added potential storage for KFParticle Chi2 Added additional histogram (XY) --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 20 ++++++++++++------- .../TableProducer/skimmerGammaConversions.cxx | 5 +++-- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 6 ++++-- .../PhotonMeson/Utils/gammaConvDefinitions.h | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index eb4a17c49f4..971fd9f5ecc 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -173,19 +173,25 @@ DECLARE_SOA_INDEX_COLUMN(V0DaughterMcParticle, v0DaughterMcParticle); // DECLARE_SOA_INDEX_TABLE_USER(MCTrackIndex, V0MCDaughterParticles, "MCTRACKINDEX", MCParticleTrueIndex::V0DaughterTrackId); DECLARE_SOA_TABLE(MCParticleIndex, "AOD", "MCPARTICLEINDEX", MCParticleTrueIndex::V0DaughterMcParticleId); -namespace gammarecalculated +namespace v0Recalculations { DECLARE_SOA_COLUMN(RecalculatedVtxX, recalculatedVtxX, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxY, recalculatedVtxY, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxZ, recalculatedVtxZ, float); //! Recalculated conversion point DECLARE_SOA_DYNAMIC_COLUMN(RecalculatedVtxR, recalculatedVtxR, [](float x, float y) { return TMath::Sqrt(x * x + y * y); }); -} // namespace gammarecalculated +} // namespace v0RecalculationsAndKF -DECLARE_SOA_TABLE(V0Recalculated, "AOD", "V0RECALCULATED", - gammarecalculated::RecalculatedVtxX, - gammarecalculated::RecalculatedVtxY, - gammarecalculated::RecalculatedVtxZ, - gammarecalculated::RecalculatedVtxR); +namespace v0KFParticle +{ +DECLARE_SOA_COLUMN(ChiSquare, chiSquare, float); // Chi2 of the reconstructed V0 +} // namespace v0KFParticle + +DECLARE_SOA_TABLE(V0RecalculationAndKF, "AOD", "V0RECALCANDKF", + v0Recalculations::RecalculatedVtxX, + v0Recalculations::RecalculatedVtxY, + v0Recalculations::RecalculatedVtxZ, + v0Recalculations::RecalculatedVtxR, + v0KFParticle::ChiSquare); namespace gammamctrue { diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 52d9d7f68cb..8884792948f 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -96,7 +96,7 @@ struct skimmerGammaConversions { Produces fFuncTableV0DaughterTracks; Produces fFuncTableMcGammasFromConfirmedV0s; - Produces fFuncTableV0Recalculated; + Produces fFuncTableV0Recalculated; Produces fFuncTableMCTrackInformation; Produces fIndexTableMCTrackIndex; @@ -181,7 +181,8 @@ struct skimmerGammaConversions { fFuncTableV0Recalculated( recalculatedVtx[0], recalculatedVtx[1], - recalculatedVtx[2]); + recalculatedVtx[2], + 0.0); // temporarily add 0 } template diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 7327bfb82ba..67b23481d92 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -29,7 +29,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using V0DatasAdditional = soa::Join; +using V0DatasAdditional = soa::Join; using V0DaughterTracksWithMC = soa::Join; // using collisionEvSelIt = soa::Join::iterator; @@ -146,6 +146,7 @@ struct GammaConversions { {"hPsiPt", "hPsiPt;#Psi;p_{T} (GeV/c)", {HistType::kTH2F, {gAxis_eta, gAxis_pT}}}, {"hCosPAngle", "hCosPAngle;CosPAngle;counts", {HistType::kTH1F, {{800, 0.99f, 1.005f}}}}, {"hRVsZ", "hRVsZ;R (cm);z (cm)", {HistType::kTH2F, {gAxis_r, gAxis_xyz}}}, + {"hXVsY", "hXVsY;conversion x (cm);conversion y (cm)", {HistType::kTH2F, {gAxis_z2d, gAxis_z2d}}}, {"hpeDivpGamma", "hpeDivpGamma;p_{T} (GeV/c);p_{T, e}/p_{T, #gamma};counts", {HistType::kTH2F, {gAxis_pT, {220, 0.f, 1.1f}}}}}; // recalculated conversion Point for V0, only Rec and MCVal need this @@ -732,7 +733,8 @@ struct GammaConversions { fillTH2(theContainer, "hArmenteros", theV0.alpha(), theV0.qtarm()); fillTH2(theContainer, "hinvestigationOfQtCut", theV0.qtarm(), theV0.pt()); fillTH2(theContainer, "hPsiPt", theV0.psipair(), theV0.pt()); - fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.z()); // as long as z recalculation is not fixed use this + fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.recalculatedVtxZ()); + fillTH2(theContainer, "hXVsY", theV0.recalculatedVtxX(), theV0.recalculatedVtxY()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracpos()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracneg()); } diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index bb847f68557..056109d7744 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -27,7 +27,7 @@ AxisSpec const gAxis_r{800, 0.f, 200.f}; AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; AxisSpec const gAxis_dr{200, -100.f, 100.f}; AxisSpec const gAxis_r2d{400, 0.f, 250.f}; -AxisSpec const gAxis_z2d{400, -250.f, 250.f}; +AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; AxisSpec const gAxis_TPCdEdxSig{800, -10.f, 10.f}; AxisSpec const gAxis_radRes{800, -PI, PI}; AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; From 2b697b8718d0a990d30b646cae9e46c20162e65b Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Mon, 12 Dec 2022 18:01:37 +0100 Subject: [PATCH 05/10] PWGEM/PhotonMeson Code Cleanup --- .../TableProducer/skimmerGammaConversions.cxx | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 7e89d7d2542..482c1e4d36c 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -17,17 +17,6 @@ // *****revision history*****: // // added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// -// added recalculation of the conversion point on 08.07.22 by Nikita Philip Tatsch (tatsch@physi.uni-heidelberg.de) -// -// ************************** - -// *****revision history*****: -// // adding accesing to ccdb objects for 2022 data taking on 30.11.22 by A. Marin (a.marin@gsi.de) // // ************************** @@ -53,24 +42,23 @@ #include "ReconstructionDataFormats/TrackFwd.h" #include "Common/Core/trackUtilities.h" -#include // for ATan2, Cos, Sin, Sqrt -#include "TVector2.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// using collisionEvSelIt = soa::Join::iterator; using tracksAndTPCInfo = soa::Join; using tracksAndTPCInfoMC = soa::Join; struct skimmerGammaConversions { //configurables for CCDB access - Configurable path{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbPath{"ccdb-path", "GLO/GRP/GRP", "path to the ccdb object"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "path to the GRPMagField object"}; + Configurable ccdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; HistogramRegistry fRegistry{ "fRegistry", @@ -130,14 +118,12 @@ struct skimmerGammaConversions { lXaxis->SetBinLabel(lPairIt.first + 1, lPairIt.second.data()); } - // This is added in order to access the ccdb - - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); // no idea wether this is useful or not, there is no documentation + ccdb->setLocalObjectValidityChecking(); // Not later than now, will be replaced by the value of the train creation // This avoids that users can replace objects **while** a train is running - ccdb->setCreatedNotAfter(nolaterthan.value); // was like that in the tutorial efficiencyPerRun + ccdb->setCreatedNotAfter(ccdbNoLaterThan); ccdb->setFatalWhenNull(false); } @@ -147,20 +133,26 @@ struct skimmerGammaConversions { if (runNumber == bc.runNumber()) { return; } + auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(path.value, bc.timestamp()); - o2::parameters::GRPMagField* grpmag = 0x0; + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(ccdbPath, run3grp_timestamp); + o2::parameters::GRPMagField* grpmag = nullptr; - if (grpo) { + if(grpo) { o2::base::Propagator::initFieldFromGRP(grpo); - } else { + } + else { grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << path << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << ccdbPath << " of object GRPObject for timestamp " << run3grp_timestamp; + } + else + { + LOG(info) << "Magnetic field initialized from GRPMagField"; } o2::base::Propagator::initFieldFromGRP(grpmag); } - //o2::base::Propagator::Instance()->setMatLUT(lut); + runNumber = bc.runNumber(); } @@ -393,7 +385,6 @@ struct skimmerGammaConversions { void Vtx_recalculation(T lTrackPos, T lTrackNeg, float* conversionPosition) { o2::base::Propagator* prop = o2::base::Propagator::Instance(); //This singleton propagator requires some initialisation of the CCDB object. - float bz = prop->getNominalBz(); //******************************************************* From c9869029f98a9945b23b90053c14a7ae36b04cae Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Fri, 16 Dec 2022 17:53:08 +0100 Subject: [PATCH 06/10] PWGEM/PhotonMeson Added potential storage for KFParticle Chi2 Added additional histogram (XY) --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 20 ++++++++++++------- .../TableProducer/skimmerGammaConversions.cxx | 5 +++-- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 6 ++++-- .../PhotonMeson/Utils/gammaConvDefinitions.h | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 644a71e5bd4..7a2f8cd9bad 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -173,19 +173,25 @@ DECLARE_SOA_INDEX_COLUMN(V0DaughterMcParticle, v0DaughterMcParticle); // DECLARE_SOA_INDEX_TABLE_USER(MCTrackIndex, V0MCDaughterParticles, "MCTRACKINDEX", MCParticleTrueIndex::V0DaughterTrackId); DECLARE_SOA_TABLE(MCParticleIndex, "AOD", "MCPARTICLEINDEX", MCParticleTrueIndex::V0DaughterMcParticleId); -namespace gammarecalculated +namespace v0Recalculations { DECLARE_SOA_COLUMN(RecalculatedVtxX, recalculatedVtxX, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxY, recalculatedVtxY, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxZ, recalculatedVtxZ, float); //! Recalculated conversion point DECLARE_SOA_DYNAMIC_COLUMN(RecalculatedVtxR, recalculatedVtxR, [](float x, float y) { return TMath::Sqrt(x * x + y * y); }); -} // namespace gammarecalculated +} // namespace v0RecalculationsAndKF -DECLARE_SOA_TABLE(V0Recalculated, "AOD", "V0RECALCULATED", - gammarecalculated::RecalculatedVtxX, - gammarecalculated::RecalculatedVtxY, - gammarecalculated::RecalculatedVtxZ, - gammarecalculated::RecalculatedVtxR); +namespace v0KFParticle +{ +DECLARE_SOA_COLUMN(ChiSquare, chiSquare, float); // Chi2 of the reconstructed V0 +} // namespace v0KFParticle + +DECLARE_SOA_TABLE(V0RecalculationAndKF, "AOD", "V0RECALCANDKF", + v0Recalculations::RecalculatedVtxX, + v0Recalculations::RecalculatedVtxY, + v0Recalculations::RecalculatedVtxZ, + v0Recalculations::RecalculatedVtxR, + v0KFParticle::ChiSquare); namespace gammamctrue { diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index 482c1e4d36c..f50c67ce17f 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -96,7 +96,7 @@ struct skimmerGammaConversions { Produces fFuncTableV0DaughterTracks; Produces fFuncTableMcGammasFromConfirmedV0s; - Produces fFuncTableV0Recalculated; + Produces fFuncTableV0Recalculated; Produces fFuncTableMCTrackInformation; Produces fIndexTableMCTrackIndex; @@ -181,7 +181,8 @@ struct skimmerGammaConversions { fFuncTableV0Recalculated( recalculatedVtx[0], recalculatedVtx[1], - recalculatedVtx[2]); + recalculatedVtx[2], + 0.0); // temporarily add 0 } template diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 7327bfb82ba..67b23481d92 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -29,7 +29,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using V0DatasAdditional = soa::Join; +using V0DatasAdditional = soa::Join; using V0DaughterTracksWithMC = soa::Join; // using collisionEvSelIt = soa::Join::iterator; @@ -146,6 +146,7 @@ struct GammaConversions { {"hPsiPt", "hPsiPt;#Psi;p_{T} (GeV/c)", {HistType::kTH2F, {gAxis_eta, gAxis_pT}}}, {"hCosPAngle", "hCosPAngle;CosPAngle;counts", {HistType::kTH1F, {{800, 0.99f, 1.005f}}}}, {"hRVsZ", "hRVsZ;R (cm);z (cm)", {HistType::kTH2F, {gAxis_r, gAxis_xyz}}}, + {"hXVsY", "hXVsY;conversion x (cm);conversion y (cm)", {HistType::kTH2F, {gAxis_z2d, gAxis_z2d}}}, {"hpeDivpGamma", "hpeDivpGamma;p_{T} (GeV/c);p_{T, e}/p_{T, #gamma};counts", {HistType::kTH2F, {gAxis_pT, {220, 0.f, 1.1f}}}}}; // recalculated conversion Point for V0, only Rec and MCVal need this @@ -732,7 +733,8 @@ struct GammaConversions { fillTH2(theContainer, "hArmenteros", theV0.alpha(), theV0.qtarm()); fillTH2(theContainer, "hinvestigationOfQtCut", theV0.qtarm(), theV0.pt()); fillTH2(theContainer, "hPsiPt", theV0.psipair(), theV0.pt()); - fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.z()); // as long as z recalculation is not fixed use this + fillTH2(theContainer, "hRVsZ", theV0.recalculatedVtxR(), theV0.recalculatedVtxZ()); + fillTH2(theContainer, "hXVsY", theV0.recalculatedVtxX(), theV0.recalculatedVtxY()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracpos()); fillTH2(theContainer, "hpeDivpGamma", RecoDecay::sqrtSumOfSquares(theV0.px(), theV0.py()), theV0.pfracneg()); } diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index bb847f68557..056109d7744 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -27,7 +27,7 @@ AxisSpec const gAxis_r{800, 0.f, 200.f}; AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; AxisSpec const gAxis_dr{200, -100.f, 100.f}; AxisSpec const gAxis_r2d{400, 0.f, 250.f}; -AxisSpec const gAxis_z2d{400, -250.f, 250.f}; +AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; AxisSpec const gAxis_TPCdEdxSig{800, -10.f, 10.f}; AxisSpec const gAxis_radRes{800, -PI, PI}; AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; From ed9c06db324d5d2b109c3e6865c95ef461fbf970 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 9 Feb 2023 14:13:07 +0000 Subject: [PATCH 07/10] Please consider the following formatting changes --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- .../TableProducer/skimmerGammaConversions.cxx | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 7a2f8cd9bad..181db9040cf 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -179,7 +179,7 @@ DECLARE_SOA_COLUMN(RecalculatedVtxX, recalculatedVtxX, float); //! Recalculated DECLARE_SOA_COLUMN(RecalculatedVtxY, recalculatedVtxY, float); //! Recalculated conversion point DECLARE_SOA_COLUMN(RecalculatedVtxZ, recalculatedVtxZ, float); //! Recalculated conversion point DECLARE_SOA_DYNAMIC_COLUMN(RecalculatedVtxR, recalculatedVtxR, [](float x, float y) { return TMath::Sqrt(x * x + y * y); }); -} // namespace v0RecalculationsAndKF +} // namespace v0Recalculations namespace v0KFParticle { diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx index f50c67ce17f..725e5f6b8b0 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversions.cxx @@ -138,21 +138,18 @@ struct skimmerGammaConversions { o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(ccdbPath, run3grp_timestamp); o2::parameters::GRPMagField* grpmag = nullptr; - if(grpo) { + if (grpo) { o2::base::Propagator::initFieldFromGRP(grpo); - } - else { + } else { grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); if (!grpmag) { LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << ccdbPath << " of object GRPObject for timestamp " << run3grp_timestamp; - } - else - { + } else { LOG(info) << "Magnetic field initialized from GRPMagField"; } o2::base::Propagator::initFieldFromGRP(grpmag); } - + runNumber = bc.runNumber(); } @@ -182,7 +179,7 @@ struct skimmerGammaConversions { recalculatedVtx[0], recalculatedVtx[1], recalculatedVtx[2], - 0.0); // temporarily add 0 + 0.0); // temporarily add 0 } template From bb601142722b4718ec6bd928c01dd02c131bd4db Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Thu, 23 Feb 2023 21:23:54 +0100 Subject: [PATCH 08/10] PWGEM: Fixed formatting problems pointed out in the PR --- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 67b23481d92..4dd7b1f15b9 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -24,6 +24,10 @@ #include #include // for ATan2, Cos, Sin, Sqrt +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -64,8 +68,8 @@ struct GammaConversions { Configurable fV0QtPtMultiplicator{"fV0QtPtMultiplicator", 0.125, "Multiply pt of V0s by this value to get the 2nd denominator in the armenteros cut. The products maximum value is fV0QtMax."}; Configurable fV0QtMax{"fV0QtMax", 0.050, "the maximum value of the product, that is the maximum qt"}; Configurable fLineCutZ0{"fLineCutZ0", 12.0, "The offset for the linecute used in the Z vs R plot"}; - Configurable fLineCutZRSlope{"fLineCutZRSlope", (float)TMath::Tan(2 * TMath::ATan(TMath::Exp(-fTruePhotonEtaMax))), "The slope for the line cut"}; - Configurable fPhysicalPrimaryOnly{"fPhysicalPrimaryOnly", true, "fPhysicalPrimaryOnly"}; + Configurable fLineCutZRSlope{"fLineCutZRSlope", static_cast(TMath::Tan(2 * TMath::ATan(TMath::Exp(-fTruePhotonEtaMax)))), "The slope for the line cut"}; + Configurable fPhysicalPrimaryOnly{"fPhysicalPrimaryOnly", true, "fPhysicalPrimaryOnly"}; std::map fPhotonCutLabels{ {ePhotonCuts::kV0In, "kV0In"}, @@ -882,9 +886,8 @@ struct GammaConversions { fillV0SelectionHisto(ePhotonCuts::kPionRejLowMom); return kFALSE; } - } // High Pt Pion rej - else { + } else { if (theTrack.tpcNSigmaEl() > fPIDnSigmaElectronMin && theTrack.tpcNSigmaEl() < fPIDnSigmaElectronMax && theTrack.tpcNSigmaPi() < fPIDnSigmaAbovePionLineHighPMin) { fillV0SelectionHisto(ePhotonCuts::kPionRejHighMom); return kFALSE; @@ -898,4 +901,4 @@ struct GammaConversions { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} From e2eb35524834e794d361bd3d215e082c51b1e464 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 23 Feb 2023 20:26:17 +0000 Subject: [PATCH 09/10] Please consider the following formatting changes --- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 4dd7b1f15b9..7c06641995d 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -69,7 +69,7 @@ struct GammaConversions { Configurable fV0QtMax{"fV0QtMax", 0.050, "the maximum value of the product, that is the maximum qt"}; Configurable fLineCutZ0{"fLineCutZ0", 12.0, "The offset for the linecute used in the Z vs R plot"}; Configurable fLineCutZRSlope{"fLineCutZRSlope", static_cast(TMath::Tan(2 * TMath::ATan(TMath::Exp(-fTruePhotonEtaMax)))), "The slope for the line cut"}; - Configurable fPhysicalPrimaryOnly{"fPhysicalPrimaryOnly", true, "fPhysicalPrimaryOnly"}; + Configurable fPhysicalPrimaryOnly{"fPhysicalPrimaryOnly", true, "fPhysicalPrimaryOnly"}; std::map fPhotonCutLabels{ {ePhotonCuts::kV0In, "kV0In"}, From 318708fa4eac8c8c104186fe57d019317e7a98ec Mon Sep 17 00:00:00 2001 From: MrWhatZitTooYa Date: Thu, 23 Feb 2023 21:44:52 +0100 Subject: [PATCH 10/10] PWGEM: Fixed formatting problems pointed out in the PR --- PWGEM/PhotonMeson/Tasks/gammaConversions.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 4dd7b1f15b9..df468075a37 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx @@ -14,6 +14,12 @@ /// \author stephan.friedrich.stiefelmaier@cern.ch #include "PWGEM/PhotonMeson/Tasks/gammaConversions.h" + +#include +#include +#include +#include + #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" @@ -24,10 +30,6 @@ #include #include // for ATan2, Cos, Sin, Sqrt -#include -#include -#include -#include using namespace o2; using namespace o2::framework;