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
48 changes: 27 additions & 21 deletions PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// or submit itself to any jurisdiction.
//
// *+-+*+-+*+-+*+-+*+-+*+-+*
// Lambdakzero PID
// Strangeness TOF PID
// *+-+*+-+*+-+*+-+*+-+*+-+*
//
/// \author Nicolò Jacazio
Expand Down Expand Up @@ -162,23 +162,23 @@

// for n-sigma calibration
bool nSigmaCalibLoaded;
TList* nSigmaCalibObjects;
TH1 *hMeanPosLaPi, *hSigmaPosLaPi;
TH1 *hMeanPosLaPr, *hSigmaPosLaPr;
TH1 *hMeanNegLaPi, *hSigmaNegLaPi;
TH1 *hMeanNegLaPr, *hSigmaNegLaPr;
TH1 *hMeanPosK0Pi, *hSigmaPosK0Pi;
TH1 *hMeanNegK0Pi, *hSigmaNegK0Pi;
TH1 *hMeanPosXiPi, *hSigmaPosXiPi;
TH1 *hMeanPosXiPr, *hSigmaPosXiPr;
TH1 *hMeanNegXiPi, *hSigmaNegXiPi;
TH1 *hMeanNegXiPr, *hSigmaNegXiPr;
TH1 *hMeanBachXiPi, *hSigmaBachXiPi;
TH1 *hMeanPosOmPi, *hSigmaPosOmPi;
TH1 *hMeanPosOmPr, *hSigmaPosOmPr;
TH1 *hMeanNegOmPi, *hSigmaNegOmPi;
TH1 *hMeanNegOmPr, *hSigmaNegOmPr;
TH1 *hMeanBachOmKa, *hSigmaBachOmKa;
TList* nSigmaCalibObjects = nullptr;
TH1 *hMeanPosLaPi = nullptr, *hSigmaPosLaPi = nullptr;
TH1 *hMeanPosLaPr = nullptr, *hSigmaPosLaPr = nullptr;
TH1 *hMeanNegLaPi = nullptr, *hSigmaNegLaPi = nullptr;
TH1 *hMeanNegLaPr = nullptr, *hSigmaNegLaPr = nullptr;
TH1 *hMeanPosK0Pi = nullptr, *hSigmaPosK0Pi = nullptr;
TH1 *hMeanNegK0Pi = nullptr, *hSigmaNegK0Pi = nullptr;
TH1 *hMeanPosXiPi = nullptr, *hSigmaPosXiPi = nullptr;
TH1 *hMeanPosXiPr = nullptr, *hSigmaPosXiPr = nullptr;
TH1 *hMeanNegXiPi = nullptr, *hSigmaNegXiPi = nullptr;
TH1 *hMeanNegXiPr = nullptr, *hSigmaNegXiPr = nullptr;
TH1 *hMeanBachXiPi = nullptr, *hSigmaBachXiPi = nullptr;
TH1 *hMeanPosOmPi = nullptr, *hSigmaPosOmPi = nullptr;
TH1 *hMeanPosOmPr = nullptr, *hSigmaPosOmPr = nullptr;
TH1 *hMeanNegOmPi = nullptr, *hSigmaNegOmPi = nullptr;
TH1 *hMeanNegOmPr = nullptr, *hSigmaNegOmPr = nullptr;
TH1 *hMeanBachOmKa = nullptr, *hSigmaBachOmKa = nullptr;

int mRunNumber;
float d_bz;
Expand All @@ -191,7 +191,7 @@
kNEnums };

/// function to calculate track length of this track up to a certain segment of a detector
/// to be used internally in another funcrtion that calculates length until it finds the proper one
/// to be used internally in another function that calculates length until it finds the proper one
/// warning: this could be optimised further for speed
/// \param track the input track
/// \param x1 x of the first point of the detector segment
Expand Down Expand Up @@ -234,7 +234,7 @@
if (centerDistToPC > trcCircle.rC)
return -103;

float pcaToIntercept = TMath::Sqrt(TMath::Abs(trcCircle.rC * trcCircle.rC - centerDistToPC * centerDistToPC));

Check failure on line 237 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

