1010// or submit itself to any jurisdiction.
1111
1212// / \file correlatorDsHadronsReduced.cxx
13- // / \brief Ds-Hadrons correlator task for ME offline
13+ // / \brief Ds-Hadrons correlator task for offline analysis
1414// / \author Samuele Cattaruzzi <samuele.cattaruzzi@cern.ch>
1515
1616#include < vector>
@@ -43,10 +43,15 @@ using BinningTypeDerived = ColumnBinningPolicy<aod::hf_collisions_reduced::PosZ,
4343struct HfCorrelatorDsHadronsReduced {
4444 Produces<aod::DsHadronPair> entryDsHadronPair;
4545 Produces<aod::DsHadronRecoInfo> entryDsHadronRecoInfo;
46+ Produces<aod::DsHadronMlInfo> entryDsHadronMlInfo;
47+ Produces<aod::DsCandRecoInfo> entryDsCandRecoInfo;
48+ Produces<aod::TrackRecoInfo> entryTrackRecoInfo;
4649 // Produces<aod::DsHadronGenInfo> entryDsHadronGenInfo;
4750
4851 Configurable<bool > fillHistoData{" fillHistoData" , true , " Flag for filling histograms in data processes" };
4952 Configurable<int > numberEventsMixed{" numberEventsMixed" , 5 , " Number of events mixed in ME process" };
53+ Configurable<std::vector<double >> binsPtD{" binsPtD" , std::vector<double >{1 ., 3 ., 5 ., 8 ., 16 ., 36 .}, " pT bin limits for candidate mass plots" };
54+ Configurable<std::vector<double >> binsPtHadron{" binsPtHadron" , std::vector<double >{0.3 , 1 ., 2 ., 50 .}, " pT bin limits for assoc particle" };
5055
5156 SliceCache cache;
5257
@@ -56,9 +61,11 @@ struct HfCorrelatorDsHadronsReduced {
5661
5762 ConfigurableAxis zPoolBins{" zPoolBins" , {VARIABLE_WIDTH, -10.0 , -2.5 , 2.5 , 10.0 }, " z vertex position pools" };
5863 ConfigurableAxis multPoolBins{" multPoolBins" , {VARIABLE_WIDTH, 0 ., 900 ., 1800 ., 6000 .}, " event multiplicity pools (FT0M)" };
59- ConfigurableAxis binsMultFT0M{" binsMultFT0M" , {600 , 0 ., 6000 .}, " Multiplicity as FT0M signal amplitude" };
64+ ConfigurableAxis binsMultFT0M{" binsMultFT0M" , {100 , 0 ., 10000 .}, " Multiplicity as FT0M signal amplitude" };
6065 ConfigurableAxis binsPosZ{" binsPosZ" , {100 , -10 ., 10 .}, " primary vertex z coordinate" };
6166 ConfigurableAxis binsPoolBin{" binsPoolBin" , {9 , 0 ., 9 .}, " PoolBin" };
67+ ConfigurableAxis binsEta{" binsEta" , {50 , -2 ., 2 .}, " #it{#eta}" };
68+ ConfigurableAxis binsPhi{" binsPhi" , {64 , -PIHalf, 3 . * PIHalf}, " #it{#varphi}" };
6269
6370 HistogramRegistry registry{" registry" , {}, OutputObjHandlingPolicy::AnalysisObject};
6471
@@ -67,23 +74,95 @@ struct HfCorrelatorDsHadronsReduced {
6774 AxisSpec axisMultFT0M = {binsMultFT0M, " MultiplicityFT0M" };
6875 AxisSpec axisPosZ = {binsPosZ, " PosZ" };
6976 AxisSpec axisPoolBin = {binsPoolBin, " PoolBin" };
77+ AxisSpec axisEta = {binsEta, " #it{#eta}" };
78+ AxisSpec axisPhi = {binsPhi, " #it{#varphi}" };
79+ AxisSpec axisPtD = {(std::vector<double >)binsPtD, " #it{p}_{T} (GeV/#it{c})" };
80+ AxisSpec axisPtHadron = {(std::vector<double >)binsPtHadron, " #it{p}_{T} Hadron (GeV/#it{c})" };
7081
7182 // Histograms for data analysis
7283 if (fillHistoData) {
7384 registry.add (" hMultFT0M" , " Multiplicity FT0M" , {HistType::kTH1F , {axisMultFT0M}});
7485 registry.add (" hZVtx" , " z vertex" , {HistType::kTH1F , {axisPosZ}});
86+ registry.add (" hCollisionPoolBin" , " Collision pool bin" , {HistType::kTH1F , {axisPoolBin}});
7587 registry.add (" hDsPoolBin" , " Ds candidates pool bin" , {HistType::kTH1F , {axisPoolBin}});
88+ registry.add (" hPhiVsPtCand" , " Ds candidates phiVsPt" , {HistType::kTH2F , {{axisPhi}, {axisPtD}}});
89+ registry.add (" hPhiVsPtPartAssoc" , " Particles associated phiVsPt" , {HistType::kTH3F , {{axisPhi}, {axisPtD}, {axisPtHadron}}});
90+ registry.add (" hEtaVsPtCand" , " Ds candidates etaVsPt" , {HistType::kTH2F , {{axisEta}, {axisPtD}}});
91+ registry.add (" hEtaVsPtPartAssoc" , " Particles associated etaVsPt" , {HistType::kTH3F , {{axisEta}, {axisPtD}, {axisPtHadron}}});
7692 registry.add (" hTracksPoolBin" , " Particles associated pool bin" , {HistType::kTH1F , {axisPoolBin}});
7793 }
7894 }
7995
96+ void processDerivedData (aod::HfcRedCollisions const & collisions,
97+ soa::Join<aod::DsCandReduceds, aod::DsCandSelInfos> const & candidates,
98+ soa::Join<aod::AssocTrackReds, aod::AssocTrackSels> const & tracks)
99+ {
100+
101+ BinningTypeDerived corrBinning{{zPoolBins, multPoolBins}, true };
102+
103+ for (const auto & collision : collisions) {
104+ int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multiplicity ()));
105+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
106+ registry.fill (HIST (" hMultFT0M" ), collision.multiplicity ());
107+ registry.fill (HIST (" hZVtx" ), collision.posZ ());
108+
109+ auto thisCollId = collision.globalIndex ();
110+ auto candsDsThisColl = candidates.sliceBy (candPerCol, thisCollId);
111+ auto tracksThisColl = tracks.sliceBy (tracksPerCol, thisCollId);
112+
113+ for (const auto & candidate : candsDsThisColl) {
114+ registry.fill (HIST (" hDsPoolBin" ), poolBin);
115+ registry.fill (HIST (" hPhiVsPtCand" ), RecoDecay::constrainAngle (candidate.phiCand (), -PIHalf), candidate.ptCand ());
116+ registry.fill (HIST (" hEtaVsPtCand" ), candidate.etaCand (), candidate.ptCand ());
117+ entryDsCandRecoInfo (candidate.invMassDs (), candidate.ptCand (), candidate.bdtScorePrompt (), candidate.bdtScoreBkg ());
118+ for (const auto & track : tracksThisColl) {
119+ registry.fill (HIST (" hTracksPoolBin" ), poolBin);
120+ registry.fill (HIST (" hPhiVsPtPartAssoc" ), RecoDecay::constrainAngle (track.phiAssocTrack (), -PIHalf), candidate.ptCand (), track.ptAssocTrack ());
121+ registry.fill (HIST (" hEtaVsPtPartAssoc" ), track.etaAssocTrack (), candidate.ptCand (), track.ptAssocTrack ());
122+
123+ entryDsHadronPair (getDeltaPhi (track.phiAssocTrack (), candidate.phiCand ()),
124+ track.etaAssocTrack () - candidate.etaCand (),
125+ candidate.ptCand (),
126+ track.ptAssocTrack (),
127+ poolBin);
128+ entryDsHadronRecoInfo (candidate.invMassDs (), false , false );
129+ entryDsHadronMlInfo (candidate.bdtScorePrompt (), candidate.bdtScoreBkg ());
130+ entryTrackRecoInfo (track.dcaXY (), track.dcaZ (), track.nTpcCrossedRows ());
131+ }
132+ }
133+ }
134+ }
135+ PROCESS_SWITCH (HfCorrelatorDsHadronsReduced, processDerivedData, " Process Derived Data" , true );
136+
80137 void processDerivedDataME (aod::HfcRedCollisions const & collisions,
81138 aod::DsCandReduceds const & candidates,
82139 aod::AssocTrackReds const & tracks)
83140 {
84141
85142 BinningTypeDerived corrBinning{{zPoolBins, multPoolBins}, true };
86143
144+ for (const auto & collision : collisions) {
145+ int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multiplicity ()));
146+ registry.fill (HIST (" hCollisionPoolBin" ), poolBin);
147+ registry.fill (HIST (" hMultFT0M" ), collision.multiplicity ());
148+ registry.fill (HIST (" hZVtx" ), collision.posZ ());
149+
150+ auto thisCollId = collision.globalIndex ();
151+ auto candsDsThisColl = candidates.sliceBy (candPerCol, thisCollId);
152+ auto tracksThisColl = tracks.sliceBy (tracksPerCol, thisCollId);
153+
154+ for (const auto & candidate : candsDsThisColl) {
155+ registry.fill (HIST (" hDsPoolBin" ), poolBin);
156+ registry.fill (HIST (" hPhiVsPtCand" ), RecoDecay::constrainAngle (candidate.phiCand (), -PIHalf), candidate.ptCand ());
157+ registry.fill (HIST (" hEtaVsPtCand" ), candidate.etaCand (), candidate.ptCand ());
158+ for (const auto & track : tracksThisColl) {
159+ registry.fill (HIST (" hTracksPoolBin" ), poolBin);
160+ registry.fill (HIST (" hPhiVsPtPartAssoc" ), RecoDecay::constrainAngle (track.phiAssocTrack (), -PIHalf), candidate.ptCand (), track.ptAssocTrack ());
161+ registry.fill (HIST (" hEtaVsPtPartAssoc" ), track.etaAssocTrack (), candidate.ptCand (), track.ptAssocTrack ());
162+ }
163+ }
164+ }
165+
87166 auto tracksTuple = std::make_tuple (candidates, tracks);
88167
89168 Pair<aod::HfcRedCollisions, aod::DsCandReduceds, aod::AssocTrackReds, BinningTypeDerived> pairData{corrBinning, numberEventsMixed, -1 , collisions, tracksTuple, &cache};
@@ -95,13 +174,13 @@ struct HfCorrelatorDsHadronsReduced {
95174
96175 int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multiplicity ()));
97176 int poolBinDs = corrBinning.getBin (std::make_tuple (c1.posZ (), c1.multiplicity ()));
98- registry. fill ( HIST ( " hMultFT0M " ), c1. multiplicity ());
99- registry. fill ( HIST ( " hZVtx " ), c1. posZ ());
100- registry. fill ( HIST ( " hTracksPoolBin " ), poolBin );
101- registry. fill ( HIST ( " hDsPoolBin " ), poolBinDs);
177+
178+ if (poolBin != poolBinDs) {
179+ LOGF (info, " Error, poolBins are diffrent " );
180+ }
102181
103182 for (const auto & [cand, pAssoc] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
104- LOGF (info, " Mixed event tracks pair: (%d, %d) from events (%d, %d), track event: (%d, %d)" , cand.index (), pAssoc.index (), c1.index (), c2.index (), cand.hfcRedCollisionId (), pAssoc.hfcRedCollisionId ());
183+ // LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d), track event: (%d, %d)", cand.index(), pAssoc.index(), c1.index(), c2.index(), cand.hfcRedCollisionId(), pAssoc.hfcRedCollisionId());
105184
106185 entryDsHadronPair (getDeltaPhi (pAssoc.phiAssocTrack (), cand.phiCand ()),
107186 pAssoc.etaAssocTrack () - cand.etaCand (),
@@ -113,7 +192,7 @@ struct HfCorrelatorDsHadronsReduced {
113192 }
114193 }
115194 }
116- PROCESS_SWITCH (HfCorrelatorDsHadronsReduced, processDerivedDataME, " Process Mixed Event Derived Data" , true );
195+ PROCESS_SWITCH (HfCorrelatorDsHadronsReduced, processDerivedDataME, " Process Mixed Event Derived Data" , false );
117196};
118197
119198WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments