Skip to content

Commit 9f3fe49

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents b09308c + 7500c53 commit 9f3fe49

41 files changed

Lines changed: 5808 additions & 911 deletions

Some content is hidden

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

Common/Tools/PID/pidTPCModule.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ struct pidTPCConfigurables : o2::framework::ConfigurableGroup {
127127
o2::framework::Configurable<int> useNetworkHe{"useNetworkHe", 1, {"Switch for applying neural network on the helium3 mass hypothesis (if network enabled) (set to 0 to disable)"}};
128128
o2::framework::Configurable<int> useNetworkAl{"useNetworkAl", 1, {"Switch for applying neural network on the alpha mass hypothesis (if network enabled) (set to 0 to disable)"}};
129129
o2::framework::Configurable<float> networkBetaGammaCutoff{"networkBetaGammaCutoff", 0.45, {"Lower value of beta-gamma to override the NN application"}};
130+
o2::framework::Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
130131
};
131132

132133
// helper getter - FIXME should be separate
@@ -432,6 +433,8 @@ class pidTPCModule
432433
// Filling a std::vector<float> to be evaluated by the network
433434
// Evaluation on single tracks brings huge overhead: Thus evaluation is done on one large vector
434435
for (int i = 0; i < 9; i++) { // Loop over particle number for which network correction is used
436+
float hadronicRate = 0.;
437+
uint64_t timeStamp_bcOld = 0;
435438
for (auto const& trk : tracks) {
436439
if (!trk.hasTPC()) {
437440
continue;
@@ -450,6 +453,19 @@ class pidTPCModule
450453
if (input_dimensions == 7 && networkVersion == "2") {
451454
track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.;
452455
}
456+
if (input_dimensions == 8 && networkVersion == "3") {
457+
track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.;
458+
if (trk.has_collision()) {
459+
auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as<B>();
460+
if (trk_bc.timestamp() != timeStamp_bcOld) {
461+
hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), pidTPCopts.irSource.value) * 1.e-3;
462+
}
463+
timeStamp_bcOld = trk_bc.timestamp();
464+
track_properties[counter_track_props + 7] = hadronicRate / 50.;
465+
} else {
466+
track_properties[counter_track_props + 7] = 1;
467+
}
468+
}
453469
counter_track_props += input_dimensions;
454470
}
455471

DPG/Tasks/AOTTrack/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ o2physics_add_dpl_workflow(qa-tracksplitting
8080
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
8181
COMPONENT_NAME Analysis)
8282

