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
6 changes: 6 additions & 0 deletions PWGDQ/Tasks/global-muon-matcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ struct GlobalMuonMatching {
Configurable<float> cfgMFTAlignmentCorrYOffsetBottom{"cfgMFTAlignmentCorrYOffsetBottom", 0.f, "MFT Y offset correction - bottom half"};
} configMftAlignmentCorrections;

// Magnetic field position bias
Configurable<float> cfgFieldOriginBiasZ{"cfgFieldOriginBiasZ", 0.0f, "Bias applied to the magnetic field z position"};

// Variables for CCDB objects access and retrieval
struct : ConfigurableGroup {
Configurable<std::string> cfgCcdbUrl{"cfgCcdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Expand Down Expand Up @@ -755,6 +758,9 @@ struct GlobalMuonMatching {
fCCDBApi.init(configCcdb.cfgCcdbUrl);
mRunNumber = 0;

// configure magnetic field position bias
o2::conf::ConfigurableParam::setValue("FieldOriginBias.z", std::to_string(cfgFieldOriginBiasZ.value));

// Configuration for track fitter
const auto& trackerParam = mch::TrackerParam::Instance();
trackFitter.setBendingVertexDispersion(trackerParam.bendingVertexDispersion);
Expand Down
11 changes: 7 additions & 4 deletions PWGDQ/Tasks/muonGlobalAlignment.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@

Configurable<uint32_t> fMftTracksMultiplicityMax{"cfgMftTracksMultiplicityMax", 0, "Maximum number of MFT tracks to be processed per event (zero means no limit)"};

// Magnetic field position bias
Configurable<float> cfgFieldOriginBiasZ{"cfgFieldOriginBiasZ", 0.0f, "Bias applied to the magnetic field z position"};
Configurable<float> fVertexZshift{"cfgVertexZshift", 0.0f, "Correction to the vertex z position"};
Configurable<float> fDipoleZshift{"cfgDipoleZshift", 0.0f, "Correction to the dipole z position"};

Expand Down Expand Up @@ -272,7 +274,7 @@
std::map<uint64_t, CollisionInfo>& collisionInfos)
{
// fill collision information for global muon tracks (MFT-MCH-MID matches)
for (auto muonTrack : muonTracks) {

Check failure on line 277 in PWGDQ/Tasks/muonGlobalAlignment.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 (!muonTrack.has_collision())
continue;

Expand Down Expand Up @@ -320,8 +322,8 @@
return (track1.chi2MatchMCHMFT() < track2.chi2MatchMCHMFT());
};

for (auto& [collisionIndex, collisionInfo] : collisionInfos) {

Check failure on line 325 in PWGDQ/Tasks/muonGlobalAlignment.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.
for (auto& [mchIndex, globalTracksVector] : collisionInfo.globalMuonTracks) {

Check failure on line 326 in PWGDQ/Tasks/muonGlobalAlignment.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.
std::sort(globalTracksVector.begin(), globalTracksVector.end(), compareChi2);
}
}
Expand All @@ -336,7 +338,7 @@
InitCollisions(collisions, bcs, muonTracks, collisionInfos);

// fill collision information for MFT standalone tracks
for (auto mftTrack : mftTracks) {

Check failure on line 341 in PWGDQ/Tasks/muonGlobalAlignment.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 (!mftTrack.has_collision())
continue;

Expand Down Expand Up @@ -418,10 +420,8 @@
ccdbApi.init(configCCDB.ccdburl);
mRunNumber = 0;

if (!o2::base::GeometryManager::isGeometryLoaded()) {
LOGF(info, "Load geometry from CCDB");
ccdbManager->get<TGeoManager>(configCCDB.geoPath);
}
// configure magnetic field position bias
o2::conf::ConfigurableParam::setValue("FieldOriginBias.z", std::to_string(cfgFieldOriginBiasZ.value));

// Configuration for track fitter
const auto& trackerParam = TrackerParam::Instance();
Expand All @@ -431,6 +431,9 @@
trackFitter.useChamberResolution();
mImproveCutChi2 = 2. * configRealign.fSigmaCutImprove * configRealign.fSigmaCutImprove;

// use the Runge-Kutta extrapolation v2
TrackExtrap::useExtrapV2();

// Fill table of MCH alignment corrections
rapidjson::Document document;
// Check that the json is parsed correctly
Expand Down Expand Up @@ -1094,8 +1097,8 @@
track.setBendingCoor(y + yCorrection);
track.setBendingSlope(ySlope + ySlopeCorrection);
/*
std::cout << std::format("[TOTO] MFT position: pos={:0.3f},{:0.3f}", x, y) << std::endl;

Check failure on line 1100 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
std::cout << std::format("[TOTO] MFT corrections: pos={:0.3f},{:0.3f} slope={:0.12f},{:0.12f} angle={:0.12f},{:0.12f}",

Check failure on line 1101 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
xCorrection, yCorrection, xSlopeCorrection, ySlopeCorrection,
std::atan2(xSlopeCorrection, 1), std::atan2(ySlopeCorrection, 1)) << std::endl;
*/
Expand Down Expand Up @@ -1133,8 +1136,8 @@
template <typename T>
T UpdateTrackMomentum(const T& track, const double p, int sign)
{
double px = p * sin(M_PI / 2 - atan(track.tgl())) * cos(track.phi());

Check failure on line 1139 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double py = p * sin(M_PI / 2 - atan(track.tgl())) * sin(track.phi());

Check failure on line 1140 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2));

SMatrix5 tpars = {track.x(), track.y(), track.phi(), track.tgl(), sign / pt};
Expand All @@ -1154,8 +1157,8 @@
template <typename T>
T UpdateTrackMomentum(const T& track, const o2::mch::TrackParam& track4mom)
{
double px = track4mom.p() * sin(M_PI / 2 - atan(track.tgl())) * cos(track.phi());

Check failure on line 1160 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double py = track4mom.p() * sin(M_PI / 2 - atan(track.tgl())) * sin(track.phi());

Check failure on line 1161 in PWGDQ/Tasks/muonGlobalAlignment.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2));
double sign = track4mom.getCharge();

Expand Down
Loading