float interceptX1 = pcaX + (x2 - x1) / segmentModulus * pcaToIntercept;
float interceptY1 = pcaY + (y2 - y1) / segmentModulus * pcaToIntercept;
Expand All @@ -253,23 +253,23 @@
sinAngle1 = (interceptX1 - trcCircle.xC) * (startPoint[1] - trcCircle.yC) - (interceptY1 - trcCircle.yC) * (startPoint[0] - trcCircle.xC);
cosAngle1 /= modulus1;
sinAngle1 /= modulus1;
length1 = trcCircle.rC * TMath::ACos(cosAngle1);

Check failure on line 256 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
length1 *= sqrt(1.0f + track.getTgl() * track.getTgl());

Check failure on line 257 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

modulus2 = std::hypot(interceptX2 - trcCircle.xC, interceptY2 - trcCircle.yC) * std::hypot(startPoint[0] - trcCircle.xC, startPoint[1] - trcCircle.yC);
cosAngle2 = (interceptX2 - trcCircle.xC) * (startPoint[0] - trcCircle.xC) + (interceptY2 - trcCircle.yC) * (startPoint[1] - trcCircle.yC);
sinAngle2 = (interceptX2 - trcCircle.xC) * (startPoint[1] - trcCircle.yC) - (interceptY2 - trcCircle.yC) * (startPoint[0] - trcCircle.xC);
cosAngle2 /= modulus2;
sinAngle2 /= modulus2;
length2 = trcCircle.rC * TMath::ACos(cosAngle2);

Check failure on line 264 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
length2 *= sqrt(1.0f + track.getTgl() * track.getTgl());

Check failure on line 265 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

// rotate transverse momentum vector such that it is at intercepts
float angle1 = TMath::ACos(cosAngle1);

Check failure on line 268 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (sinAngle1 < 0)
angle1 *= -1.0f;
float px1 = +TMath::Cos(angle1) * mom[0] + TMath::Sin(angle1) * mom[1];

Check failure on line 271 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
float py1 = -TMath::Sin(angle1) * mom[0] + TMath::Cos(angle1) * mom[1];

Check failure on line 272 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

float angle2 = TMath::ACos(cosAngle2);
if (sinAngle2 < 0)
Expand Down Expand Up @@ -430,7 +430,7 @@
if (propagationConfiguration.d_bz_input > -990) {
d_bz = propagationConfiguration.d_bz_input;
o2::parameters::GRPMagField grpmag;
if (fabs(d_bz) > 1e-5) {

Check failure on line 433 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand Down Expand Up @@ -807,7 +807,7 @@
// d3d = std::hypot(cascade.x() - cascCloseToPVPosition[0], cascade.y() - cascCloseToPVPosition[1], cascade.z() - cascCloseToPVPosition[2]); // cross-check variable
float sinThetaOverTwo = d / (2.0f * trcCircleCascade.rC);
lengthCascade = 2.0f * trcCircleCascade.rC * TMath::ASin(sinThetaOverTwo);
lengthCascade *= sqrt(1.0f + cascTrack.getTgl() * cascTrack.getTgl());

Check failure on line 810 in PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}

if (!successPropag) {
Expand Down Expand Up @@ -1169,7 +1169,13 @@
return;
}
auto firstTOFPID = dauTrackTOFPIDs.rawIteratorAt(0);
bool isNewTOFFOrmat = firstTOFPID.straCollisionId() < 0 ? false : true;
bool isNewTOFFormat = firstTOFPID.straCollisionId() < 0 ? false : true;

LOGF(info, "Processing derived data. Is this the new TOF info format? %i", isNewTOFFormat);

if (!isNewTOFFormat && calculationMethod.value > 0) {
LOGF(fatal, "Using the old derived data format with the new calculation method is not viable due to lack of needed info! Crashing.");
}

// Fire up CCDB with first collision in record. If no collisions, bypass
if (useCustomRunNumber || collisions.size() < 1) {
Expand All @@ -1182,7 +1188,7 @@
// hold indices
std::vector<int> tofIndices(dauTrackTable.size(), -1);

if (isNewTOFFOrmat) {
if (isNewTOFFormat) {
// re-index
for (const auto& dauTrackTOFPID : dauTrackTOFPIDs) {
tofIndices[dauTrackTOFPID.dauTrackExtraId()] = dauTrackTOFPID.globalIndex();
Expand Down
Loading