Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ALICE3/Core/FastTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
index = 1;
z0 = -4 * sigmaD + i * dz0;
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * std::exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
if (index != 4)

Check failure on line 354 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
index = 4;
else
index = 2;
Expand Down Expand Up @@ -442,11 +442,7 @@
inputTrack.getXYZGlo(posIni);
const float initialRadius = std::hypot(posIni[0], posIni[1]);
const float kTrackingMargin = 0.1;
const int kMaxNumberOfDetectors = 20;
if (kMaxNumberOfDetectors < layers.size()) {
LOG(fatal) << "Too many layers in FastTracker, increase kMaxNumberOfDetectors";
return -1; // too many layers
}

int firstActiveLayer = -1; // first layer that is not inert
for (size_t i = 0; i < layers.size(); ++i) {
if (!layers[i].isInert()) {
Expand All @@ -461,8 +457,12 @@
const int xrhosteps = 100;
const bool applyAngularCorrection = true;

// Delphes sets this to 20 instead of the number of layers,
// but does not count all points in the tpc as layers which we do here
// Loop over all the added layers to prevent crash when adding the tpc
// Should not affect efficiency calculation
goodHitProbability.clear();
for (int i = 0; i < kMaxNumberOfDetectors; ++i) {
for (size_t i = 0; i < layers.size(); ++i) {
goodHitProbability.push_back(-1.);
}
goodHitProbability[0] = 1.; // we use layer zero to accumulate
Expand All @@ -481,7 +481,7 @@
// check if layer is reached
float targetX = 1e+3;
inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField);
if (targetX > 999.f) {

Check failure on line 484 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGF(debug, "Failed to find intercept for layer %d at radius %.2f cm", il, layers[il].getRadius());
break; // failed to find intercept
}
Expand Down Expand Up @@ -563,7 +563,7 @@

float targetX = 1e+3;
inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField);
if (targetX > 999)

Check failure on line 566 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue; // failed to find intercept

if (!inputTrack.propagateTo(targetX, magneticField)) {
Expand Down Expand Up @@ -635,7 +635,7 @@
// backpropagate to original radius
float finalX = 1e+3;
bool inPropStatus = inwardTrack.getXatLabR(initialRadius, finalX, magneticField);
if (finalX > 999) {

Check failure on line 638 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOG(debug) << "Failed to find intercept for initial radius " << initialRadius << " cm, x = " << finalX << " and status " << inPropStatus << " and sn = " << inwardTrack.getSnp() << " r = " << inwardTrack.getY() * inwardTrack.getY();
return -3; // failed to find intercept
}
Expand All @@ -645,12 +645,12 @@
}

// only attempt to continue if intercepts are at least four
if (nIntercepts < 4)

Check failure on line 648 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return nIntercepts;

// generate efficiency
float eff = 1.;
for (int i = 0; i < kMaxNumberOfDetectors; i++) {
for (size_t i = 0; i < layers.size(); i++) {
float iGoodHit = goodHitProbability[i];
if (iGoodHit <= 0)
continue;
Expand All @@ -672,7 +672,7 @@
TMatrixDSym m(5);
double fcovm[5][5]; // double precision is needed for regularisation

for (int ii = 0, k = 0; ii < 5; ++ii) {

Check failure on line 675 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int j = 0; j < ii + 1; ++j, ++k) {
fcovm[ii][j] = covMat[k];
fcovm[j][ii] = covMat[k];
Expand All @@ -680,7 +680,7 @@
}

// evaluate ruben's conditional, regularise
const bool makePositiveDefinite = (covMatFactor > -1e-5); // apply fix

Check failure on line 683 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
bool rubenConditional = false;
for (int ii = 0; ii < 5; ii++) {
for (int jj = 0; jj < 5; jj++) {
Expand All @@ -689,7 +689,7 @@
if (fcovm[ii][jj] * fcovm[ii][jj] > std::abs(fcovm[ii][ii] * fcovm[jj][jj])) {
rubenConditional = true;
if (makePositiveDefinite) {
fcovm[ii][jj] = TMath::Sign(1, fcovm[ii][jj]) * covMatFactor * sqrt(std::abs(fcovm[ii][ii] * fcovm[jj][jj]));

Check failure on line 692 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}
}
}
Expand Down Expand Up @@ -727,7 +727,7 @@
for (int j = 0; j < 5; ++j)
val += eigVec[j][ii] * outputTrack.getParam(j);
// smear parameters according to eigenvalues
params_[ii] = gRandom->Gaus(val, sqrt(eigVal[ii]));

Check failure on line 730 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}

// invert eigenvector matrix
Expand All @@ -740,7 +740,7 @@
outputTrack.setParam(val, ii);
}
// should make a sanity check that par[2] sin(phi) is in [-1, 1]
if (fabs(outputTrack.getParam(2)) > 1.) {

Check failure on line 743 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
LOG(info) << " --- smearTrack failed sin(phi) sanity check: " << outputTrack.getParam(2);
return -2;
}
Expand Down
4 changes: 3 additions & 1 deletion ALICE3/DataModel/OTFMulticharm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(XiCCPion, xiCCPion, int, Tracks, "_PiXiCC");

DECLARE_SOA_COLUMN(XicMass, xicMass, float);
DECLARE_SOA_COLUMN(XiccMass, xiccMass, float);
DECLARE_SOA_COLUMN(LUTConfigId, lutConfigId, int); //! Index for LUT configuration

// kine vars
DECLARE_SOA_COLUMN(XiccPt, xiccPt, float);
Expand Down Expand Up @@ -155,7 +156,8 @@ DECLARE_SOA_TABLE(MCharmCores, "AOD", "MCharmCores",
otfmulticharm::XiccProperLength,
otfmulticharm::Pi1cPt,
otfmulticharm::Pi2cPt,
otfmulticharm::PiccPt);
otfmulticharm::PiccPt,
otfmulticharm::LUTConfigId);

DECLARE_SOA_TABLE(MCharmPID, "AOD", "MCharmPID",
otfmulticharm::Pi1cTofDeltaInner,
Expand Down
35 changes: 35 additions & 0 deletions ALICE3/DataModel/OTFTracks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \file OTFTracks.h
/// \author Jesper Karlsson Gumprecht
/// \since 11/11/2025
/// \brief Table to map track to LUT configuration
///

#ifndef ALICE3_DATAMODEL_OTFTRACKS_H_
#define ALICE3_DATAMODEL_OTFTRACKS_H_

// O2 includes
#include "Framework/AnalysisDataModel.h"

namespace o2::aod
{
namespace otftracks
{
DECLARE_SOA_COLUMN(LUTConfigId, lutConfigId, int); //! Index for LUT configuration
} // namespace otftracks

DECLARE_SOA_TABLE(OTFLUTConfigId, "AOD", "OTFLUTConfigId", otftracks::LUTConfigId);
} // namespace o2::aod

#endif // ALICE3_DATAMODEL_OTFTRACKS_H_
Loading
Loading