6161#include " ALICE3/Core/DelphesO2TrackSmearer.h"
6262#include " ALICE3/Core/FastTracker.h"
6363#include " ALICE3/Core/DetLayer.h"
64+ #include " ALICE3/Core/TrackUtilities.h"
6465#include " ALICE3/DataModel/collisionAlice3.h"
6566#include " ALICE3/DataModel/tracksAlice3.h"
6667#include " ALICE3/DataModel/OTFStrangeness.h"
@@ -275,7 +276,7 @@ struct OnTheFlyTracker {
275276 mapPdgLut.insert (std::make_pair (1000010030 , lutTrChar));
276277 mapPdgLut.insert (std::make_pair (1000020030 , lutHe3Char));
277278 }
278- for (auto e : mapPdgLut) {
279+ for (const auto & e : mapPdgLut) {
279280 if (!mSmearer .loadTable (e.first , e.second )) {
280281 LOG (fatal) << " Having issue with loading the LUT " << e.first << " " << e.second ;
281282 }
@@ -493,59 +494,6 @@ struct OnTheFlyTracker {
493494 decayDaughters.push_back (*laDecay.GetDecay (1 ));
494495 }
495496
496- // / Function to convert a TLorentzVector into a perfect Track
497- // / \param pdgCode particle pdg
498- // / \param particle the particle to convert (TLorentzVector)
499- // / \param productionVertex where the particle was produced
500- // / \param o2track the address of the resulting TrackParCov
501- void convertTLorentzVectorToO2Track (int pdgCode, TLorentzVector particle, std::vector<double > productionVertex, o2::track::TrackParCov& o2track)
502- {
503- auto pdgInfo = pdgDB->GetParticle (pdgCode);
504- int charge = 0 ;
505- if (pdgInfo != nullptr ) {
506- charge = pdgInfo->Charge () / 3 ;
507- }
508- std::array<float , 5 > params;
509- std::array<float , 15 > covm = {0 .};
510- float s, c, x;
511- o2::math_utils::sincos (static_cast <float >(particle.Phi ()), s, c);
512- o2::math_utils::rotateZInv (static_cast <float >(productionVertex[0 ]), static_cast <float >(productionVertex[1 ]), x, params[0 ], s, c);
513- params[1 ] = static_cast <float >(productionVertex[2 ]);
514- params[2 ] = 0 ;
515- auto theta = 2 . * std::atan (std::exp (-particle.PseudoRapidity ()));
516- params[3 ] = 1 . / std::tan (theta);
517- params[4 ] = charge / particle.Pt ();
518-
519- // Initialize TrackParCov in-place
520- new (&o2track)(o2::track::TrackParCov)(x, particle.Phi (), params, covm);
521- }
522-
523- // / Function to convert a McParticle into a perfect Track
524- // / \param particle the particle to convert (mcParticle)
525- // / \param o2track the address of the resulting TrackParCov
526- template <typename McParticleType>
527- void convertMCParticleToO2Track (McParticleType& particle, o2::track::TrackParCov& o2track)
528- {
529- auto pdgInfo = pdgDB->GetParticle (particle.pdgCode ());
530- int charge = 0 ;
531- if (pdgInfo != nullptr ) {
532- charge = pdgInfo->Charge () / 3 ;
533- }
534- std::array<float , 5 > params;
535- std::array<float , 15 > covm = {0 .};
536- float s, c, x;
537- o2::math_utils::sincos (particle.phi (), s, c);
538- o2::math_utils::rotateZInv (particle.vx (), particle.vy (), x, params[0 ], s, c);
539- params[1 ] = particle.vz ();
540- params[2 ] = 0 .; // since alpha = phi
541- auto theta = 2 . * std::atan (std::exp (-particle.eta ()));
542- params[3 ] = 1 . / std::tan (theta);
543- params[4 ] = charge / particle.pt ();
544-
545- // Initialize TrackParCov in-place
546- new (&o2track)(o2::track::TrackParCov)(x, particle.phi (), params, covm);
547- }
548-
549497 float dNdEta = 0 .f; // Charged particle multiplicity to use in the efficiency evaluation
550498 void process (aod::McCollision const & mcCollision, aod::McParticles const & mcParticles)
551499 {
@@ -605,7 +553,7 @@ struct OnTheFlyTracker {
605553 if (cascadeDecaySettings.decayXi ) {
606554 if (mcParticle.pdgCode () == 3312 ) {
607555 o2::track::TrackParCov xiTrackParCov;
608- convertMCParticleToO2Track (mcParticle, xiTrackParCov);
556+ o2::upgrade:: convertMCParticleToO2Track (mcParticle, xiTrackParCov, pdgDB );
609557 decayParticle (mcParticle, xiTrackParCov, decayProducts, xiDecayVertex, laDecayVertex);
610558 xiDecayRadius2D = sqrt (xiDecayVertex[0 ] * xiDecayVertex[0 ] + xiDecayVertex[1 ] * xiDecayVertex[1 ]);
611559 laDecayRadius2D = sqrt (laDecayVertex[0 ] * laDecayVertex[0 ] + laDecayVertex[1 ] * laDecayVertex[1 ]);
@@ -653,7 +601,7 @@ struct OnTheFlyTracker {
653601 }
654602
655603 o2::track::TrackParCov trackParCov;
656- convertMCParticleToO2Track (mcParticle, trackParCov);
604+ o2::upgrade:: convertMCParticleToO2Track (mcParticle, trackParCov, pdgDB );
657605
658606 bool isDecayDaughter = false ;
659607 if (mcParticle.getProcess () == 4 )
@@ -674,9 +622,9 @@ struct OnTheFlyTracker {
674622 continue ;
675623 }
676624
677- convertTLorentzVectorToO2Track (-211 , decayProducts[0 ], xiDecayVertex, xiDaughterTrackParCovsPerfect[0 ]);
678- convertTLorentzVectorToO2Track (-211 , decayProducts[1 ], laDecayVertex, xiDaughterTrackParCovsPerfect[1 ]);
679- convertTLorentzVectorToO2Track (2212 , decayProducts[2 ], laDecayVertex, xiDaughterTrackParCovsPerfect[2 ]);
625+ o2::upgrade:: convertTLorentzVectorToO2Track (-211 , decayProducts[0 ], xiDecayVertex, xiDaughterTrackParCovsPerfect[0 ], pdgDB );
626+ o2::upgrade:: convertTLorentzVectorToO2Track (-211 , decayProducts[1 ], laDecayVertex, xiDaughterTrackParCovsPerfect[1 ], pdgDB );
627+ o2::upgrade:: convertTLorentzVectorToO2Track (2212 , decayProducts[2 ], laDecayVertex, xiDaughterTrackParCovsPerfect[2 ], pdgDB );
680628
681629 for (int i = 0 ; i < 3 ; i++) {
682630 isReco[i] = false ;
0 commit comments