Skip to content

Commit b61cfbe

Browse files
authored
Merge branch 'master' into master
2 parents e664aba + ed36b44 commit b61cfbe

474 files changed

Lines changed: 15492 additions & 8581 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ALICE3/Core/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,30 @@
1212
o2physics_add_library(ALICE3Core
1313
SOURCES TOFResoALICE3.cxx
1414
TrackUtilities.cxx
15-
DelphesO2TrackSmearer.cxx
15+
FlatLutEntry.cxx
16+
FlatTrackSmearer.cxx
1617
GeometryContainer.cxx
1718
PUBLIC_LINK_LIBRARIES O2::Framework
1819
O2Physics::AnalysisCore)
1920

2021
o2physics_target_root_dictionary(ALICE3Core
2122
HEADERS TOFResoALICE3.h
2223
TrackUtilities.h
23-
DelphesO2TrackSmearer.h
24+
FlatLutEntry.h
2425
GeometryContainer.h
2526
LINKDEF ALICE3CoreLinkDef.h)
2627

2728
o2physics_add_library(FastTracker
2829
SOURCES FastTracker.cxx
2930
DetLayer.cxx
30-
DelphesO2LutWriter.cxx
31+
FlatLutEntry.cxx
32+
FlatLutWriter.cxx
3133
PUBLIC_LINK_LIBRARIES O2::Framework
3234
O2Physics::AnalysisCore
3335
O2Physics::ALICE3Core)
3436

3537
o2physics_target_root_dictionary(FastTracker
3638
HEADERS FastTracker.h
3739
DetLayer.h
38-
DelphesO2LutWriter.h
40+
FlatLutWriter.h
3941
LINKDEF FastTrackerLinkDef.h)

ALICE3/Core/Decayer.h

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,46 +47,49 @@ class Decayer
4747
Decayer() = default;
4848

4949
template <typename TDatabase>
50-
std::vector<o2::upgrade::OTFParticle> decayParticle(const TDatabase& pdgDB, const o2::track::TrackParCov& track, const int pdgCode)
50+
std::vector<o2::upgrade::OTFParticle> decayParticle(const TDatabase& pdgDB, const OTFParticle& particle)
5151
{
52-
const auto& particleInfo = pdgDB->GetParticle(pdgCode);
52+
const auto& particleInfo = pdgDB->GetParticle(particle.pdgCode());
53+
if (!particleInfo) {
54+
return {};
55+
}
56+
5357
const int charge = particleInfo->Charge() / 3;
5458
const double mass = particleInfo->Mass();
55-
std::array<float, 3> mom;
56-
std::array<float, 3> pos;
57-
track.getPxPyPzGlo(mom);
58-
track.getXYZGlo(pos);
5959

60-
const double u = mRand3.Uniform(0, 1);
60+
const double u = mRand3.Uniform(0.001, 0.999);
6161
const double ctau = o2::constants::physics::LightSpeedCm2S * particleInfo->Lifetime(); // cm
62-
const double betaGamma = track.getP() / mass;
62+
const double betaGamma = particle.p() / mass;
6363
const double rxyz = -betaGamma * ctau * std::log(1 - u);
6464
double vx, vy, vz;
6565
double px, py, e;
6666

6767
if (!charge) {
68-
vx = pos[0] + rxyz * (mom[0] / track.getP());
69-
vy = pos[1] + rxyz * (mom[1] / track.getP());
70-
vz = pos[2] + rxyz * (mom[2] / track.getP());
71-
px = mom[0];
72-
py = mom[1];
68+
vx = particle.vx() + rxyz * (particle.px() / particle.p());
69+
vy = particle.vy() + rxyz * (particle.py() / particle.p());
70+
vz = particle.vz() + rxyz * (particle.pz() / particle.p());
71+
px = particle.px();
72+
py = particle.py();
7373
} else {
74-
float sna, csa;
74+
o2::track::TrackParCov track;
7575
o2::math_utils::CircleXYf_t circle;
76+
o2::upgrade::convertOTFParticleToO2Track(particle, track, pdgDB);
77+
78+
float sna, csa;
7679
track.getCircleParams(mBz, circle, sna, csa);
7780
const double rxy = rxyz / std::sqrt(1. + track.getTgl() * track.getTgl());
7881
const double theta = rxy / circle.rC;
7982

80-
vx = ((pos[0] - circle.xC) * std::cos(theta) - (pos[1] - circle.yC) * std::sin(theta)) + circle.xC;
81-
vy = ((pos[1] - circle.yC) * std::cos(theta) + (pos[0] - circle.xC) * std::sin(theta)) + circle.yC;
82-
vz = mom[2] + rxyz * (mom[2] / track.getP());
83+
vx = ((particle.vx() - circle.xC) * std::cos(theta) - (particle.vy() - circle.yC) * std::sin(theta)) + circle.xC;
84+
vy = ((particle.vy() - circle.yC) * std::cos(theta) + (particle.vx() - circle.xC) * std::sin(theta)) + circle.yC;
85+
vz = particle.vz() + rxyz * (particle.pz() / track.getP());
8386

84-
px = mom[0] * std::cos(theta) - mom[1] * std::sin(theta);
85-
py = mom[1] * std::cos(theta) + mom[0] * std::sin(theta);
87+
px = particle.px() * std::cos(theta) - particle.py() * std::sin(theta);
88+
py = particle.py() * std::cos(theta) + particle.px() * std::sin(theta);
8689
}
8790

8891
double brTotal = 0.;
89-
e = std::sqrt(mass * mass + px * px + py * py + mom[2] * mom[2]);
92+
e = std::sqrt(mass * mass + px * px + py * py + particle.pz() * particle.pz());
9093
for (int ch = 0; ch < particleInfo->NDecayChannels(); ++ch) {
9194
brTotal += particleInfo->DecayChannel(ch)->BranchingRatio();
9295
}
@@ -108,7 +111,11 @@ class Decayer
108111
}
109112
}
110113

111-
TLorentzVector tlv(px, py, mom[2], e);
114+
if (dauMasses.empty()) {
115+
return {};
116+
}
117+
118+
TLorentzVector tlv(px, py, particle.pz(), e);
112119
TGenPhaseSpace decay;
113120
decay.SetDecay(tlv, dauMasses.size(), dauMasses.data());
114121
decay.Generate();

ALICE3/Core/FastTrackerLinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
#pragma link C++ class o2::fastsim::GeometryContainer + ;
2020
#pragma link C++ class o2::fastsim::FastTracker + ;
21-
#pragma link C++ class o2::fastsim::DelphesO2LutWriter + ;
21+
#pragma link C++ class o2::fastsim::FlatLutWriter + ;
2222

2323
#endif // ALICE3_CORE_FASTTRACKERLINKDEF_H_

0 commit comments

Comments
 (0)