Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
de54b64
fixed calculation of Rmax (#4171)
alcaliva Dec 15, 2023
e26cdac
[PWGLF] MC histograms are not produced for data (#4154)
vbarbaso Dec 15, 2023
a9c9323
PWGJE: Broader area range for larger R (#4112)
joonsukbae Dec 15, 2023
71ec725
Rename candidateSelectorLcMl (#4169)
saganatt Dec 15, 2023
a181b6c
PWGJE : Adding the ability to cut on pT hat in the QA tasks (#4173)
nzardosh Dec 15, 2023
d475a2a
PWGHF: Adjust code to rename candidateSelectorLcMl -> candidateSelect…
saganatt Dec 15, 2023
4074ef6
Add ITS cluster map for pions (#4177)
qgp Dec 15, 2023
e69dcf1
PWGLF: Lambda1520 sph update (#4176)
yashpatley Dec 15, 2023
298b225
[PWGCF]: FemtoUniverse - Adding centrality to producer, renaming trac…
basiach Dec 17, 2023
bca3f9c
fixed deltaPhi calculation (smallest angle taken) (#4178)
alcaliva Dec 17, 2023
9cb92e4
PWGCF: Masked Mixing in FemtoDream (#4181)
ariedel-cern Dec 17, 2023
a0cb0e8
Fix: fix typo (#4185)
ariedel-cern Dec 18, 2023
6fb1c6f
Generic Framework changes (#4141)
EmilGorm Dec 18, 2023
6435c00
Adding missing process function (#4188)
lucamicheletti93 Dec 18, 2023
82bbba6
Changes in invMass histograms (#4184)
kgwizdzi Dec 18, 2023
858131b
Also include LS pairs in filter (#4193)
vfeuilla Dec 18, 2023
517122a
toggle search of missing tpc segment across collisions (#4190)
maciacco Dec 18, 2023
8e277ae
PWGEM/PhotonMeson: update efficiency for primary muon (#4195)
dsekihat Dec 18, 2023
82c0efd
PWGHF: Add D0 derived-data creator (#4121)
vkucera Dec 18, 2023
ef5cb68
[Event plane] fix bug (#4183)
jikim1290 Dec 19, 2023
96dc5fe
Extend table helpers (#4166)
njacazio Dec 19, 2023
c9bd5ae
NoTwoProngFitter (#4197)
rbailhac Dec 19, 2023
fce65a1
PWGJE+EM: Add EMCal ambiguous collision table and include in QC task …
nstrangm Dec 19, 2023
3827d28
PWGEM/PhotonMeson: update material budget study with dalitz ee (#4203)
dsekihat Dec 19, 2023
5bd917a
Add processBarrelOnly functions with Cov and Cent and Mults (#4204)
rbailhac Dec 19, 2023
9466df7
PWGHF: Add mass and d0xd0 in B0 reduced tree (#4199)
fgrosa Dec 19, 2023
e9b730d
Add trackTuner.h and update trackPropagation.cxx
Dec 15, 2023
4b69e9a
TrackTuner configuration via string and other improvements
Dec 19, 2023
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
29 changes: 25 additions & 4 deletions Common/Core/TableHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,39 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext)
/// @param table name of the table to check for
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
{
LOG(info) << "Checking if table " << table << " is needed";
LOG(debug) << "Checking if table " << table << " is needed";
bool tableNeeded = false;
auto& workflows = initContext.services().get<o2::framework::RunningWorkflowInfo const>();
for (auto const& device : workflows.devices) {
for (auto const& input : device.inputs) {
if (input.matcher.binding == table) {
LOG(info) << "Table: " << input.matcher.binding << " is needed in device: " << device.name;
LOG(debug) << "Table: " << input.matcher.binding << " is needed in device: " << device.name;
tableNeeded = true;
}
}
}
return tableNeeded;
}

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
/// @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.
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
{
if (flag) {
LOG(info) << "Table enabled: " + table;
return;
}
if (isTableRequiredInWorkflow(initContext, table)) {
flag = true;
LOG(info) << "Auto-enabling table: " + table;
return;
}
flag = false;
LOG(info) << "Table disabled and not required: " + table;
}

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
Expand All @@ -68,8 +87,10 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
if (flag < 0) {
flag = 1;
LOG(info) << "Auto-enabling table: " + table;
} else {
LOG(info) << "Table disabled: " + table;
return;
}
LOG(info) << "Table disabled but required: " + table;
}
flag = 0;
LOG(info) << "Table disabled and not required: " + table;
}
13 changes: 12 additions & 1 deletion Common/Core/TableHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext);
/// @param table name of the table to check for
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table);

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
/// @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.
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag);

/// Function to enable or disable a configurable flag, depending on the fact that a table is needed or not
/// @param initContext initContext of the init function
/// @param table name of the table to check for
Expand All @@ -48,7 +54,12 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
enableFlagIfTableRequired(initContext, table, flag.value);
}

/// Function to check for a specific configurable in the current workflow
/// 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.
/// @param initContext initContext of the init function
/// @param taskName name of the task to check for
/// @param optName name of the option to check for
/// @param value value of the option to set
/// @param verbose if true, print debug messages
template <typename ValueType>
bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::string& taskName, const std::string& optName, ValueType& value, const bool verbose = true)
{
Expand Down
66 changes: 57 additions & 9 deletions Common/TableProducer/trackPropagation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "CommonConstants/GeomConstants.h"
#include "TableHelper.h"
#include "Common/Tools/trackTuner.h"

// The Run 3 AO2D stores the tracks at the point of innermost update. For a track with ITS this is the innermost (or second innermost)
// ITS layer. For a track without ITS, this is the TPC inner wall or for loopers in the TPC even a radius beyond that.
Expand Down Expand Up @@ -64,13 +65,21 @@ struct TrackPropagation {
const o2::dataformats::MeanVertexObject* mMeanVtx = nullptr;
o2::parameters::GRPMagField* grpmag = nullptr;
o2::base::MatLayerCylSet* lut = nullptr;
TrackTuner trackTunerObj;

Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"};
Configurable<float> minPropagationRadius{"minPropagationDistance", o2::constants::geom::XTPCInnerRef + 0.1, "Only tracks which are at a smaller radius will be propagated, defaults to TPC inner wall"};
// for TrackTuner only (MC smearing)
Configurable<bool> useTrackTuner{"useTrackTuner", 0, "Apply Improver/DCA corrections to MC"};
Configurable<std::string> trackTunerParams{"trackTunerParams", "debugInfo=0|updateTrackCovMat=1|updateCurvature=0|updatePulls=0|pathCurrFileDcaXY=|pathUpgrFileDcaXY=|pathCurrFileDcaZ=|pathUpgrFileDcaZ=", "TrackTuner parameter initialization (format: <name>=<value>|<name>=<value>)"};
OutputObj<TH1D> trackTunedTracks{TH1D("trackTunedTracks", "", 1, 0.5, 1.5), OutputObjHandlingPolicy::AnalysisObject};

using tracksIUWithMc = soa::Join<aod::StoredTracksIU, aod::McTrackLabels, aod::TracksCovIU>;
using tracksIU = soa::Join<aod::StoredTracksIU, aod::TracksCovIU>;

void init(o2::framework::InitContext& initContext)
{
Expand All @@ -79,10 +88,16 @@ struct TrackPropagation {
LOG(info) << "Enabling processStandard";
nEnabledProcesses++;
}
if (doprocessCovariance == true) {
LOG(info) << "Enabling processCovariance";
if (doprocessCovarianceMc == true) {
LOG(info) << "Enabling processCovarianceMc";
nEnabledProcesses++;
}

if (doprocessCovarianceData == true) {
LOG(info) << "Enabling processCovarianceData";
nEnabledProcesses++;
}

if (doprocessStandardWithPID == true) {
LOG(info) << "Enabling processStandardWithPID";
nEnabledProcesses++;
Expand All @@ -103,6 +118,13 @@ struct TrackPropagation {
ccdb->setLocalObjectValidityChecking();

lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(lutPath));

/// TrackTuner initialization
if(useTrackTuner) {
std::string outputStringParams = trackTunerObj.configParams(trackTunerParams);
trackTunerObj.getDcaGraphs();
trackTunedTracks->SetTitle(outputStringParams.c_str());
}
}

void initCCDB(aod::BCsWithTimestamps::iterator const& bc)
Expand All @@ -125,8 +147,9 @@ struct TrackPropagation {
o2::track::TrackParametrization<float> mTrackPar;
o2::track::TrackParametrizationWithError<float> mTrackParCov;

template <typename TTrack, bool fillCovMat = false, bool useTrkPid = false>
template <bool IS_MC, bool fillCovMat = false, bool useTrkPid = false, typename TTrack, typename particle>
void fillTrackTables(TTrack const& tracks,
particle const& mcParticles,
aod::Collisions const&,
aod::BCsWithTimestamps const& bcs)
{
Expand Down Expand Up @@ -168,9 +191,26 @@ struct TrackPropagation {
mTrackPar.setPID(track.pidForTracking());
}
}
// auto trackParCov = getTrackParCov(track);
aod::track::TrackTypeEnum trackType = (aod::track::TrackTypeEnum)track.trackType();
// Only propagate tracks which have passed the innermost wall of the TPC (e.g. skipping loopers etc). Others fill unpropagated.
if (track.trackType() == aod::track::TrackIU && track.x() < minPropagationRadius) {
if constexpr (IS_MC && fillCovMat) { /// track tuner ok only if cov. matrix is used
if (useTrackTuner) {
// call track propagator
// this function reads many many things
// - reads track params
bool has_MCparticle = track.has_mcParticle();
if (has_MCparticle) {
// LOG(info) << " MC particle exists... ";
// LOG(info) << "Inside trackPropagation: before calling tuneTrackParams trackParCov.getY(): " << trackParCov.getY();
auto mcparticle = track.mcParticle();
trackTunerObj.tuneTrackParams(mcparticle, mTrackParCov, matCorr, &mDcaInfoCov);
// LOG(info) << "Inside trackPropagation: after calling tuneTrackParams trackParCov.getY(): " << trackParCov.getY();
trackTunedTracks->Fill(1);
}
}
}
if (track.has_collision()) {
auto const& collision = track.collision();
if constexpr (fillCovMat) {
Expand Down Expand Up @@ -219,25 +259,33 @@ struct TrackPropagation {

void processStandard(aod::StoredTracksIU const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
{
fillTrackTables<aod::StoredTracksIU, /*fillCovMat =*/false, /*useTrkPid =*/false>(tracks, collisions, bcs);
fillTrackTables</*IS_MC = */ false, /*fillCovMat =*/false, /*useTrkPid =*/false>(tracks, tracks, collisions, bcs);
}
PROCESS_SWITCH(TrackPropagation, processStandard, "Process without covariance", true);

void processStandardWithPID(soa::Join<aod::StoredTracksIU, aod::TracksExtra> const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
{
fillTrackTables<soa::Join<aod::StoredTracksIU, aod::TracksExtra>, /*fillCovMat =*/false, /*useTrkPid =*/true>(tracks, collisions, bcs);
fillTrackTables</*IS_MC = */ false, /*fillCovMat =*/false, /*useTrkPid =*/true>(tracks, tracks, collisions, bcs);
}
PROCESS_SWITCH(TrackPropagation, processStandardWithPID, "Process without covariance and with PID in tracking", false);

void processCovariance(soa::Join<aod::StoredTracksIU, aod::TracksCovIU> const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
// -----------------------
void processCovarianceMc(tracksIUWithMc const& tracks, aod::McParticles const& mcParticles, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
{
fillTrackTables</*IS_MC = */ true, /*fillCovMat =*/true, /*useTrkPid =*/false, tracksIUWithMc, aod::McParticles>(tracks, mcParticles, collisions, bcs);
}
PROCESS_SWITCH(TrackPropagation, processCovarianceMc, "Process with covariance on MC", true);

void processCovarianceData(tracksIU const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
{
fillTrackTables<soa::Join<aod::StoredTracksIU, aod::TracksCovIU>, /*fillCovMat =*/true, /*useTrkPid =*/false>(tracks, collisions, bcs);
fillTrackTables</*IS_MC = */ false, /*fillCovMat =*/true, /*useTrkPid =*/false>(tracks, tracks, collisions, bcs);
}
PROCESS_SWITCH(TrackPropagation, processCovariance, "Process with covariance", false);
PROCESS_SWITCH(TrackPropagation, processCovarianceData, "Process with covariance on Data", false);
// ------------------------

void processCovarianceWithPID(soa::Join<aod::StoredTracksIU, aod::TracksCovIU, aod::TracksExtra> const& tracks, aod::Collisions const& collisions, aod::BCsWithTimestamps const& bcs)
{
fillTrackTables<soa::Join<aod::StoredTracksIU, aod::TracksCovIU, aod::TracksExtra>, /*fillCovMat =*/true, /*useTrkPid =*/false>(tracks, collisions, bcs);
fillTrackTables</*IS_MC = */ false, /*fillCovMat =*/true, /*useTrkPid =*/false>(tracks, tracks, collisions, bcs);
}
PROCESS_SWITCH(TrackPropagation, processCovarianceWithPID, "Process with covariance and with PID in tracking", false);
};
Expand Down
Loading