Skip to content
Merged
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
12 changes: 12 additions & 0 deletions Common/Tasks/qaMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
Configurable<double> fChamberResolutionX{"cfgChamberResolutionX", 0.4, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
Configurable<double> fChamberResolutionY{"cfgChamberResolutionY", 0.4, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
Configurable<double> fSigmaCutImprove{"cfgSigmaCutImprove", 6., "Sigma cut for track improvement"};
Configurable<double> fDipoleZcorr{"cfgDipoleZcorr", 0.0f, "Correction to the dipole z position"};
} configRealign;

/// Variables to event mixing criteria
Expand Down Expand Up @@ -512,7 +513,7 @@
const auto& quadrant = quadrants[j];
AxisSpec xAxis = {20, 0, 200, "|x| (cm)"};
AxisSpec yAxis = {10, 0, 200, "|y| (cm)"};
for (int chamber = 0; chamber < 10; chamber++) {

Check failure on line 516 in Common/Tasks/qaMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::string histPath = std::string("Alignment/same-event/Residuals/MFT/") + quadrant + "/CH" + std::to_string(chamber + 1) + "/";
// Delta x at cluster
residualsHistos[j][chamber]["dx_vs_x"] = registryResiduals.add((histPath + "dx_vs_x").c_str(), "Cluster x residual vs. x", {HistType::kTH2F, {xAxis, dxAxis}});
Expand All @@ -530,11 +531,11 @@
}
}

for (size_t i = 0; i < 2; i++) {

Check failure on line 534 in Common/Tasks/qaMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::string topBottom = (i == 0) ? "top" : "bottom";
AxisSpec deAxis = {26, 0, 26, "DE index"};
AxisSpec phiAxisInner = {16, -180, 180, "#phi (degrees)"};
for (size_t j = 0; j < 2; j++) {

Check failure on line 538 in Common/Tasks/qaMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::string sign = (j == 0) ? "positive" : "negative";
for (int chamber = 0; chamber < 10; chamber++) {
std::string histPath = std::string("Alignment/same-event/Residuals/MFT/MFT_") + topBottom + "/" + sign + "/CH" + std::to_string(chamber + 1) + "/";
Expand Down Expand Up @@ -1242,7 +1243,7 @@
}

if (!removeTrack) {
for (auto& param : track) {

Check failure on line 1246 in Common/Tasks/qaMuon.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.
param.setParameters(param.getSmoothParameters());
param.setCovariances(param.getSmoothCovariances());
}
Expand Down Expand Up @@ -1651,6 +1652,11 @@
fgValues.errorClusters.emplace_back(eCls);
fgValues.DEIDs.emplace_back(cluster.deId());

// subtract the dipole shift correction from the cluster z position
if (configRealign.fDipoleZcorr != 0) {
clusterMCH->z -= configRealign.fDipoleZcorr;
}

// Add transformed cluster into temporary variable
convertedTrack.createParamAtCluster(*clusterMCH);
}
Expand All @@ -1663,6 +1669,12 @@
LOGF(fatal, "Muon track %d has no associated clusters.", muon.globalIndex());
}

// add back the dipole shift correction to the track z
if (configRealign.fDipoleZcorr != 0) {
auto& trackParam = *(convertedTrack.begin());
trackParam.setZ(trackParam.getZ() + configRealign.fDipoleZcorr);
}

for (auto it = convertedTrack.begin(); it != convertedTrack.end(); it++) {
std::vector<float> pos = {static_cast<float>(it->getNonBendingCoor()), static_cast<float>(it->getBendingCoor()), static_cast<float>(it->getZ())};
fgValues.posClusters.emplace_back(pos);
Expand Down Expand Up @@ -2420,7 +2432,7 @@
}

// Loop over collisions
for (auto& [collisionId, fgValuesColltmp] : collisions) {

Check failure on line 2435 in Common/Tasks/qaMuon.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.

bool sameEvent = (fgValuesColltmp.bc == fgValuesColl.bc);
bool mixedEvent = IsMixedEvent(fgValuesColltmp, fgValuesColl);
Expand Down Expand Up @@ -2468,7 +2480,7 @@

int sign = (fgValuesMFTtmp.sign > 0) ? 1 : 2;

for (auto& [collisionId, fgValuesColltmp] : collisions) {

Check failure on line 2483 in Common/Tasks/qaMuon.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.

bool sameEvent = (fgValuesColltmp.bc == fgValuesColl.bc);
bool mixedEvent = IsMixedEvent(fgValuesColltmp, fgValuesColl);
Expand Down Expand Up @@ -2506,7 +2518,7 @@

// do collision loop and (again) propagation?
// propagation in principle already done in runMuonQA?
for (auto& [collisionId, fgValuesCollGlo] : collisions) {

Check failure on line 2521 in Common/Tasks/qaMuon.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.

bool sameEvent = (fgValuesCollGlo.bc == fgValuesColl.bc);
bool mixedEvent = IsMixedEvent(fgValuesCollGlo, fgValuesColl);
Expand Down Expand Up @@ -2556,7 +2568,7 @@

// Do extrapolation for muons to all reference planes
std::vector<VarTrack> mchTrackExtrap;
for (const double z : zRefPlane) {

Check failure on line 2571 in Common/Tasks/qaMuon.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.
VarTrack fgValues;
if (configRealign.fDoRealign) {
FillPropagation(mchrealigned, VarColl{}, fgValues, kToZ, z);
Expand Down Expand Up @@ -2592,7 +2604,7 @@

// Do extrapolation for MFTs to all reference planes
std::vector<VarTrack> mftTrackExtrap;
for (const double z : zRefPlane) {

Check failure on line 2607 in Common/Tasks/qaMuon.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.
VarTrack fgValues;
FillPropagation<0, 1>(mft, fgValuesCollMFT, mchTrackExtrap[1], fgValues, kToZ, z);
mftTrackExtrap.emplace_back(fgValues);
Expand Down Expand Up @@ -2758,7 +2770,7 @@
}

//// Second loop over global muon tracks
for (auto& [mchIndex, globalMuonsVector] : matchingCandidates) {

Check failure on line 2773 in Common/Tasks/qaMuon.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.

//// sort matching candidates in ascending order based on the matching chi2
auto compareChi2 = [&muons](uint64_t trackIndex1, uint64_t trackIndex2) -> bool {
Expand Down
Loading