@@ -84,25 +84,42 @@ struct HfCandidateCreatorXic0Omegac0Qa {
8484
8585 // Configurables
8686 struct : ConfigurableGroup {
87+
88+ // Options for internal cascade building - DCAFitter settings
89+ // ...Initial vaules taken from PWGLF/Utils/strangenessBuilderHelper
90+ // ----------------------------------------------------------------
91+ Configurable<bool > propagateToPCALF{" propagateToPCALF" , true , " Create tracks version propagated to PCA" };
92+ Configurable<double > maxRLF{" maxRLF" , 200 ., " Reject PCA's above this radius" };
93+ Configurable<double > maxDZIniLF{" maxDZIniLF" , 1e9 , " Reject (if>0) PCA candidate if tracks DZ exceeds this threshold" };
94+ Configurable<double > maxDXYIniLF{" maxDXYIniLF" , 4 .0f , " Reject (if>0) PCA candidate if tracks DXY exceeds this threshold" };
95+ Configurable<double > minParamChangeLF{" minParamChangeLF" , 1 .e -3 , " Stop iteration if largest change of any X is smaller than this" };
96+ Configurable<double > minRelChi2ChangeLF{" minRelChi2ChangeLF" , 0.9 , " Stop iteration if Chi2/Chi2old > this" };
97+ Configurable<double > maxChi2LF{" maxChi2LF" , 1e9 , " Discard vertices with Chi2/Nprongs > this(or sum {DCAi^2}/Nprongs for abs. distance minimization)" };
98+ Configurable<bool > useAbsDCALF{" useAbsDCALF" , true , " Minimise abs. distance rather than chi2" };
99+ Configurable<bool > useWeightedFinalPCALF{" useWeightedFinalPCALF" , false , " Recalculate vertex position using track covariance, effective only if useAbsDCA is true" };
100+ Configurable<bool > refitWithMaterialCorrectionLF{" refitWithMaterialCorrectionLF" , false , " Do refit after material correction applied" };
101+
87102 // Options for internal V0 building
88103 // ...Initial values taken from PWGLF/Utiles/strangenessBuilderModule.h
104+ // ...Modified according to the configurable in core wagon
89105 // ---------------------------------------------------------------------
90106 Configurable<int > minCrossedRowsFromLF{" minCrossedRowsFromLF" , 50 , " minimun TPC crossed rows for daughter tracks. Used for internal V0 Building" };
91- Configurable<float > dcanegtopvFromLF{" dcanegtopvFromLF" , .1 , " DCV Neg to PV" };
92- Configurable<float > dcapostopvFromLF{" dcapostopvFromLF" , .1 , " DCV Pos To PV" };
107+ Configurable<float > dcanegtopvFromLF{" dcanegtopvFromLF" , .05 , " DCV Neg to PV" };
108+ Configurable<float > dcapostopvFromLF{" dcapostopvFromLF" , .05 , " DCV Pos To PV" };
93109 Configurable<double > v0cospaFromLF{" v0cospaFromLF" , 0.95 , " V0 CosPA" };
94110 Configurable<float > dcav0dauFromLF{" dcav0dauFromLF" , 1.0 , " DCA V0 Daughters" };
95111 Configurable<float > v0radiusFromLF{" v0radiusFromLF" , 0.9 , " v0radius" };
96112 Configurable<float > maxDaughterEtaFromLF{" maxDaughterEtaFromLF" , 5.0 , " Maximun daughter eta (in abs value)" };
97113
98114 // Options for internal cascade building
99115 // ...Initial values taken from PWGLF/Utiles/strangenessBuilderModule.h
116+ // ...Modified according to the configurable in core wagon
100117 // --------------------------------------------------------------------
101- Configurable<float > dcabachtopvFromLF{" dcabachtopvFromLF" , .1 , " DCV Bach to PV" };
102- Configurable<float > cascradiusFromLF{" cascradiusFromLF" , .1 , " DCV Bach to PV" };
118+ Configurable<float > dcabachtopvFromLF{" dcabachtopvFromLF" , .05 , " DCV Bach to PV" };
119+ Configurable<float > cascradiusFromLF{" cascradiusFromLF" , .9 , " DCV Bach to PV" };
103120 Configurable<float > casccospaFromLF{" casccospaFromLF" , 0.95 , " Cascade CosPA" };
104121 Configurable<float > dcacascdauFromLF{" dcacascdauFromLF" , 1.0 , " DCA cascade daughters" };
105- Configurable<float > lambdaMassWindowFromLF{" lambdaMassWindowFromLF" , 0.10 , " Distance from Lambda mass(does not apply to KF path)" };
122+ Configurable<float > lambdaMassWindowFromLF{" lambdaMassWindowFromLF" , 0.01 , " Distance from Lambda mass(does not apply to KF path)" };
106123
107124 // Options for internal cascade building - KF Building specifics
108125 // ...Initial values taken from PWGLF/Utiles/strangenessBuilderModule.h
@@ -123,6 +140,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
123140 // Switch for filling histograms
124141 // -----------------------------
125142 Configurable<bool > fillHistograms{" fillHistograms" , true , " fill validation plots" };
143+
126144 // Magnetic field setting from CCDB
127145 // --------------------------------
128146 Configurable<bool > isRun2{" isRun2" , false , " enable Run2 or Run3 GRP objects for magnetic field" };
@@ -132,7 +150,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
132150 Configurable<std::string> ccdbPathGrpMag{" ccdbPathGrpMag" , " GLO/Config/GRPMagField" , " CCDB path of the GRPMagField object (Run3)" };
133151
134152 // Cascade pre selection
135- // --------------------
153+ // ---------------------
136154 Configurable<bool > doCascadePreselection{" doCascadePreselection" , true , " Use invariant mass and dcaXY cuts to preselect cascade candidates" };
137155 Configurable<double > massToleranceCascade{" massToleranceCascade" , 0.01 , " Invariant mass tolerance for cascades" };
138156 Configurable<float > dcaXYToPVCascadeMax{" dcaXYToPVCascadeMax" , 3 , " Max cascade DCA to PV in XY plane" };
@@ -162,7 +180,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
162180
163181 // Options for QA histogram binning
164182 // -----------------------------
165-
166183 // For Cascade
167184 Configurable<int > nBinMassCasc{" nBinMassCasc" , 1000 , " nBinCascMass" };
168185 Configurable<float > minMassCasc{" minMassCasc" , 1.0 , " xiMassMin" };
@@ -234,8 +251,8 @@ struct HfCandidateCreatorXic0Omegac0Qa {
234251 int trackPidOfCascade;
235252
236253 // Mass of daughter tracks & V0s & cascades & charm baryons;
237- int massOfV0DauPos, massOfV0DauNeg, massOfBach, massOfCharmBach;
238- int massOfV0, massOfCascade, massOfCharmBaryon;
254+ float massOfV0DauPos, massOfV0DauNeg, massOfBach, massOfCharmBach;
255+ float massOfV0, massOfCascade, massOfCharmBaryon;
239256
240257 // Pointer of histograms for QA
241258 std::shared_ptr<TH1> hInvMassCharmBaryonToXiPi, hInvMassCharmBaryonToOmegaPi, hInvMassCharmBaryonToOmegaKa;
@@ -279,7 +296,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
279296 }
280297
281298 // Assign pdg & mass hypothesis for each decay channel
282- if (xipiEnabledDca || xipiEnabledKf) {
299+ if (xipiEnabledDca > 0 || xipiEnabledKf > 0 ) {
283300 pdgIdOfV0DauPos = kProton ;
284301 pdgIdOfV0DauNeg = kPiMinus ;
285302 pdgIdOfBach = kPiMinus ;
@@ -298,7 +315,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
298315 massOfCharmBach = o2::constants::physics::MassPiPlus;
299316 massOfV0 = o2::constants::physics::MassLambda;
300317 massOfCascade = o2::constants::physics::MassXiMinus;
301- } else if (omegapiEnabledDca || omegapiEnabledKf) {
318+ } else if (omegapiEnabledDca > 0 || omegapiEnabledKf > 0 ) {
302319 pdgIdOfV0DauPos = kProton ;
303320 pdgIdOfV0DauNeg = kPiMinus ;
304321 pdgIdOfBach = kKMinus ;
@@ -317,7 +334,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
317334 massOfCharmBach = o2::constants::physics::MassPiPlus;
318335 massOfV0 = o2::constants::physics::MassLambda;
319336 massOfCascade = o2::constants::physics::MassOmegaMinus;
320- } else if (omegakaEnabledDca || omegakaEnabledKf) {
337+ } else if (omegakaEnabledDca > 0 || omegakaEnabledKf > 0 ) {
321338 pdgIdOfV0DauPos = kProton ;
322339 pdgIdOfV0DauNeg = kPiMinus ;
323340 pdgIdOfBach = kKMinus ;
@@ -342,15 +359,19 @@ struct HfCandidateCreatorXic0Omegac0Qa {
342359 LOGF (info, " PDG ID of V0 negative daughter: %d" , pdgIdOfV0DauNeg);
343360 LOGF (info, " PDG ID of Bachelor: %d" , pdgIdOfBach);
344361 LOGF (info, " PDG ID of Charm Bachelor: %d" , pdgIdOfCharmBach);
345- LOGF (info, " ----------" );
362+ LOGF (info, " ------------------------------------------- " );
346363 LOGF (info, " PDG ID of anti V0 positive daughter: %d" , pdgIdOfAntiV0DauPos);
347364 LOGF (info, " PDG ID of anti V0 negative daughter: %d" , pdgIdOfAntiV0DauNeg);
348365 LOGF (info, " PDG ID of anti Bachelor: %d" , pdgIdOfAntiBach);
349366 LOGF (info, " PDG ID of anti Charm Bachelor: %d" , pdgIdOfAntiCharmBach);
350- LOGF (info, " ----------" );
367+ LOGF (info, " ------------------------------------------- " );
351368 LOGF (info, " PDG ID of V0: %d" , pdgIdOfV0);
352369 LOGF (info, " PDG ID of Cascade: %d" , pdgIdOfCascade);
353370 LOGF (info, " PDG ID of Charm Baryon: %d" , pdgIdOfCharmBaryon);
371+ LOGF (info, " -------------------------------------------" );
372+ LOGF (info, " Mass of V0 set as: %f" , massOfV0);
373+ LOGF (info, " Mass of CharmBach set as: %f" , massOfCharmBach);
374+ LOGF (info, " Mass of Casc as: %f" , massOfCascade);
354375 LOGF (info, " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
355376
356377 // Add histogram to indicate which sv method was used
@@ -389,12 +410,16 @@ struct HfCandidateCreatorXic0Omegac0Qa {
389410 straHelper.cascadeselections .maxDaughterEta = LFConfigs.maxDaughterEtaFromLF ;
390411
391412 // Fitter setting
392- straHelper.fitter .setPropagateToPCA (configs.propagateToPCA );
393- straHelper.fitter .setMaxR (configs.maxR );
394- straHelper.fitter .setMaxDZIni (configs.maxDZIni );
395- straHelper.fitter .setMinParamChange (configs.minParamChange );
396- straHelper.fitter .setUseAbsDCA (configs.useAbsDCA );
397- straHelper.fitter .setWeightedFinalPCA (configs.useWeightedFinalPCA );
413+ straHelper.fitter .setPropagateToPCA (LFConfigs.propagateToPCALF );
414+ straHelper.fitter .setMaxR (LFConfigs.maxRLF );
415+ straHelper.fitter .setMaxDZIni (LFConfigs.maxDZIniLF );
416+ straHelper.fitter .setMaxDXYIni (LFConfigs.maxDXYIniLF );
417+ straHelper.fitter .setMinParamChange (LFConfigs.minParamChangeLF );
418+ straHelper.fitter .setMinRelChi2Change (LFConfigs.minRelChi2ChangeLF );
419+ straHelper.fitter .setMaxChi2 (LFConfigs.maxChi2LF );
420+ straHelper.fitter .setUseAbsDCA (LFConfigs.useAbsDCALF );
421+ straHelper.fitter .setWeightedFinalPCA (LFConfigs.useWeightedFinalPCALF );
422+ straHelper.fitter .setRefitWithMatCorr (LFConfigs.refitWithMaterialCorrectionLF );
398423
399424 // Extra initialization for DCAFitter
400425 // ----------------------------------
@@ -423,7 +448,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
423448
424449 // Histograms for QA
425450 // -----------------
426- registry.add (" ReconstructedDecayChannel" , " DecayChannel " , {kTH1F , {{3 , 0.0 , 3.0 }}});
451+ registry.add (" ReconstructedDecayChannel" , " DecyayChannel " , {kTH1F , {{3 , 0.0 , 3.0 }}});
427452 registry.get <TH1>(HIST (" ReconstructedDecayChannel" ))->GetXaxis ()->SetBinLabel (1 + hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi, " To #Xi #pi" );
428453 registry.get <TH1>(HIST (" ReconstructedDecayChannel" ))->GetXaxis ()->SetBinLabel (1 + hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi, " To #Omega #pi" );
429454 registry.get <TH1>(HIST (" ReconstructedDecayChannel" ))->GetXaxis ()->SetBinLabel (1 + hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK, " To #Omega K" );
@@ -563,9 +588,8 @@ struct HfCandidateCreatorXic0Omegac0Qa {
563588 // float pseudorapV0Dau1 = RecoDecay::eta(pVecV0DauNeg);
564589
565590 // Cascade quantities from LF strangeness builder
566- int chargeCasc = straHelper.cascade .charge ;
567- std::array<float , 3 > vertexCasc (straHelper.cascade .cascadePosition );
568- std::array<float , 3 > const pVecCasc (straHelper.cascade .cascadeMomentum );
591+ std::array<float , 3 > vertexCasc = {straHelper.cascade .cascadePosition [0 ], straHelper.cascade .cascadePosition [1 ], straHelper.cascade .cascadePosition [2 ]};
592+ std::array<float , 3 > const pVecCasc = {straHelper.cascade .cascadeMomentum [0 ], straHelper.cascade .cascadeMomentum [1 ], straHelper.cascade .cascadeMomentum [2 ]};
569593 std::array<float , 21 > covCasc = {0 .};
570594 constexpr int NumCovElement = 6 ;
571595 constexpr int MomInd[NumCovElement] = {9 , 13 , 14 , 18 , 19 , 20 };
@@ -580,9 +604,9 @@ struct HfCandidateCreatorXic0Omegac0Qa {
580604 // ------------------------------Create cascade track------------------------------
581605
582606 o2::track::TrackParCov trackCasc;
583- if (chargeCasc < 0 ) { // Xi- or Omega-
607+ if (bachTrack. sign () < 0 ) { // Xi- or Omega-
584608 trackCasc = o2::track::TrackParCov (vertexCasc, pVecCasc, covCasc, -1 , true );
585- } else if (chargeCasc > 0 ) { // Xi+ or Omega+
609+ } else if (bachTrack. sign () > 0 ) { // Xi+ or Omega+
586610 trackCasc = o2::track::TrackParCov (vertexCasc, pVecCasc, covCasc, 1 , true );
587611 } else {
588612 continue ;
@@ -600,8 +624,8 @@ struct HfCandidateCreatorXic0Omegac0Qa {
600624 if (df.process (trackCasc, trackParCovCharmBachelor) == 0 ) {
601625 continue ;
602626 }
603- } catch (std::runtime_error& e ) {
604- LOG (error ) << " Execption caught in charm DCA Fitter process call : " << e .what ();
627+ } catch (const std::runtime_error& error ) {
628+ LOG (info ) << " Run time error found : " << error .what () << " . DCAFitter cannot work. Skipping this candidate " ;
605629 continue ;
606630 }
607631
@@ -656,18 +680,10 @@ struct HfCandidateCreatorXic0Omegac0Qa {
656680 float mLambda = straHelper.v0 .massLambda ; // from LF Table
657681
658682 // get Casc mass - from LF Table
659- float mCasc = 0 .;
660- if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) {
661- mCasc = straHelper.cascade .massXi ;
662- } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) {
663- mCasc = straHelper.cascade .massOmega ;
664- } else if constexpr (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) {
665- mCasc = straHelper.cascade .massOmega ;
666- }
683+ float mCasc = (decayChannel != hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi) ? straHelper.cascade .massOmega : straHelper.cascade .massXi ;
667684
668685 // get Charm baryon invariant mass
669- auto arrMomenta = std::array{pVecCascAsD, pVecCharmBachAsD};
670- float massCharmBaryonCand = RecoDecay::m (arrMomenta, std::array{massOfCascade, massOfCharmBach});
686+ float massCharmBaryonCand = RecoDecay::m (std::array{pVecCascAsD, pVecCharmBachAsD}, std::array{massOfCascade, massOfCharmBach});
671687 if (configs.fillHistograms ) {
672688 hInvMassCharmBaryon->Fill (massCharmBaryonCand);
673689 }
0 commit comments