Skip to content

Commit c90aa97

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents fdfcb0d + 7363b9f commit c90aa97

File tree

452 files changed

+56404
-20612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+56404
-20612
lines changed

ALICE3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ add_subdirectory(Core)
1414
# add_subdirectory(DataModel)
1515
add_subdirectory(Tasks)
1616
add_subdirectory(TableProducer)
17-
add_subdirectory(Tools)
17+
# add_subdirectory(Tools)

ALICE3/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
o2physics_add_library(ALICE3Core
1313
SOURCES TOFResoALICE3.cxx
14+
TrackUtilities.cxx
1415
DelphesO2TrackSmearer.cxx
1516
PUBLIC_LINK_LIBRARIES O2::Framework
1617
O2Physics::AnalysisCore)

ALICE3/Core/DelphesO2LutWriter.cxx

Lines changed: 144 additions & 108 deletions
Large diffs are not rendered by default.

ALICE3/Core/DelphesO2LutWriter.h

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
12-
///
13-
/// @file DelphesO2LutWriter.h
14-
/// @brief Porting to O2Physics of DelphesO2 code.
11+
/// \file DelphesO2LutWriter.h
12+
/// \brief Porting to O2Physics of DelphesO2 code.
1513
/// Minimal changes have been made to the original code for adaptation purposes, formatting and commented parts have been considered.
1614
/// Relevant sources:
1715
/// DelphesO2/src/lutWrite.cc https://github.com/AliceO2Group/DelphesO2/blob/master/src/lutWrite.cc
18-
/// @author: Roberto Preghenella
19-
/// @email: preghenella@bo.infn.it
16+
/// \author: Roberto Preghenella
17+
/// \email: preghenella@bo.infn.it
2018
///
2119

2220
#ifndef ALICE3_CORE_DELPHESO2LUTWRITER_H_
2321
#define ALICE3_CORE_DELPHESO2LUTWRITER_H_
2422

2523
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
2624
#include "ALICE3/Core/FastTracker.h"
25+
26+
#include "ReconstructionDataFormats/PID.h"
27+
2728
#include "TGraph.h"
2829

