Skip to content

Commit ca009d9

Browse files
authored
Merge pull request #96 from preghenella/rdev-dndneta
Prototype for hybrid full/fast simulation (missing parts)
2 parents 9392eda + 864dfdc commit ca009d9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/TrackUtils.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/// @email: [email protected]
33

44
#include "TrackUtils.hh"
5+
#include "TParticle.h"
6+
#include "TParticlePDG.h"
57

68
namespace o2
79
{
@@ -140,6 +142,19 @@ TrackUtils::convertGenParticleToO2Track(const GenParticle& particle, O2Track& o2
140142

141143
/*****************************************************************/
142144

145+
void
146+
TrackUtils::convertTParticleToO2Track(const TParticle& particle, O2Track& o2track)
147+
{
148+
149+
std::array<float, 3> xyz = {static_cast<float>(particle.Vx()), static_cast<float>(particle.Vy()), static_cast<float>(particle.Vz())};
150+
std::array<float, 3> ptetaphi = {static_cast<float>(particle.Pt()), static_cast<float>(particle.Eta()), static_cast<float>(particle.Phi())};
151+
int charge = particle.GetPDG() ? particle.GetPDG()->Charge() / 3. : 0;
152+
makeO2Track(o2track, xyz, ptetaphi, charge);
153+
154+
}
155+
156+
/*****************************************************************/
157+
143158
bool
144159
TrackUtils::propagateToDCA(O2Track &o2track, std::array<float, 3> xyz, float Bz)
145160
{

src/TrackUtils.hh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include "classes/DelphesClasses.h"
99

1010
using O2Track = o2::track::TrackParCov;
11-
11+
12+
class TParticle;
13+
1214
namespace o2
1315
{
1416
namespace delphes
@@ -23,6 +25,7 @@ public:
2325

2426
static void convertTrackToO2Track(const Track &track, O2Track &o2track, bool atDCA);
2527
static void convertGenParticleToO2Track(const GenParticle &particle, O2Track &o2track);
28+
static void convertTParticleToO2Track(const TParticle &particle, O2Track &o2track);
2629

2730
static bool propagateToDCA(O2Track &o2track, std::array<float, 3> xyz, float Bz);
2831

0 commit comments

Comments
 (0)