3030#include " Common/DataModel/PIDResponse.h"
3131#include " Common/Core/PID/PIDTOF.h"
3232#include " Common/TableProducer/PID/pidTOFBase.h"
33- #include " Common/DataModel/McCollisionExtra.h"
34- #include " PWGDQ/DataModel/ReducedInfoTables.h"
35- #include " PWGJE/Core/JetDerivedDataUtilities.h"
36- #include " PWGJE/DataModel/JetReducedData.h"
37- #include " PWGJE/DataModel/Jet.h"
38- #include " PWGJE/Core/FastJetUtilities.h"
33+ #include " Common/Core/RecoDecay.h"
3934
4035#include " fastjet/PseudoJet.hh"
4136#include " fastjet/AreaDefinition.hh"
@@ -83,8 +78,8 @@ struct AngularCorrelationsInJets {
8378 Configurable<float > maxChi2TPC{" maxChi2TPC" , 4.0 , " max chi2 per cluster TPC" };
8479 Configurable<float > maxDCAxy{" maxDCAxy" , 0.05 , " max DCA to vertex xy" };
8580 Configurable<float > maxDCAz{" maxDCAz" , 0.05 , " max DCA to vertex z" };
86- Configurable<float > maxEta{" maxEta" , 0.8 , " max pseudorapidity" }; // consider jet cone
87- Configurable<float > deltaEtaEdge{" deltaEtaEdge" , 0.05 , " min eta distance of jet from acceptance edge" }; // consider jet cone
81+ Configurable<float > maxEta{" maxEta" , 0.8 , " max pseudorapidity" };
82+ Configurable<float > deltaEtaEdge{" deltaEtaEdge" , 0.05 , " min eta distance of jet from acceptance edge" };
8883 Configurable<float > minTrackPt{" minTrackPt" , 0.3 , " minimum track pT" };
8984 Configurable<float > requirePVContributor{" requirePVContributor" , false , " require track to be PV contributor" };
9085
@@ -153,28 +148,31 @@ struct AngularCorrelationsInJets {
153148 Configurable<float > zVtx{" zVtx" , 10.0 , " max zVertex" };
154149 Configurable<float > rMax{" rMax" , 0.4 , " Maximum radius for jet and UE regions" };
155150
151+ double maxDCAzForFilter = 2.0 ;
152+ double maxEtaForFilter = 0.8 ;
153+ double minTrackPtForFilter = 0.1 ;
154+
156155 Service<o2::ccdb::BasicCCDBManager> ccdb;
157156 int mRunNumber ;
158157
159158 using FullTracksRun2 = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TOFSignal, aod::TOFEvTime, aod::TrackSelection,
160159 aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa>;
161160 using FullTracksRun3 = soa::Join<aod::Tracks, aod::TracksExtra, aod::TOFSignal, aod::TrackSelection, aod::TrackSelectionExtension,
162- aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa>;
161+ aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa>;
163162 using McTracksRun2 = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TOFSignal, aod::TOFEvTime, aod::TrackSelection,
164163 aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa, aod::McTrackLabels>;
165164 using McTracksRun3 = soa::Join<aod::Tracks, aod::TracksExtra, aod::TOFSignal, aod::TrackSelection, aod::TrackSelectionExtension,
166- aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa, aod::McTrackLabels>;
165+ aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl, aod::pidTOFPi, aod::pidTOFKa, aod::McTrackLabels>;
167166 using BCsWithRun2Info = soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps>;
168167 using McCollisions = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels>;
169168
170169 Filter prelimTrackCuts = (aod::track::itsChi2NCl < maxChi2ITS &&
171170 aod::track::tpcChi2NCl < maxChi2TPC &&
172171 nabs (aod::track::dcaXY) < maxDCAxy &&
173- nabs (aod::track::dcaZ) < 2 .0f &&
174- nabs (aod::track::eta) < 0 .8f &&
175- aod::track::pt > 0 .1f ); // add more preliminary cuts to filter if possible
176- Filter collisionFilter = (nabs(aod::jcollision::posZ) < zVtx);
177-
172+ nabs (aod::track::dcaZ) < maxDCAzForFilter &&
173+ nabs (aod::track::eta) < maxEtaForFilter &&
174+ aod::track::pt > minTrackPtForFilter); // add more preliminary cuts to filter if possible
175+
178176 Preslice<FullTracksRun2> perCollisionFullTracksRun2 = o2::aod::track::collisionId;
179177 Preslice<FullTracksRun3> perCollisionFullTracksRun3 = o2::aod::track::collisionId;
180178 Preslice<McTracksRun2> perCollisionMcTracksRun2 = o2::aod::track::collisionId;
@@ -197,8 +195,6 @@ struct AngularCorrelationsInJets {
197195 ccdb->setLocalObjectValidityChecking ();
198196 ccdb->setFatalWhenNull (false );
199197
200- eventSelection = jetderiveddatautilities::initialiseEventSelectionBits (static_cast <std::string>(" sel8" ));
201-
202198 // Counters
203199 registryData.add (" numberOfEvents" , " Number of events" , HistType::kTH1I , {{1 , 0 , 1 }});
204200 registryData.add (" numberOfJets" , " Total number of jets" , HistType::kTH1I , {{1 , 0 , 1 }});
@@ -377,11 +373,13 @@ struct AngularCorrelationsInJets {
377373 return false ;
378374 if (!track.hasTPC ())
379375 return false ;
380- if (track.tpcNClsCrossedRows () < 70 )
376+ int minCrossedRowsForJetReco = 70 ;
377+ if (track.tpcNClsCrossedRows () < minCrossedRowsForJetReco)
381378 return false ;
382379 if ((!hasITSHit (track, 1 )) && (!hasITSHit (track, 2 )) && (!hasITSHit (track, 3 )))
383380 return false ;
384- if ((static_cast <double >(track.tpcNClsCrossedRows ()) / static_cast <double >(track.tpcNClsFindable ())) < 0.8 )
381+ double minRatioCrRowsFindableJetReco = 0.8 ;
382+ if ((static_cast <double >(track.tpcNClsCrossedRows ()) / static_cast <double >(track.tpcNClsFindable ())) < minRatioCrRowsFindableJetReco)
385383 return false ;
386384 if (std::fabs (track.dcaXY ()) > (0.0105 + 0.035 / std::pow (track.pt (), 1.1 )))
387385 return false ;
@@ -437,7 +435,7 @@ struct AngularCorrelationsInJets {
437435 return false ;
438436
439437 double pt = track.pt ();
440-
438+
441439 // DCA
442440 double maxDCApt = 1.2 ;
443441 if (pt < maxDCApt) {
@@ -450,7 +448,7 @@ struct AngularCorrelationsInJets {
450448 // nsigma
451449 double midPt = 1.5 ;
452450 double highPt = 3.0 ;
453-
451+
454452 double maxTPCnsigma = protonTPCnsigma;
455453 double maxTOFnsigma = protonTOFnsigma;
456454 if (pt > midPt) {
@@ -463,24 +461,24 @@ struct AngularCorrelationsInJets {
463461 }
464462
465463 registryData.fill (HIST (" tpcNSigmaProtonCF" ), track.pt (), track.tpcNSigmaPr ());
466- if (pt < protonTPCTOFpT && (std::abs (track.tpcNSigmaPr () > maxTPCnsigma) ))
464+ if (pt < protonTPCTOFpT && (std::abs (track.tpcNSigmaPr ()) > maxTPCnsigma))
467465 return false ;
468466
469467 double tofNSigma = 999 ;
470468 if (track.hasTOF ()) {
471469 registryData.fill (HIST (" tofNSigmaProtonCF" ), track.pt (), track.tofNSigmaPr ());
472470 tofNSigma = track.tofNSigmaPr ();
473471 }
474-
475- if (pt > protonTPCTOFpT && ((std::abs (tofNSigma) > maxTOFnsigma) || std::abs (track.tpcNSigmaPr () > maxTPCnsigma) ))
472+
473+ if (pt > protonTPCTOFpT && ((std::abs (tofNSigma) > maxTOFnsigma) || std::abs (track.tpcNSigmaPr ()) > maxTPCnsigma))
476474 return false ;
477475
478476 if (useRejectionCut && !singleSpeciesTPCNSigma (track))
479477 return false ;
480-
478+
481479 return true ;
482480 }
483-
481+
484482 template <typename T>
485483 bool isProtonForYield (const T& track)
486484 {
@@ -518,7 +516,7 @@ struct AngularCorrelationsInJets {
518516 return false ;
519517
520518 double pt = track.pt ();
521-
519+
522520 // DCA
523521 double maxDCApt = 1.2 ;
524522 if (pt < maxDCApt) {
@@ -531,7 +529,7 @@ struct AngularCorrelationsInJets {
531529 // nsigma
532530 double midPt = 1.5 ;
533531 double highPt = 3.0 ;
534-
532+
535533 double maxTPCnsigma = antiprotonTPCnsigma;
536534 double maxTOFnsigma = antiprotonTOFnsigma;
537535 if (pt > midPt) {
@@ -544,21 +542,21 @@ struct AngularCorrelationsInJets {
544542 }
545543
546544 registryData.fill (HIST (" tpcNSigmaAntiprotonCF" ), track.pt (), track.tpcNSigmaPr ());
547- if (pt < antiprotonTPCTOFpT && (std::abs (track.tpcNSigmaPr () > maxTPCnsigma) ))
545+ if (pt < antiprotonTPCTOFpT && (std::abs (track.tpcNSigmaPr ()) > maxTPCnsigma))
548546 return false ;
549547
550548 double tofNSigma = 999 ;
551549 if (track.hasTOF ()) {
552550 registryData.fill (HIST (" tofNSigmaAntiprotonCF" ), track.pt (), track.tofNSigmaPr ());
553551 tofNSigma = track.tofNSigmaPr ();
554552 }
555-
556- if (pt > antiprotonTPCTOFpT && ((std::abs (tofNSigma) > maxTOFnsigma) || std::abs (track.tpcNSigmaPr () > maxTPCnsigma) ))
553+
554+ if (pt > antiprotonTPCTOFpT && ((std::abs (tofNSigma) > maxTOFnsigma) || std::abs (track.tpcNSigmaPr ()) > maxTPCnsigma))
557555 return false ;
558556
559557 if (useRejectionCut && !singleSpeciesTPCNSigma (track))
560558 return false ;
561-
559+
562560 return true ;
563561 }
564562
@@ -896,7 +894,8 @@ struct AngularCorrelationsInJets {
896894
897895 double getDeltaPhi (double a1, double a2)
898896 {
899- if (std::isnan (a1) || std::isnan (a2) || a1 == -999 || a2 == -999 )
897+ double failedPhi = -999 ;
898+ if (std::isnan (a1) || std::isnan (a2) || a1 == failedPhi || a2 == failedPhi)
900899 return -999 ;
901900 double deltaPhi (0 );
902901 double phi1 = RecoDecay::constrainAngle (a1, 0 );
@@ -1039,21 +1038,21 @@ struct AngularCorrelationsInJets {
10391038 double deltaEtaUE2 = particleDir.Eta () - ueAxis2.Eta ();
10401039 double deltaPhiUE2 = getDeltaPhi (particleDir.Phi (), ueAxis2.Phi ());
10411040 double deltaRUE2 = std::abs (deltaEtaUE2 * deltaEtaUE2 + deltaPhiUE2 * deltaPhiUE2);
1042-
1041+ double failedPhi = - 999 ;
10431042 if (deltaRJet < rMax) {
1044- if (deltaPhiJet != - 999 )
1043+ if (deltaPhiJet != failedPhi )
10451044 registryQC.fill (HIST (" deltaEtadeltaPhiJet" ), deltaEtaJet, deltaPhiJet);
10461045 nchJetPlusUE++;
10471046 ptJetPlusUE = ptJetPlusUE + track.pt ();
10481047 }
10491048 if (deltaRUE1 < rMax) {
1050- if (deltaPhiUE1 != - 999 )
1049+ if (deltaPhiUE1 != failedPhi )
10511050 registryQC.fill (HIST (" deltaEtadeltaPhiUE" ), deltaEtaUE1, deltaPhiUE1);
10521051 nchUE++;
10531052 ptUE = ptUE + track.pt ();
10541053 }
10551054 if (deltaRUE2 < rMax) {
1056- if (deltaPhiUE2 != - 999 )
1055+ if (deltaPhiUE2 != failedPhi )
10571056 registryQC.fill (HIST (" deltaEtadeltaPhiUE" ), deltaEtaUE2, deltaPhiUE2);
10581057 nchUE++;
10591058 ptUE = ptUE + track.pt ();
@@ -1120,7 +1119,7 @@ struct AngularCorrelationsInJets {
11201119 if (isProtonForYield (jetParticle)) { // collect protons in jet
11211120 registryData.fill (HIST (" ptJetProton" ), jetParticle.pt ());
11221121 registryQC.fill (HIST (" ptJetProtonVsTotalJet" ), jetParticle.pt (), subtractedJetPerp.pt ());
1123- registryData.fill (HIST (" trackProtocol" ), 3 ); // # protons
1122+ registryData.fill (HIST (" trackProtocol" ), 3 ); // # protons
11241123 } else if (isAntiprotonForYield (jetParticle)) { // collect antiprotons in jet
11251124 registryData.fill (HIST (" ptJetAntiproton" ), jetParticle.pt ());
11261125 registryQC.fill (HIST (" ptJetAntiprotonVsTotalJet" ), jetParticle.pt (), subtractedJetPerp.pt ());
@@ -1177,7 +1176,8 @@ struct AngularCorrelationsInJets {
11771176 doCorrelationsAnti (jetProtons, jetAntiprotons, fBufferAntiproton , fTempBufferProton , pJet);
11781177 doCorrelationsAnti (jetAntiprotons, jetProtons, fBufferProton , fTempBufferAntiproton , pJet); // divide SE distributions by 2 in post
11791178 }
1180- if ((jetProtons.size () < 2 ) && (jetAntiprotons.size () < 2 ) && (jetPiPlus.size () < 2 ) && (jetPiMinus.size () < 2 ))
1179+ long unsigned int minNumPartForCorrelations = 2 ;
1180+ if ((jetProtons.size () < minNumPartForCorrelations) && (jetAntiprotons.size () < minNumPartForCorrelations) && (jetPiPlus.size () < minNumPartForCorrelations) && (jetPiMinus.size () < minNumPartForCorrelations))
11811181 return jetCounter;
11821182 registryData.fill (HIST (" eventProtocol" ), 6 );
11831183
@@ -1262,7 +1262,8 @@ struct AngularCorrelationsInJets {
12621262 index++;
12631263 } // for (const auto& track : tracks)
12641264
1265- if (jetInput.size () < 2 )
1265+ long unsigned int minNumPartForJetReco = 2 ;
1266+ if (jetInput.size () < minNumPartForJetReco)
12661267 return ;
12671268 registryData.fill (HIST (" eventProtocol" ), 2 );
12681269
@@ -1335,7 +1336,8 @@ struct AngularCorrelationsInJets {
13351336 index++;
13361337 } // for (const auto& track : tracks)
13371338
1338- if (jetInput.size () < 2 )
1339+ long unsigned int minNumPartForJetReco = 2 ;
1340+ if (jetInput.size () < minNumPartForJetReco)
13391341 return ;
13401342 registryData.fill (HIST (" eventProtocol" ), 2 );
13411343
@@ -1433,20 +1435,21 @@ struct AngularCorrelationsInJets {
14331435 double deltaPhiUE2 = getDeltaPhi (particleDir.Phi (), ueAxis2.Phi ());
14341436 double deltaRUE2 = std::abs (deltaEtaUE2 * deltaEtaUE2 + deltaPhiUE2 * deltaPhiUE2);
14351437
1438+ double failedPhi = -999 ;
14361439 if (deltaRJet < rMax) {
1437- if (deltaPhiJet != - 999 )
1440+ if (deltaPhiJet != failedPhi )
14381441 registryQC.fill (HIST (" deltaEtadeltaPhiJet" ), deltaEtaJet, deltaPhiJet);
14391442 nchJetPlusUE++;
14401443 ptJetPlusUE = ptJetPlusUE + track.pt ();
14411444 }
14421445 if (deltaRUE1 < rMax) {
1443- if (deltaPhiUE1 != - 999 )
1446+ if (deltaPhiUE1 != failedPhi )
14441447 registryQC.fill (HIST (" deltaEtadeltaPhiUE" ), deltaEtaUE1, deltaPhiUE1);
14451448 nchUE++;
14461449 ptUE = ptUE + track.pt ();
14471450 }
14481451 if (deltaRUE2 < rMax) {
1449- if (deltaPhiUE2 != - 999 )
1452+ if (deltaPhiUE2 != failedPhi )
14501453 registryQC.fill (HIST (" deltaEtadeltaPhiUE" ), deltaEtaUE2, deltaPhiUE2);
14511454 nchUE++;
14521455 ptUE = ptUE + track.pt ();
@@ -1576,8 +1579,8 @@ struct AngularCorrelationsInJets {
15761579 }
15771580
15781581 void processRun2 (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
1579- soa::Filtered<FullTracksRun2> const & tracks,
1580- BCsWithRun2Info const &)
1582+ soa::Filtered<FullTracksRun2> const & tracks,
1583+ BCsWithRun2Info const &)
15811584 {
15821585 for (const auto & collision : collisions) {
15831586 auto bc = collision.bc_as <BCsWithRun2Info>();
@@ -1597,7 +1600,7 @@ struct AngularCorrelationsInJets {
15971600 PROCESS_SWITCH (AngularCorrelationsInJets, processRun2, " process Run 2 data w/o jet tables" , false );
15981601
15991602 void processRun3 (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
1600- soa::Filtered<FullTracksRun3> const & tracks)
1603+ soa::Filtered<FullTracksRun3> const & tracks)
16011604 {
16021605 for (const auto & collision : collisions) {
16031606 registryData.fill (HIST (" eventProtocol" ), 0 );
0 commit comments