30+
#include <string>
31+
2932
namespace o2::fastsim
3033
{
3134
class DelphesO2LutWriter
@@ -34,7 +37,33 @@ class DelphesO2LutWriter
3437
DelphesO2LutWriter() = default;
3538
virtual ~DelphesO2LutWriter() = default;
3639

40+
// Setters
41+
void setBinningNch(bool log, int nbins, float min, float max) { mNchBinning = {log, nbins, min, max}; }
42+
void setBinningRadius(bool log, int nbins, float min, float max) { mRadiusBinning = {log, nbins, min, max}; }
43+
void setBinningEta(bool log, int nbins, float min, float max) { mEtaBinning = {log, nbins, min, max}; }
44+
void setBinningPt(bool log, int nbins, float min, float max) { mPtBinning = {log, nbins, min, max}; }
45+
void setEtaMaxBarrel(float eta) { etaMaxBarrel = eta; }
46+
void setAtLeastHits(int n) { mAtLeastHits = n; }
47+
void setAtLeastCorr(int n) { mAtLeastCorr = n; }
48+
void setAtLeastFake(int n) { mAtLeastFake = n; }
49+
bool fatSolve(lutEntry_t& lutEntry,
50+
float pt = 0.1,
51+
float eta = 0.0,
52+
const float mass = o2::track::pid_constants::sMasses[o2::track::PID::Pion],
53+
size_t itof = 0,
54+
size_t otof = 0,
55+
int q = 1,
56+
const float nch = 1);
57+
58+
void print() const;
59+
bool fwdSolve(float* covm, float pt = 0.1, float eta = 0.0, float mass = o2::track::pid_constants::sMasses[o2::track::PID::Pion]);
60+
bool fwdPara(lutEntry_t& lutEntry, float pt = 0.1, float eta = 0.0, float mass = o2::track::pid_constants::sMasses[o2::track::PID::Pion], float Bfield = 0.5);
61+
void lutWrite(const char* filename = "lutCovm.dat", int pdg = 211, float field = 0.2, size_t itof = 0, size_t otof = 0);
62+
TGraph* lutRead(const char* filename, int pdg, int what, int vs, float nch = 0., float radius = 0., float eta = 0., float pt = 0.);
63+
3764
o2::fastsim::FastTracker fat;
65+
66+
private:
3867
void diagonalise(lutEntry_t& lutEntry);
3968
float etaMaxBarrel = 1.75f;
4069
bool usePara = true; // use fwd parameterisation
@@ -44,23 +73,19 @@ class DelphesO2LutWriter
4473
int mAtLeastHits = 4;
4574
int mAtLeastCorr = 4;
4675
int mAtLeastFake = 0;
47-
void SetAtLeastHits(int n) { mAtLeastHits = n; }
48-
void SetAtLeastCorr(int n) { mAtLeastCorr = n; }
49-
void SetAtLeastFake(int n) { mAtLeastFake = n; }
5076

51-
void printLutWriterConfiguration();
52-
bool fatSolve(lutEntry_t& lutEntry,
53-
float pt = 0.1,
54-
float eta = 0.0,
55-
const float mass = 0.13957000,
56-
int itof = 0,
57-
int otof = 0,
58-
int q = 1,
59-
const float nch = 1);
60-
bool fwdSolve(float* covm, float pt = 0.1, float eta = 0.0, float mass = 0.13957000);
61-
bool fwdPara(lutEntry_t& lutEntry, float pt = 0.1, float eta = 0.0, float mass = 0.13957000, float Bfield = 0.5);
62-
void lutWrite(const char* filename = "lutCovm.dat", int pdg = 211, float field = 0.2, int itof = 0, int otof = 0);
63-
TGraph* lutRead(const char* filename, int pdg, int what, int vs, float nch = 0., float radius = 0., float eta = 0., float pt = 0.);
77+
// Binning of the LUT to make
78+
struct LutBinning {
79+
bool log;
80+
int nbins;
81+
float min;
82+
float max;
83+
std::string toString() const;
84+
};
85+
LutBinning mNchBinning = {true, 20, 0.5f, 3.5f};
86+
LutBinning mRadiusBinning = {false, 1, 0.0f, 100.0f};
87+
LutBinning mEtaBinning = {false, 80, -4.0f, 4.0f};
88+
LutBinning mPtBinning = {true, 200, -2.0f, 2.0f};
6489

6590
ClassDef(DelphesO2LutWriter, 1);
6691
};

ALICE3/Core/FastTracker.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,9 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
368368
}
369369

370370
if (layers[il].isInert()) {
371-
LOG(info) << "Skipping inert layer: " << layers[il].getName() << " at radius " << layers[il].getRadius() << " cm";
371+
if (mVerboseLevel > 0) {
372+
LOG(info) << "Skipping inert layer: " << layers[il].getName() << " at radius " << layers[il].getRadius() << " cm";
373+
}
372374
continue; // inert layer, skip
373375
}
374376

ALICE3/Core/TrackUtilities.cxx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
///
12+
/// \file TrackUtilities.cxx
13+
/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT)
14+
/// \brief Set of utilities for the ALICE3 track handling
15+
/// \since May 21, 2025
16+
///
17+
18+
#include "TrackUtilities.h"
19+
20+
#include <vector>
21+
22+
void o2::upgrade::convertTLorentzVectorToO2Track(const int charge,
23+
const TLorentzVector particle,
24+
const std::vector<double> productionVertex,
25+
o2::track::TrackParCov& o2track)
26+
{
27+
std::array<float, 5> params;
28+
std::array<float, 15> covm = {0.};
29+
float s, c, x;
30+
o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c);
31+
o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c);
32+
params[1] = static_cast<float>(productionVertex[2]);
33+
params[2] = 0.; // since alpha = phi
34+
const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity()));
35+
params[3] = 1. / std::tan(theta);
36+
params[4] = charge / particle.Pt();
37+
38+
// Initialize TrackParCov in-place
39+
new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm);
40+
}

