Skip to content

Commit 11836d6

Browse files
authored
Merge branch 'AliceO2Group:master' into pmd-qa
2 parents e2f7270 + d86e06e commit 11836d6

File tree

66 files changed

+6892
-1222
lines changed

Some content is hidden

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

66 files changed

+6892
-1222
lines changed

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
#include "DetectorsVertexing/HelixHelper.h"
5656
#include "TableHelper.h"
5757
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
58+
#include "TEfficiency.h"
59+
#include "THashList.h"
5860

5961
using namespace o2;
6062
using namespace o2::framework;
@@ -117,6 +119,8 @@ struct OnTheFlyTofPid {
117119
Configurable<int> nBinsTimeRes{"nBinsTimeRes", 400, "number of bins plots time resolution"};
118120
Configurable<int> nBinsRelativeEtaPt{"nBinsRelativeEtaPt", 400, "number of bins plots pt and eta relative errors"};
119121
Configurable<int> nBinsEta{"nBinsEta", 400, "number of bins plot relative eta error"};
122+
Configurable<int> nBinsMult{"nBinsMult", 200, "number of bins in multiplicity"};
123+
Configurable<float> maxMultRange{"maxMultRange", 1000.f, "upper limit in multiplicity plots"};
120124
} plotsConfig;
121125

