Skip to content

Commit 5044716

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/master'
2 parents 25f3617 + f523055 commit 5044716

1,058 files changed

Lines changed: 58268 additions & 29173 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.

.github/workflows/clean-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ name: Clean PR checks
3434
type: boolean
3535
default: true
3636

37+
'check_build/O2Physics/staging':
38+
description: build/O2Physics/staging
39+
type: boolean
40+
default: true
41+
3742
permissions: {}
3843

3944
jobs:

ALICE3/Core/ALICE3CoreLinkDef.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
#pragma link off all classes;
1414
#pragma link off all functions;
1515

16-
#pragma link C++ class o2::pid::tof::TOFResoALICE3 + ;
1716
#pragma link C++ class std::vector < std::vector < unsigned int>> + ;
1817
#pragma link C++ class std::vector < std::vector < std::uint32_t>> + ;

ALICE3/Core/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@
1010
# or submit itself to any jurisdiction.
1111

1212
o2physics_add_library(ALICE3Core
13-
SOURCES TOFResoALICE3.cxx
14-
TrackUtilities.cxx
15-
DelphesO2TrackSmearer.cxx
13+
SOURCES TrackUtilities.cxx
14+
FlatLutEntry.cxx
15+
FlatTrackSmearer.cxx
1616
GeometryContainer.cxx
1717
PUBLIC_LINK_LIBRARIES O2::Framework
1818
O2Physics::AnalysisCore)
1919

2020
o2physics_target_root_dictionary(ALICE3Core
21-
HEADERS TOFResoALICE3.h
22-
TrackUtilities.h
23-
DelphesO2TrackSmearer.h
21+
HEADERS TrackUtilities.h
22+
FlatLutEntry.h
2423
GeometryContainer.h
2524
LINKDEF ALICE3CoreLinkDef.h)
2625

2726
o2physics_add_library(FastTracker
2827
SOURCES FastTracker.cxx
2928
DetLayer.cxx
30-
DelphesO2LutWriter.cxx
29+
FlatLutEntry.cxx
30+
FlatLutWriter.cxx
3131
PUBLIC_LINK_LIBRARIES O2::Framework
3232
O2Physics::AnalysisCore
3333
O2Physics::ALICE3Core)
3434

3535
o2physics_target_root_dictionary(FastTracker
3636
HEADERS FastTracker.h
3737
DetLayer.h
38-
DelphesO2LutWriter.h
38+
FlatLutWriter.h
3939
LINKDEF FastTrackerLinkDef.h)

ALICE3/Core/Decayer.h

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <TLorentzVector.h>
3131
#include <TRandom3.h>
3232

33-
#include <array>
3433
#include <cmath>
3534
#include <cstddef>
3635
#include <vector>
@@ -47,46 +46,49 @@ class Decayer
4746
Decayer() = default;
4847

4948
template <typename TDatabase>
50-
std::vector<o2::upgrade::OTFParticle> decayParticle(const TDatabase& pdgDB, const o2::track::TrackParCov& track, const int pdgCode)
49+
std::vector<o2::upgrade::OTFParticle> decayParticle(const TDatabase& pdgDB, const OTFParticle& particle)
5150
{
52-
const auto& particleInfo = pdgDB->GetParticle(pdgCode);
51+
const auto& particleInfo = pdgDB->GetParticle(particle.pdgCode());
52+
if (!particleInfo) {
53+
return {};
54+
}
55+
5356
const int charge = particleInfo->Charge() / 3;
5457
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);
5958

60-
const double u = mRand3.Uniform(0, 1);
59+
const double u = mRand3.Uniform(0.001, 0.999);
6160
const double ctau = o2::constants::physics::LightSpeedCm2S * particleInfo->Lifetime(); // cm
62-
const double betaGamma = track.getP() / mass;
61+
const double betaGamma = particle.p() / mass;
6362
const double rxyz = -betaGamma * ctau * std::log(1 - u);
6463
double vx, vy, vz;
6564
double px, py, e;
6665

6766
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];
67+
vx = particle.vx() + rxyz * (particle.px() / particle.p());
68+
vy = particle.vy() + rxyz * (particle.py() / particle.p());
69+
vz = particle.vz() + rxyz * (particle.pz() / particle.p());
70+
px = particle.px();
71+
py = particle.py();
7372
} else {
74-
float sna, csa;
73+
o2::track::TrackParCov track;
7574
o2::math_utils::CircleXYf_t circle;
75+
o2::upgrade::convertOTFParticleToO2Track(particle, track, pdgDB);
76+
77+
float sna, csa;
7678
track.getCircleParams(mBz, circle, sna, csa);
7779
const double rxy = rxyz / std::sqrt(1. + track.getTgl() * track.getTgl());
7880
const double theta = rxy / circle.rC;
7981

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());
82+
vx = ((particle.vx() - circle.xC) * std::cos(theta) - (particle.vy() - circle.yC) * std::sin(theta)) + circle.xC;
83+
vy = ((particle.vy() - circle.yC) * std::cos(theta) + (particle.vx() - circle.xC) * std::sin(theta)) + circle.yC;
84+
vz = particle.vz() + rxyz * (particle.pz() / track.getP());
8385

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

8890
double brTotal = 0.;
89-
e = std::sqrt(mass * mass + px * px + py * py + mom[2] * mom[2]);
91+
e = std::sqrt(mass * mass + px * px + py * py + particle.pz() * particle.pz());
9092
for (int ch = 0; ch < particleInfo->NDecayChannels(); ++ch) {
9193
brTotal += particleInfo->DecayChannel(ch)->BranchingRatio();
9294
}
@@ -108,7 +110,11 @@ class Decayer
108110
}
109111
}
110112

111-
TLorentzVector tlv(px, py, mom[2], e);
113+
if (dauMasses.empty()) {
114+
return {};
115+
}
116+
117+
TLorentzVector tlv(px, py, particle.pz(), e);
112118
TGenPhaseSpace decay;
113119
decay.SetDecay(tlv, dauMasses.size(), dauMasses.data());
114120
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)