2727
2828#include " PWGHF/DataModel/CandidateReconstructionTables.h"
2929#include " PWGHF/Utils/utilsBfieldCCDB.h"
30- #include " PWGHF/Utils/utilsDebugLcToK0sP.h"
3130
3231using namespace o2 ;
3332using namespace o2 ::analysis;
3433using namespace o2 ::framework;
3534
36- // #define MY_DEBUG
37-
38- #ifdef MY_DEBUG
39- using MyBigTracks = soa::Join<aod::TracksWCov, aod::McTrackLabels>;
40- #define MY_DEBUG_MSG (condition, cmd ) \
41- if (condition) { \
42- cmd; \
43- }
44- #else
45- using MyBigTracks = aod::TracksWCov;
46- #define MY_DEBUG_MSG (condition, cmd )
47- #endif
48-
4935// / Reconstruction of heavy-flavour cascade decay candidates
5036struct HfCandidateCreatorCascade {
5137 Produces<aod::HfCandCascBase> rowCandidateBase;
@@ -72,13 +58,6 @@ struct HfCandidateCreatorCascade {
7258 o2::base::MatLayerCylSet* lut;
7359 o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
7460
75- // for debugging
76- #ifdef MY_DEBUG
77- Configurable<std::vector<int >> indexK0Spos{" indexK0Spos" , {729 , 2866 , 4754 , 5457 , 6891 , 7824 , 9243 , 9810 }, " indices of K0S positive daughters, for debug" };
78- Configurable<std::vector<int >> indexK0Sneg{" indexK0Sneg" , {730 , 2867 , 4755 , 5458 , 6892 , 7825 , 9244 , 9811 }, " indices of K0S negative daughters, for debug" };
79- Configurable<std::vector<int >> indexProton{" indexProton" , {717 , 2810 , 4393 , 5442 , 6769 , 7793 , 9002 , 9789 }, " indices of protons, for debug" };
80- #endif
81-
8261 int runNumber{0 };
8362 double massP{0 .};
8463 double massK0s{0 .};
@@ -106,15 +85,10 @@ struct HfCandidateCreatorCascade {
10685
10786 void process (aod::Collisions const &,
10887 aod::HfCascades const & rowsTrackIndexCasc,
109- MyBigTracks const &,
88+ aod::TracksWCov const &,
11089 aod::V0sLinked const &,
11190 aod::V0Datas const &,
112- aod::BCsWithTimestamps const &
113- #ifdef MY_DEBUG
114- ,
115- aod::McParticles const & mcParticles
116- #endif
117- )
91+ aod::BCsWithTimestamps const &)
11892 {
11993 // 2-prong vertex fitter
12094 o2::vertexing::DCAFitterN<2 > df;
@@ -130,7 +104,7 @@ struct HfCandidateCreatorCascade {
130104 // loop over pairs of track indeces
131105 for (const auto & casc : rowsTrackIndexCasc) {
132106
133- const auto & bach = casc.prong0_as <MyBigTracks >();
107+ const auto & bach = casc.prong0_as <aod::TracksWCov >();
134108 LOGF (debug, " V0 %d in HF cascade %d." , casc.v0Id (), casc.globalIndex ());
135109 if (!casc.has_v0 ()) {
136110 LOGF (error, " V0 not there for HF cascade %d. Skipping candidate." , casc.globalIndex ());
@@ -144,8 +118,8 @@ struct HfCandidateCreatorCascade {
144118 }
145119 LOGF (debug, " V0Data ID: %d" , casc.v0_as <aod::V0sLinked>().v0DataId ());
146120 const auto & v0 = casc.v0_as <aod::V0sLinked>().v0Data ();
147- const auto & trackV0DaughPos = v0.posTrack_as <MyBigTracks >();
148- const auto & trackV0DaughNeg = v0.negTrack_as <MyBigTracks >();
121+ const auto & trackV0DaughPos = v0.posTrack_as <aod::TracksWCov >();
122+ const auto & trackV0DaughNeg = v0.negTrack_as <aod::TracksWCov >();
149123
150124 auto collision = casc.collision ();
151125
@@ -160,18 +134,9 @@ struct HfCandidateCreatorCascade {
160134 }
161135 df.setBz (bz);
162136
163- #ifdef MY_DEBUG
164- auto indexBach = bach.mcParticleId ();
165- auto indexV0DaughPos = trackV0DaughPos.mcParticleId ();
166- auto indexV0DaughNeg = trackV0DaughNeg.mcParticleId ();
167- bool isLc = isLcK0SpFunc (indexBach, indexV0DaughPos, indexV0DaughNeg, indexProton, indexK0Spos, indexK0Sneg);
168- #endif
169-
170- MY_DEBUG_MSG (isLc, LOG (info) << " Processing the Lc with proton " << indexBach << " trackV0DaughPos " << indexV0DaughPos << " trackV0DaughNeg " << indexV0DaughNeg);
171-
172137 auto trackParCovBach = getTrackParCov (bach);
173- auto trackParCovV0DaughPos = getTrackParCov (trackV0DaughPos); // check that MyBigTracks does not need TracksDCA!
174- auto trackParCovV0DaughNeg = getTrackParCov (trackV0DaughNeg); // check that MyBigTracks does not need TracksDCA!
138+ auto trackParCovV0DaughPos = getTrackParCov (trackV0DaughPos); // check that aod::TracksWCov does not need TracksDCA!
139+ auto trackParCovV0DaughNeg = getTrackParCov (trackV0DaughNeg); // check that aod::TracksWCov does not need TracksDCA!
175140 trackParCovV0DaughPos.propagateTo (v0.posX (), bz); // propagate the track to the X closest to the V0 vertex
176141 trackParCovV0DaughNeg.propagateTo (v0.negX (), bz); // propagate the track to the X closest to the V0 vertex
177142 const std::array<float , 3 > vertexV0 = {v0.x (), v0.y (), v0.z ()};
@@ -181,10 +146,6 @@ struct HfCandidateCreatorCascade {
181146
182147 // reconstruct the cascade secondary vertex
183148 if (df.process (trackV0, trackParCovBach) == 0 ) {
184- MY_DEBUG_MSG (isLc, LOG (info) << " Vertexing failed for Lc candidate" );
185- // if (isLc) {
186- // LOG(info) << "Vertexing failed for Lc with proton " << indexBach << " trackV0DaughPos " << indexV0DaughPos << " trackV0DaughNeg " << indexV0DaughNeg;
187- // }
188149 continue ;
189150 } else {
190151 // LOG(info) << "Vertexing succeeded for Lc candidate";
@@ -221,7 +182,6 @@ struct HfCandidateCreatorCascade {
221182 auto errorDecayLengthXY = std::sqrt (getRotatedCovMatrixXX (covMatrixPV, phi, 0 .) + getRotatedCovMatrixXX (covMatrixPCA, phi, 0 .));
222183
223184 // fill candidate table rows
224- MY_DEBUG_MSG (isLc, LOG (info) << " IT IS A Lc! Filling for Lc with proton " << indexBach << " trackV0DaughPos " << indexV0DaughPos << " trackV0DaughNeg " << indexV0DaughNeg);
225185 rowCandidateBase (collision.globalIndex (),
226186 collision.posX (), collision.posY (), collision.posZ (),
227187 secondaryVertex[0 ], secondaryVertex[1 ], secondaryVertex[2 ],
@@ -258,12 +218,6 @@ struct HfCandidateCreatorCascadeMc {
258218 Produces<aod::HfCandCascadeMcRec> rowMcMatchRec;
259219 Produces<aod::HfCandCascadeMcGen> rowMcMatchGen;
260220
261- #ifdef MY_DEBUG
262- Configurable<std::vector<int >> indexK0Spos{" indexK0Spos" , {729 , 2866 , 4754 , 5457 , 6891 , 7824 , 9243 , 9810 }, " indices of K0S positive daughters, for debug" };
263- Configurable<std::vector<int >> indexK0Sneg{" indexK0Sneg" , {730 , 2867 , 4755 , 5458 , 6892 , 7825 , 9244 , 9811 }, " indices of K0S negative daughters, for debug" };
264- Configurable<std::vector<int >> indexProton{" indexProton" , {717 , 2810 , 4393 , 5442 , 6769 , 7793 , 9002 , 9789 }, " indices of protons, for debug" };
265- #endif
266-
267221 using MyTracksWMc = soa::Join<aod::TracksWCov, aod::McTrackLabels>;
268222
269223 void processMc (MyTracksWMc const & tracks,
@@ -293,24 +247,12 @@ struct HfCandidateCreatorCascadeMc {
293247 LOG (debug) << " \n " ;
294248 LOG (debug) << " Checking MC for candidate!" ;
295249 LOG (debug) << " Looking for K0s" ;
296- #ifdef MY_DEBUG
297- auto indexV0DaughPos = trackV0DaughPos.mcParticleId ();
298- auto indexV0DaughNeg = trackV0DaughNeg.mcParticleId ();
299- auto indexBach = bach.mcParticleId ();
300- bool isLc = isLcK0SpFunc (indexBach, indexV0DaughPos, indexV0DaughNeg, indexProton, indexK0Spos, indexK0Sneg);
301- bool isK0SfromLc = isK0SfromLcFunc (indexV0DaughPos, indexV0DaughNeg, indexK0Spos, indexK0Sneg);
302- #endif
303- MY_DEBUG_MSG (isK0SfromLc, LOG (info) << " correct K0S in the Lc daughters: posTrack --> " << indexV0DaughPos << " , negTrack --> " << indexV0DaughNeg);
304250
305251 // if (isLc) {
306252 RecoDecay::getMatchedMCRec (mcParticles, arrayDaughtersV0, kK0Short , std::array{+kPiPlus , -kPiPlus }, false , &sign, 1 );
307-
308253 if (sign != 0 ) { // we have already positively checked the K0s
309254 // then we check the Lc
310- MY_DEBUG_MSG (sign, LOG (info) << " K0S was correct! now we check the Lc" );
311- MY_DEBUG_MSG (sign, LOG (info) << " index proton = " << indexBach);
312255 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus , std::array{+kProton , +kPiPlus , -kPiPlus }, true , &sign, 3 ); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi-
313- MY_DEBUG_MSG (sign, LOG (info) << " Lc found with sign " << sign; printf (" \n " ));
314256 }
315257
316258 // Check whether the particle is non-prompt (from a b quark).
@@ -333,7 +275,6 @@ struct HfCandidateCreatorCascadeMc {
333275 sign = -sign;
334276 }
335277 if (sign != 0 ) {
336- MY_DEBUG_MSG (sign, LOG (info) << " Lc in K0S p" );
337278 arrDaughLcIndex.clear ();
338279 // checking that the final daughters (decay depth = 3) are p, pi+, pi-
339280 RecoDecay::getDaughters (particle, &arrDaughLcIndex, arrDaughLcPDGRef, 3 ); // best would be to check the K0S daughters
@@ -347,7 +288,6 @@ struct HfCandidateCreatorCascadeMc {
347288 } else {
348289 LOG (debug) << " Lc --> K0S+p found in MC table" ;
349290 }
350- MY_DEBUG_MSG (sign == 0 , LOG (info) << " Pity, the three final daughters are not p, pi+, pi-, but " << arrDaughLcPDG[0 ] << " , " << arrDaughLcPDG[1 ] << " , " << arrDaughLcPDG[2 ]);
351291 }
352292 }
353293 // Check whether the particle is non-prompt (from a b quark).
0 commit comments