Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 24 additions & 17 deletions Common/TableProducer/trackPropagationTester.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,28 @@
//
//===============================================================

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Core/trackUtilities.h"
#include "ReconstructionDataFormats/DCA.h"
#include "DetectorsBase/Propagator.h"
#include "DetectorsBase/GeometryManager.h"
#include "CommonUtils/NameConf.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Tools/StandardCCDBLoader.h"
#include "Common/Tools/TrackPropagationModule.h"
#include "Common/Tools/TrackTuner.h"

#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
#include "CommonConstants/GeomConstants.h"
#include "CommonUtils/NameConf.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "CCDB/BasicCCDBManager.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "CommonConstants/GeomConstants.h"
#include "Common/Tools/TrackPropagationModule.h"
#include "Common/Tools/StandardCCDBLoader.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/DCA.h"

#include <string>

// 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 All @@ -59,6 +63,9 @@ struct TrackPropagationTester {
o2::common::TrackPropagationProducts trackPropagationProducts;
o2::common::TrackPropagationConfigurables trackPropagationConfigurables;

// the track tuner object -> needs to be here as it inherits from ConfigurableGroup (+ has its own copy of ccdbApi)
TrackTuner trackTunerObj;

// CCDB boilerplate declarations
o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand All @@ -76,22 +83,22 @@ struct TrackPropagationTester {
ccdb->setURL(ccdburl.value);

// task-specific
trackPropagation.init(trackPropagationConfigurables, registry, initContext);
trackPropagation.init(trackPropagationConfigurables, trackTunerObj, registry, initContext);
}

void processReal(aod::Collisions const& collisions, soa::Join<aod::StoredTracksIU, aod::TracksCovIU, aod::TracksExtra> const& tracks, aod::Collisions const&, aod::BCs const& bcs)
{
// task-specific
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, registry);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, trackTunerObj, ccdbLoader, collisions, tracks, trackPropagationProducts, registry);
}
PROCESS_SWITCH(TrackPropagationTester, processReal, "Process Real Data", true);

// -----------------------
void processMc(aod::Collisions const& collisions, soa::Join<aod::StoredTracksIU, aod::McTrackLabels, aod::TracksCovIU, aod::TracksExtra> const& tracks, aod::McParticles const&, aod::Collisions const&, aod::BCs const& bcs)
{
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, registry);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, trackTunerObj, ccdbLoader, collisions, tracks, trackPropagationProducts, registry);
}
PROCESS_SWITCH(TrackPropagationTester, processMc, "Process Monte Carlo", false);
};
Expand Down
14 changes: 10 additions & 4 deletions Common/Tools/StandardCCDBLoader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in Common/Tools/StandardCCDBLoader.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -11,17 +11,23 @@

/// \file StandardCCDBLoader.cxx
/// \brief A simple object to handle ccdb queries
/// \author ALICE

Check failure on line 14 in Common/Tools/StandardCCDBLoader.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#ifndef COMMON_TOOLS_STANDARDCCDBLOADER_H_
#define COMMON_TOOLS_STANDARDCCDBLOADER_H_

#include <string>
#include <cstdlib>
#include <cmath>
#include <array>
#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/AnalysisDataModel.h"

#include <array>
#include <cmath>
#include <cstdlib>
#include <string>

