Skip to content

Commit a72ebe2

Browse files
authored
Merge branch 'master' into cent-study-tables
2 parents 8b210d5 + 0db20fc commit a72ebe2

217 files changed

Lines changed: 11140 additions & 4939 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]

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,11 @@ struct OnTheFlyTofPid {
307307
public:
308308
~TOFLayerEfficiency()
309309
{
310-
hHitMap->SaveAs(Form("/tmp/%s.png", hHitMap->GetName()));
311-
hHitMapInPixel->SaveAs(Form("/tmp/%s.png", hHitMapInPixel->GetName()));
312-
hHitMapInPixelBefore->SaveAs(Form("/tmp/%s.png", hHitMapInPixelBefore->GetName()));
310+
if (0) {
311+
hHitMap->SaveAs(Form("/tmp/%s.png", hHitMap->GetName()));
312+
hHitMapInPixel->SaveAs(Form("/tmp/%s.png", hHitMapInPixel->GetName()));
313+
hHitMapInPixelBefore->SaveAs(Form("/tmp/%s.png", hHitMapInPixelBefore->GetName()));
314+
}
313315

314316
delete axisZ;
315317
delete axisRPhi;

ALICE3/Tasks/alice3-qa-singleparticle.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
/// \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles
1616
///
1717

18+
#include <CommonConstants/PhysicsConstants.h>
1819
#include <Framework/ASoA.h>
1920
#include <Framework/AnalysisDataModel.h>
2021
#include <Framework/AnalysisHelpers.h>
@@ -88,10 +89,10 @@ struct Alice3SingleParticle {
8889
pdg->AddParticle("triton", "triton", 2.8089218, kTRUE, 0.0, 3, "Nucleus", 1000010030);
8990
pdg->AddAntiParticle("anti-triton", -1000010030);
9091

91-
pdg->AddParticle("helium3", "helium3", 2.80839160743, kTRUE, 0.0, 6, "Nucleus", 1000020030);
92+
pdg->AddParticle("helium3", "helium3", o2::constants::physics::MassHelium3, kTRUE, 0.0, 6, "Nucleus", 1000020030);
9293
pdg->AddAntiParticle("anti-helium3", -1000020030);
9394

94-
pdg->AddParticle("helium4", "helium4", 2.80839160743, kTRUE, 0.0, 6, "Nucleus", 1000020040);
95+
pdg->AddParticle("helium4", "helium4", o2::constants::physics::MassAlpha, kTRUE, 0.0, 6, "Nucleus", 1000020040);
9596
pdg->AddAntiParticle("anti-helium4", -1000020040);
9697

9798
const TString tit = Form("%i", PDG.value);

ALICE3/Tasks/alice3DecayerQa.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ struct Alice3DecayerQa {
132132

133133
void process(const aod::McCollision& collision, const aod::McParticles& particles)
134134
{
135-
LOG(info) << particles.size();
136135
// Group with collision
137136
auto trueElectronsGrouped = trueElectrons->sliceByCached(aod::mcparticle::mcCollisionId, collision.globalIndex(), cache);
138137
auto trueMuonsGrouped = trueMuons->sliceByCached(aod::mcparticle::mcCollisionId, collision.globalIndex(), cache);

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();

0 commit comments

Comments
 (0)