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
5 changes: 5 additions & 0 deletions PWGDQ/Core/VarManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@
// TO Do: add more systems

// set the beam 4-momentum vectors
float beamAEnergy = energy / 2.0 * sqrt(NumberOfProtonsA * NumberOfProtonsC / NumberOfProtonsC / NumberOfProtonsA); // GeV

Check failure on line 196 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float beamCEnergy = energy / 2.0 * sqrt(NumberOfProtonsC * NumberOfProtonsA / NumberOfProtonsA / NumberOfProtonsC); // GeV

Check failure on line 197 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float beamAMomentum = std::sqrt(beamAEnergy * beamAEnergy - NumberOfNucleonsA * NumberOfNucleonsA * MassProton * MassProton);
float beamCMomentum = std::sqrt(beamCEnergy * beamCEnergy - NumberOfNucleonsC * NumberOfNucleonsC * MassProton * MassProton);
fgBeamA.SetPxPyPzE(0, 0, beamAMomentum, beamAEnergy);
Expand Down Expand Up @@ -293,7 +293,7 @@
double mean = calibMeanHist->GetBinContent(binTPCncls, binPin, binEta);
double sigma = calibSigmaHist->GetBinContent(binTPCncls, binPin, binEta);
return (nSigmaValue - mean) / sigma; // Return the calibrated nSigma value
} else if (fgCalibrationType == 2) {

Check failure on line 296 in PWGDQ/Core/VarManager.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.
// get the calibration histograms
CalibObjects calibMean, calibSigma, calibStatus;
switch (species) {
Expand Down Expand Up @@ -460,14 +460,14 @@
// Bimodality coefficient = (skewness^2 + 1) / kurtosis
// return a tuple including the coefficient, mean, RMS, skewness, and kurtosis
size_t n = data.size();
if (n < 3) {

Check failure on line 463 in PWGDQ/Core/VarManager.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.
return std::make_tuple(-1.0, -1.0, -1.0, -1.0, -1.0);
}
float mean = std::accumulate(data.begin(), data.end(), 0.0) / n;

float m2 = 0.0, m3 = 0.0, m4 = 0.0;
float diff, diff2;
for (float x : data) {

Check failure on line 470 in PWGDQ/Core/VarManager.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.
diff = x - mean;
diff2 = diff * diff;
m2 += diff2;
Expand Down Expand Up @@ -506,7 +506,7 @@
int nBins = static_cast<int>((max - min) / binWidth);
std::vector<int> counts(nBins, 0.0);

for (float x : data) {

Check failure on line 509 in PWGDQ/Core/VarManager.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 (x < min || x >= max) {
continue; // skip out-of-range values
}
Expand Down Expand Up @@ -1739,6 +1739,8 @@
fgVariableUnits[kAmplitudeFT0A] = "a.u.";
fgVariableNames[kAmplitudeFT0C] = "FT0C amplitude";
fgVariableUnits[kAmplitudeFT0C] = "a.u.";
fgVariableNames[kAmplitudeFT0M] = "FT0M amplitude";
fgVariableUnits[kAmplitudeFT0M] = "a.u.";
fgVariableNames[kTimeFT0A] = "FT0A time";
fgVariableUnits[kTimeFT0A] = "ns";
fgVariableNames[kTimeFT0C] = "FT0C time";
Expand Down Expand Up @@ -2658,6 +2660,9 @@
fgVarNamesMap["kBdtNonprompt"] = kBdtNonprompt;
fgVarNamesMap["kAmplitudeFT0A"] = kAmplitudeFT0A;
fgVarNamesMap["kAmplitudeFT0C"] = kAmplitudeFT0C;
fgVarNamesMap["kAmplitudeFT0M"] = kAmplitudeFT0M;
fgVarNamesMap["kFT0OrA"] = kFT0OrA;
fgVarNamesMap["kFT0OrC"] = kFT0OrC;
fgVarNamesMap["kTimeFT0A"] = kTimeFT0A;
fgVarNamesMap["kTimeFT0C"] = kTimeFT0C;
fgVarNamesMap["kTriggerMaskFT0"] = kTriggerMaskFT0;
Expand Down
10 changes: 10 additions & 0 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <CommonConstants/PhysicsConstants.h>
#include <DCAFitter/DCAFitterN.h>
#include <DCAFitter/FwdDCAFitterN.h>
#include <DataFormatsFIT/Triggers.h>
#include <DataFormatsParameters/GRPLHCIFData.h>
#include <DetectorsBase/GeometryManager.h>
#include <DetectorsBase/MatLayerCylSet.h>
Expand Down Expand Up @@ -1022,9 +1023,12 @@
// FIT detector variables
kAmplitudeFT0A,
kAmplitudeFT0C,
kAmplitudeFT0M,
kTimeFT0A,
kTimeFT0C,
kTriggerMaskFT0,
kFT0OrA,
kFT0OrC,
kAmplitudeFDDA,
kAmplitudeFDDC,
kTimeFDDA,
Expand Down Expand Up @@ -1845,9 +1849,9 @@
}
if constexpr ((fillMap & MuonCov) > 0 || (fillMap & ReducedMuonCov) > 0) {
o2::dataformats::GlobalFwdTrack propmuon = PropagateMuon(muontrack, collision);
double px = propmuon.getP() * sin(M_PI / 2 - atan(mfttrack.tgl())) * cos(mfttrack.phi());

Check failure on line 1852 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

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

Check failure on line 1853 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pz = propmuon.getP() * cos(M_PI / 2 - atan(mfttrack.tgl()));

Check failure on line 1854 in PWGDQ/Core/VarManager.h

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));
auto mftprop = o2::aod::fwdtrackutils::getTrackParCovFwdShift(mfttrack, fgzShiftFwd);
values[kX] = mftprop.getX();
Expand Down Expand Up @@ -2434,9 +2438,12 @@
if constexpr ((fillMap & ReducedFit) > 0) {
values[kAmplitudeFT0A] = event.amplitudeFT0A();
values[kAmplitudeFT0C] = event.amplitudeFT0C();
values[kAmplitudeFT0M] = values[kAmplitudeFT0A] + values[kAmplitudeFT0C];
values[kTimeFT0A] = event.timeFT0A();
values[kTimeFT0C] = event.timeFT0C();
values[kTriggerMaskFT0] = event.triggerMaskFT0();
values[kFT0OrA] = TESTBIT(event.triggerMaskFT0(), o2::fit::Triggers::bitA);
values[kFT0OrC] = TESTBIT(event.triggerMaskFT0(), o2::fit::Triggers::bitC);
values[kNFiredChannelsFT0A] = event.nFiredChannelsFT0A();
values[kNFiredChannelsFT0C] = event.nFiredChannelsFT0C();
values[kAmplitudeFDDA] = event.amplitudeFDDA();
Expand Down Expand Up @@ -4815,7 +4822,7 @@
values[kVertexingLxyErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV);
values[kVertexingLzErr] = (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV;
values[kVertexingLxyzErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV + (KFPV.GetCovariance(3) + KFGeoTwoProng.GetCovariance(3)) * dxPair2PV * dzPair2PV + (KFPV.GetCovariance(4) + KFGeoTwoProng.GetCovariance(4)) * dyPair2PV * dzPair2PV);
if (fabs(values[kVertexingLxy]) < 1.e-8f)

Check failure on line 4825 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxy] = 1.e-8f;
values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy];
if (fabs(values[kVertexingLz]) < 1.e-8f)
Expand Down Expand Up @@ -6797,9 +6804,12 @@
// Fill FT0 information
values[kAmplitudeFT0A] = fitInfo.ampFT0A;
values[kAmplitudeFT0C] = fitInfo.ampFT0C;
values[kAmplitudeFT0M] = values[kAmplitudeFT0A] + values[kAmplitudeFT0C];
values[kTimeFT0A] = fitInfo.timeFT0A;
values[kTimeFT0C] = fitInfo.timeFT0C;
values[kTriggerMaskFT0] = static_cast<float>(fitInfo.triggerMaskFT0);
values[kFT0OrA] = TESTBIT(fitInfo.triggerMaskFT0, o2::fit::Triggers::bitA);
values[kFT0OrC] = TESTBIT(fitInfo.triggerMaskFT0, o2::fit::Triggers::bitC);
const auto ft0Index = bc.ft0Id();
if (ft0Index < 0 || ft0Index >= ft0s.size()) {
values[kNFiredChannelsFT0A] = -1;
Expand Down
Loading