122126
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
@@ -129,6 +133,7 @@ struct OnTheFlyTofPid {
129133

130134
// for handling basic QA histograms if requested
131135
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
136+
OutputObj<THashList> listEfficiency{"efficiency"};
132137
static constexpr int kParticles = 5;
133138

134139
void init(o2::framework::InitContext& initContext)
@@ -179,13 +184,16 @@ struct OnTheFlyTofPid {
179184
}
180185

181186
if (plotsConfig.doQAplots) {
182-
const AxisSpec axisdNdeta{200, 0.0f, 1000.0f, Form("dN/d#eta in |#eta| < %f", simConfig.multiplicityEtaRange.value)};
187+
const AxisSpec axisdNdeta{plotsConfig.nBinsMult, 0.0f, plotsConfig.maxMultRange, Form("dN/d#eta in |#eta| < %f", simConfig.multiplicityEtaRange.value)};
183188

184189
histos.add("h1dNdeta", "h2dNdeta", kTH1F, {axisdNdeta});
185190
histos.add("h2dEventTime", "h2dEventTime", kTH2F, {{200, -1000, 1000, "computed"}, {200, -1000, 1000, "generated"}});
186191
histos.add("h1dEventTimegen", "h1dEventTimegen", kTH1F, {{200, -1000, 1000, "generated"}});
187192
histos.add("h1dEventTimerec", "h1dEventTimerec", kTH1F, {{200, -1000, 1000, "computed"}});
193+
histos.add("h1dEventTimedelta", "h1dEventTimedelta", kTH1F, {{200, -1000, 1000, "generated - computed"}});
188194
histos.add("h2dEventTimeres", "h2dEventTimeres", kTH2F, {axisdNdeta, {300, 0, 300, "resolution"}});
195+
listEfficiency.setObject(new THashList);
196+
listEfficiency->Add(new TEfficiency("effEventTime", "effEventTime", plotsConfig.nBinsMult, 0.0f, plotsConfig.maxMultRange));
189197

190198
const AxisSpec axisMomentum{static_cast<int>(plotsConfig.nBinsP), 0.0f, +10.0f, "#it{p} (GeV/#it{c})"};
191199
const AxisSpec axisMomentumSmall{static_cast<int>(plotsConfig.nBinsP), 0.0f, +1.0f, "#it{p} (GeV/#it{c})"};
@@ -564,8 +572,9 @@ struct OnTheFlyTofPid {
564572
// Now we compute the event time for the tracks
565573

566574
std::array<float, 2> tzero = {0.f, 0.f};
575+
bool etStatus = false;
567576
if (simConfig.considerEventTime.value) {
568-
const bool etStatus = eventTime(tracksWithTime, tzero);
577+
etStatus = eventTime(tracksWithTime, tzero);
569578
if (!etStatus) {
570579
LOG(warning) << "Event time calculation failed with " << tracksWithTime.size() << " tracks";
571580
}
@@ -576,6 +585,10 @@ struct OnTheFlyTofPid {
576585
histos.fill(HIST("h1dEventTimegen"), eventCollisionTimePS);
577586
histos.fill(HIST("h1dEventTimerec"), tzero[0]);
578587
histos.fill(HIST("h2dEventTimeres"), dNdEta, tzero[1]);
588+
if (etStatus) {
589+
histos.fill(HIST("h1dEventTimedelta"), eventCollisionTimePS - tzero[0]);
590+
}
591+
static_cast<TEfficiency*>(listEfficiency->At(0))->Fill(etStatus, dNdEta);
579592
}
580593

581594
// Then we do a second loop to compute the measured quantities with the measured event time

Common/CCDB/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ o2physics_target_root_dictionary(AnalysisCCDB
2121
HEADERS ctpRateFetcher.h
2222
HEADERS RCTSelectionFlags.h
2323
LINKDEF AnalysisCCDBLinkDef.h)
24+
25+
o2physics_add_header_only_library(RCTSelectionFlags
26+
HEADERS RCTSelectionFlags.h)

Common/Core/TableHelper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <string>
2222

23+
#include "Framework/Configurable.h"
2324
#include "Framework/InitContext.h"
2425
#include "Framework/RunningWorkflowInfo.h"
2526

@@ -95,4 +96,15 @@ bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::stri
9596
return false;
9697
}
9798

99+
/// Function to check for a specific configurable from another task in the current workflow and fetch its value. Useful for tasks that need to know the value of a configurable in another task.
100+
/// @param initContext initContext of the init function
101+
/// @param taskName name of the task to check for
102+
/// @param value Task configurable to inherit from (name and values are used)
103+
/// @param verbose if true, print debug messages
104+
template <typename ValueType>
105+
bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::string& taskName, ValueType& configurable, const bool verbose = true)
106+
{
107+
return getTaskOptionValue(initContext, taskName, configurable.name, configurable.value, verbose);
108+
}
109+
98110
#endif // COMMON_CORE_TABLEHELPER_H_

Common/DataModel/PIDResponseTOF.h

Lines changed: 75 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Framework/AnalysisDataModel.h"
2828
#include "ReconstructionDataFormats/PID.h"
2929
#include "Framework/Logger.h"
30+
#include "Common/Core/PID/PIDTOF.h"
3031

3132
namespace o2::aod
3233
{
@@ -209,6 +210,65 @@ perSpeciesWrapper(tofExpSignalDiff);
209210

210211
} // namespace pidutils
211212

213+
// Extra tables
214+
namespace pidflags
215+
{
216+
217+
namespace enums
218+
{
219+
enum PIDFlags : uint8_t {
220+
EvTimeUndef = 0x0, // Event collision not set, corresponding to the LHC Fill event time
221+
EvTimeTOF = 0x1, // Event collision time from TOF
222+
EvTimeT0AC = 0x2, // Event collision time from the FT0AC
223+
EvTimeTOFT0AC = 0x4 // Event collision time from the TOF and FT0AC
224+
};
225+
}
226+
227+
DECLARE_SOA_COLUMN(GoodTOFMatch, goodTOFMatch, bool); //! Bool for the TOF PID information on the single track information
228+
DECLARE_SOA_COLUMN(TOFFlags, tofFlags, uint8_t); //! Flag for the complementary TOF PID information for the event time
229+
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeDefined, isEvTimeDefined, //! True if the Event Time was computed with any method i.e. there is a usable event time
230+
[](uint8_t flags) -> bool { return (flags > 0); });
231+
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeTOF, isEvTimeTOF, //! True if the Event Time was computed with the TOF
232+
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeTOF) == enums::PIDFlags::EvTimeTOF; });
233+
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeT0AC, isEvTimeT0AC, //! True if the Event Time was computed with the T0AC
234+
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeT0AC) == enums::PIDFlags::EvTimeT0AC; });
235+
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeTOFT0AC, isEvTimeTOFT0AC, //! True if the Event Time was computed with the TOF and T0AC
236+
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeTOFT0AC) == enums::PIDFlags::EvTimeTOFT0AC; });
237+
238+
} // namespace pidflags
239+
240+
DECLARE_SOA_TABLE(pidTOFFlags, "AOD", "pidTOFFlags", //! Table of the flags for TOF signal quality on the track level
241+
pidflags::GoodTOFMatch);
242+
243+
DECLARE_SOA_TABLE(pidEvTimeFlags, "AOD", "pidEvTimeFlags", //! Table of the PID flags for the event time tables
244+
pidflags::TOFFlags,
245+
pidflags::IsEvTimeDefined<pidflags::TOFFlags>,
246+
pidflags::IsEvTimeTOF<pidflags::TOFFlags>,
247+
pidflags::IsEvTimeT0AC<pidflags::TOFFlags>,
248+
pidflags::IsEvTimeTOFT0AC<pidflags::TOFFlags>);
249+
250+
namespace pidtofsignal
251+
{
252+
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! TOF signal from track time
253+
DECLARE_SOA_DYNAMIC_COLUMN(EventCollisionTime, eventCollisionTime, //! Event collision time used for the track. Needs the TOF
254+
[](float signal, float tMinusTexp, float texp) -> float { return texp + tMinusTexp - signal; });
255+
256+
} // namespace pidtofsignal
257+
258+
DECLARE_SOA_TABLE(TOFSignal, "AOD", "TOFSignal", //! Table of the TOF signal
259+
pidtofsignal::TOFSignal,
260+
pidtofsignal::EventCollisionTime<pidtofsignal::TOFSignal>);
261+
262+
namespace pidtofevtime
263+
{
264+
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
265+
DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
266+
} // namespace pidtofevtime
267+
268+
DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track.
269+
pidtofevtime::TOFEvTime,
270+
pidtofevtime::TOFEvTimeErr);
271+
212272
namespace pidtof
213273
{
214274
// Expected signals
@@ -397,69 +457,15 @@ DECLARE_SOA_TABLE(pidTOFHe, "AOD", "pidTOFHe", //! Table of the TOF response wit
397457
DECLARE_SOA_TABLE(pidTOFAl, "AOD", "pidTOFAl", //! Table of the TOF response with binned Nsigma for alpha
398458
pidtof_tiny::TOFNSigmaStoreAl, pidtof_tiny::TOFNSigmaAl<pidtof_tiny::TOFNSigmaStoreAl>);
399459

400-
// Extra tables
401-
namespace pidflags
402-
{
403-
404-
namespace enums
405-
{
406-
enum PIDFlags : uint8_t {
407-
EvTimeUndef = 0x0, // Event collision not set, corresponding to the LHC Fill event time
408-
EvTimeTOF = 0x1, // Event collision time from TOF
409-
EvTimeT0AC = 0x2, // Event collision time from the FT0AC
410-
EvTimeTOFT0AC = 0x4 // Event collision time from the TOF and FT0AC
411-
};
412-
}
413-
414-
DECLARE_SOA_COLUMN(GoodTOFMatch, goodTOFMatch, bool); //! Bool for the TOF PID information on the single track information
415-
DECLARE_SOA_COLUMN(TOFFlags, tofFlags, uint8_t); //! Flag for the complementary TOF PID information for the event time
416-
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeDefined, isEvTimeDefined, //! True if the Event Time was computed with any method i.e. there is a usable event time
417-
[](uint8_t flags) -> bool { return (flags > 0); });
418-
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeTOF, isEvTimeTOF, //! True if the Event Time was computed with the TOF
419-
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeTOF) == enums::PIDFlags::EvTimeTOF; });
420-
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeT0AC, isEvTimeT0AC, //! True if the Event Time was computed with the T0AC
421-
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeT0AC) == enums::PIDFlags::EvTimeT0AC; });
422-
DECLARE_SOA_DYNAMIC_COLUMN(IsEvTimeTOFT0AC, isEvTimeTOFT0AC, //! True if the Event Time was computed with the TOF and T0AC
423-
[](uint8_t flags) -> bool { return (flags & enums::PIDFlags::EvTimeTOFT0AC) == enums::PIDFlags::EvTimeTOFT0AC; });
424-
425-
} // namespace pidflags
426-
427-
DECLARE_SOA_TABLE(pidTOFFlags, "AOD", "pidTOFFlags", //! Table of the flags for TOF signal quality on the track level
428-
pidflags::GoodTOFMatch);
429-
430-
DECLARE_SOA_TABLE(pidEvTimeFlags, "AOD", "pidEvTimeFlags", //! Table of the PID flags for the event time tables
431-
pidflags::TOFFlags,
432-
pidflags::IsEvTimeDefined<pidflags::TOFFlags>,
433-
pidflags::IsEvTimeTOF<pidflags::TOFFlags>,
434-
pidflags::IsEvTimeT0AC<pidflags::TOFFlags>,
435-
pidflags::IsEvTimeTOFT0AC<pidflags::TOFFlags>);
436-
437-
namespace pidtofsignal
438-
{
439-
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! TOF signal from track time
440-
DECLARE_SOA_DYNAMIC_COLUMN(EventCollisionTime, eventCollisionTime, //! Event collision time used for the track. Needs the TOF
441-
[](float signal, float tMinusTexp, float texp) -> float { return texp + tMinusTexp - signal; });
442-
443-
} // namespace pidtofsignal
444-
445-
DECLARE_SOA_TABLE(TOFSignal, "AOD", "TOFSignal", //! Table of the TOF signal
446-
pidtofsignal::TOFSignal,
447-
pidtofsignal::EventCollisionTime<pidtofsignal::TOFSignal>);
448-
449-
namespace pidtofevtime
450-
{
451-
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time for TOF signal. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
452-
DECLARE_SOA_COLUMN(TOFEvTimeErr, tofEvTimeErr, float); //! event time error for TOF. Can be obtained via a combination of detectors e.g. TOF, FT0A, FT0C
453-
} // namespace pidtofevtime
454-
455-
DECLARE_SOA_TABLE(TOFEvTime, "AOD", "TOFEvTime", //! Table of the TOF event time. One entry per track.
456-
pidtofevtime::TOFEvTime,
457-
pidtofevtime::TOFEvTimeErr);
458-
459460
namespace pidtofbeta
460461
{
461462
DECLARE_SOA_COLUMN(Beta, beta, float); //! TOF beta
462463
DECLARE_SOA_COLUMN(BetaError, betaerror, float); //! Uncertainty on the TOF beta
464+
// Dynamic column, i.e. the future
465+
DECLARE_SOA_DYNAMIC_COLUMN(TOFBetaImp, tofBeta, //! TOF Beta value
466+
[](const float length, const float tofSignal, const float collisionTime) -> float {
467+
return o2::pid::tof::Beta::GetBeta(length, tofSignal, collisionTime);
468+
});
463469
//
464470
DECLARE_SOA_COLUMN(ExpBetaEl, expbetael, float); //! Expected beta of electron
465471
DECLARE_SOA_COLUMN(ExpBetaElError, expbetaelerror, float); //! Expected uncertainty on the beta of electron
@@ -469,14 +475,24 @@ DECLARE_SOA_DYNAMIC_COLUMN(DiffBetaEl, diffbetael, //! Difference be
469475
[](float beta, float expbetael) -> float { return beta - expbetael; });
470476
} // namespace pidtofbeta
471477

