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
15 changes: 8 additions & 7 deletions Common/TableProducer/trackPropagationTester.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

//===============================================================
//
// Experimental version of the track propagation task
// Experimental version of the track propagation task
// this utilizes an analysis task module that can be employed elsewhere
// and allows for the re-utilization of a material LUT
//
// and allows for the re-utilization of a material LUT
//
// candidate approach for core service approach
//
//===============================================================
Expand Down Expand Up @@ -75,12 +75,12 @@
StandardCCDBLoader ccdbLoader;
TrackPropagationModule trackPropagationMod;

// registry
// registry
HistogramRegistry registry{"registry"};

void init(o2::framework::InitContext& initContext)
{
// configure ccdb
// configure ccdb
ccdb->setURL(ccdbConfigurables.ccdburl);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
Expand All @@ -90,7 +90,7 @@
trackPropagationMod.initHistograms(registry, trackPropagationConfigurables);
}

void processReal(soa::Join<aod::StoredTracksIU, aod::TracksCovIU, aod::TracksExtra> const& tracks, aod::Collisions const&, aod::BCs const& bcs)
void processReal(soa::Join<aod::StoredTracksIU, aod::TracksCovIU, aod::TracksExtra> const& tracks, aod::Collisions const&, aod::BCs const& bcs)
{
ccdbLoader.initCCDBfromBCs(ccdb, bcs);
trackPropagationMod.getFromCCDBLoader(ccdbLoader);
Expand All @@ -117,4 +117,5 @@
{
WorkflowSpec workflow{adaptAnalysisTask<TrackPropagationTester>(cfgc)};
return workflow;
}
}

Check failure on line 121 in Common/TableProducer/trackPropagationTester.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
17 changes: 9 additions & 8 deletions Common/Tools/StandardCCDBLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "Framework/AnalysisDataModel.h"

//__________________________________________
// Standard class to load stuff
// Standard class to load stuff
// such as matLUT, B and mean Vertex
// partial requests possible.
// partial requests possible.