ALICE3/Core/TrackUtilities.h

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
///
12-
/// \file TrackUtilities.h
13-
///
14-
/// \brief Set of utilities for the ALICE3 track handling
15-
///
12+
/// \file TrackUtilities.h
13+
/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT)
14+
/// \brief Set of utilities for the ALICE3 track handling
1615
/// \since May 21, 2025
1716
///
1817

1918
#ifndef ALICE3_CORE_TRACKUTILITIES_H_
2019
#define ALICE3_CORE_TRACKUTILITIES_H_
2120

22-
#include <vector>
23-
2421
#include "ReconstructionDataFormats/Track.h"
25-
#include "Framework/O2DatabasePDGPlugin.h"
26-
#include "Framework/AnalysisHelpers.h"
22+
2723
#include "TLorentzVector.h"
2824

25+
#include <vector>
26+
2927
namespace o2::upgrade
3028
{
3129

@@ -37,34 +35,20 @@ namespace o2::upgrade
3735
void convertTLorentzVectorToO2Track(const int charge,
3836
const TLorentzVector particle,
3937
const std::vector<double> productionVertex,
40-
o2::track::TrackParCov& o2track)
41-
{
42-
std::array<float, 5> params;
43-
std::array<float, 15> covm = {0.};
44-
float s, c, x;
45-
o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c);
46-
o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c);
47-
params[1] = static_cast<float>(productionVertex[2]);
48-
params[2] = 0.; // since alpha = phi
49-
const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity()));
50-
params[3] = 1. / std::tan(theta);
51-
params[4] = charge / particle.Pt();
52-
53-
// Initialize TrackParCov in-place
54-
new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm);
55-
}
38+
o2::track::TrackParCov& o2track);
5639

5740
/// Function to convert a TLorentzVector into a perfect Track
5841
/// \param pdgCode particle pdg
5942
/// \param particle the particle to convert (TLorentzVector)
6043
/// \param productionVertex where the particle was produced
6144
/// \param o2track the address of the resulting TrackParCov
6245
/// \param pdg the pdg service
46+
template <typename PdgService>
6347
void convertTLorentzVectorToO2Track(int pdgCode,
6448
TLorentzVector particle,
6549
std::vector<double> productionVertex,
6650
o2::track::TrackParCov& o2track,
67-
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
51+
const PdgService& pdg)
6852
{
6953
const auto pdgInfo = pdg->GetParticle(pdgCode);
7054
int charge = 0;
@@ -78,10 +62,10 @@ void convertTLorentzVectorToO2Track(int pdgCode,
7862
/// \param particle the particle to convert (mcParticle)
7963
/// \param o2track the address of the resulting TrackParCov
8064
/// \param pdg the pdg service
81-
template <typename McParticleType>
65+
template <typename McParticleType, typename PdgService>
8266
void convertMCParticleToO2Track(McParticleType& particle,
8367
o2::track::TrackParCov& o2track,
84-
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
68+
const PdgService& pdg)
8569
{
8670
static TLorentzVector tlv;
8771
tlv.SetPxPyPzE(particle.px(), particle.py(), particle.pz(), particle.e());
@@ -92,9 +76,9 @@ void convertMCParticleToO2Track(McParticleType& particle,
9276
/// \param particle the particle to convert (mcParticle)
9377
/// \param o2track the address of the resulting TrackParCov
9478
/// \param pdg the pdg service
95-
template <typename McParticleType>
79+
template <typename McParticleType, typename PdgService>
9680
o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
97-
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
81+
const PdgService& pdg)
9882
{
9983
o2::track::TrackParCov o2track;
10084
convertMCParticleToO2Track(particle, o2track, pdg);

ALICE3/DataModel/OTFMcTrackExtra.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)