Skip to content
Closed
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
4 changes: 2 additions & 2 deletions ALICE3/Core/DelphesO2LutWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "ALICE3/Core/TrackUtilities.h"

#include "TAxis.h"
#include "TDatabasePDG.h"

Check failure on line 29 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include "TLorentzVector.h"

Check failure on line 30 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include "TMatrixD.h"
#include "TMatrixDSymEigen.h"
#include "TVectorD.h"
Expand Down Expand Up @@ -84,10 +84,10 @@
{
lutEntry.valid = false;

static TLorentzVector tlv;

Check failure on line 87 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
tlv.SetPtEtaPhiM(pt, eta, 0., mass);
o2::track::TrackParCov trkIn;
o2::upgrade::convertTLorentzVectorToO2Track(q, tlv, {0., 0., 0.}, trkIn);

Check failure on line 90 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
// tlv.Print();
// return fmt::format("X:{:+.4e} Alp:{:+.3e} Par: {:+.4e} {:+.4e} {:+.4e} {:+.4e} {:+.4e} |Q|:{:d} {:s}\n",
// getX(), getAlpha(), getY(), getZ(), getSnp(), getTgl(), getQ2Pt(), getAbsCharge(), getPID().getName());
Expand All @@ -104,7 +104,7 @@
lutEntry.valid = true;
lutEntry.itof = fat.GetGoodHitProb(itof);
lutEntry.otof = fat.GetGoodHitProb(otof);
for (int i = 0; i < 15; ++i)

Check failure on line 107 in ALICE3/Core/DelphesO2LutWriter.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.
lutEntry.covm[i] = trkOut.getCov()[i];

// define the efficiency
Expand Down Expand Up @@ -151,7 +151,7 @@
lutEntry.valid = false;

// parametrised forward response; interpolates between FAT at eta = 1.75 and a fixed parametrisation at eta = 4; only diagonal elements
if (std::fabs(eta) < etaMaxBarrel || std::fabs(eta) > 4)

Check failure on line 154 in ALICE3/Core/DelphesO2LutWriter.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 false;

if (!fatSolve(lutEntry, pt, etaMaxBarrel, mass))
Expand All @@ -163,7 +163,7 @@

// parametrisation at eta = 4
const double beta = 1. / std::sqrt(1 + mass * mass / pt / pt / std::cosh(eta) / std::cosh(eta));
const float dcaPos = 2.5e-4 / std::sqrt(3); // 2.5 micron/sqrt(3)
const float dcaPos = 2.5e-4 / std::sqrt(3); // 2.5 micron/sqrt(3)
const float r0 = 0.5; // layer 0 radius [cm]
const float r1 = 1.3;
const float r2 = 2.5;
Expand Down Expand Up @@ -200,7 +200,7 @@
lutEntry.covm[2] = dcaz2;
lutEntry.covm[5] = covmbarrel[5]; // sigma^2 sin(phi)
lutEntry.covm[9] = covmbarrel[9]; // sigma^2 tanl
lutEntry.covm[14] = momresTot * momresTot / pt / pt / pt / pt; // sigma^2 1/pt
lutEntry.covm[14] = momresTot * momresTot / pt / pt / pt / pt; // sigma^2 1/pt
// Check that all numbers are numbers
for (int i = 0; i < 15; ++i) {
if (std::isnan(lutEntry.covm[i])) {
Expand Down Expand Up @@ -230,10 +230,10 @@
lutHeader_t lutHeader;
// pid
lutHeader.pdg = pdg;
lutHeader.mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();

Check failure on line 233 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
const int q = std::abs(TDatabasePDG::Instance()->GetParticle(pdg)->Charge()) / 3;

Check failure on line 234 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
if (q <= 0) {
LOGF(info, "Negative or null charge (%f) for pdg code %i. Fix the charge!", TDatabasePDG::Instance()->GetParticle(pdg)->Charge(), pdg);

Check failure on line 236 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
return;
}
lutHeader.field = field;
Expand Down Expand Up @@ -319,7 +319,7 @@
lutEntry.eff2 = lutEntryBarrel.eff2;
}
if (!retval) {
printf(" --- fwdSolve: error \n");

Check failure on line 322 in ALICE3/Core/DelphesO2LutWriter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
lutEntry.valid = false;
for (int i = 0; i < 15; ++i) {
lutEntry.covm[i] = 0.;
Expand Down
Loading