Skip to content

Commit 4a12ca0

Browse files
authored
PWGHF: Add candidate and track counter histograms. Subscribe to PID tables only when needed. (#4723)
1 parent 88658d5 commit 4a12ca0

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

Analysis/DataModel/include/Analysis/HFSecondaryVertex.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ DECLARE_SOA_TABLE(HFSelTrack, "AOD", "HFSELTRACK",
3737
hf_seltrack::DCAPrim0,
3838
hf_seltrack::DCAPrim1);
3939

40-
using BigTracks = soa::Join<Tracks, TracksCov, TracksExtra, HFSelTrack, pidRespTPC, pidRespTOF>;
40+
using BigTracks = soa::Join<Tracks, TracksCov, TracksExtra, HFSelTrack>;
4141
using BigTracksMC = soa::Join<BigTracks, McTrackLabels>;
42+
using BigTracksPID = soa::Join<BigTracks, pidRespTPC, pidRespTOF>;
4243

4344
// FIXME: this is a workaround until we get the index columns to work with joins.
4445

Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,16 @@ struct HFD0CandidateSelector {
316316
}
317317
}
318318

319-
void process(aod::HfCandProng2 const& hfCandProng2s, aod::BigTracks const& tracks)
319+
void process(aod::HfCandProng2 const& hfCandProng2s, aod::BigTracksPID const& tracks)
320320
{
321321
int statusD0, statusD0bar; // final selection flag : 0-rejected 1-accepted
322322
bool topolD0, topolD0bar;
323323
int pidD0, pidD0bar, pionPlus, pionMinus, kaonPlus, kaonMinus;
324324

325325
for (auto& hfCandProng2 : hfCandProng2s) { //looping over 2 prong candidates
326326

327-
auto trackPos = hfCandProng2.index0(); //positive daughter
328-
auto trackNeg = hfCandProng2.index1(); //negative daughter
327+
auto trackPos = hfCandProng2.index0_as<aod::BigTracksPID>(); //positive daughter
328+
auto trackNeg = hfCandProng2.index1_as<aod::BigTracksPID>(); //negative daughter
329329

330330
statusD0 = 0;
331331
statusD0bar = 0;

Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ struct HFTrackIndexSkimsCreator {
169169
OutputObj<TH1F> hvtx3_z{TH1F("hvtx3_z", "3-prong candidates;#it{z}_{sec. vtx.} (cm);entries", 1000, -20., 20.)};
170170
OutputObj<TH1F> hmass3{TH1F("hmass3", "3-prong candidates;inv. mass (#pi K #pi) (GeV/#it{c}^{2});entries", 500, 1.6, 2.1)};
171171

172+
/*
173+
// Counter histograms
174+
OutputObj<TH2F> hNCand2ProngVsNTracks{TH2F("hNCand2ProngVsNTracks", "2-prong candidates;# of tracks;# of candidates;entries", 1000, 0., 1000., 1000, 0., 10000.)};
175+
OutputObj<TH2F> hNCand3ProngVsNTracks{TH2F("hNCand3ProngVsNTracks", "3-prong candidates;# of tracks;# of candidates;entries", 1000, 0., 1000., 1000, 0., 10000.)};
176+
OutputObj<TH1F> hNCand2Prong{TH1F("hNCand2Prong", "2-prong candidates;# of candidates;entries", 1000, 0., 10000.)};
177+
OutputObj<TH1F> hNCand3Prong{TH1F("hNCand3Prong", "3-prong candidates;# of candidates;entries", 1000, 0., 10000.)};
178+
OutputObj<TH1F> hNTracks{TH1F("hNTracks", ";# of tracks;entries", 1000, 0., 1000.)};
179+
*/
180+
172181
Filter filterSelectTracks = (aod::hf_seltrack::isSel2Prong == 1);
173182
using SelectedTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksCov, aod::TracksExtra, aod::HFSelTrack>>;
174183
// FIXME
@@ -214,6 +223,9 @@ struct HFTrackIndexSkimsCreator {
214223
df3.setMinRelChi2Change(d_minrelchi2change);
215224
df3.setUseAbsDCA(true);
216225

226+
//auto nCand2 = rowTrackIndexProng2.lastIndex();
227+
//auto nCand3 = rowTrackIndexProng3.lastIndex();
228+
217229
// first loop over positive tracks
218230
//for (auto trackPos1 = tracksPos.begin(); trackPos1 != tracksPos.end(); ++trackPos1) {
219231
for (auto trackPos1 = tracks.begin(); trackPos1 != tracks.end(); ++trackPos1) {
@@ -471,6 +483,16 @@ struct HFTrackIndexSkimsCreator {
471483
}
472484
}
473485
}
486+
/*
487+
auto nTracks = tracks.size(); // number of tracks in this collision
488+
nCand2 = rowTrackIndexProng2.lastIndex() - nCand2; // number of 2-prong candidates in this collision
489+
nCand3 = rowTrackIndexProng3.lastIndex() - nCand3; // number of 3-prong candidates in this collision
490+
hNTracks->Fill(nTracks);
491+
hNCand2Prong->Fill(nCand2);
492+
hNCand3Prong->Fill(nCand3);
493+
hNCand2ProngVsNTracks->Fill(nTracks, nCand2);
494+
hNCand3ProngVsNTracks->Fill(nTracks, nCand3);
495+
*/
474496
}
475497
};
476498

0 commit comments

Comments
 (0)