Skip to content

Commit ccbf300

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents c695bbc + a578a67 commit ccbf300

File tree

308 files changed

+25980
-10821
lines changed

Some content is hidden

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

308 files changed

+25980
-10821
lines changed

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/DataModel/OTFRICH.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(NSigmaRich, nSigmaRich, //! General f
5555
}
5656
});
5757

58+
DECLARE_SOA_COLUMN(HasSig, hasSig, bool); //! Has signal in the barrel rich (is particle over threshold)
59+
DECLARE_SOA_COLUMN(HasSigEl, hasSigEl, bool); //! Has nSigma electron BarrelRich (is electron over threshold)
60+
DECLARE_SOA_COLUMN(HasSigMu, hasSigMu, bool); //! Has nSigma muon BarrelRich (is muon over threshold)
61+
DECLARE_SOA_COLUMN(HasSigPi, hasSigPi, bool); //! Has nSigma pion BarrelRich (is pion over threshold)
62+
DECLARE_SOA_COLUMN(HasSigKa, hasSigKa, bool); //! Has nSigma kaon BarrelRich (is kaon over threshold)
63+
DECLARE_SOA_COLUMN(HasSigPr, hasSigPr, bool); //! Has nSigma proton BarrelRich (is proton over threshold)
64+
5865
} // namespace upgrade_rich
5966
DECLARE_SOA_TABLE(UpgradeRichs, "AOD", "UPGRADERICH",
6067
upgrade_rich::NSigmaElectronRich,
@@ -70,6 +77,16 @@ DECLARE_SOA_TABLE(UpgradeRichs, "AOD", "UPGRADERICH",
7077

7178
using UpgradeRich = UpgradeRichs::iterator;
7279

80+
DECLARE_SOA_TABLE(UpgradeRichSignals, "AOD", "UPGRADERICHSIG",
81+
upgrade_rich::HasSig,
82+
upgrade_rich::HasSigEl,
83+
upgrade_rich::HasSigMu,
84+
upgrade_rich::HasSigPi,
85+
upgrade_rich::HasSigKa,
86+
upgrade_rich::HasSigPr);
87+
88+
using UpgradeRichSignal = UpgradeRichSignals::iterator;
89+
7390
} // namespace o2::aod
7491

7592
#endif // ALICE3_DATAMODEL_OTFRICH_H_

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 483 additions & 436 deletions
Large diffs are not rendered by default.

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,42 @@
2424
/// \since May 22, 2024
2525
///
2626

27-
#include <utility>
28-
#include <map>
29-
#include <string>
30-
#include <vector>
27+
#include "TableHelper.h"
3128

32-
#include <TPDGCode.h>
29+
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
30+
#include "ALICE3/Core/TrackUtilities.h"
31+
#include "ALICE3/DataModel/OTFTOF.h"
32+
#include "Common/Core/trackUtilities.h"
33+
#include "Common/DataModel/TrackSelectionTables.h"
3334

35+
#include "CCDB/BasicCCDBManager.h"
36+
#include "CCDB/CcdbApi.h"
37+
#include "CommonConstants/GeomConstants.h"
38+
#include "CommonConstants/PhysicsConstants.h"
39+
#include "CommonUtils/NameConf.h"
40+
#include "DataFormatsCalibration/MeanVertexObject.h"
41+
#include "DataFormatsParameters/GRPMagField.h"
42+
#include "DetectorsBase/GeometryManager.h"
43+
#include "DetectorsBase/Propagator.h"
44+
#include "DetectorsVertexing/HelixHelper.h"
45+
#include "Framework/ASoAHelpers.h"
3446
#include "Framework/AnalysisDataModel.h"
3547
#include "Framework/AnalysisTask.h"
36-
#include "Framework/runDataProcessing.h"
37-
#include "Framework/RunningWorkflowInfo.h"
3848
#include "Framework/HistogramRegistry.h"
3949
#include "Framework/O2DatabasePDGPlugin.h"
40-
#include "Framework/ASoAHelpers.h"
41-
#include "Common/DataModel/TrackSelectionTables.h"
42-
#include "Common/Core/trackUtilities.h"
43-
#include "ALICE3/Core/TrackUtilities.h"
50+
#include "Framework/RunningWorkflowInfo.h"
51+
#include "Framework/runDataProcessing.h"
4452
#include "ReconstructionDataFormats/DCA.h"
45-
#include "DetectorsBase/Propagator.h"
46-
#include "DetectorsBase/GeometryManager.h"
47-
#include "CommonUtils/NameConf.h"
48-
#include "CCDB/CcdbApi.h"
49-
#include "CCDB/BasicCCDBManager.h"
50-
#include "DataFormatsParameters/GRPMagField.h"
51-
#include "DataFormatsCalibration/MeanVertexObject.h"
52-
#include "CommonConstants/GeomConstants.h"
53-
#include "CommonConstants/PhysicsConstants.h"
54-
#include "TRandom3.h"
55-
#include "ALICE3/DataModel/OTFTOF.h"
56-
#include "DetectorsVertexing/HelixHelper.h"
57-
#include "TableHelper.h"
58-
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
53+
5954
#include "TEfficiency.h"
6055
#include "THashList.h"
56+
#include "TRandom3.h"
57+
#include <TPDGCode.h>
58+
59+
#include <map>
60+
#include <string>
61+
#include <utility>
62+
#include <vector>
6163

6264
using namespace o2;
6365
using namespace o2::framework;
@@ -84,7 +86,7 @@ struct OnTheFlyTofPid {
8486
// more could be added (especially a disk TOF at a certain z?)
8587
// in the evolution of this effort
8688
struct : ConfigurableGroup {
87-
Configurable<float> dBz{"dBz", 20, "magnetic field (kilogauss)"};
89+
Configurable<float> magneticField{"magneticField", 0, "magnetic field (kilogauss) if 0, taken from the tracker task"};
8890
Configurable<bool> considerEventTime{"considerEventTime", true, "flag to consider event time"};
8991
Configurable<float> innerTOFRadius{"innerTOFRadius", 20, "barrel inner TOF radius (cm)"};
9092
Configurable<float> outerTOFRadius{"outerTOFRadius", 80, "barrel outer TOF radius (cm)"};
@@ -140,6 +142,13 @@ struct OnTheFlyTofPid {
140142
void init(o2::framework::InitContext& initContext)
141143
{
142144
pRandomNumberGenerator.SetSeed(0); // fully randomize
145+
if (simConfig.magneticField.value < 0.0001f) {
146+
LOG(info) << "Getting the magnetic field from the on-the-fly tracker task";
147+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", simConfig.magneticField, false)) {
148+
LOG(fatal) << "Could not get Bz from on-the-fly-tracker task";
149+
}
150+
LOG(info) << "Bz = " << simConfig.magneticField.value << " T";
151+
}
143152

144153
// Check if inheriting the LUT configuration
145154
auto configLutPath = [&](Configurable<std::string>& lut) {
@@ -397,7 +406,7 @@ struct OnTheFlyTofPid {
397406

398407
static constexpr float kMaxEventTimeResolution = 200.f;
399408
if (sumw <= 0. || tracks.size() <= 1 || std::sqrt(1. / sumw) > kMaxEventTimeResolution) {
400-
tzero[0] = 0.; // [ps]
409+
tzero[0] = 0.; // [ps]
401410
tzero[1] = kMaxEventTimeResolution; // [ps]
402411
return false;
403412
}
@@ -496,13 +505,13 @@ struct OnTheFlyTofPid {
496505

497506
float xPv = -100.f;
498507
static constexpr float kTrkXThreshold = -99.f; // Threshold to consider a good propagation of the track
499-
if (o2track.propagateToDCA(mcPvVtx, simConfig.dBz)) {
508+
if (o2track.propagateToDCA(mcPvVtx, simConfig.magneticField)) {
500509
xPv = o2track.getX();
501510
}
502511
float trackLengthInnerTOF = -1, trackLengthOuterTOF = -1;
503512
if (xPv > kTrkXThreshold) {
504-
trackLengthInnerTOF = computeTrackLength(o2track, simConfig.innerTOFRadius, simConfig.dBz);
505-
trackLengthOuterTOF = computeTrackLength(o2track, simConfig.outerTOFRadius, simConfig.dBz);
513+
trackLengthInnerTOF = computeTrackLength(o2track, simConfig.innerTOFRadius, simConfig.magneticField);
514+
trackLengthOuterTOF = computeTrackLength(o2track, simConfig.outerTOFRadius, simConfig.magneticField);
506515
}
507516

508517
// get mass to calculate velocity
@@ -526,12 +535,12 @@ struct OnTheFlyTofPid {
526535
float trackLengthRecoInnerTOF = -1, trackLengthRecoOuterTOF = -1;
527536
auto recoTrack = getTrackParCov(track);
528537
xPv = -100.f;
529-
if (recoTrack.propagateToDCA(pvVtx, simConfig.dBz)) {
538+
if (recoTrack.propagateToDCA(pvVtx, simConfig.magneticField)) {
530539
xPv = recoTrack.getX();
531540
}
532541
if (xPv > kTrkXThreshold) {
533-
trackLengthRecoInnerTOF = computeTrackLength(recoTrack, simConfig.innerTOFRadius, simConfig.dBz);
534-
trackLengthRecoOuterTOF = computeTrackLength(recoTrack, simConfig.outerTOFRadius, simConfig.dBz);
542+
trackLengthRecoInnerTOF = computeTrackLength(recoTrack, simConfig.innerTOFRadius, simConfig.magneticField);
543+
trackLengthRecoOuterTOF = computeTrackLength(recoTrack, simConfig.outerTOFRadius, simConfig.magneticField);
535544
}
536545

537546
// cache the track info needed for the event time calculation
@@ -639,8 +648,8 @@ struct OnTheFlyTofPid {
639648
ptResolution = mSmearer.getAbsPtRes(pdgInfoThis->PdgCode(), dNdEta, pseudorapidity, momentum / std::cosh(pseudorapidity));
640649
etaResolution = mSmearer.getAbsEtaRes(pdgInfoThis->PdgCode(), dNdEta, pseudorapidity, momentum / std::cosh(pseudorapidity));
641650
}
642-
float innerTrackTimeReso = calculateTrackTimeResolutionAdvanced(momentum / std::cosh(pseudorapidity), pseudorapidity, ptResolution, etaResolution, masses[ii], simConfig.innerTOFRadius, simConfig.dBz);
643-
float outerTrackTimeReso = calculateTrackTimeResolutionAdvanced(momentum / std::cosh(pseudorapidity), pseudorapidity, ptResolution, etaResolution, masses[ii], simConfig.outerTOFRadius, simConfig.dBz);
651+
float innerTrackTimeReso = calculateTrackTimeResolutionAdvanced(momentum / std::cosh(pseudorapidity), pseudorapidity, ptResolution, etaResolution, masses[ii], simConfig.innerTOFRadius, simConfig.magneticField);
652+
float outerTrackTimeReso = calculateTrackTimeResolutionAdvanced(momentum / std::cosh(pseudorapidity), pseudorapidity, ptResolution, etaResolution, masses[ii], simConfig.outerTOFRadius, simConfig.magneticField);
644653
innerTotalTimeReso = std::hypot(simConfig.innerTOFTimeReso, innerTrackTimeReso);
645654
outerTotalTimeReso = std::hypot(simConfig.outerTOFTimeReso, outerTrackTimeReso);
646655

CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/PWGCF/Tasks @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul @lgraczykCern @prchakra @lauraser @ariedel-cern @EmilGorm @otonvd @shouqiye @glromane
3737
/PWGDQ @alibuild @iarsene @mcoquet642 @lucamicheletti93
3838
/PWGEM @alibuild @feisenhu @dsekihat @ivorobye
39-
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu
39+
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu @hscheid
4040
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat
4141
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano @zhangbiao-phy @gluparel
4242
# PWG-LF
@@ -50,6 +50,7 @@
5050
/PWGLF/TableProducer/Resonances @alibuild @sustripathy @skundu692 @dmallick2 @smaff92
5151
/PWGLF/Tasks/Strangeness @alibuild @sustripathy @skundu692 @ercolessi @romainschotter
5252
/PWGLF/TableProducer/Strangeness @alibuild @sustripathy @skundu692 @ercolessi @romainschotter
53+
/PWGLF/Utils @alibuild @sustripathy @skundu692 @gbencedi @abmodak @fmazzasc @maciacco @dmallick2 @smaff92 @ercolessi @romainschotter
5354

5455
# PWG-MM
5556
/PWGMM @alibuild @sustripathy @skundu692 @aalkin @jgcn

Common/Core/CollisionTypeHelper.cxx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
///
13-
/// \file CollisionTypeHelper.h
13+
/// \file CollisionTypeHelper.cxx
1414
/// \author Nicolò Jacazio nicolo.jacazio@cern.ch
1515
/// \brief Utility to handle the collision type from the GRP information
1616
///
@@ -34,17 +34,26 @@ std::string o2::common::core::CollisionSystemType::getCollisionSystemName(collTy
3434
return "XeXe";
3535
case kCollSyspPb:
3636
return "pPb";
37+
case kCollSysOO:
38+
return "OO";
39+
case kCollSyspO:
40+
return "pO";
41+
case kCollSysNeNe:
42+
return "NeNe";
43+
case kCollSysUndef:
44+
return "Undefined";
3745
default:
46+
LOG(warning) << "Undefined collision system type: " << collSys;
3847
return "Undefined";
3948
}
4049
}
4150

4251
int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif)
4352
{
44-
const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA);
45-
const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC);
46-
LOG(debug) << "Collision system: " << ZBeamA << " * " << ZBeamC << " detected";
47-
switch (ZBeamA * ZBeamC) {
53+
const int zBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA);
54+
const int zBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC);
55+
LOG(debug) << "Collision system Z: " << zBeamA << " * " << zBeamC << " detected = " << zBeamA * zBeamC;
56+
switch (zBeamA * zBeamC) {
4857
case 1: // pp 1*1
4958
return kCollSyspp;
5059
case 6724: // Pb-Pb 82*82
@@ -53,8 +62,14 @@ int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameter
5362
return kCollSysXeXe;
5463
case 82: // p-Pb 82*1
5564
return kCollSyspPb;
65+
case 64: // O-O 8*8
66+
return kCollSysOO;
67+
case 8: // p-O 8*1
68+
return kCollSyspO;
69+
case 100: // Ne-Ne 10*10
70+
return kCollSysNeNe;
5671
default:
57-
LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with BeamA = " << ZBeamA << " and BeamC = " << ZBeamC;
72+
LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with Z of BeamA = " << zBeamA << " and Z of BeamC = " << zBeamC;
5873
return kCollSysUndef;
5974
}
6075
return kCollSysUndef;

Common/Core/CollisionTypeHelper.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ struct CollisionSystemType {
3434
static constexpr collType kCollSysPbPb = 1; // PbPb
3535
static constexpr collType kCollSysXeXe = 2; // XeXe
3636
static constexpr collType kCollSyspPb = 3; // pPb
37-
static constexpr collType kNCollSys = 4; // Number of collision systems
37+
static constexpr collType kCollSysOO = 4; // OO (Oxygen-Oxygen)
38+
static constexpr collType kCollSyspO = 5; // pO (proton-Oxygen)
39+
static constexpr collType kCollSysNeNe = 6; // NeNe (Neon-Neon)
40+
static constexpr collType kNCollSys = 7; // Number of collision systems
3841

3942
static std::string getCollisionSystemName(collType collSys);
4043

Common/Core/RecoDecay.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ struct RecoDecay {
732732
if (!arrDaughters[iProng].has_mcParticle()) {
733733
return -1;
734734
}
735-
auto particleI = arrDaughters[iProng].mcParticle(); // ith daughter particle
735+
auto particleI = arrDaughters[iProng].template mcParticle_as<T>(); // ith daughter particle
736736
if (std::abs(particleI.getGenStatusCode()) == StatusCodeAfterFlavourOscillation) { // oscillation decay product spotted
737737
coefFlavourOscillation = -1; // select the sign of the mother after oscillation (and not before)
738738
break;
@@ -744,7 +744,7 @@ struct RecoDecay {
744744
if (!arrDaughters[iProng].has_mcParticle()) {
745745
return -1;
746746
}
747-
auto particleI = arrDaughters[iProng].mcParticle(); // ith daughter particle
747+
auto particleI = arrDaughters[iProng].template mcParticle_as<T>(); // ith daughter particle
748748
if constexpr (acceptTrackDecay) {
749749
// Replace the MC particle associated with the prong by its mother for π → μ and K → π.
750750
auto motherI = particleI.template mothers_first_as<T>();

Common/Core/TableHelper.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
#include "Common/Core/TableHelper.h"
1919

20-
#include <string>
21-
2220
#include "Framework/InitContext.h"
2321
#include "Framework/RunningWorkflowInfo.h"
2422

23+
#include <string>
24+
2525
/// Function to print the table required in the full workflow
2626
/// @param initContext initContext of the init function
27-
void printTablesInWorkflow(o2::framework::InitContext& initContext)
27+
void o2::common::core::printTablesInWorkflow(o2::framework::InitContext& initContext)
2828
{
2929
auto& workflows = initContext.services().get<o2::framework::RunningWorkflowInfo const>();
3030
for (auto const& device : workflows.devices) {
@@ -37,7 +37,7 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext)
3737
/// Function to check if a table is required in a workflow
3838
/// @param initContext initContext of the init function
3939
/// @param table name of the table to check for
40-
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
40+
bool o2::common::core::isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
4141
{
4242
LOG(debug) << "Checking if table " << table << " is needed";
4343
bool tableNeeded = false;
@@ -57,7 +57,7 @@ bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const st
5757
/// @param initContext initContext of the init function
5858
/// @param table name of the table to check for
5959
/// @param flag bool value of flag to set, if the given value is true it will be kept, disregarding the table usage in the workflow.
60-
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
60+
void o2::common::core::enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
6161
{
6262
if (flag) {
6363
LOG(info) << "Table enabled: " + table;
@@ -75,7 +75,7 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
7575
/// @param initContext initContext of the init function
7676
/// @param table name of the table to check for
7777
/// @param flag int value of flag to set, only if initially set to -1. Initial values of 0 or 1 will be kept disregarding the table usage in the workflow.
78-
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, int& flag)
78+
void o2::common::core::enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, int& flag)
7979
{
8080
if (flag > 0) {
8181
flag = 1;

Common/Core/TableHelper.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
#include <string>
2626

27+
namespace o2::common::core
28+
{
29+
2730
/// Function to print the table required in the full workflow
2831
/// @param initContext initContext of the init function
2932
void printTablesInWorkflow(o2::framework::InitContext& initContext);
@@ -109,4 +112,11 @@ bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::stri
109112
return getTaskOptionValue(initContext, taskName, configurable.name, configurable.value, verbose);
110113
}
111114

115+
} // namespace o2::common::core
116+
117+
using o2::common::core::enableFlagIfTableRequired;
118+
using o2::common::core::getTaskOptionValue;
119+
using o2::common::core::isTableRequiredInWorkflow;
120+
using o2::common::core::printTablesInWorkflow;
121+
112122
#endif // COMMON_CORE_TABLEHELPER_H_

0 commit comments

Comments
 (0)