//__________________________________________
// Standard class to load stuff
// such as matLUT, B and mean Vertex
Expand All @@ -35,7 +41,7 @@
// ConfigurableGroup with locations
struct StandardCCDBLoaderConfigurables : o2::framework::ConfigurableGroup {
std::string prefix = "ccdb";
o2::framework::Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 44 in Common/Tools/StandardCCDBLoader.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
o2::framework::Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
o2::framework::Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
o2::framework::Configurable<std::string> mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"};
Expand Down
25 changes: 15 additions & 10 deletions Common/Tools/TrackPropagationModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@
#ifndef COMMON_TOOLS_TRACKPROPAGATIONMODULE_H_
#define COMMON_TOOLS_TRACKPROPAGATIONMODULE_H_

#include <memory>
#include <cstdlib>
#include <cmath>
#include <array>
#include <string>
#include "TableHelper.h"

#include "Common/Tools/TrackTuner.h"

#include "DataFormatsCalibration/MeanVertexObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/Configurable.h"
#include "Framework/HistogramSpec.h"
#include "Common/Tools/TrackTuner.h"
#include "TableHelper.h"

#include <array>
#include <cmath>
#include <cstdlib>
#include <memory>
#include <string>

//__________________________________________
// track propagation module
Expand Down Expand Up @@ -54,7 +60,7 @@

struct TrackPropagationConfigurables : o2::framework::ConfigurableGroup {
std::string prefix = "trackPropagation";
o2::framework::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"};

Check failure on line 63 in Common/Tools/TrackPropagationModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
// for TrackTuner only (MC smearing)
o2::framework::Configurable<bool> useTrackTuner{"useTrackTuner", false, "Apply track tuner corrections to MC"};
o2::framework::Configurable<bool> useTrkPid{"useTrkPid", false, "use pid in tracking"};
Expand All @@ -81,7 +87,6 @@

// pointers to objs needed for operation
std::shared_ptr<TH1> trackTunedTracks;
TrackTuner trackTunerObj;

// Running variables
std::array<float, 2> mDcaInfo;
Expand All @@ -91,7 +96,7 @@
o2::track::TrackParametrizationWithError<float> mTrackParCov;

template <typename TConfigurableGroup, typename TInitContext, typename THistoRegistry>
void init(TConfigurableGroup const& cGroup, THistoRegistry& registry, TInitContext& initContext)
void init(TConfigurableGroup const& cGroup, TrackTuner& trackTunerObj, THistoRegistry& registry, TInitContext& initContext)
{
// Checking if the tables are requested in the workflow and enabling them
fillTracks = isTableRequiredInWorkflow(initContext, "Tracks");
Expand Down Expand Up @@ -154,7 +159,7 @@
}

template <bool isMc, typename TConfigurableGroup, typename TCCDBLoader, typename TCollisions, typename TTracks, typename TOutputGroup, typename THistoRegistry>
void fillTrackTables(TConfigurableGroup const& cGroup, TCCDBLoader const& ccdbLoader, TCollisions const& collisions, TTracks const& tracks, TOutputGroup& cursors, THistoRegistry& registry)
void fillTrackTables(TConfigurableGroup const& cGroup, TrackTuner& trackTunerObj, TCCDBLoader const& ccdbLoader, TCollisions const& collisions, TTracks const& tracks, TOutputGroup& cursors, THistoRegistry& registry)
{
if (!fillTracks) {
return; // suppress everything
Expand Down
12 changes: 9 additions & 3 deletions PWGLF/TableProducer/Strangeness/propagationService.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Strangeness/propagationService.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGLF/TableProducer/Strangeness/propagationService.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -11,7 +11,7 @@

/// \file propagationService.cxx
/// \brief
/// \author ALICE

Check failure on line 14 in PWGLF/TableProducer/Strangeness/propagationService.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

//===============================================================
//
Expand All @@ -31,6 +31,7 @@
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Tools/StandardCCDBLoader.h"
#include "Common/Tools/TrackPropagationModule.h"
#include "Common/Tools/TrackTuner.h"

#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
Expand All @@ -46,6 +47,8 @@
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/DCA.h"

#include <string>

using namespace o2;
using namespace o2::framework;
// using namespace o2::framework::expressions;
Expand All @@ -64,7 +67,7 @@
// For dE/dx association in pre-selection
using TracksExtraWithPID = soa::Join<aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>;

struct propagationService {

Check failure on line 70 in PWGLF/TableProducer/Strangeness/propagationService.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
// CCDB boilerplate declarations
o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand All @@ -81,6 +84,9 @@
o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts;
o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule;

// the track tuner object -> needs to be here as it inherits from ConfigurableGroup (+ has its own copy of ccdbApi)
TrackTuner trackTunerObj;

// track propagation
o2::common::TrackPropagationProducts trackPropagationProducts;
o2::common::TrackPropagationConfigurables trackPropagationConfigurables;
Expand All @@ -97,21 +103,21 @@
ccdb->setURL(ccdburl.value);

// task-specific
trackPropagation.init(trackPropagationConfigurables, histos, initContext);
trackPropagation.init(trackPropagationConfigurables, trackTunerObj, histos, initContext);
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
}

void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIU const& tracks, aod::BCsWithTimestamps const& bcs)
{
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos);
trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, trackTunerObj, ccdbLoader, collisions, tracks, trackPropagationProducts, histos);
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, static_cast<TObject*>(nullptr), v0s, cascades, trackedCascades, tracks, bcs, static_cast<TObject*>(nullptr), products);
}

void processMonteCarlo(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const& collisions, aod::McCollisions const& mccollisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtLabeledIU const& tracks, aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticles)
{
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
trackPropagation.fillTrackTables<true>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos);
trackPropagation.fillTrackTables<true>(trackPropagationConfigurables, trackTunerObj, ccdbLoader, collisions, tracks, trackPropagationProducts, histos);
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, mccollisions, v0s, cascades, trackedCascades, tracks, bcs, mcParticles, products);
}

Expand Down
Loading