478+
using TOFBeta = pidtofbeta::TOFBetaImp<o2::aod::track::Length, o2::aod::pidtofsignal::TOFSignal, o2::aod::pidtofevtime::TOFEvTime>;
479+
472480
DECLARE_SOA_TABLE(pidTOFbeta, "AOD", "pidTOFbeta", //! Table of the TOF beta
473481
pidtofbeta::Beta, pidtofbeta::BetaError);
474482

475483
namespace pidtofmass
476484
{
477485
DECLARE_SOA_COLUMN(TOFMass, mass, float); //! TOF mass
486+
// Dynamic column, i.e. the future
487+
DECLARE_SOA_DYNAMIC_COLUMN(TOFMassImp, tofMass, //! TOF Mass value
488+
[](const float length, const float tofSignal, const float collisionTime, const float momentum) -> float {
489+
const float beta = o2::pid::tof::Beta::GetBeta(length, tofSignal, collisionTime);
490+
return o2::pid::tof::TOFMass::GetTOFMass(momentum, beta);
491+
});
478492
} // namespace pidtofmass
479493

494+
using TOFMass = pidtofmass::TOFMassImp<o2::aod::track::Length, o2::aod::pidtofsignal::TOFSignal, o2::aod::pidtofevtime::TOFEvTime, o2::aod::track::TOFExpMom>;
495+
480496
DECLARE_SOA_TABLE(pidTOFmass, "AOD", "pidTOFmass", //! Table of the TOF mass
481497
pidtofmass::TOFMass);
482498

DPG/Tasks/AOTTrack/PID/TOF/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ o2physics_add_dpl_workflow(pid-tof-qa-beta
2020
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
2121
COMPONENT_NAME Analysis)
2222

23+
o2physics_add_dpl_workflow(pid-tof-qa-beta-imp
24+
SOURCES qaPIDTOFBetaImp.cxx
25+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
26+
COMPONENT_NAME Analysis)
27+
2328
o2physics_add_dpl_workflow(pid-tof-qa-mc
2429
SOURCES qaPIDTOFMC.cxx
2530
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

0 commit comments

Comments
 (0)