class StandardCCDBLoader
{
Expand Down Expand Up @@ -53,7 +53,8 @@ class StandardCCDBLoader

// takes a configurableGroup and reads in necessary configs
template <typename TConfigurableGroup>
void readConfiguration(TConfigurableGroup const& cGroup){
void readConfiguration(TConfigurableGroup const& cGroup)
{
ccdburl = cGroup.ccdburl.value;
lutPath = cGroup.lutPath.value;
geoPath = cGroup.geoPath.value;
Expand All @@ -65,11 +66,11 @@ class StandardCCDBLoader
template <typename TCCDB, typename TBCs>
void initCCDBfromBCs(TCCDB& ccdb, TBCs& bcs, bool getMeanVertex = true)
{
// instant load from BCs table. Bonus: protect also against empty bcs
// instant load from BCs table. Bonus: protect also against empty bcs
if (bcs.size() == 0) {
return;
}
auto bc = bcs.begin();
auto bc = bcs.begin();
initCCDB(ccdb, bc.runNumber(), getMeanVertex);
}

Expand All @@ -93,15 +94,15 @@ class StandardCCDBLoader
o2::base::Propagator::initFieldFromGRP(grpmag);
LOG(info) << "Setting global propagator material propagation LUT";
o2::base::Propagator::Instance()->setMatLUT(lut);
if(getMeanVertex){
if (getMeanVertex) {
// only try this if explicitly requested
mMeanVtx = ccdb->template getForRun<o2::dataformats::MeanVertexObject>(mVtxPath, currentRunNumber);
}else{
} else {
mMeanVtx = nullptr;
}

runNumber = currentRunNumber;
}
};

#endif // COMMON_TOOLS_STANDARDCCDBLOADER_H_
#endif // COMMON_TOOLS_STANDARDCCDBLOADER_H_
56 changes: 30 additions & 26 deletions Common/Tools/TrackPropagationModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#include "Common/Tools/TrackTuner.h"

//__________________________________________
// track propagation module
//
// track propagation module
//
// this class is capable of performing the usual track propagation
// and table creation it is a demonstration of core service
// plug-in functionality that could be used to reduce the number of
// heavyweight (e.g. mat-LUT-using, propagating) core services to
// reduce overhead and make it easier to pipeline / parallelize
// and table creation it is a demonstration of core service
// plug-in functionality that could be used to reduce the number of
// heavyweight (e.g. mat-LUT-using, propagating) core services to
// reduce overhead and make it easier to pipeline / parallelize
// bottlenecks in core services

class TrackPropagationModule
Expand All @@ -36,19 +36,19 @@ class TrackPropagationModule
TrackPropagationModule()
{
// constructor: set defaults
minPropagationRadius = o2::constants::geom::XTPCInnerRef + 0.1;
minPropagationRadius = o2::constants::geom::XTPCInnerRef + 0.1;
useTrackTuner = false;
useTrkPid = false;
fillTrackTunerTable = false;
useTrkPid = false;
fillTrackTunerTable = false;
trackTunerConfigSource = o2::aod::track_tuner::InputString;
std::string trackTunerParams = "debugInfo=0|updateTrackDCAs=1|updateTrackCovMat=1|updateCurvature=0|updateCurvatureIU=0|updatePulls=0|isInputFileFromCCDB=1|pathInputFile=Users/m/mfaggin/test/inputsTrackTuner/PbPb2022|nameInputFile=trackTuner_DataLHC22sPass5_McLHC22l1b2_run529397.root|pathFileQoverPt=Users/h/hsharma/qOverPtGraphs|nameFileQoverPt=D0sigma_Data_removal_itstps_MC_LHC22b1b.root|usePvRefitCorrections=0|qOverPtMC=-1.|qOverPtData=-1.";
};

float minPropagationRadius;
bool useTrackTuner;
float minPropagationRadius;
bool useTrackTuner;
bool useTrkPid;
bool fillTrackTunerTable;
int trackTunerConfigSource;
bool fillTrackTunerTable;
int trackTunerConfigSource;
std::string trackTunerParams;

// controls behaviour
Expand All @@ -74,7 +74,8 @@ class TrackPropagationModule

// takes a configurableGroup and reads in necessary configs
template <typename TConfigurableGroup>
void readConfiguration(TConfigurableGroup const& cGroup){
void readConfiguration(TConfigurableGroup const& cGroup)
{
minPropagationRadius = cGroup.minPropagationRadius.value;
useTrackTuner = cGroup.minPropagationRadius.value;
useTrkPid = cGroup.useTrkPid.value;
Expand All @@ -84,14 +85,16 @@ class TrackPropagationModule
LOGF(info, "Track propagation module configuration done.");
}
template <typename TCCDBLoader>
void getFromCCDBLoader(TCCDBLoader const& loader){
void getFromCCDBLoader(TCCDBLoader const& loader)
{
lut = loader.lut;
mMeanVtx = loader.mMeanVtx;
grpmag = loader.grpmag;
}

template <typename TInitContext>
void init(TInitContext& initContext){
void init(TInitContext& initContext)
{
// Checking if the tables are requested in the workflow and enabling them
fillTracksCov = isTableRequiredInWorkflow(initContext, "TracksCov");
fillTracksDCA = isTableRequiredInWorkflow(initContext, "TracksDCA");
Expand All @@ -118,15 +121,16 @@ class TrackPropagationModule
}

template <typename THistoRegistry, typename TConfigurableGroup>
void initHistograms(THistoRegistry& registry, TConfigurableGroup& cGroup){
void initHistograms(THistoRegistry& registry, TConfigurableGroup& cGroup)
{
trackTunedTracks = registry.template add<TH1>("trackTunedTracks", "trackTunedTracks", o2::framework::kTH1D, {{1, 0.5f, 1.5f}});

// Histograms for track tuner
o2::framework::AxisSpec axisBinsDCA = {600, -0.15f, 0.15f, "#it{dca}_{xy} (cm)"};
registry.template add("hDCAxyVsPtRec", "hDCAxyVsPtRec", o2::framework::kTH2F, {axisBinsDCA, cGroup.axisPtQA});
registry.template add("hDCAxyVsPtMC", "hDCAxyVsPtMC", o2::framework::kTH2F, {axisBinsDCA, cGroup.axisPtQA});
registry.template add("hDCAzVsPtRec", "hDCAzVsPtRec", o2::framework::kTH2F, {axisBinsDCA, cGroup.axisPtQA});
registry.template add("hDCAzVsPtMC", "hDCAzVsPtMC", o2::framework::kTH2F, {axisBinsDCA, cGroup.axisPtQA});
registry.template add("hDCAzVsPtMC", "hDCAzVsPtMC", o2::framework::kTH2F, {axisBinsDCA, cGroup.axisPtQA});
}

template <bool isMc, typename TTracks, typename TOutputGroup, typename THistoRegistry>
Expand Down Expand Up @@ -172,7 +176,7 @@ class TrackPropagationModule
double q2OverPtNew = -9999.;
// Only propagate tracks which have passed the innermost wall of the TPC (e.g. skipping loopers etc). Others fill unpropagated.
if (track.trackType() == o2::aod::track::TrackIU && track.x() < minPropagationRadius) {
if(fillTracksCov){
if (fillTracksCov) {
if constexpr (isMc) { // checking MC and fillCovMat block begins
// bool hasMcParticle = track.has_mcParticle();
if (useTrackTuner) {
Expand Down Expand Up @@ -210,7 +214,7 @@ class TrackPropagationModule
trackType = o2::aod::track::Track;
}
// filling some QA histograms for track tuner test purpose
if(fillTracksCov){
if (fillTracksCov) {
if constexpr (isMc) { // checking MC and fillCovMat block begins
if (track.has_mcParticle() && isPropagationOK) {
auto mcParticle1 = track.mcParticle();
Expand All @@ -235,11 +239,11 @@ class TrackPropagationModule
cursors.tracksParExtensionPropagated(mTrackParCov.getPt(), mTrackParCov.getP(), mTrackParCov.getEta(), mTrackParCov.getPhi());
// TODO do we keep the rho as 0? Also the sigma's are duplicated information
cursors.tracksParCovPropagated(std::sqrt(mTrackParCov.getSigmaY2()), std::sqrt(mTrackParCov.getSigmaZ2()), std::sqrt(mTrackParCov.getSigmaSnp2()),
std::sqrt(mTrackParCov.getSigmaTgl2()), std::sqrt(mTrackParCov.getSigma1Pt2()), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
std::sqrt(mTrackParCov.getSigmaTgl2()), std::sqrt(mTrackParCov.getSigma1Pt2()), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
cursors.tracksParCovExtensionPropagated(mTrackParCov.getSigmaY2(), mTrackParCov.getSigmaZY(), mTrackParCov.getSigmaZ2(), mTrackParCov.getSigmaSnpY(),
mTrackParCov.getSigmaSnpZ(), mTrackParCov.getSigmaSnp2(), mTrackParCov.getSigmaTglY(), mTrackParCov.getSigmaTglZ(), mTrackParCov.getSigmaTglSnp(),
mTrackParCov.getSigmaTgl2(), mTrackParCov.getSigma1PtY(), mTrackParCov.getSigma1PtZ(), mTrackParCov.getSigma1PtSnp(), mTrackParCov.getSigma1PtTgl(),
mTrackParCov.getSigma1Pt2());
mTrackParCov.getSigmaSnpZ(), mTrackParCov.getSigmaSnp2(), mTrackParCov.getSigmaTglY(), mTrackParCov.getSigmaTglZ(), mTrackParCov.getSigmaTglSnp(),
mTrackParCov.getSigmaTgl2(), mTrackParCov.getSigma1PtY(), mTrackParCov.getSigma1PtZ(), mTrackParCov.getSigma1PtSnp(), mTrackParCov.getSigma1PtTgl(),
mTrackParCov.getSigma1Pt2());
if (fillTracksDCA) {
cursors.tracksDCA(mDcaInfoCov.getY(), mDcaInfoCov.getZ());
}
Expand All @@ -257,4 +261,4 @@ class TrackPropagationModule
}
};

#endif // COMMON_TOOLS_TRACKPROPAGATIONMODULE_H_
#endif // COMMON_TOOLS_TRACKPROPAGATIONMODULE_H_
Loading