1818#include " PWGCF/Core/CorrelationContainer.h"
1919#include " PWGCF/Core/PairCuts.h"
2020#include " PWGHF/Core/HfHelper.h"
21+ #include " PWGHF/DataModel/AliasTables.h"
2122#include " PWGHF/DataModel/CandidateReconstructionTables.h"
2223#include " PWGHF/DataModel/CandidateSelectionTables.h"
24+ #include " PWGHF/DataModel/TrackIndexSkimmingTables.h"
2325#include " PWGHF/Utils/utilsPid.h"
2426#include " PWGMM/Mult/DataModel/bestCollisionTable.h"
2527
3234#include < CCDB/BasicCCDBManager.h>
3335#include < CCDB/CcdbApi.h>
3436#include < CommonConstants/MathConstants.h>
35- #include < CommonConstants/PhysicsConstants.h>
3637#include < DataFormatsParameters/GRPMagField.h>
3738#include < DetectorsCommonDataFormats/AlignParam.h>
3839#include < FT0Base/Geometry.h>
4142#include < Framework/AnalysisDataModel.h>
4243#include < Framework/AnalysisHelpers.h>
4344#include < Framework/AnalysisTask.h>
45+ #include < Framework/Array2D.h>
4446#include < Framework/BinningPolicy.h>
4547#include < Framework/Configurable.h>
4648#include < Framework/DataTypes.h>
5052#include < Framework/InitContext.h>
5153#include < Framework/Logger.h>
5254#include < Framework/O2DatabasePDGPlugin.h>
53- #include < Framework/StepTHn.h>
5455#include < Framework/runDataProcessing.h>
5556#include < MathUtils/Utils.h>
5657
5758#include < THn.h>
5859#include < TPDGCode.h>
59- #include < TParticlePDG.h>
6060#include < TString.h>
6161
6262#include < sys/types.h>
@@ -247,13 +247,12 @@ struct HfTaskFlow {
247247 Configurable<float > mftMaxDCAz{" mftMaxDCAz" , 2 .0f , " Cut on dcaZ for MFT tracks" };
248248 Configurable<int > nClustersMftTrack{" nClustersMftTrack" , 5 , " Minimum number of clusters for the reconstruction of MFT tracks" };
249249 Configurable<float > ptMftTrackMax{" ptMftTrackMax" , 10 .0f , " max value of MFT tracks pT when used in cut function" };
250- Configurable<float > ptMftTrackMin{" ptMftTrackMin" , 0 .2f , " min value of MFT tracks pT when used in cut function" };
250+ Configurable<float > ptMftTrackMin{" ptMftTrackMin" , 0 .f , " min value of MFT tracks pT when used in cut function" };
251251 Configurable<bool > useMftPtCut{" useMftPtCut" , false , " if true, use the Mft pt function cut" };
252252 } configMft;
253253
254254 TF1* fPtDepDCAxy = nullptr ;
255255
256- HfHelper hfHelper;
257256 SliceCache cache;
258257 Service<o2::framework::O2DatabasePDG> pdg;
259258 Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -328,22 +327,22 @@ struct HfTaskFlow {
328327
329328 struct : ConfigurableGroup {
330329 std::string prefix = " ConfigAxis_group" ;
331- ConfigurableAxis axisMass{" axisMass" , {120 , 1.5848 , 2.1848 }, " axis of invariant mass of candidates" };
330+ ConfigurableAxis axisMass{" axisMass" , {40 , 1.5848 , 2.1848 }, " axis of invariant mass of candidates" };
332331 ConfigurableAxis binsMixingMultiplicity{" binsMixingMultiplicity" , {VARIABLE_WIDTH, 0 , 5 , 10 , 20 , 30 , 40 , 50 , 100.1 }, " multiplicity bins for event mixing" };
333- ConfigurableAxis binsMixingVertex{" binsMixingVertex" , {14 , -7 , 7 }, " vertex bins for event mixing" };
334- ConfigurableAxis axisEtaEfficiency{" axisEtaEfficiency" , {20 , -1.0 , 1.0 }, " eta axis for efficiency histograms" };
332+ ConfigurableAxis binsMixingVertex{" binsMixingVertex" , {20 , -10 , 10 }, " vertex bins for event mixing" };
333+ ConfigurableAxis axisEtaEfficiency{" axisEtaEfficiency" , {1 , -1.0 , 1.0 }, " eta axis for efficiency histograms" };
335334 ConfigurableAxis axisEtaAssociated{" axisEtaAssociated" , {48 , -4 , -2 }, " eta axis for MFT histograms" };
336335 ConfigurableAxis axisEtaTrigger{" axisEtaTrigger" , {48 , -1 , 1 }, " eta axis for TPC histograms" };
337336 ConfigurableAxis axisDeltaPhi{" axisDeltaPhi" , {72 , -PIHalf, PIHalf * 3 }, " delta phi axis for histograms" };
338337 ConfigurableAxis axisDeltaEta{" axisDeltaEta" , {48 , -2.4 , 2.4 }, " delta eta axis for histograms" };
339338 ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH, 0 , 5 , 10 , 20 , 30 , 40 , 50 , 100.1 }, " multiplicity axis for histograms" };
340339 ConfigurableAxis axisPhi{" axisPhi" , {72 , 0 , TwoPI}, " phi axis for histograms" };
341- ConfigurableAxis axisPt{" axisPt" , {72 , 0 , 36 }, " pt axis for histograms" };
342- ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 }, " pt associated axis for histograms" };
343- ConfigurableAxis axisPtEfficiency{" axisPtEfficiency" , {VARIABLE_WIDTH, 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.25 , 1. 5 , 1.75 , 2.0 , 2.25 , 2.5 , 2.75 , 3.0 , 3.25 , 3.5 , 3.75 , 4.0 , 4.5 , 5.0 , 6.0 , 7.0 , 8.0 }, " pt axis for efficiency histograms" };
344- ConfigurableAxis axisPtTrigger{" axisPtTrigger" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 8.0 }, " pt trigger axis for histograms" };
345- ConfigurableAxis axisVertex{" axisVertex" , {14 , -7 , 7 }, " vertex axis for histograms" };
346- ConfigurableAxis axisVertexEfficiency{" axisVertexEfficiency" , {10 , -10 , 10 }, " vertex axis for efficiency histograms" };
340+ ConfigurableAxis axisPt{" axisPt" , {VARIABLE_WIDTH , 0.2 , 0.5 , 1 , 1.5 , 2 , 3 , 4 , 6 , 10 }, " pt axis for histograms" };
341+ ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.2 , 0. 5 , 1 , 1.5 , 2 , 3 , 4 , 6 , 10 }, " pt associated axis for histograms" };
342+ ConfigurableAxis axisPtEfficiency{" axisPtEfficiency" , {VARIABLE_WIDTH, 0.2 , 0.5 , 1 , 1.5 , 2 , 3 , 4 , 6 , 10 }, " pt axis for efficiency histograms" };
343+ ConfigurableAxis axisPtTrigger{" axisPtTrigger" , {VARIABLE_WIDTH, 0.2 , 0. 5 , 1 , 1.5 , 2 , 3 , 4 , 6 , 10 }, " pt trigger axis for histograms" };
344+ ConfigurableAxis axisVertex{" axisVertex" , {20 , -10 , 10 }, " vertex axis for histograms" };
345+ ConfigurableAxis axisVertexEfficiency{" axisVertexEfficiency" , {1 , -10 , 10 }, " vertex axis for efficiency histograms" };
347346 } configAxis;
348347
349348 HistogramRegistry registry{" registry" };
@@ -501,8 +500,7 @@ struct HfTaskFlow {
501500 // Initialization of histograms and CorrelationContainers for TpcMft cases
502501 // =========================
503502
504- // if (doprocessSameTpcMftChCh || doprocessSameTpcMftChChReassociated || doprocessSameTpcMftChChReassociated3d || doprocessSameTpcMftChChNonAmbiguous) {
505- if (doprocessSameTpcMftChCh || doprocessSameTpcMftChChReassociated || doprocessSameTpcMftChChNonAmbiguous) {
503+ if (doprocessSameTpcMftChCh || doprocessSameTpcMftChChReassociated || doprocessSameTpcMftChChReassociated3d || doprocessSameTpcMftChChNonAmbiguous) {
506504 addHistograms<Data, TpcMft, ChPartChPart>();
507505 addMftHistograms ();
508506
@@ -593,7 +591,7 @@ struct HfTaskFlow {
593591 // Initialization of histograms and CorrelationContainers for MftFt0a cases
594592 // =========================
595593
596- if (doprocessSameMftFt0aChCh || doprocessSameMftFt0aChChReassociated || doprocessSameMftFt0aChChNonAmbiguous) {
594+ if (doprocessSameMftFt0aChCh || doprocessSameMftFt0aChChReassociated || doprocessSameMftFt0aChChReassociated3d || doprocessSameMftFt0aChChNonAmbiguous) {
597595 addHistograms<Data, MftFt0a, ChPartChPart>();
598596 addMftHistograms ();
599597
@@ -827,7 +825,7 @@ struct HfTaskFlow {
827825 void getChannel (TFT0s const & ft0, std::size_t const & iCh, int & id, int fitType)
828826 {
829827 if (fitType == isFT0C) {
830- id = ft0.channelC ()[iCh];
828+ id = ft0.channelC ()[iCh] + kMinFt0cCell ;
831829 } else if (fitType == isFT0A) {
832830 id = ft0.channelA ()[iCh];
833831 } else {
@@ -899,7 +897,7 @@ struct HfTaskFlow {
899897 if (configCandidates.etaCandidateMax >= 0 . && std::abs (etaCandidate) > configCandidates.etaCandidateMax ) {
900898 return false ;
901899 }
902- if (configCandidates.yCandRecoMax >= 0 . && std::abs (hfHelper. yLc (candidate)) > configCandidates.yCandRecoMax ) {
900+ if (configCandidates.yCandRecoMax >= 0 . && std::abs (HfHelper:: yLc (candidate)) > configCandidates.yCandRecoMax ) {
903901 return false ;
904902 }
905903 return true ;
@@ -911,7 +909,7 @@ struct HfTaskFlow {
911909 if (configCandidates.etaCandidateMax >= 0 . && std::abs (etaCandidate) > configCandidates.etaCandidateMax ) {
912910 return false ;
913911 }
914- if (configCandidates.yCandRecoMax >= 0 . && std::abs (hfHelper. yD0 (candidate)) > configCandidates.yCandRecoMax ) {
912+ if (configCandidates.yCandRecoMax >= 0 . && std::abs (HfHelper:: yD0 (candidate)) > configCandidates.yCandRecoMax ) {
915913 return false ;
916914 }
917915 return true ;
@@ -1016,9 +1014,9 @@ struct HfTaskFlow {
10161014 }
10171015 fillingHFcontainer = true ;
10181016 if constexpr (std::is_same_v<HfCandidatesSelD0, TTracksTrig>) { // If D0
1019- invmass = hfHelper. invMassD0ToPiK (track1);
1017+ invmass = HfHelper:: invMassD0ToPiK (track1);
10201018 } else { // If Lc
1021- invmass = hfHelper. invMassLcToPKPi (track1);
1019+ invmass = HfHelper:: invMassLcToPKPi (track1);
10221020 }
10231021 }
10241022
@@ -1216,9 +1214,9 @@ struct HfTaskFlow {
12161214 }
12171215 fillingHFcontainer = true ;
12181216 if constexpr (std::is_same_v<HfCandidatesSelD0, TTracksTrig>) { // If D0
1219- invmass = hfHelper. invMassD0ToPiK (track1);
1217+ invmass = HfHelper:: invMassD0ToPiK (track1);
12201218 } else { // If Lc
1221- invmass = hfHelper. invMassLcToPKPi (track1);
1219+ invmass = HfHelper:: invMassLcToPKPi (track1);
12221220 }
12231221 }
12241222
@@ -1230,7 +1228,7 @@ struct HfTaskFlow {
12301228 }
12311229
12321230 // FILL QA PLOTS for trigger particle
1233- if (sameEvent && (cutAmbiguousTracks == false ) ) {
1231+ if (sameEvent) {
12341232 if constexpr (std::is_same_v<HfCandidatesSelD0, TTracksTrig>) {
12351233 fillTriggerQa<Data, TpcMft, D0ChPart>(multiplicity, eta1, phi1, pt1);
12361234 } else if constexpr (std::is_same_v<HfCandidatesSelLc, TTracksTrig>) {
@@ -1325,7 +1323,7 @@ struct HfTaskFlow {
13251323 }
13261324
13271325 // FILL QA PLOTS for associated particle
1328- if (sameEvent && (loopCounter == 1 ) && (!cutAmbiguousTracks) ) {
1326+ if (sameEvent && (loopCounter == 1 )) {
13291327 if constexpr (std::is_same_v<HfCandidatesSelD0, TTracksTrig>) {
13301328 fillAssociatedQa<Data, TpcMft, D0ChPart>(multiplicity, eta2, phi2);
13311329 registry.fill (HIST (" Data/Mft/hPtMft" ), pt2);
@@ -1379,9 +1377,9 @@ struct HfTaskFlow {
13791377 }
13801378 fillingHFcontainer = true ;
13811379 if constexpr (std::is_same_v<HfCandidatesSelD0, TTracksTrig>) { // If D0
1382- invmass = hfHelper. invMassD0ToPiK (track1);
1380+ invmass = HfHelper:: invMassD0ToPiK (track1);
13831381 } else { // If Lc
1384- invmass = hfHelper. invMassLcToPKPi (track1);
1382+ invmass = HfHelper:: invMassLcToPKPi (track1);
13851383 }
13861384 }
13871385
@@ -1965,7 +1963,6 @@ struct HfTaskFlow {
19651963 }
19661964 PROCESS_SWITCH (HfTaskFlow, processSameTpcMftChChReassociated, " DATA : Process same-event correlations for TPC-MFT h-h case reassociated" , false );
19671965
1968- /*
19691966 void processSameTpcMftChChReassociated3d (FilteredCollisionsWSelMult::iterator const & collision,
19701967 soa::SmallGroups<aod::BestCollisionsFwd3d> const & reassociatedMftTracks,
19711968 FilteredTracksWDcaSel const & tracks,
@@ -1990,7 +1987,6 @@ struct HfTaskFlow {
19901987 fillCorrelationsReassociatedMftTracks (sameEvent, CorrelationContainer::CFStep::kCFStepReconstructed , tracks, reassociatedMftTracks, multiplicity, collision.posZ (), true , false );
19911988 }
19921989 PROCESS_SWITCH (HfTaskFlow, processSameTpcMftChChReassociated3d, " DATA : Process same-event correlations for TPC-MFT h-h case 3d reassociated" , false );
1993- */
19941990
19951991 void processSameTpcMftChChNonAmbiguous (FilteredCollisionsWSelMult::iterator const & collision,
19961992 soa::SmallGroups<aod::BestCollisionsFwd> const & reassociatedMftTracks,
@@ -2426,6 +2422,29 @@ struct HfTaskFlow {
24262422 }
24272423 PROCESS_SWITCH (HfTaskFlow, processSameMftFt0aChChReassociated, " DATA : Process same-event correlations for MFT-FT0-A h-h case reassociated" , false );
24282424
2425+ void processSameMftFt0aChChReassociated3d (FilteredCollisionsWSelMult::iterator const & collision,
2426+ soa::SmallGroups<aod::BestCollisionsFwd3d> const & reassociatedMftTracks,
2427+ FilteredMftTracks const &,
2428+ aod::FT0s const & ft0as)
2429+ {
2430+ if (!(isAcceptedCollision (collision, true ))) {
2431+ return ;
2432+ }
2433+
2434+ if (collision.has_foundFT0 ()) {
2435+ const auto & ft0 = collision.foundFT0 ();
2436+ const auto multiplicity = getMultiplicityEstimator (collision, true );
2437+
2438+ if (multiplicity < configCollision.minMultiplicity || multiplicity > configCollision.maxMultiplicity ) {
2439+ return ;
2440+ }
2441+
2442+ sameEvent->fillEvent (multiplicity, CorrelationContainer::kCFStepReconstructed );
2443+ fillCorrelationsFITReassociatedMftTracks (sameEvent, CorrelationContainer::CFStep::kCFStepReconstructed , reassociatedMftTracks, ft0, ft0as, multiplicity, collision.posZ (), true , false , isFT0A);
2444+ }
2445+ }
2446+ PROCESS_SWITCH (HfTaskFlow, processSameMftFt0aChChReassociated3d, " DATA : Process same-event correlations for MFT-FT0-A h-h case reassociated 3d" , false );
2447+
24292448 void processSameMftFt0aChChNonAmbiguous (FilteredCollisionsWSelMult::iterator const & collision,
24302449 soa::SmallGroups<aod::BestCollisionsFwd> const & reassociatedMftTracks,
24312450 FilteredMftTracks const &,
0 commit comments