1313// / \brief Task to analyze photon-deuteron correlations
1414// / \author Arvind Khuntia <arvind.khuntia@cern.ch> and Francesco Noferini <francesco.noferini@cern.ch>
1515
16- #include < TLorentzVector.h >
17- #include < TVector3.h >
16+ #include " PWGLF/DataModel/LFPhotonDeuteronTables.h "
17+ #include " PWGLF/DataModel/LFStrangenessTables.h "
1818
1919#include " Common/DataModel/EventSelection.h"
2020#include " Common/DataModel/PIDResponse.h"
2121#include " Common/DataModel/TrackSelectionTables.h"
22- # include " Framework/AnalysisTask.h "
22+
2323#include " Framework/ASoAHelpers.h"
24+ #include " Framework/AnalysisTask.h"
2425#include " Framework/HistogramRegistry.h"
2526#include " Framework/runDataProcessing.h"
26- #include " PWGLF/DataModel/LFStrangenessTables.h"
27- #include " PWGLF/DataModel/LFPhotonDeuteronTables.h"
27+
28+ #include < TLorentzVector.h>
29+ #include < TVector3.h>
2830
2931using namespace o2 ;
3032using namespace o2 ::framework;
@@ -43,13 +45,13 @@ struct PhotonDeuteronCorrelation {
4345 Configurable<float > cfgPhotonMaxPt{" cfgPhotonMaxPt" , 10.0 , " Maximum photon pT (GeV/c)" };
4446 Configurable<float > cfgPhotonMaxEta{" cfgPhotonMaxEta" , 0.8 , " Maximum photon eta" };
4547 Configurable<float > cfgPhotonDaughterNSigmaElTPCMax{" cfgPhotonDaughterNSigmaElTPCMax" , 5.0 , " Maximum NSigma TPC electron for photon daughters (999=off)" };
46-
48+
4749 Configurable<float > cfgDeuteronMinPt{" cfgDeuteronMinPt" , 0.2 , " Minimum deuteron pT (GeV/c)" };
4850 Configurable<float > cfgDeuteronMaxPt{" cfgDeuteronMaxPt" , 5.0 , " Maximum deuteron pT (GeV/c)" };
4951 Configurable<float > cfgDeuteronMaxEta{" cfgDeuteronMaxEta" , 0.8 , " Maximum deuteron eta" };
5052 Configurable<float > cfgDeuteronNSigmaTPCMax{" cfgDeuteronNSigmaTPCMax" , 3.0 , " Maximum NSigma TPC for deuteron" };
5153 Configurable<float > cfgDeuteronNSigmaTOFMax{" cfgDeuteronNSigmaTOFMax" , 3.0 , " Maximum NSigma TOF for deuteron" };
52-
54+
5355 Configurable<float > cfgV0CosPA{" cfgV0CosPA" , 0.995 , " Minimum V0 cosine of pointing angle" };
5456 Configurable<float > cfgV0Radius{" cfgV0Radius" , 5.0 , " Minimum V0 radius (cm)" };
5557 Configurable<bool > cfgUsePhotonDaughterPIDTPCOnly{" cfgUsePhotonDaughterPIDTPCOnly" , true , " Use TPC-only PID for photon daughters" };
@@ -75,7 +77,7 @@ struct PhotonDeuteronCorrelation {
7577
7678 // Event histograms
7779 histos.add (" hEventCounter" , " Event counter" , kTH1F , {{5 , 0.5 , 5.5 }});
78-
80+
7981 // V0 (photon) histograms
8082 histos.add (" hV0Mass" , " V0 invariant mass" , kTH1F , {axisPhotonMass});
8183 histos.add (" hV0Pt" , " V0 p_{T}" , kTH1F , {axisPt});
@@ -84,7 +86,7 @@ struct PhotonDeuteronCorrelation {
8486 histos.add (" hV0CosPA" , " V0 cos(PA)" , kTH1F , {axisV0CosPA});
8587 histos.add (" hV0Radius" , " V0 radius" , kTH1F , {axisV0Radius});
8688 histos.add (" hPhotonPtEta" , " Photon p_{T} vs #eta" , kTH2F , {axisPt, axisEta});
87-
89+
8890 // Deuteron histograms
8991 histos.add (" hDeuteronPt" , " Deuteron p_{T}" , kTH1F , {axisPt});
9092 histos.add (" hDeuteronEta" , " Deuteron #eta" , kTH1F , {axisEta});
@@ -93,7 +95,7 @@ struct PhotonDeuteronCorrelation {
9395 histos.add (" hDeuteronNSigmaTOF" , " Deuteron n#sigma TOF" , kTH1F , {axisNSigma});
9496 histos.add (" hDeuteronNSigmaTPCvsPt" , " Deuteron n#sigma TPC vs p_{T}" , kTH2F , {axisPt, axisNSigma});
9597 histos.add (" hDeuteronNSigmaTOFvsPt" , " Deuteron n#sigma TOF vs p_{T}" , kTH2F , {axisPt, axisNSigma});
96-
98+
9799 // Correlation histograms
98100 histos.add (" hPhotonDeuteronDeltaPhi" , " Photon-Deuteron #Delta#phi" , kTH1F , {axisDeltaPhi});
99101 histos.add (" hPhotonDeuteronDeltaEta" , " Photon-Deuteron #Delta#eta" , kTH1F , {axisDeltaEta});
@@ -115,33 +117,33 @@ struct PhotonDeuteronCorrelation {
115117 if (v0.v0radius () < cfgV0Radius) {
116118 return false ;
117119 }
118-
120+
119121 // Photon mass window
120122 if (std::abs (v0.mGamma ()) > cfgPhotonMassWindow) {
121123 return false ;
122124 }
123-
125+
124126 // Kinematic cuts
125127 if (v0.pt () < cfgPhotonMinPt || v0.pt () > cfgPhotonMaxPt) {
126128 return false ;
127129 }
128130 if (std::abs (v0.eta ()) > cfgPhotonMaxEta) {
129131 return false ;
130132 }
131-
133+
132134 // Optional electron PID cuts for daughter tracks (TPC-only)
133135 if (cfgUsePhotonDaughterPIDTPCOnly) {
134136 auto posTrack = v0.template posTrack_as <TTracks>();
135137 auto negTrack = v0.template negTrack_as <TTracks>();
136-
138+
137139 if (std::abs (posTrack.tpcNSigmaEl ()) > cfgPhotonDaughterNSigmaElTPCMax) {
138140 return false ;
139141 }
140142 if (std::abs (negTrack.tpcNSigmaEl ()) > cfgPhotonDaughterNSigmaElTPCMax) {
141143 return false ;
142144 }
143145 }
144-
146+
145147 return true ;
146148 }
147149
@@ -156,21 +158,21 @@ struct PhotonDeuteronCorrelation {
156158 if (std::abs (track.eta ()) > cfgDeuteronMaxEta) {
157159 return false ;
158160 }
159-
161+
160162 // TPC PID
161163 if (std::abs (track.tpcNSigmaDe ()) > cfgDeuteronNSigmaTPCMax) {
162164 return false ;
163165 }
164-
166+
165167 // TOF PID (if available)
166168 if (track.hasTOF () && std::abs (track.tofNSigmaDe ()) > cfgDeuteronNSigmaTOFMax) {
167169 return false ;
168170 }
169-
171+
170172 return true ;
171173 }
172174
173- // range [-pi/2, 3pi/2]
175+ // range [-pi/2, 3pi/2]
174176 float getDeltaPhi (float phi1, float phi2)
175177 {
176178 float dphi = phi1 - phi2;
@@ -189,21 +191,21 @@ struct PhotonDeuteronCorrelation {
189191 if (invMass <= 0.0 ) {
190192 return -1.0 ;
191193 }
192-
194+
193195 float M = invMass;
194196 float M2 = M * M;
195197 float M4 = M2 * M2;
196198 float mn2 = massNeutron * massNeutron;
197199 float mp2 = massProton * massProton;
198200 float deltaMass2 = mn2 - mp2;
199201 float sumMass2 = mn2 + mp2;
200-
202+
201203 float term = M4 + deltaMass2 * deltaMass2 - 2.0 * sumMass2 * M2;
202-
204+
203205 if (term < 0.0 ) {
204206 return -1.0 ;
205207 }
206-
208+
207209 float kpn = 0.5 / M * std::sqrt (term);
208210 return kpn;
209211 }
@@ -217,28 +219,29 @@ struct PhotonDeuteronCorrelation {
217219 {
218220 histos.fill (HIST (" hEventCounter" ), 1 );
219221
220-
221222 // Loop over V0s to find photons
222223 std::vector<int > photonIndices;
223224 for (auto const & v0 : V0s) {
224225 // Fill V0 QA histograms
225226 histos.fill (HIST (" hV0Mass" ), v0.mGamma ());
226227 histos.fill (HIST (" hV0CosPA" ), v0.v0cosPA ());
227228 histos.fill (HIST (" hV0Radius" ), v0.v0radius ());
228-
229+
229230 // Select photons
230231 if (!selectPhoton (v0, tracks)) {
231232 continue ;
232233 }
233-
234+
234235 // Fill photon histograms
235236 histos.fill (HIST (" hV0Pt" ), v0.pt ());
236237 histos.fill (HIST (" hV0Eta" ), v0.eta ());
237238 histos.fill (HIST (" hV0Phi" ), v0.phi ());
238239 histos.fill (HIST (" hPhotonPtEta" ), v0.pt (), v0.eta ());
239-
240- if (v0.isPhotonTPConly ()) photonIndices.push_back (v0.index ());
241- if (v0.isPhotonTPConly ()) std::cout<<" [main] global index photon: " <<v0.globalIndex ()<<" v0 id: " <<v0.index ()<<" pt " <<v0.pt ()<<std::endl;
240+
241+ if (v0.isPhotonTPConly ())
242+ photonIndices.push_back (v0.index ());
243+ if (v0.isPhotonTPConly ())
244+ std::cout << " [main] global index photon: " << v0.globalIndex () << " v0 id: " << v0.index () << " pt " << v0.pt () << std::endl;
242245 }
243246
244247 // Loop over tracks to find deuterons
@@ -248,19 +251,19 @@ struct PhotonDeuteronCorrelation {
248251 if (!track.isGlobalTrack ()) {
249252 continue ;
250253 }
251-
254+
252255 // Select deuterons
253256 if (!selectDeuteron (track)) {
254257 continue ;
255258 }
256-
259+
257260 // Fill deuteron histograms
258261 histos.fill (HIST (" hDeuteronPt" ), track.pt ());
259262 histos.fill (HIST (" hDeuteronEta" ), track.eta ());
260263 histos.fill (HIST (" hDeuteronPhi" ), track.phi ());
261264 histos.fill (HIST (" hDeuteronNSigmaTPC" ), track.tpcNSigmaDe ());
262265 histos.fill (HIST (" hDeuteronNSigmaTPCvsPt" ), track.pt (), track.tpcNSigmaDe ());
263-
266+
264267 if (track.hasTOF ()) {
265268 histos.fill (HIST (" hDeuteronNSigmaTOF" ), track.tofNSigmaDe ());
266269 histos.fill (HIST (" hDeuteronNSigmaTOFvsPt" ), track.pt (), track.tofNSigmaDe ());
@@ -269,11 +272,11 @@ struct PhotonDeuteronCorrelation {
269272 }
270273 // Calculate correlations between photons and deuterons
271274 for (auto const & photonIdx : photonIndices) {
272- const auto & photon = V0s.iteratorAt (photonIdx);
273-
275+ const auto & photon = V0s.iteratorAt (photonIdx);
276+
274277 for (auto const & deuteronIdx : deuteronIndices) {
275- const auto & deuteron = tracks.iteratorAt (deuteronIdx);
276-
278+ const auto & deuteron = tracks.iteratorAt (deuteronIdx);
279+
277280 // Calculate angular correlations
278281 float deltaPhi = getDeltaPhi (photon.phi (), deuteron.phi ());
279282 float deltaEta = photon.eta () - deuteron.eta ();
@@ -283,27 +286,27 @@ struct PhotonDeuteronCorrelation {
283286 histos.fill (HIST (" hPhotonDeuteronDeltaEta" ), deltaEta);
284287 histos.fill (HIST (" hPhotonDeuteronCorrelation" ), deltaPhi, deltaEta);
285288 histos.fill (HIST (" hPhotonDeuteronPtCorr" ), photon.pt (), deuteron.pt ());
286-
289+
287290 // Calculate invariant mass
288291 TLorentzVector photonVec, deuteronVec;
289- photonVec.SetPtEtaPhiM (photon.pt (), photon.eta (), photon.phi (), 0.0 ); // Photon-mass = 0
292+ photonVec.SetPtEtaPhiM (photon.pt (), photon.eta (), photon.phi (), 0.0 ); // Photon-mass = 0
290293 deuteronVec.SetPtEtaPhiM (deuteron.pt (), deuteron.eta (), deuteron.phi (), massDeuteron); // Deuteron-mass
291-
294+
292295 TLorentzVector combinedVec = photonVec + deuteronVec;
293296 float invMass = combinedVec.M ();
294297 histos.fill (HIST (" hPhotonDeuteronInvMass" ), invMass);
295-
298+
296299 // Calculate relative momentum using Equation 4.6
297300 float kpn = calculateRelativeMomentum (invMass);
298301 if (kpn >= 0.0 ) {
299302 histos.fill (HIST (" hRelativeMomentum" ), kpn);
300303 histos.fill (HIST (" hRelativeMomentumVsInvMass" ), invMass, kpn);
301304 }
302-
305+
303306 // Fill the output table
304307 auto posTrack = photon.posTrack_as <soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::pidTPCFullDe, aod::pidTOFFullDe, aod::pidTPCFullEl, aod::pidTOFFullEl>>();
305308 auto negTrack = photon.negTrack_as <soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::pidTPCFullDe, aod::pidTOFFullDe, aod::pidTPCFullEl, aod::pidTOFFullEl>>();
306-
309+
307310 photonDeuteronTable (
308311 photon.pt (),
309312 photon.eta (),
@@ -325,8 +328,7 @@ struct PhotonDeuteronCorrelation {
325328 deltaPhi,
326329 deltaEta,
327330 invMass,
328- kpn
329- );
331+ kpn);
330332 }
331333 }
332334 }
0 commit comments