4141#include " ALICE3/DataModel/OTFRICH.h"
4242#include " ALICE3/DataModel/OTFTOF.h"
4343#include " ALICE3/DataModel/RICH.h"
44+ #include " ALICE3/Utils/utilsHfAlice3.h"
4445#include " Common/Core/RecoDecay.h"
4546#include " Common/Core/TrackSelection.h"
4647#include " Common/Core/trackUtilities.h"
4748#include " Common/DataModel/TrackSelectionTables.h"
48- #include " PWGHF/Utils/utilsAnalysis.h"
4949
5050#include " CCDB/BasicCCDBManager.h"
5151#include " DCAFitter/DCAFitterN.h"
@@ -94,18 +94,17 @@ struct alice3decayFinder {
9494 Produces<aod::Alice3PidLcs> pidInfoLcDaugs; // contains PID info for Lc candidates
9595 Produces<aod::Alice3McGenFlags> mcGenFlags; // contains MC gen info for 3-prong candidates
9696
97- Configurable<bool > fillSwapHypo{" fillSwapHypo" , true , " swap prong 0 and prong 2 in 3-prong case" };
9897 // Vertexing
9998 Configurable<bool > propagateToPCA{" propagateToPCA" , true , " create tracks version propagated to PCA" };
100- Configurable<bool > useAbsDCA{" useAbsDCA" , true , " Minimise abs. distance rather than chi2" };
99+ Configurable<bool > useAbsDCA{" useAbsDCA" , false , " Minimise abs. distance rather than chi2" };
101100 Configurable<bool > useWeightedFinalPCA{" useWeightedFinalPCA" , false , " Recalculate vertex position using track covariances, effective only if useAbsDCA is true" };
102101 Configurable<double > maxR{" maxR" , 200 ., " reject PCA's above this radius" };
103102 Configurable<double > maxDZIni{" maxDZIni" , 1e9 , " reject (if>0) PCA candidate if tracks DZ exceeds threshold" };
104103 Configurable<double > maxVtxChi2{" maxVtxChi2" , 1e9 , " reject (if>0) vtx. chi2 above this value" };
105104 Configurable<double > minParamChange{" minParamChange" , 1 .e -3 , " stop iterations if largest change of any X is smaller than this" };
106105 Configurable<double > minRelChi2Change{" minRelChi2Change" , 0.9 , " stop iterations is chi2/chi2old > this" };
107106 // Operation and minimisation criteria
108- Configurable<float > magneticField{" magneticField" , 20 .0f , " Magnetic field (in kilogauss)" };
107+ Configurable<float > magneticField{" magneticField" , 20 .0f , " Magnetic field (in kilogauss)" };
109108 Configurable<bool > doDCAplotsD{" doDCAplotsD" , true , " do daughter prong DCA plots for D mesons" };
110109 Configurable<bool > doDCAplots3Prong{" doDCAplots3Prong" , true , " do daughter prong DCA plots for Lc baryons" };
111110 Configurable<bool > doTopoPlotsForSAndB{" doTopoPlotsForSAndB" , true , " do topological variable distributions for S and B separately" };
@@ -240,29 +239,29 @@ struct alice3decayFinder {
240239 float pt;
241240 float phi;
242241 float eta;
243- std::array<float , 3 > Pdaug0; // proton track
244- std::array<float , 3 > Pdaug1; // kaon track
245- std::array<float , 3 > Pdaug2; // pion track
246- std::array<float , 3 > primaryVertex; // primary vertex coordinates
247- std::array<float , 3 > secondaryVertex; // secondary vertex coordinates
248- float impactParameterY0; // impact parameters
249- float errorImpactParameterY0; // impact parameters error
250- float impactParameterY1; // impact parameters
251- float errorImpactParameterY1; // impact parameters error
252- float impactParameterY2; // impact parameters
253- float errorImpactParameterY2; // impact parameters error
254- float impactParameterZ0; // impact parameters
255- float errorImpactParameterZ0; // impact parameters error
256- float impactParameterZ1; // impact parameters
257- float errorImpactParameterZ1; // impact parameters error
258- float impactParameterZ2; // impact parameters
259- float errorImpactParameterZ2; // impact parameters error
260- float errorDecayLength; // normalized 3D decay length
261- float errorDecayLengthXY; // normalized 3D decay length
262- float chi2PCA; // normalized 3D decay length
263- int flagMc; // 0 = bkg, pdg code for signal
264- int origin; // 1 = prompt, 2 = non-prompt
265- float ptBMotherRec; // pT of the B hadron mother (reconstructed)
242+ std::array<float , 3 > Pdaug0; // proton track
243+ std::array<float , 3 > Pdaug1; // kaon track
244+ std::array<float , 3 > Pdaug2; // pion track
245+ std::array<float , 3 > primaryVertex; // primary vertex coordinates
246+ std::array<double , 3 > secondaryVertex; // secondary vertex coordinates
247+ float impactParameterY0; // impact parameters
248+ float errorImpactParameterY0; // impact parameters error
249+ float impactParameterY1; // impact parameters
250+ float errorImpactParameterY1; // impact parameters error
251+ float impactParameterY2; // impact parameters
252+ float errorImpactParameterY2; // impact parameters error
253+ float impactParameterZ0; // impact parameters
254+ float errorImpactParameterZ0; // impact parameters error
255+ float impactParameterZ1; // impact parameters
256+ float errorImpactParameterZ1; // impact parameters error
257+ float impactParameterZ2; // impact parameters
258+ float errorImpactParameterZ2; // impact parameters error
259+ float errorDecayLength; // normalized 3D decay length
260+ float errorDecayLengthXY; // normalized 3D decay length
261+ float chi2PCA; // normalized 3D decay length
262+ int flagMc; // 0 = bkg, CharmHadAlice3 otherwise
263+ int origin; // 1 = prompt, 2 = non-prompt
264+ float ptBMotherRec; // pT of the B hadron mother (reconstructed)
266265 } cand3prong;
267266
268267 template <typename TTrackType>
@@ -432,23 +431,20 @@ struct alice3decayFinder {
432431 cand3prong.Pdaug2 [2 ] = P2[2 ];
433432
434433 // MC truth check
434+ cand3prong.flagMc = 0 ; // bkg
435435 int8_t sign = 0 ;
436436 auto arrayDaughters = std::array{prong0, prong1, prong2};
437437 int indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, motherPdgCode, daugsPdgCodes3Prong, true , &sign, 2 );
438438 auto motherPart = mcParticles.rawIteratorAt (indexRec);
439- if (indexRec < 0 ) {
440- cand3prong.flagMc = 0 ; // bkg
441- } else {
439+ if (indexRec > -1 ) {
442440 cand3prong.flagMc = motherPart.pdgCode () > 0 ? charmHadFlag : -charmHadFlag; // Particle
443441 }
444442
445443 cand3prong.origin = 0 ;
446- if (indexRec > 0 ) {
447- LOG (info) << " indexRec: " << indexRec;
444+ if (indexRec > -1 ) {
448445 auto motherParticle = mcParticles.rawIteratorAt (indexRec);
449446 std::vector<int > idxBhadMothers{};
450447 int origin = RecoDecay::getCharmHadronOrigin (mcParticles, motherParticle, false , &idxBhadMothers);
451- LOG (info) << " Origin: " << origin;
452448 cand3prong.origin = origin;
453449 cand3prong.ptBMotherRec = -1 .f ;
454450 if (origin == RecoDecay::OriginType::NonPrompt) {
@@ -661,7 +657,6 @@ struct alice3decayFinder {
661657 }
662658 }
663659 if (doprocessFindLc) {
664- LOG (info) << " Processing generated MC particles: total number = " << mcParticles.size ();
665660 for (auto const & mcParticle : mcParticles) {
666661 if (std::abs (mcParticle.pdgCode ()) != motherPdgCode) {
667662 mcGenFlags (-1 , -1 , -1 );
@@ -676,11 +671,9 @@ struct alice3decayFinder {
676671 }
677672 mcGenFlags (origin, ptBMotherGen, mcParticle.pdgCode () ? charmHadFlag : -charmHadFlag);
678673 if (mcParticle.pdgCode () > 0 ) {
679- LOG (info) << " [P] Origin: " << origin << " PDG: " << charmHadFlag << " " << mcParticle.pdgCode ();
680674 histos.fill (HIST (" h2dGen3Prong" ), mcParticle.pt (), mcParticle.eta ());
681675 } else {
682676 histos.fill (HIST (" h2dGen3ProngBar" ), mcParticle.pt (), mcParticle.eta ());
683- LOG (info) << " [AP] Origin: " << origin << " PDG: " << -charmHadFlag << " " << mcParticle.pdgCode ();
684677 }
685678 }
686679 }
@@ -1015,10 +1008,9 @@ struct alice3decayFinder {
10151008 }
10161009
10171010 // *+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*
1018- template <bool FillSwapHypo, typename TProng>
1011+ template <typename TProng>
10191012 void fill3ProngTable (aod::Collision const & collision, TProng const & prongs0, TProng const & prongs1, TProng const & prongs2, aod::McParticles const & mcParticles)
10201013 {
1021- // LOG(info) << "Filling 3-prong candidates with nprongs0: " << prongs0.size() << ", nprongs1: " << prongs1.size() << ", nprongs2: " << prongs2.size();
10221014 for (auto const & prong0 : prongs0) {
10231015 for (auto const & prong2 : prongs2) {
10241016 if (prong2.globalIndex () == prong0.globalIndex ())
@@ -1058,38 +1050,9 @@ struct alice3decayFinder {
10581050 std::sqrt (cand3prong.errorImpactParameterZ0 ),
10591051 std::sqrt (cand3prong.errorImpactParameterZ1 ),
10601052 std::sqrt (cand3prong.errorImpactParameterZ2 ),
1061- false , // is swapped hypothesis
10621053 candPx, candPy, candPz);
10631054 mcRecFlags (cand3prong.origin , cand3prong.ptBMotherRec , cand3prong.flagMc ); // placeholder for prompt/non-prompt
10641055 fillPidTable (prong0, prong1, prong2);
1065-
1066- if constexpr (FillSwapHypo) {
1067- // fill also swapped hypothesis
1068- candidate3Prong (collision.globalIndex (),
1069- cand3prong.primaryVertex [0 ], cand3prong.primaryVertex [1 ], cand3prong.primaryVertex [2 ],
1070- cand3prong.secondaryVertex [0 ], cand3prong.secondaryVertex [1 ], cand3prong.secondaryVertex [2 ],
1071- cand3prong.errorDecayLength , cand3prong.errorDecayLengthXY ,
1072- cand3prong.chi2PCA ,
1073- cand3prong.eta ,
1074- cand3prong.phi ,
1075- cand3prong.pt ,
1076- prong2.globalIndex (), prong1.globalIndex (), prong0.globalIndex (),
1077- cand3prong.Pdaug2 [0 ], cand3prong.Pdaug2 [1 ], cand3prong.Pdaug2 [2 ],
1078- cand3prong.Pdaug1 [0 ], cand3prong.Pdaug1 [1 ], cand3prong.Pdaug1 [2 ],
1079- cand3prong.Pdaug0 [0 ], cand3prong.Pdaug0 [1 ], cand3prong.Pdaug0 [2 ],
1080- cand3prong.impactParameterY2 , cand3prong.impactParameterY1 , cand3prong.impactParameterY0 ,
1081- std::sqrt (cand3prong.errorImpactParameterY2 ),
1082- std::sqrt (cand3prong.errorImpactParameterY1 ),
1083- std::sqrt (cand3prong.errorImpactParameterY0 ),
1084- cand3prong.impactParameterZ2 , cand3prong.impactParameterZ1 , cand3prong.impactParameterZ0 ,
1085- std::sqrt (cand3prong.errorImpactParameterZ2 ),
1086- std::sqrt (cand3prong.errorImpactParameterZ1 ),
1087- std::sqrt (cand3prong.errorImpactParameterZ0 ),
1088- true , // is swapped hypothesis
1089- candPx, candPy, candPz);
1090- mcRecFlags (cand3prong.origin , cand3prong.ptBMotherRec , cand3prong.flagMc ); // placeholder for prompt/non-prompt
1091- fillPidTable (prong2, prong1, prong0);
1092- }
10931056 }
10941057 }
10951058 }
@@ -1128,17 +1091,8 @@ struct alice3decayFinder {
11281091 }
11291092
11301093 // Particles
1131- if (fillSwapHypo) {
1132- fill3ProngTable<true >(collision, tracksPrPlus, tracksKaMinus, tracksPiPlus, mcParticles);
1133- } else {
1134- fill3ProngTable<false >(collision, tracksPiPlus, tracksKaMinus, tracksPrPlus, mcParticles);
1135- }
1136- // Antiparticles
1137- if (fillSwapHypo) {
1138- fill3ProngTable<true >(collision, tracksPrMinus, tracksKaPlus, tracksPiMinus, mcParticles);
1139- } else {
1140- fill3ProngTable<false >(collision, tracksPiMinus, tracksKaPlus, tracksPrMinus, mcParticles);
1141- }
1094+ fill3ProngTable (collision, tracksPrPlus, tracksKaMinus, tracksPiPlus, mcParticles);
1095+ fill3ProngTable (collision, tracksPrMinus, tracksKaPlus, tracksPiMinus, mcParticles);
11421096 }
11431097 PROCESS_SWITCH (alice3decayFinder, processFindLc, " find Lc Baryons" , true );
11441098 // *>-~-<*>-~-<*>-~-<*>-~-<*>-~-<*>-~-<*>-~-<*>-~-<*
0 commit comments