Skip to content

Commit 6d885f5

Browse files
authored
Merge branch 'master' into modify_taskFlow
2 parents c4c4219 + 1ee4cc6 commit 6d885f5

415 files changed

Lines changed: 50565 additions & 29615 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/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
add_subdirectory(Core)
1414
# add_subdirectory(DataModel)
15+
add_subdirectory(ML)
1516
add_subdirectory(Tasks)
1617
add_subdirectory(TableProducer)
1718
add_subdirectory(Macros)

ALICE3/Core/OTFParticle.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <array>
2424
#include <bitset>
2525
#include <cmath>
26+
#include <cstddef>
2627
#include <cstdint>
2728
#include <span>
2829

@@ -54,7 +55,7 @@ class OTFParticle
5455
mVt = particle.vt();
5556
mFlag = particle.flags();
5657
mStatusCode = particle.statusCode();
57-
mIsFromMcParticles = true;
58+
setBitOff(DecayerBits::ProducedByDecayer);
5859
if (particle.has_mothers()) {
5960
mIndicesMother = {particle.mothersIds().front(), particle.mothersIds().back()};
6061
}
@@ -71,7 +72,6 @@ class OTFParticle
7172
}
7273

7374
// Setters
74-
void setIsPrimary(const bool isPrimary) { mIsPrimary = isPrimary; }
7575
void setCollisionId(const int collisionId) { mCollisionId = collisionId; }
7676
void setPDG(const int pdg) { mPdgCode = pdg; }
7777
void setIndicesMother(const int start, const int stop) { mIndicesMother = {start, stop}; }
@@ -104,9 +104,9 @@ class OTFParticle
104104
int pdgCode() const { return mPdgCode; }
105105
int globalIndex() const { return mGlobalIndex; }
106106
int collisionId() const { return mCollisionId; }
107-
bool isAlive() const { return mIsAlive; }
108-
bool isPrimary() const { return mIsPrimary; }
109-
bool isFromMcParticles() const { return mIsFromMcParticles; }
107+
bool isAlive() const { return checkBit(DecayerBits::IsAlive); }
108+
bool isPrimary() const { return checkBit(DecayerBits::IsPrimary); }
109+
bool isFromMcParticles() const { return !checkBit(DecayerBits::ProducedByDecayer); }
110110
float weight() const
111111
{
112112
static constexpr float Weight = 1.f;
@@ -153,8 +153,8 @@ class OTFParticle
153153
int getMotherIndexStop() const { return mIndicesMother[1]; }
154154
int getDaughterIndexStart() const { return mIndicesDaughter[0]; }
155155
int getDaughterIndexStop() const { return mIndicesDaughter[1]; }
156-
std::array<int, 2> getMothers() const { return mIndicesMother; }
157-
std::array<int, 2> getDaughters() const { return mIndicesDaughter; }
156+
const std::array<int, 2>& getMothers() const { return mIndicesMother; }
157+
const std::array<int, 2>& getDaughters() const { return mIndicesDaughter; }
158158
std::span<const int> getMotherSpan() const { return hasMothers() ? std::span<const int>(mIndicesMother.data(), 2) : std::span<const int>(); }
159159

160160
// Checks
@@ -176,7 +176,7 @@ class OTFParticle
176176
void setBitOn(DecayerBits bit) { mBits.set(static_cast<size_t>(bit), true); }
177177
void setBitOff(DecayerBits bit) { mBits.set(static_cast<size_t>(bit), false); }
178178

179-
std::bitset<8> getBits() const { return mBits; }
179+
const std::bitset<8>& getBits() const { return mBits; }
180180
uint8_t getBitsValue() const { return static_cast<uint8_t>(mBits.to_ulong()); }
181181
void setBits(std::bitset<8> bits) { mBits = bits; }
182182

@@ -185,8 +185,6 @@ class OTFParticle
185185
int mCollisionId{-1};
186186
float mVx{}, mVy{}, mVz{}, mVt{};
187187
float mPx{}, mPy{}, mPz{}, mE{};
188-
bool mIsAlive{}, mIsFromMcParticles{false};
189-
bool mIsPrimary{};
190188

191189
int mStatusCode{};
192190
uint8_t mFlag{};

ALICE3/Core/TrackUtilities.cxx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
#include <vector>
3030

3131
void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,
32-
const TLorentzVector particle,
33-
const std::vector<double> productionVertex,
32+
const TLorentzVector& particle,
33+
const std::vector<double>& productionVertex,
3434
o2::track::TrackParCov& o2track)
3535
{
36-
std::array<float, 5> params;
36+
std::array<float, 5> params = {0.};
3737
std::array<float, 15> covm = {0.};
38-
float s, c, x;
38+
float s{}, c{}, x{};
3939
o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c);
4040
o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c);
4141
params[1] = static_cast<float>(productionVertex[2]);
@@ -48,29 +48,27 @@ void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,
4848
new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm);
4949
}
5050

