Skip to content

Commit aaaa5c2

Browse files
authored
Fix the HF task to reject cases where a DCA candidate is not found (#3333)
* Add explicit propagation to vertex * Skip when there is no DCA candidate
1 parent a0f76c0 commit aaaa5c2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Analysis/Tasks/vertexerhf.cxx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ struct DecayVertexBuilder2Prong {
4343
OutputObj<TH1F> hchi2dca{TH1F("hchi2dca", "chi2 DCA decay", 1000, 0., 0.0002)};
4444

4545
Produces<aod::SecVtx2Prong> secvtx2prong;
46-
Configurable<std::string> triggersel{"triggersel", "test", "A string configurable"};
46+
//Configurable<std::string> triggersel{"triggersel", "test", "A string configurable"};
4747

4848
void process(aod::Collision const& collision, soa::Join<aod::Tracks,
4949
aod::TracksCov, aod::TracksExtra> const& tracks)
5050
{
51-
LOGP(error, "Trigger selection {}", std::string{triggersel});
52-
LOGF(info, "Tracks for collision: %d", tracks.size());
51+
//LOGP(error, "Trigger selection {}", std::string{triggersel});
52+
LOGF(info, "N. of Tracks for collision: %d", tracks.size());
5353
o2::vertexing::DCAFitterN<2> df;
5454
df.setBz(5.0);
5555
// After finding the vertex, propagate tracks to the DCA. This is default anyway
@@ -116,7 +116,8 @@ struct DecayVertexBuilder2Prong {
116116
o2::track::TrackParCov trackparvar1(x1_, alpha1_, arraypar1, covpar1);
117117
df.setUseAbsDCA(true);
118118
int nCand = df.process(trackparvar0, trackparvar1);
119-
//FIXME: currently filling the table for all dca candidates.
119+
if (nCand == 0)
120+
continue;
120121
const auto& vtx = df.getPCACandidate();
121122
LOGF(info, "vertex x %f", vtx[0]);
122123
hvtx_x_out->Fill(vtx[0]);
@@ -151,7 +152,7 @@ struct CandidateBuildingDzero {
151152
void process(aod::SecVtx2Prong const& secVtx2Prongs,
152153
soa::Join<aod::Tracks, aod::TracksCov, aod::TracksExtra> const& tracks)
153154
{
154-
LOGF(info, "NEW EVENT");
155+
LOGF(info, "NEW EVENT CANDIDATE");
155156

156157
o2::vertexing::DCAFitterN<2> df;
157158
df.setBz(5.0);
@@ -208,6 +209,9 @@ struct CandidateBuildingDzero {
208209
//select the candidate via its index. It is redundant cause the secondary
209210
//vertex recostruction is performed more than once for each dca candidate
210211
int nCand = df.process(trackparvar0, trackparvar1);
212+
if (nCand == 0) {
213+
LOGF(error, " DCAFitter failing in the candidate building: it should not happen");
214+
}
211215
const auto& secvtx = df.getPCACandidate();
212216
float masspion = 0.140;
213217
float masskaon = 0.494;

0 commit comments

Comments
 (0)