Skip to content

Commit 95fbd16

Browse files
authored
Merge branch 'AliceO2Group:master' into feature-pwgje-jetXsecEff-cascade
2 parents 0f9d277 + ba24424 commit 95fbd16

154 files changed

Lines changed: 4825 additions & 2574 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/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v9.4.0
41+
uses: oxsecurity/megalinter@v9.5.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.mega-linter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ DISABLE_LINTERS:
2121
- REPOSITORY_DEVSKIM
2222
- REPOSITORY_GITLEAKS
2323
- REPOSITORY_KICS
24+
- REPOSITORY_OSV_SCANNER
2425
- REPOSITORY_SECRETLINT
2526
- REPOSITORY_TRIVY
2627
- YAML_PRETTIER
2728
- YAML_V8R
2829
DISABLE_ERRORS_LINTERS: # If errors are found by these linters, they will be considered as non blocking.
30+
- ACTION_ZIZMOR
2931
- PYTHON_BANDIT # The bandit check is overly broad and complains about subprocess usage.
3032
SHOW_ELAPSED_TIME: true
3133
FILEIO_REPORTER: false
@@ -42,3 +44,4 @@ CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".c
4244
CPP_CPPCHECK_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4345
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --check-level=exhaustive --suppressions-list=cppcheck_config
4446
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true
47+
ACTION_ZIZMOR_UNSECURED_ENV_VARIABLES: [GITHUB_TOKEN]

Common/Core/PID/TPCPIDResponse.h

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,17 @@ class Response
9090
/// Gets the deviation to the expected signal
9191
template <typename TrackType>
9292
float GetSignalDelta(const TrackType& trk, const o2::track::PID::ID id) const;
93+
9394
/// Gets relative dEdx resolution contribution due to relative pt resolution
9495
float GetRelativeResolutiondEdx(const float p, const float mass, const float charge, const float resol) const;
9596

9697
void PrintAll() const;
9798

