@@ -78,25 +78,26 @@ struct PhotonConversionBuilder {
7878 Configurable<int > useMatCorrType{" useMatCorrType" , 0 , " 0: none, 1: TGeo, 2: LUT" };
7979
8080 // single track cuts
81+ Configurable<int > min_ncluster_tpc{" min_ncluster_tpc" , 25 , " min ncluster tpc" };
8182 Configurable<int > mincrossedrows{" mincrossedrows" , 10 , " min crossed rows" };
8283 Configurable<float > maxchi2tpc{" maxchi2tpc" , 4.0 , " max chi2/NclsTPC" };
8384 Configurable<float > maxchi2its{" maxchi2its" , 5.0 , " max chi2/NclsITS" };
8485 Configurable<float > maxpt_itsonly{" maxpt_itsonly" , 0.15 , " max pT for ITSonly tracks at SV" };
8586 Configurable<float > maxTPCNsigmaEl{" maxTPCNsigmaEl" , 4.0 , " max. TPC n sigma for electron" };
8687 Configurable<float > dcanegtopv{" dcanegtopv" , 0.1 , " DCA Neg To PV" };
8788 Configurable<float > dcapostopv{" dcapostopv" , 0.1 , " DCA Pos To PV" };
88- Configurable<float > min_pt_leg{" min_pt_leg" , 0.05 , " min pT for v0 legs at SV" };
89+ Configurable<float > min_pt_leg{" min_pt_leg" , 0.04 , " min pT for v0 legs at SV" };
8990 Configurable<float > maxX{" maxX" , 83.1 , " max X for track IU" };
9091
9192 // v0 cuts
92- Configurable<float > min_v0cospa{" min_v0cospa" , 0.99 , " V0 CosPA" }; // double -> N.B. dcos(x)/dx = 0 at x=0)
93- Configurable<float > max_dcav0dau{" max_dcav0dau" , 2 .0 , " max distance btween 2 legs" };
93+ Configurable<float > min_v0cospa{" min_v0cospa" , 0.95 , " V0 CosPA" }; // double -> N.B. dcos(x)/dx = 0 at x=0)
94+ Configurable<float > max_dcav0dau{" max_dcav0dau" , 3 .0 , " max distance btween 2 legs" };
9495 Configurable<float > min_v0radius{" min_v0radius" , 1.0 , " min v0 radius" };
9596 Configurable<float > margin_r_its{" margin_r_its" , 3.0 , " margin for r cut in cm" };
9697 Configurable<float > margin_r_tpconly{" margin_r_tpconly" , 7.0 , " margin for r cut in cm" };
9798 Configurable<float > margin_z{" margin_z" , 7.0 , " margin for z cut in cm" };
9899 Configurable<float > max_alpha_ap{" max_alpha_ap" , 0.95 , " max alpha for AP cut" };
99- Configurable<float > max_qt_ap{" max_qt_ap" , 0.02 , " max qT for AP cut" };
100+ Configurable<float > max_qt_ap{" max_qt_ap" , 0.01 , " max qT for AP cut" };
100101 Configurable<float > min_pt_v0{" min_pt_v0" , 0.05 , " min pT for v0 photons at SV" };
101102 Configurable<float > max_pt_v0_itsonly{" max_pt_v0_itsonly" , 0.3 , " max pT for v0 photons wth 2 ITSonly tracks at SV" };
102103 Configurable<float > max_eta_v0{" max_eta_v0" , 0.9 , " max eta for v0 photons at SV" };
@@ -119,14 +120,14 @@ struct PhotonConversionBuilder {
119120 {" V0/hAP" , " Armenteros Podolanski;#alpha;q_{T} (GeV/c)" , {HistType::kTH2F , {{200 , -1 .0f , 1 .0f }, {250 , 0 , 0.25 }}}},
120121 {" V0/hConversionPointXY" , " conversion point in XY;X (cm);Y (cm)" , {HistType::kTH2F , {{400 , -100 .0f , 100 .0f }, {400 , -100 .f , 100 .f }}}},
121122 {" V0/hConversionPointRZ" , " conversion point in RZ;Z (cm);R_{xy} (cm)" , {HistType::kTH2F , {{200 , -100 .0f , 100 .0f }, {200 , 0 .f , 100 .f }}}},
122- {" V0/hPt" , " pT of V0 at PV ;p_{T,#gamma} (GeV/c)" , {HistType::kTH1F , {{1000 , 0 .0f , 10 .0f }}}},
123- {" V0/hEtaPhi" , " #eta vs. #varphi of V0 at PV ;#varphi (rad.);#eta" , {HistType::kTH2F , {{72 , 0 .0f , TMath::TwoPi ()}, {400 , -2 , +2 }}}},
123+ {" V0/hPt" , " pT of V0 at SV ;p_{T,#gamma} (GeV/c)" , {HistType::kTH1F , {{1000 , 0 .0f , 10 .0f }}}},
124+ {" V0/hEtaPhi" , " #eta vs. #varphi of V0 at SV ;#varphi (rad.);#eta" , {HistType::kTH2F , {{72 , 0 .0f , TMath::TwoPi ()}, {400 , -2 , +2 }}}},
124125 {" V0/hCosPA" , " cosine of pointing angle;cosine of pointing angle" , {HistType::kTH1F , {{100 , 0 .9f , 1 .f }}}},
126+ {" V0/hCosPA_Rxy" , " cosine of pointing angle;r_{xy} (cm);cosine of pointing angle" , {HistType::kTH2F , {{100 , 0 , 100 }, {100 , 0 .9f , 1 .f }}}},
125127 {" V0/hPCA" , " distance between 2 legs at SV;PCA (cm)" , {HistType::kTH1F , {{500 , 0 .0f , 5 .f }}}},
128+ {" V0/hPCA_Rxy" , " distance between 2 legs at SV;R_{xy} (cm);PCA (cm)" , {HistType::kTH2F , {{100 , 0 , 100 }, {500 , 0 .0f , 5 .f }}}},
126129 {" V0/hDCAxyz" , " DCA to PV;DCA_{xy} (cm);DCA_{z} (cm)" , {HistType::kTH2F , {{200 , -5 .f , +5 .f }, {200 , -5 .f , +5 .f }}}},
127- // {"V0/hMee_SVPV", "mee at PV and SV;m_{ee} at PV (GeV/c^{2});m_{ee} at SV (GeV/c^{2})", {HistType::kTH2F, {{100, 0.0f, 0.1f}, {100, 0, 0.1f}}}},
128130 {" V0/hMeeSV_Rxy" , " mee at SV vs. R_{xy};R_{xy} (cm);m_{ee} at SV (GeV/c^{2})" , {HistType::kTH2F , {{200 , 0 .0f , 100 .f }, {100 , 0 , 0 .1f }}}},
129- // {"V0/hMeePV_Rxy", "mee at PV vs. R_{xy};R_{xy} (cm);m_{ee} at PV (GeV/c^{2})", {HistType::kTH2F, {{200, 0.0f, 100.f}, {100, 0, 0.1f}}}},
130131 {" V0Leg/hPt" , " pT of leg at SV;p_{T,e} (GeV/c)" , {HistType::kTH1F , {{1000 , 0 .0f , 10 .0f }}}},
131132 {" V0Leg/hEtaPhi" , " #eta vs. #varphi of leg at SV;#varphi (rad.);#eta" , {HistType::kTH2F , {{72 , 0 .0f , TMath::TwoPi ()}, {400 , -2 , +2 }}}},
132133 {" V0Leg/hDCAxyz" , " DCA xy vs. z to PV;DCA_{xy} (cm);DCA_{z} (cm)" , {HistType::kTH2F , {{200 , -10 .f , 10 .f }, {200 , -10 .f , +10 .f }}}},
@@ -230,7 +231,14 @@ struct PhotonConversionBuilder {
230231 return false ;
231232 }
232233
234+ if (track.hasITS () && !track.hasTPC () && (track.hasTRD () || track.hasTOF ())) { // remove unrealistic track. this should not happen.
235+ return false ;
236+ }
237+
233238 if (track.hasTPC ()) {
239+ if (track.tpcNClsFound () < min_ncluster_tpc) {
240+ return false ;
241+ }
234242 if (track.tpcNClsCrossedRows () < mincrossedrows || track.tpcChi2NCl () > maxchi2tpc) {
235243 return false ;
236244 }
@@ -255,41 +263,19 @@ struct PhotonConversionBuilder {
255263 }
256264 }
257265
258- if (!track.hasITS () && track.x () < 0.1 ) { // TPConly tracks which cannot be propagated to X=83cm during asynch. reco..
259- auto track_par_cov = getTrackParCov (track);
260- o2::base::Propagator::Instance ()->propagateToX (track_par_cov, 83 .f , d_bz, o2::base::PropagatorImpl<float >::MAX_SIN_PHI, o2::base::PropagatorImpl<float >::MAX_STEP, matCorr);
261- if (40.0 < track_par_cov.getX () && track_par_cov.getX () < 82.9 ) { // propagation failed.
262- return false ;
263- }
264- }
265-
266266 return true ;
267267 }
268268
269269 template <typename TTrack, typename TKFParticle>
270270 void fillTrackTable (TTrack const & track, TKFParticle const & kfp, float dcaXY, float dcaZ)
271271 {
272- float trackiu_x = 0.0 , trackiu_y = 0.0 , trackiu_z = 0.0 ;
273- if (!track.hasITS () && track.x () < 0.1 ) { // TPConly tracks which cannot be propagated to X=83cm during asynch. reco..
274- auto track_par_cov = getTrackParCov (track);
275- o2::base::Propagator::Instance ()->propagateToX (track_par_cov, 83 .f , d_bz, o2::base::PropagatorImpl<float >::MAX_SIN_PHI, o2::base::PropagatorImpl<float >::MAX_STEP, matCorr);
276- trackiu_x = track_par_cov.getX ();
277- // trackiu_y = track_par_cov.getY();
278- trackiu_y = track.y ();
279- trackiu_z = track_par_cov.getZ ();
280- } else {
281- trackiu_x = track.x ();
282- trackiu_y = track.y ();
283- trackiu_z = track.z ();
284- }
285-
286272 v0legs (track.collisionId (), track.globalIndex (), track.sign (),
287273 kfp.GetPx (), kfp.GetPy (), kfp.GetPz (), dcaXY, dcaZ,
288274 track.tpcNClsFindable (), track.tpcNClsFindableMinusFound (), track.tpcNClsFindableMinusCrossedRows (),
289275 track.tpcChi2NCl (), track.tpcInnerParam (), track.tpcSignal (),
290276 track.tpcNSigmaEl (), track.tpcNSigmaPi (),
291277 track.itsClusterMap (), track.itsChi2NCl (), track.detectorMap (),
292- trackiu_x, trackiu_y, trackiu_z , track.tgl (), track.signed1Pt ());
278+ track. x (), track. y (), track. z () , track.tgl (), track.signed1Pt ());
293279 }
294280
295281 template <bool isMC, class TCollision , class TTrack , typename TV0>
@@ -308,10 +294,10 @@ struct PhotonConversionBuilder {
308294 return ;
309295 }
310296
311- if (isITSonlyTrack (pos) && isTPConlyTrack ( ele)) {
297+ if (isITSonlyTrack (pos) && ! ele. hasITS ( )) {
312298 return ;
313299 }
314- if (isITSonlyTrack (ele) && isTPConlyTrack ( pos)) {
300+ if (isITSonlyTrack (ele) && ! pos. hasITS ( )) {
315301 return ;
316302 }
317303
@@ -324,13 +310,11 @@ struct PhotonConversionBuilder {
324310 gpu::gpustd::array<float , 2 > dcaInfo;
325311
326312 auto pTrack = getTrackPar (pos);
327- // pTrack.setPID(o2::track::PID::Electron);
328313 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({collision.posX (), collision.posY (), collision.posZ ()}, pTrack, 2 .f , matCorr, &dcaInfo);
329314 auto posdcaXY = dcaInfo[0 ];
330315 auto posdcaZ = dcaInfo[1 ];
331316
332317 auto nTrack = getTrackPar (ele);
333- // nTrack.setPID(o2::track::PID::Electron);
334318 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({collision.posX (), collision.posY (), collision.posZ ()}, nTrack, 2 .f , matCorr, &dcaInfo);
335319 auto eledcaXY = dcaInfo[0 ];
336320 auto eledcaZ = dcaInfo[1 ];
@@ -346,6 +330,7 @@ struct PhotonConversionBuilder {
346330 if (rxy_tmp > maxX + margin_r_tpconly) {
347331 return ;
348332 }
333+
349334 if (rxy_tmp < abs (xyz[2 ]) * TMath::Tan (2 * TMath::ATan (TMath::Exp (-max_eta_v0))) - margin_z) {
350335 return ; // RZ line cut
351336 }
@@ -397,6 +382,10 @@ struct PhotonConversionBuilder {
397382 }
398383 }
399384
385+ if (rxy < abs (gammaKF_DecayVtx.GetZ ()) * TMath::Tan (2 * TMath::ATan (TMath::Exp (-max_eta_v0))) - margin_z) {
386+ return ; // RZ line cut
387+ }
388+
400389 if ((!pos.hasITS () || !ele.hasITS ()) && rxy < max_r_req_its) { // conversion points smaller than max_r_req_its have to be detected with ITS hits.
401390 return ;
402391 }
@@ -405,17 +394,20 @@ struct PhotonConversionBuilder {
405394 return ;
406395 }
407396
408- if (rxy < abs (gammaKF_DecayVtx.GetZ ()) * TMath::Tan (2 * TMath::ATan (TMath::Exp (-max_eta_v0))) - margin_z) {
409- return ; // RZ line cut
410- }
397+ // // Apply a topological constraint of the gamma to the PV. Parameters will be given at the primary vertex.
398+ // KFParticle gammaKF_PV = gammaKF_DecayVtx;
399+ // gammaKF_PV.SetProductionVertex(KFPV);
400+ // LOGF(info, "gammaKF_PV.GetPx() = %f, gammaKF_DecayVtx.GetPx() = %f", gammaKF_PV.GetPx(), gammaKF_DecayVtx.GetPx());
401+ // LOGF(info, "gammaKF_PV.GetPy() = %f, gammaKF_DecayVtx.GetPy() = %f", gammaKF_PV.GetPy(), gammaKF_DecayVtx.GetPy());
402+ // LOGF(info, "gammaKF_PV.GetPz() = %f, gammaKF_DecayVtx.GetPz() = %f", gammaKF_PV.GetPz(), gammaKF_DecayVtx.GetPz());
411403
412404 float v0pt = RecoDecay::sqrtSumOfSquares (gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy ());
413405 float v0eta = RecoDecay::eta (std::array{gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy (), gammaKF_DecayVtx.GetPz ()});
414406 float v0phi = RecoDecay::phi (gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy ()) > 0 .f ? RecoDecay::phi (gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy ()) : RecoDecay::phi (gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy ()) + TMath::TwoPi ();
415407
416- if (fabs (v0eta) > max_eta_v0 || v0pt < min_pt_v0) {
417- return ;
418- }
408+ // if (fabs(v0eta) > max_eta_v0 || v0pt < min_pt_v0) {
409+ // return;
410+ // }
419411
420412 if (isITSonlyTrack (ele) && isITSonlyTrack (pos) && v0pt > max_pt_v0_itsonly) {
421413 return ;
@@ -426,11 +418,6 @@ struct PhotonConversionBuilder {
426418 kfp_pos_DecayVtx.TransportToPoint (xyz); // Don't set Primary Vertex
427419 kfp_ele_DecayVtx.TransportToPoint (xyz); // Don't set Primary Vertex
428420
429- // KFParticle kfp_pos_PV = kfp_pos_DecayVtx;
430- // KFParticle kfp_ele_PV = kfp_ele_DecayVtx;
431- // kfp_pos_PV.SetProductionVertex(KFPV);
432- // kfp_ele_PV.SetProductionVertex(KFPV);
433-
434421 float pca_kf = kfp_pos_DecayVtx.GetDistanceFromParticle (kfp_ele_DecayVtx);
435422 if (pca_kf > max_dcav0dau) {
436423 return ;
@@ -442,18 +429,12 @@ struct PhotonConversionBuilder {
442429 return ;
443430 }
444431
445- if (isITSonlyTrack (pos)) {
446- float legpt = RecoDecay::sqrtSumOfSquares (kfp_pos_DecayVtx.GetPx (), kfp_pos_DecayVtx.GetPy ());
447- if (legpt > maxpt_itsonly) {
448- return ;
449- }
432+ if (isITSonlyTrack (pos) && pos_pt > maxpt_itsonly) {
433+ return ;
450434 }
451435
452- if (isITSonlyTrack (ele)) {
453- float legpt = RecoDecay::sqrtSumOfSquares (kfp_ele_DecayVtx.GetPx (), kfp_ele_DecayVtx.GetPy ());
454- if (legpt > maxpt_itsonly) {
455- return ;
456- }
436+ if (isITSonlyTrack (ele) && ele_pt > maxpt_itsonly) {
437+ return ;
457438 }
458439
459440 float alpha = v0_alpha (kfp_pos_DecayVtx.GetPx (), kfp_pos_DecayVtx.GetPy (), kfp_pos_DecayVtx.GetPz (), kfp_ele_DecayVtx.GetPx (), kfp_ele_DecayVtx.GetPy (), kfp_ele_DecayVtx.GetPz ());
@@ -471,7 +452,9 @@ struct PhotonConversionBuilder {
471452 registry.fill (HIST (" V0/hPt" ), v0pt);
472453 registry.fill (HIST (" V0/hEtaPhi" ), v0phi, v0eta);
473454 registry.fill (HIST (" V0/hCosPA" ), cospa_kf);
455+ registry.fill (HIST (" V0/hCosPA_Rxy" ), rxy, cospa_kf);
474456 registry.fill (HIST (" V0/hPCA" ), pca_kf);
457+ registry.fill (HIST (" V0/hPCA_Rxy" ), rxy, pca_kf);
475458
476459 // calculate DCAxy,z to PV
477460 float v0mom = RecoDecay::sqrtSumOfSquares (gammaKF_DecayVtx.GetPx (), gammaKF_DecayVtx.GetPy (), gammaKF_DecayVtx.GetPz ());
@@ -499,16 +482,10 @@ struct PhotonConversionBuilder {
499482 registry.fill (HIST (" V0Leg/hDCAxyz" ), posdcaXY, posdcaZ);
500483 registry.fill (HIST (" V0Leg/hDCAxyz" ), eledcaXY, eledcaZ);
501484
502- // ROOT::Math::PxPyPzMVector vpos_pv(kfp_pos_PV.GetPx(), kfp_pos_PV.GetPy(), kfp_pos_PV.GetPz(), o2::constants::physics::MassElectron);
503- // ROOT::Math::PxPyPzMVector vele_pv(kfp_ele_PV.GetPx(), kfp_ele_PV.GetPy(), kfp_ele_PV.GetPz(), o2::constants::physics::MassElectron);
504- // ROOT::Math::PxPyPzMVector v0_pv = vpos_pv + vele_pv;
505-
506485 ROOT::Math::PxPyPzMVector vpos_sv (kfp_pos_DecayVtx.GetPx (), kfp_pos_DecayVtx.GetPy (), kfp_pos_DecayVtx.GetPz (), o2::constants::physics::MassElectron);
507486 ROOT::Math::PxPyPzMVector vele_sv (kfp_ele_DecayVtx.GetPx (), kfp_ele_DecayVtx.GetPy (), kfp_ele_DecayVtx.GetPz (), o2::constants::physics::MassElectron);
508487 ROOT::Math::PxPyPzMVector v0_sv = vpos_sv + vele_sv;
509- // registry.fill(HIST("V0/hMee_SVPV"), v0_pv.M(), v0_sv.M());
510488 registry.fill (HIST (" V0/hMeeSV_Rxy" ), rxy, v0_sv.M ());
511- // registry.fill(HIST("V0/hMeePV_Rxy"), rxy, v0_pv.M());
512489
513490 v0photonskf (collision.globalIndex (), v0legs.lastIndex () + 1 , v0legs.lastIndex () + 2 ,
514491 gammaKF_DecayVtx.GetX (), gammaKF_DecayVtx.GetY (), gammaKF_DecayVtx.GetZ (),
0 commit comments