@@ -102,6 +102,7 @@ struct nucleiFilter {
102102 Configurable<float > cfgCutDCAxy{" cfgCutDCAxy" , 3 , " Max DCAxy" };
103103 Configurable<float > cfgCutDCAz{" cfgCutDCAz" , 10 , " Max DCAz" };
104104 Configurable<float > cfgCutKstar{" cfgCutKstar" , 1 .f , " Kstar cut for triton femto trigger" };
105+ Configurable<double > cfgCutCosPAheV0{" cfgCutCosPAheV0" , 0.99 , " CosPA cut for HeV0" };
105106
106107 Configurable<LabeledArray<double >> cfgBetheBlochParams{" cfgBetheBlochParams" , {betheBlochDefault[0 ], nNuclei, 6 , nucleiNames, betheBlochParNames}, " TPC Bethe-Bloch parameterisation for light nuclei" };
107108 Configurable<LabeledArray<double >> cfgMomentumScalingBetheBloch{" cfgMomentumScalingBetheBloch" , {bbMomScalingDefault[0 ], nNuclei, 2 , nucleiNames, matterOrNot}, " TPC Bethe-Bloch momentum scaling for light nuclei" };
@@ -112,16 +113,17 @@ struct nucleiFilter {
112113
113114 // variable/tool for hypertriton 3body decay
114115 int mRunNumber ;
115- float d_bz ;
116+ float mBz ;
116117 Service<o2::ccdb::BasicCCDBManager> ccdb;
117118 using TrackCandidates = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TrackSelection, aod::TracksDCA, aod::EvTimeTOFFT0ForTrack, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullTr, aod::pidTPCFullHe, aod::pidTPCFullAl, aod::pidTOFFullDe, aod::pidTOFFullTr, aod::pidTOFFullHe, aod::pidTOFFullAl>; // FIXME: positio has been changed
118119 o2::aod::pidtofgeneric::TofPidNewCollision<TrackCandidates::iterator> bachelorTOFPID;
119120 o2::base::MatLayerCylSet* lut = nullptr ;
121+ o2::vertexing::DCAFitterN<2 > fitter2body;
120122 o2::vertexing::DCAFitterN<3 > fitter3body;
121123 o2::pid::tof::TOFResoParamsV2 mRespParamsV2 ;
122124 // configurable for hypertriton 3body decay
123125 struct : ConfigurableGroup {
124- Configurable<double > d_bz_input {" trgH3L3Body.d_bz " , -999 , " bz field, -999 is automatic" };
126+ Configurable<double > bFieldInput {" trgH3L3Body.mBz " , -999 , " bz field, -999 is automatic" };
125127 Configurable<float > minCosPA3body{" trgH3L3Body.minCosPA3body" , 0.9995 , " minCosPA3body" };
126128 Configurable<float > dcavtxdau{" trgH3L3Body.dcavtxdau" , 0.02 , " meen DCA among Daughters" };
127129 Configurable<float > dcapiontopv{" trgH3L3Body.dcapiontopv" , 0.05 , " DCA Pion To PV" };
@@ -200,6 +202,15 @@ struct nucleiFilter {
200202 fitter3body.setMaxChi2 (1e9 );
201203 fitter3body.setUseAbsDCA (true );
202204
205+ fitter2body.setPropagateToPCA (true );
206+ fitter2body.setMaxR (200 .);
207+ fitter2body.setMinParamChange (1e-3 );
208+ fitter2body.setMinRelChi2Change (0.9 );
209+ fitter2body.setMaxDZIni (1e9 );
210+ fitter2body.setMaxChi2 (1e9 );
211+ fitter2body.setUseAbsDCA (true );
212+
213+
203214 ccdb->setURL (trgH3L3Body.ccdburl );
204215 ccdb->setCaching (true );
205216 ccdb->setLocalObjectValidityChecking ();
@@ -213,12 +224,11 @@ struct nucleiFilter {
213224 }
214225
215226 // In case override, don't proceed, please - no CCDB access required
216- if (trgH3L3Body.d_bz_input > -990 ) {
217- d_bz = trgH3L3Body.d_bz_input ;
218- fitter3body.setBz (d_bz);
227+ if (trgH3L3Body.bFieldInput > -990 ) {
228+ mBz = trgH3L3Body.bFieldInput ;
219229 o2::parameters::GRPMagField grpmag;
220- if (std::fabs (d_bz ) > 1e-5 ) {
221- grpmag.setL3Current (30000 .f / (d_bz / 5 .0f ));
230+ if (std::fabs (mBz ) > 1e-5 ) {
231+ grpmag.setL3Current (30000 .f / (mBz / 5 .0f ));
222232 }
223233 o2::base::Propagator::initFieldFromGRP (&grpmag);
224234 mRunNumber = bc.runNumber ();
@@ -231,22 +241,23 @@ struct nucleiFilter {
231241 if (grpo) {
232242 o2::base::Propagator::initFieldFromGRP (grpo);
233243 // Fetch magnetic field from ccdb for current collision
234- d_bz = grpo->getNominalL3Field ();
235- LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG" ;
244+ mBz = grpo->getNominalL3Field ();
245+ LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG" ;
236246 } else {
237247 grpmag = ccdb->getForTimeStamp <o2::parameters::GRPMagField>(trgH3L3Body.grpmagPath , run3grp_timestamp);
238248 if (!grpmag) {
239249 LOG (fatal) << " Got nullptr from CCDB for path " << trgH3L3Body.grpmagPath << " of object GRPMagField and " << trgH3L3Body.grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
240250 }
241251 o2::base::Propagator::initFieldFromGRP (grpmag);
242252 // Fetch magnetic field from ccdb for current collision
243- // d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
244- d_bz = o2::base::Propagator::Instance ()->getNominalBz ();
245- LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG" ;
253+ // mBz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
254+ mBz = o2::base::Propagator::Instance ()->getNominalBz ();
255+ LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG" ;
246256 }
247257 mRunNumber = bc.runNumber ();
248258 // Set magnetic field value once known
249- fitter3body.setBz (d_bz);
259+ fitter2body.setBz (mBz );
260+ fitter3body.setBz (mBz );
250261
251262 if (trgH3L3Body.useMatCorrType == 2 ) {
252263 // setMatLUT only after magfield has been initalized
@@ -457,11 +468,29 @@ struct nucleiFilter {
457468 float nSigmas[2 ]{
458469 cfgBetheBlochParams->get (2 , 5u ) > 0 .f ? getNsigma (posTrack, 2 , 0 ) : posTrack.tpcNSigmaHe (),
459470 cfgBetheBlochParams->get (2 , 5u ) > 0 .f ? getNsigma (negTrack, 2 , 1 ) : negTrack.tpcNSigmaHe ()};
460- if ((nSigmas[0 ] > cfgCutsPID->get (2 , 0u ) && nSigmas[0 ] < cfgCutsPID->get (2 , 1u )) ||
461- (nSigmas[1 ] > cfgCutsPID->get (2 , 0u ) && nSigmas[1 ] < cfgCutsPID->get (2 , 1u ))) {
462- keepEvent[kHeV0 ] = true ;
463- break ;
471+ if ((nSigmas[0 ] < cfgCutsPID->get (2 , 0u ) || nSigmas[0 ] > cfgCutsPID->get (2 , 1u )) &&
472+ (nSigmas[1 ] < cfgCutsPID->get (2 , 0u ) || nSigmas[1 ] > cfgCutsPID->get (2 , 1u ))) {
473+ continue ;
474+ }
475+ int n2bodyVtx = fitter2body.process (getTrackParCov (posTrack), getTrackParCov (negTrack));
476+ if (n2bodyVtx == 0 ) {
477+ continue ;
478+ }
479+ auto vtxXYZ = fitter2body.getPCACandidate ();
480+ o2::gpu::gpustd::array<float , 3 > mom = {0 .};
481+ vtxXYZ[0 ] -= collision.posX ();
482+ vtxXYZ[1 ] -= collision.posY ();
483+ vtxXYZ[2 ] -= collision.posZ ();
484+ auto momTrackParCov = fitter2body.createParentTrackPar ();
485+ momTrackParCov.getPxPyPzGlo (mom);
486+ double cosPA = (vtxXYZ[0 ] * mom[0 ] + vtxXYZ[1 ] * mom[1 ] + vtxXYZ[2 ] * mom[2 ]) /
487+ std::sqrt ((vtxXYZ[0 ] * vtxXYZ[0 ] + vtxXYZ[1 ] * vtxXYZ[1 ] + vtxXYZ[2 ] * vtxXYZ[2 ]) *
488+ (mom[0 ] * mom[0 ] + mom[1 ] * mom[1 ] + mom[2 ] * mom[2 ]));
489+ if (cosPA < cfgCutCosPAheV0) {
490+ continue ;
464491 }
492+ keepEvent[kHeV0 ] = true ;
493+ break ;
465494 }
466495
467496 //
0 commit comments