51-
float o2::upgrade::computeParticleVelocity(float momentum, float mass)
51+
float o2::upgrade::computeParticleVelocity(const float momentum, const float mass)
5252
{
5353
const float a = momentum / mass;
5454
// uses light speed in cm/ps so output is in those units
5555
return o2::constants::physics::LightSpeedCm2PS * a / std::sqrt((1.f + a * a));
5656
}
5757

58-
float o2::upgrade::computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField)
58+
float o2::upgrade::computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField)
5959
{
6060
// don't make use of the track parametrization
6161
float length = -100;
6262

6363
o2::math_utils::CircleXYf_t trcCircle;
64-
float sna, csa;
64+
float sna{}, csa{};
6565
track.getCircleParams(magneticField, trcCircle, sna, csa);
6666

6767
// distance between circle centers (one circle is at origin -> easy)
6868
const float centerDistance = std::hypot(trcCircle.xC, trcCircle.yC);
6969

7070
// condition of circles touching - if not satisfied returned length will be -100
7171
if (centerDistance < trcCircle.rC + radius && centerDistance > std::fabs(trcCircle.rC - radius)) {
72-
length = 0.0f;
73-
7472
// base radical direction
7573
const float ux = trcCircle.xC / centerDistance;
7674
const float uy = trcCircle.yC / centerDistance;
@@ -87,17 +85,17 @@ float o2::upgrade::computeTrackLength(o2::track::TrackParCov track, float radius
8785
(centerDistance + trcCircle.rC + radius));
8886

8987
// possible intercept points of track and TOF layer in 2D plane
90-
const float point1[2] = {radical * ux + displace * vx, radical * uy + displace * vy};
91-
const float point2[2] = {radical * ux - displace * vx, radical * uy - displace * vy};
88+
const std::array<float, 2> point1 = {radical * ux + displace * vx, radical * uy + displace * vy};
89+
const std::array<float, 2> point2 = {radical * ux - displace * vx, radical * uy - displace * vy};
9290

9391
// decide on correct intercept point
94-
std::array<float, 3> mom;
92+
std::array<float, 3> mom{};
9593
track.getPxPyPzGlo(mom);
9694
const float scalarProduct1 = point1[0] * mom[0] + point1[1] * mom[1];
9795
const float scalarProduct2 = point2[0] * mom[0] + point2[1] * mom[1];
9896

9997
// get start point
100-
std::array<float, 3> startPoint;
98+
std::array<float, 3> startPoint{};
10199
track.getXYZGlo(startPoint);
102100

103101
float cosAngle = -1000, modulus = -1000;

ALICE3/Core/TrackUtilities.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace o2::upgrade
3636
/// \param productionVertex where the particle was produced
3737
/// \param o2track the address of the resulting TrackParCov
3838
void convertTLorentzVectorToO2Track(const int charge,
39-
const TLorentzVector particle,
40-
const std::vector<double> productionVertex,
39+
const TLorentzVector& particle,
40+
const std::vector<double>& productionVertex,
4141
o2::track::TrackParCov& o2track);
4242

4343
/// Function to convert a TLorentzVector into a perfect Track
@@ -47,9 +47,9 @@ void convertTLorentzVectorToO2Track(const int charge,
4747
/// \param o2track the address of the resulting TrackParCov
4848
/// \param pdg the pdg service
4949
template <typename PdgService>
50-
void convertTLorentzVectorToO2Track(int pdgCode,
51-
TLorentzVector particle,
52-
std::vector<double> productionVertex,
50+
void convertTLorentzVectorToO2Track(const int pdgCode,
51+
const TLorentzVector& particle,
52+
const std::vector<double>& productionVertex,
5353
o2::track::TrackParCov& o2track,
5454
const PdgService& pdg)
5555
{
@@ -80,7 +80,7 @@ void convertOTFParticleToO2Track(const OTFParticle& particle,
8080
/// \param o2track the address of the resulting TrackParCov
8181
/// \param pdg the pdg service
8282
template <typename McParticleType, typename PdgService>
83-
void convertMCParticleToO2Track(McParticleType& particle,
83+
void convertMCParticleToO2Track(const McParticleType& particle,
8484
o2::track::TrackParCov& o2track,
8585
const PdgService& pdg)
8686
{
@@ -94,7 +94,7 @@ void convertMCParticleToO2Track(McParticleType& particle,
9494
/// \param o2track the address of the resulting TrackParCov
9595
/// \param pdg the pdg service
9696
template <typename McParticleType, typename PdgService>
97-
o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
97+
o2::track::TrackParCov convertMCParticleToO2Track(const McParticleType& particle,
9898
const PdgService& pdg)
9999
{
100100
o2::track::TrackParCov o2track;
@@ -105,13 +105,13 @@ o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
105105
/// returns velocity in centimeters per picoseconds
106106
/// \param momentum the momentum of the track
107107
/// \param mass the mass of the particle
108-
float computeParticleVelocity(float momentum, float mass);
108+
float computeParticleVelocity(const float momentum, const float mass);
109109

110110
/// function to calculate track length of this track up to a certain radius
111111
/// \param track the input track (TrackParCov)
112112
/// \param radius the radius of the layer you're calculating the length to
113113
/// \param magneticField the magnetic field to use when propagating
114-
float computeTrackLength(o2::track::TrackParCov track, float radius, float magneticField);
114+
float computeTrackLength(const o2::track::TrackParCov& track, const float radius, const float magneticField);
115115

116116
} // namespace o2::upgrade
117117

ALICE3/DataModel/OTFMulticharm.h

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ DECLARE_SOA_COLUMN(XiccDauDCA, xiccDauDCA, float);
5353
DECLARE_SOA_COLUMN(XiccDCAxy, xiccDCAxy, float);
5454
DECLARE_SOA_COLUMN(XiccDCAz, xiccDCAz, float);
5555

56-
DECLARE_SOA_COLUMN(BachDCAxy, bachDCAxy, float);
57-
DECLARE_SOA_COLUMN(BachDCAz, bachDCAz, float);
58-
DECLARE_SOA_COLUMN(PosDCAxy, posDCAxy, float);
59-
DECLARE_SOA_COLUMN(PosDCAz, posDCAz, float);
60-
DECLARE_SOA_COLUMN(NegDCAxy, negDCAxy, float);
61-
DECLARE_SOA_COLUMN(NegDCAz, negDCAz, float);
62-
6356
DECLARE_SOA_COLUMN(Pi1cDCAxy, pi1cDCAxy, float);
6457
DECLARE_SOA_COLUMN(Pi1cDCAz, pi1cDCAz, float);
6558
DECLARE_SOA_COLUMN(Pi2cDCAxy, pi2cDCAxy, float);
@@ -75,19 +68,9 @@ DECLARE_SOA_COLUMN(XicDistanceFromPV, xicDistanceFromPV, float);
7568
DECLARE_SOA_COLUMN(XiccProperLength, xiccProperLength, float);
7669

7770
// Daughter info
78-
DECLARE_SOA_COLUMN(PosPt, posPt, float);
79-
DECLARE_SOA_COLUMN(PosEta, posEta, float);
80-
DECLARE_SOA_COLUMN(NegPt, negPt, float);
81-
DECLARE_SOA_COLUMN(NegEta, negEta, float);
82-
DECLARE_SOA_COLUMN(BachPt, bachPt, float);
83-
DECLARE_SOA_COLUMN(BachEta, bachEta, float);
84-
DECLARE_SOA_COLUMN(BachPhi, bachPhi, float);
8571
DECLARE_SOA_COLUMN(Pi1cPt, pi1cPt, float);
86-
DECLARE_SOA_COLUMN(Pi1cEta, pi1cEta, float);
8772
DECLARE_SOA_COLUMN(Pi2cPt, pi2cPt, float);
88-
DECLARE_SOA_COLUMN(Pi2cEta, pi2cEta, float);
8973
DECLARE_SOA_COLUMN(PiccPt, piccPt, float);
90-
DECLARE_SOA_COLUMN(PiccEta, piccEta, float);
9174

9275
} // namespace otfmulticharm
9376

@@ -133,26 +116,6 @@ DECLARE_SOA_TABLE(MCharmCores, "AOD", "MCharmCores",
133116
otfmulticharm::PiccPt,
134117
otfmulticharm::LUTConfigId);
135118

136-
DECLARE_SOA_TABLE(MCharmExtra, "AOD", "MCharmExtra",
137-
otfmulticharm::BachPt,
138-
otfmulticharm::BachEta,
139-
otfmulticharm::BachDCAxy,
140-
otfmulticharm::BachDCAz,
141-
142-
otfmulticharm::PosPt,
143-
otfmulticharm::PosEta,
144-
otfmulticharm::PosDCAxy,
145-
otfmulticharm::PosDCAz,
146-
147-
otfmulticharm::NegPt,
148-
otfmulticharm::NegEta,
149-
otfmulticharm::NegDCAxy,
150-
otfmulticharm::NegDCAz,
151-
152-
otfmulticharm::Pi1cEta,
153-
otfmulticharm::Pi2cEta,
154-
otfmulticharm::PiccEta);
155-
156119
} // namespace o2::aod
157120

158121
#endif // ALICE3_DATAMODEL_OTFMULTICHARM_H_

0 commit comments

Comments
 (0)