9899
private:
100+
/// Compute expected sigma given a pre-computed expected signal, avoiding a redundant Bethe-Bloch call.
101+
template <typename TrackType>
102+
float sigmaFromSignal(float expectedSignal, const long multTPC, const TrackType& track, const o2::track::PID::ID id) const;
103+
99104
std::array<float, 5> mBetheBlochParams = {0.03209809958934784, 19.9768009185791, 2.5266601063857674e-16, 2.7212300300598145, 6.080920219421387};
100105
std::array<float, 2> mResolutionParamsDefault = {0.07, 0.0};
101106
std::vector<double> mResolutionParams = {5.43799e-7, 0.053044, 0.667584, 0.0142667, 0.00235175, 1.22482, 2.3501e-7, 0.031585};
@@ -135,13 +140,18 @@ inline float Response::GetExpectedSigmaAtMultiplicity(const long multTPC, const
135140
if (!track.hasTPC()) {
136141
return -999.f;
137142
}
138-
float resolution = 0.;
143+
return sigmaFromSignal(GetExpectedSignal(track, id), multTPC, track, id);
144+
}
145+
146+
template <typename TrackType>
147+
inline float Response::sigmaFromSignal(float expectedSignal, const long multTPC, const TrackType& track, const o2::track::PID::ID id) const
148+
{
149+
float resolution = 0.f;
139150
if (mUseDefaultResolutionParam) {
140-
const float reso = GetExpectedSignal(track, id) * mResolutionParamsDefault[0] * (static_cast<float>(track.tpcNClsFound()) > 0 ? std::sqrt(1. + mResolutionParamsDefault[1] / static_cast<float>(track.tpcNClsFound())) : 1.f);
151+
const float reso = expectedSignal * mResolutionParamsDefault[0] * (static_cast<float>(track.tpcNClsFound()) > 0 ? std::sqrt(1. + mResolutionParamsDefault[1] / static_cast<float>(track.tpcNClsFound())) : 1.f);
141152
reso >= 0.f ? resolution = reso : resolution = -999.f;
142153
} else {
143-
144-
const double ncl = nClNorm / track.tpcNClsFound(); //
154+
const double ncl = nClNorm / track.tpcNClsFound();
145155
const double p = track.tpcInnerParam();
146156
const double mass = o2::track::pid_constants::sMasses[id];
147157
const double bg = p / mass;
@@ -160,16 +170,15 @@ inline float Response::GetExpectedSigmaAtMultiplicity(const long multTPC, const
160170
template <typename CollisionType, typename TrackType>
161171
inline float Response::GetNumberOfSigma(const CollisionType& collision, const TrackType& trk, const o2::track::PID::ID id) const
162172
{
163-
if (GetExpectedSigma(collision, trk, id) < 0.) {
164-
return -999.f;
165-
}
166-
if (GetExpectedSignal(trk, id) < 0.) {
173+
const float signal = GetExpectedSignal(trk, id);
174+
if (signal < 0.f) {
167175
return -999.f;
168176
}
169-
if (!trk.hasTPC()) {
177+
const float sigma = sigmaFromSignal(signal, collision.multTPC(), trk, id);
178+
if (sigma < 0.f) {
170179
return -999.f;
171180
}
172-
return ((trk.tpcSignal() - GetExpectedSignal(trk, id)) / GetExpectedSigma(collision, trk, id));
181+
return (trk.tpcSignal() - signal) / sigma;
173182
}
174183

175184
template <typename CollisionType, typename TrackType>
@@ -181,29 +190,26 @@ inline float Response::GetNumberOfSigmaMCTuned(const CollisionType& collision, c
181190
template <typename TrackType>
182191
inline float Response::GetNumberOfSigmaMCTunedAtMultiplicity(const long multTPC, const TrackType& trk, const o2::track::PID::ID id, float mcTunedTPCSignal) const
183192
{
184-
if (GetExpectedSigmaAtMultiplicity(multTPC, trk, id) < 0.) {
193+
const float signal = GetExpectedSignal(trk, id);
194+
if (signal < 0.f) {
185195
return -999.f;
186196
}
187-
if (GetExpectedSignal(trk, id) < 0.) {
197+
const float sigma = sigmaFromSignal(signal, multTPC, trk, id);
198+
if (sigma < 0.f) {
188199
return -999.f;
189200
}
190-
if (!trk.hasTPC()) {
191-
return -999.f;
192-
}
193-
return ((mcTunedTPCSignal - GetExpectedSignal(trk, id)) / GetExpectedSigmaAtMultiplicity(multTPC, trk, id));
201+
return (mcTunedTPCSignal - signal) / sigma;
194202
}
195203

196204
/// Gets the deviation between the actual signal and the expected signal
197205
template <typename TrackType>
198206
inline float Response::GetSignalDelta(const TrackType& trk, const o2::track::PID::ID id) const
199207
{
200-
if (GetExpectedSignal(trk, id) < 0.) {
201-
return -999.f;
202-
}
203-
if (!trk.hasTPC()) {
208+
const float signal = GetExpectedSignal(trk, id);
209+
if (signal < 0.f) {
204210
return -999.f;
205211
}
206-
return (trk.tpcSignal() - GetExpectedSignal(trk, id));
212+
return trk.tpcSignal() - signal;
207213
}
208214

209215
//// Gets relative dEdx resolution contribution due relative pt resolution

Common/TableProducer/Converters/bcConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct bcConverter {
2424

2525
void process(aod::BCs_000 const& bcTable)
2626
{
27+
bc_001.reserve(bcTable.size());
2728
for (auto& bc : bcTable) {
2829
constexpr uint64_t lEmptyTriggerInputs = 0;
2930
bc_001(bc.runNumber(), bc.globalBC(), bc.triggerMask(), lEmptyTriggerInputs);

Common/TableProducer/Converters/bcFlagsCreator.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct bcFlagsCreator {
2525

2626
void process(aod::BCs const& bcTable)
2727
{
28+
bcFlags.reserve(bcTable.size());
2829
for (int64_t i = 0; i < bcTable.size(); ++i) {
2930
bcFlags(0);
3031
}

Common/TableProducer/Converters/caloLabelConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct caloLabelConverter {
2727
{
2828
std::vector<float> amplitude = {0};
2929
std::vector<int32_t> particleId = {0};
30+
McCaloLabels_001.reserve(mccalolabelTable.size());
3031
for (auto& mccalolabel : mccalolabelTable) {
3132
particleId[0] = mccalolabel.mcParticleId();
3233
// Repopulate new table

Common/TableProducer/Converters/collisionConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct collisionConverter {
4141
void process(aod::Collisions_000 const& collisionTable)
4242
{
4343
float negtolerance = -1.0f * tolerance;
44+
Collisions_001.reserve(collisionTable.size());
4445
for (auto& collision : collisionTable) {
4546
float lYY = collision.covXZ();
4647
float lXZ = collision.covYY();

Common/TableProducer/Converters/fddConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct FddConverter {
2525

2626
void process(aod::FDDs_000 const& fdd_000)
2727
{
28+
fdd_001.reserve(fdd_000.size());
2829
for (auto& p : fdd_000) {
2930
int16_t chargeA[8] = {0u};
3031
int16_t chargeC[8] = {0u};

Common/TableProducer/Converters/hmpConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct hmpConverter {
2525

2626
void process(aod::HMPID_000 const& hmpLegacy, aod::Tracks const&)
2727
{
28+
HMPID_001.reserve(hmpLegacy.size());
2829
for (auto& hmpData : hmpLegacy) {
2930

3031
float phots[] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

Common/TableProducer/Converters/mcCollisionConverter.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct mcCollisionConverter {
2121

2222
void process(aod::McCollisions_000 const& mcCollisionTable)
2323
{
24+
mcCollisions_001.reserve(mcCollisionTable.size());
2425
for (auto& mcCollision : mcCollisionTable) {
2526

2627
// Repopulate new table

0 commit comments

Comments
 (0)