diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 925cbca74c7..15853323947 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 v0Recalculations -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 7e89d7d2542..725e5f6b8b0 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", @@ -108,7 +96,7 @@ struct skimmerGammaConversions { Produces fFuncTableV0DaughterTracks; Produces fFuncTableMcGammasFromConfirmedV0s; - Produces fFuncTableV0Recalculated; + Produces fFuncTableV0Recalculated; Produces fFuncTableMCTrackInformation; Produces fIndexTableMCTrackIndex; @@ -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,23 @@ 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) { o2::base::Propagator::initFieldFromGRP(grpo); } 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(); } @@ -189,7 +178,8 @@ struct skimmerGammaConversions { fFuncTableV0Recalculated( recalculatedVtx[0], recalculatedVtx[1], - recalculatedVtx[2]); + recalculatedVtx[2], + 0.0); // temporarily add 0 } template @@ -393,7 +383,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(); //******************************************************* diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversions.cxx index 7327bfb82ba..fc30256c957 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" @@ -29,7 +35,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; @@ -64,7 +70,7 @@ 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 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{ @@ -146,6 +152,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 +739,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()); } @@ -880,9 +888,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; @@ -896,4 +903,4 @@ struct GammaConversions { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index 053c9e14ffd..acf40280f60 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -30,7 +30,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{401, -10.025f, 10.025f}; AxisSpec const gAxis_radRes{800, -PI, PI}; AxisSpec const gAxis_xyz{2400, -300.f, 300.f};