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
6 changes: 6 additions & 0 deletions ALICE3/Core/FlatLutEntry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
#include <Framework/Logger.h>
#include <Framework/RuntimeError.h>

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <fstream>
#include <ios>
#include <span>

namespace o2::delphes
{
Expand Down
1 change: 1 addition & 0 deletions ALICE3/Core/FlatLutEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define ALICE3_CORE_FLATLUTENTRY_H_

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <fstream>
#include <span>
Expand Down
12 changes: 6 additions & 6 deletions ALICE3/Core/FlatLutWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "ALICE3/Core/FlatLutWriter.h"

#include "TrackUtilities.h"
#include "FlatLutWriter.h"

#include "ALICE3/Core/FlatLutEntry.h"
#include "ALICE3/Core/FlatTrackSmearer.h"
#include "ALICE3/Core/TrackUtilities.h"

#include <Framework/Logger.h>
#include <ReconstructionDataFormats/Track.h>

#include <TAxis.h>
#include <TDatabasePDG.h>

Check failure on line 22 in ALICE3/Core/FlatLutWriter.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 <TGraph.h>
#include <TLorentzVector.h>

Check failure on line 24 in ALICE3/Core/FlatLutWriter.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 <TMatrixDSymfwd.h>
#include <TMatrixDfwd.h>
#include <TParticlePDG.h>
#include <TString.h>
#include <TVectorDfwd.h>

#include <Rtypes.h>

#include <cmath>
#include <cstdlib>
#include <fstream>
#include <string>

using namespace o2::delphes;

Expand Down Expand Up @@ -79,10 +79,10 @@
{
lutEntry.valid = false;

static TLorentzVector tlv;

Check failure on line 82 in ALICE3/Core/FlatLutWriter.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.f, mass);
o2::track::TrackParCov trkIn;
o2::upgrade::convertTLorentzVectorToO2Track(q, tlv, {0.f, 0.f, 0.f}, trkIn);

Check failure on line 85 in ALICE3/Core/FlatLutWriter.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.

o2::track::TrackParCov trkOut;
const int status = fat.FastTrack(trkIn, trkOut, nch);
Expand Down Expand Up @@ -190,7 +190,7 @@
const float momresTot = pt * std::sqrt(relmomresPos * relmomresPos + relmomresMS * relmomresMS); // total absolute mom reso

// Fill cov matrix diag
for (int i = 0; i < 15; ++i) {

Check failure on line 193 in ALICE3/Core/FlatLutWriter.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] = 0.f;
}

Expand All @@ -207,7 +207,7 @@
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) {

Check failure on line 210 in ALICE3/Core/FlatLutWriter.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.
if (std::isnan(lutEntry.covm[i])) {
LOGF(info, "lutEntry.covm[%d] is NaN", i);
return false;
Expand All @@ -234,7 +234,7 @@
lutHeader_t lutHeader;
lutHeader.pdg = pdg;

const TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(pdg);

Check failure on line 237 in ALICE3/Core/FlatLutWriter.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 (!particle) {
LOGF(fatal, "Cannot find particle with PDG code %d", pdg);
lutFile.close();
Expand Down Expand Up @@ -312,7 +312,7 @@
lutEntry.valid = false;
lutEntry.eff = 0.f;
lutEntry.eff2 = 0.f;
for (int i = 0; i < 15; ++i) {

Check failure on line 315 in ALICE3/Core/FlatLutWriter.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] = 0.f;
}
successfulCalls--;
Expand Down Expand Up @@ -348,7 +348,7 @@
if (!retval) {
LOGF(debug, "Forward solve failed");
lutEntry.valid = false;
for (int i = 0; i < 15; ++i) {

Check failure on line 351 in ALICE3/Core/FlatLutWriter.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] = 0.f;
}
successfulCalls--;
Expand Down
7 changes: 7 additions & 0 deletions ALICE3/Core/FlatLutWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

#include "ALICE3/Core/FastTracker.h"
#include "ALICE3/Core/FlatLutEntry.h"

#include <ReconstructionDataFormats/PID.h>

#include <TGraph.h>

#include <cstddef>
#include <string>
namespace o2::fastsim
{
using lutEntry_t = o2::delphes::lutEntry_t;
Expand Down
11 changes: 11 additions & 0 deletions ALICE3/Core/FlatTrackSmearer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@

#include "FlatTrackSmearer.h"

#include "ALICE3/Core/FlatLutEntry.h"
#include "ALICE3/Core/GeometryContainer.h"

#include <CommonConstants/PhysicsConstants.h>
#include <Framework/Logger.h>
#include <Framework/RuntimeError.h>

#include <TRandom.h>

#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <fstream>
#include <span>
#include <string>

namespace o2::delphes
{
int TrackSmearer::getIndexPDG(int pdg)
Expand Down Expand Up @@ -74,7 +85,7 @@
void TrackSmearer::setWhatEfficiency(int val)
{
// FIXME: this really should be an enum
if (val > 2) {

Check failure on line 88 in ALICE3/Core/FlatTrackSmearer.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.
throw framework::runtime_error_f("getLUTEntry: unknown efficiency type %d", mWhatEfficiency);
}
mWhatEfficiency = val;
Expand Down
4 changes: 4 additions & 0 deletions ALICE3/Core/FlatTrackSmearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include <CCDB/BasicCCDBManager.h>
#include <ReconstructionDataFormats/Track.h>

#include <cstddef>
#include <cstdint>
#include <span>

namespace o2::delphes
{
/**
Expand Down
Loading