2424#include " Framework/ASoAHelpers.h"
2525#include " Framework/RunningWorkflowInfo.h"
2626#include " Framework/StepTHn.h"
27+ #include " Framework/O2DatabasePDGPlugin.h"
2728#include " DataFormatsParameters/GRPObject.h"
2829
2930#include " PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
3031#include " PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
3132#include " PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
3233#include " PWGCF/FemtoUniverse/Core/femtoUtils.h"
34+ #include " PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h"
3335
3436using namespace o2 ;
3537using namespace o2 ::analysis::femto_universe;
@@ -38,6 +40,9 @@ using namespace o2::framework::expressions;
3840using namespace o2 ::soa;
3941
4042struct femtoUniverseDebugV0 {
43+
44+ Service<o2::framework::O2DatabasePDG> pdg;
45+
4146 SliceCache cache;
4247
4348 Configurable<int > ConfPDGCodeV0{" ConfPDGCodePartOne" , 3122 , " V0 - PDG code" };
@@ -71,21 +76,24 @@ struct femtoUniverseDebugV0 {
7176 // / Histogram output
7277 HistogramRegistry EventRegistry{" Event" , {}, OutputObjHandlingPolicy::AnalysisObject};
7378 HistogramRegistry V0Registry{" FullV0QA" , {}, OutputObjHandlingPolicy::AnalysisObject};
79+ HistogramRegistry thetaRegistry{" ThetaQA" , {}, OutputObjHandlingPolicy::AnalysisObject};
7480
7581 void init (InitContext&)
7682 {
7783 eventHisto.init (&EventRegistry);
7884 posChildHistos.init (&V0Registry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false , ConfPDGCodeChildPos.value , true );
7985 negChildHistos.init (&V0Registry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false , ConfPDGCodeChildNeg, true );
8086 V0Histos.init (&V0Registry, ConfV0TempFitVarpTBins, ConfV0TempFitVarBins, false , ConfPDGCodeV0.value , true );
87+
88+ thetaRegistry.add (" Theta/hTheta" , " ; p (GeV/#it{c}); cos(#theta)" , kTH2F , {{100 , 0 , 10 }, {50 , -5 , 5 }});
8189 }
8290
83- // / Porduce QA plots for V0 selection in FemtoUniverse framework
91+ // / Produce QA plots for V0 selection in FemtoUniverse framework
8492 void process (o2::aod::FdCollision const & col, FemtoFullParticles const & parts)
8593 {
8694 auto groupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
8795 eventHisto.fillQA (col);
88- for (auto & part : groupPartsOne) {
96+ for (const auto & part : groupPartsOne) {
8997 if (!part.has_children ()) {
9098 continue ;
9199 }
@@ -95,14 +103,21 @@ struct femtoUniverseDebugV0 {
95103 LOG (warn) << " Indices of V0 children do not match" ;
96104 continue ;
97105 }
98- // check cuts on V0 children
99- if ((posChild.partType () == uint8_t (aod::femtouniverseparticle::ParticleType::kV0Child ) && (posChild.cut () & ConfCutChildPos) == ConfCutChildPos) &&
100- (negChild.partType () == uint8_t (aod::femtouniverseparticle::ParticleType::kV0Child ) && (negChild.cut () & ConfCutChildNeg) == ConfCutChildNeg) &&
106+
107+ // Check cuts on V0 children
108+ if (posChild.partType () == uint8_t (aod::femtouniverseparticle::ParticleType::kV0Child ) &&
109+ negChild.partType () == uint8_t (aod::femtouniverseparticle::ParticleType::kV0Child ) &&
101110 isFullPIDSelected (posChild.pidCut (), posChild.p (), 999 .f , ConfChildPosIndex.value , ConfChildnSpecies.value , ConfChildPIDnSigmaMax.value , ConfChildPosPidnSigmaMax.value , 1 .f ) &&
102111 isFullPIDSelected (negChild.pidCut (), negChild.p (), 999 .f , ConfChildNegIndex.value , ConfChildnSpecies.value , ConfChildPIDnSigmaMax.value , ConfChildNegPidnSigmaMax.value , 1 .f )) {
112+ auto protonMass = pdg->Mass (2212 );
113+ auto pionMass = pdg->Mass (211 );
114+ auto protonBoosted = FemtoUniverseMath::boostPRF<decltype (posChild)>(posChild, protonMass, negChild, pionMass);
115+ auto cosineTheta = (protonBoosted.Px () * part.px () + protonBoosted.Py () * part.py () + protonBoosted.Pz () * part.pz ()) / (protonBoosted.P () * part.p ());
116+
103117 V0Histos.fillQA <false , true >(part);
104118 posChildHistos.fillQA <false , true >(posChild);
105119 negChildHistos.fillQA <false , true >(negChild);
120+ thetaRegistry.fill (HIST (" Theta/hTheta" ), part.p (), cosineTheta);
106121 }
107122 }
108123 }
0 commit comments