83+
o2physics_add_dpl_workflow(unit-test-for-reconstruction
84+
SOURCES unitTestForReconstruction.cxx
85+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
86+
COMPONENT_NAME Analysis)
87+
8388
o2physics_add_dpl_workflow(tag-and-probe-dmesons
8489
SOURCES tagAndProbeDmesons.cxx
8590
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2Physics::MLCore
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 unitTestForReconstruction.cxx
13+
///
14+
/// \brief Unit test for validating the reconstruction software
15+
/// \author Alberto Caliva (alberto.caliva@cern.ch), Catalin-Lucian Ristea (catalin.ristea@cern.ch)
16+
/// \since September 9, 2025
17+
18+
#include "Framework/ASoA.h"
19+
#include "Framework/ASoAHelpers.h"
20+
#include "Framework/AnalysisDataModel.h"
21+
#include "Framework/AnalysisTask.h"
22+
#include "Framework/DataTypes.h"
23+
#include "Framework/HistogramRegistry.h"
24+
#include "Framework/Logger.h"
25+
#include "Framework/RunningWorkflowInfo.h"
26+
#include "Framework/runDataProcessing.h"
27+
#include "ReconstructionDataFormats/DCA.h"
28+
#include "ReconstructionDataFormats/Track.h"
29+
30+
#include <cmath>
31+
#include <memory>
32+
#include <random>
33+
#include <string>
34+
#include <unordered_set>
35+
#include <vector>
36+
37+
using namespace o2::soa;
38+
using namespace o2::aod;
39+
using namespace o2::framework;
40+
using namespace o2::framework::expressions;
41+
using namespace o2::constants::physics;
42+
using namespace o2::constants::math;
43+
44+
struct UnitTestForReconstruction {
45+
46+
// Histogram registry
47+
HistogramRegistry registryData{"registryData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
48+
49+
// global IDs of events to be inspected
50+
Configurable<std::vector<int>> eventNr{"eventNr", {1, 5, 12, 44, 76, 99, 102, 115, 180, 220}, "eventNr"};
51+
std::unordered_set<int> eventSet;
52+
53+
void init(InitContext const&)
54+
{
55+
// Define histogram to monitor event counts at different selection stages
56+
registryData.add("eventCounter", "eventCounter", HistType::kTH1F, {{10, 0, 10, ""}});
57+
58+
// Define histogram for the transverse momentum spectrum of reconstructed charged tracks
59+
registryData.add("ptChargedTracks", "ptChargedTracks", HistType::kTH2F, {{11, 0, 11, "event"}, {1000, 0, 10, "#it{p}_{T} (GeV/#it{c})"}});
60+
61+
// Fast lookup set from configurable event list
62+
eventSet = std::unordered_set<int>(eventNr->begin(), eventNr->end());
63+
}
64+
65+
// Process Data
66+
void processData(o2::aod::Collisions const& collisions, o2::aod::Tracks const& tracks)
67+
{
68+
// Event index
69+
int eventIndex = 0;
70+
static constexpr int indexAllEvts = 0;
71+
72+
// Loop over reconstructed events
73+
for (const auto& collision : collisions) {
74+
75+
// Event counter: before event selection
76+
registryData.fill(HIST("eventCounter"), 0.5);
77+
78+
// Check if event global index is in the list of events to process
79+
int ev = collision.globalIndex();
80+
if (eventSet.count(ev)) {
81+
82+
// Increment event index
83+
eventIndex++;
84+
85+
// Fill event counter
86+
registryData.fill(HIST("eventCounter"), 1.5);
87+
88+
// Loop over reconstructed tracks
89+
for (auto const& track : tracks) {
90+
registryData.fill(HIST("ptChargedTracks"), indexAllEvts, track.pt());
91+
registryData.fill(HIST("ptChargedTracks"), eventIndex, track.pt());
92+
}
93+
}
94+
}
95+
}
96+
PROCESS_SWITCH(UnitTestForReconstruction, processData, "Process Data", true);
97+
};
98+
99+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
100+
{
101+
return WorkflowSpec{adaptAnalysisTask<UnitTestForReconstruction>(cfgc)};
102+
}

PWGCF/DataModel/FemtoDerived.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,14 @@ DECLARE_SOA_COLUMN(Prong2Eta, prong2Eta, float); //! Track et
245245
DECLARE_SOA_COLUMN(Prong0Phi, prong0Phi, float); //! Track phi of charm hadron prong0
246246
DECLARE_SOA_COLUMN(Prong1Phi, prong1Phi, float); //! Track phi of charm hadron prong1
247247
DECLARE_SOA_COLUMN(Prong2Phi, prong2Phi, float); //! Track phi of charm hadron prong2
248-
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
248+
DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int); //! Selection of mass hypothesis for charm hadron (1 for Lc -> pkpi, 2 for Lc -> pikp, 4 for D+ -> pikpi)
249249
DECLARE_SOA_COLUMN(BDTBkg, bdtBkg, float); //! Background score using Boosted Decision Tree for charm hadron
250250
DECLARE_SOA_COLUMN(BDTPrompt, bdtPrompt, float); //! Prompt signal score using Boosted Decision Tree for charm hadron
251251
DECLARE_SOA_COLUMN(BDTFD, bdtFD, float); //! Feed-down score using Boosted Decision Tree for charm hadron
252-
DECLARE_SOA_COLUMN(FlagMc, flagMc, int8_t); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 2, DsToKKPi = 4, XicToPKP = 8, N3ProngD = 2ecays };
253-
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
254-
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
255-
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
252+
DECLARE_SOA_COLUMN(FlagMc, flagMc, int); //! To select MC particle among charm hadrons, { DplusToPiKPi = 1, LcToPKPi = 17, DsToKKPi = 6, XicToPKPi = 21, N3ProngD = 2ecays };
253+
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
254+
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
255+
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
256256
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
257257
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
258258
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle

0 commit comments

Comments
 (0)