Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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: 14 additions & 1 deletion Common/TableProducer/trackPropagation.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 Common/TableProducer/trackPropagation.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 @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in Common/TableProducer/trackPropagation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in Common/TableProducer/trackPropagation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in Common/TableProducer/trackPropagation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
//
// Task to add a table of track parameters propagated to the primary vertex
//
Expand Down Expand Up @@ -53,12 +53,12 @@
o2::base::MatLayerCylSet* lut = nullptr;
TrackTuner trackTunerObj;

Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 56 in Common/TableProducer/trackPropagation.cxx

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.)
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"};

Check failure on line 61 in Common/TableProducer/trackPropagation.cxx

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)
Configurable<bool> useTrackTuner{"useTrackTuner", false, "Apply track tuner corrections to MC"};
Configurable<bool> fillTrackTunerTable{"fillTrackTunerTable", false, "flag to fill track tuner table"};
Expand Down Expand Up @@ -133,7 +133,20 @@
break;
}

trackTunerObj.getDcaGraphs();
/// see if other track-propagation devices are present
int counter = 0;
LOG(info) << " ---> looking for track-propagation devices";
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("track-propagation") == 0) {
// init HF event selection helper
LOG(info) << " FOUND!";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mfaggin ! I would remove this log with "FOUND" in favor of something after the loop reporting the count of devices, i.e. LOGF(info, "Number of track propagation tasks detected: %i", counter); or so. Could you please adjust?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ddobrigk , you are totally right. Done in my last commit

counter++;
}
}

std::string tmpDirName = std::string("./") + std::to_string(counter);
trackTunerObj.getDcaGraphs(tmpDirName);
trackTunedTracks->SetTitle(outputStringParams.c_str());
trackTunedTracks->GetXaxis()->SetBinLabel(1, "all tracks");
}
Expand Down Expand Up @@ -193,7 +206,7 @@
}
}

for (auto& track : tracks) {

Check failure on line 209 in Common/TableProducer/trackPropagation.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if constexpr (fillCovMat) {
if (fillTracksDCA || fillTracksDCACov) {
mDcaInfoCov.set(999, 999, 999, 999, 999);
Expand Down
3 changes: 1 addition & 2 deletions Common/Tools/TrackTuner.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
DECLARE_SOA_COLUMN(TunedQOverPt, tunedQOverPt, float);

/// configuration source
enum configSource : int { InputString = 1,

Check failure on line 60 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/enum]

Use UpperCamelCase for names of enumerators and their values.
Configurables };
} // namespace track_tuner

Expand Down Expand Up @@ -249,7 +249,7 @@

LOG(info) << "[TrackTuner]";
LOG(info) << "[TrackTuner] >>> String slices:";
for (const std::string& s : slices)

Check failure on line 252 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
LOG(info) << "[TrackTuner] " << s;

/// check if the number of input parameters is correct
Expand Down Expand Up @@ -447,7 +447,7 @@
return outputString;
}

void getDcaGraphs()
void getDcaGraphs(std::string tmpDir = ".")
{
std::string fullNameInputFile = "";
std::string fullNameFileQoverPt = "";
Expand All @@ -456,7 +456,6 @@
/// use input correction file from CCDB

// properly init the ccdb
std::string tmpDir = ".";
ccdbApi.init("http://alice-ccdb.cern.ch");

// get the DCA correction file from CCDB
Expand Down Expand Up @@ -595,7 +594,7 @@
// get phibin
double phiMC = mcparticle.phi();
if (phiMC < 0.)
phiMC += o2::constants::math::TwoPI; // 2 * std::numbers::pi;//

Check failure on line 597 in Common/Tools/TrackTuner.h

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
int phiBin = phiMC / (o2::constants::math::TwoPI + 0.0000001) * nPhiBins; // 0.0000001 just a numerical protection

dcaXYResMC = evalGraph(ptMC, grDcaXYResVsPtPionMC[phiBin].get());
Expand Down
Loading