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
14 changes: 8 additions & 6 deletions PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <Math/Vector4D.h>
#include <TFile.h>
#include <TH2F.h>
#include <TLorentzVector.h>

Check failure on line 55 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TPDGCode.h>
#include <TProfile.h>

Expand All @@ -64,8 +64,8 @@
#include <vector>

// constants
const float ctauXiPDG = 4.91; // Xi PDG lifetime

Check failure on line 67 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
const float ctauOmegaPDG = 2.461; // Omega PDG lifetime

Check failure on line 68 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.

using namespace o2;
using namespace o2::framework;
Expand All @@ -78,7 +78,7 @@
using V0Candidates = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras>;
using CascadeCandidates = soa::Join<aod::CascCollRefs, aod::CascCores, aod::CascExtras, aod::CascBBs>;

struct strangenessderivedbinnedinfo {

Check failure on line 81 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};

// master analysis switches
Expand Down Expand Up @@ -124,7 +124,7 @@
Configurable<float> maxIR{"maxIR", -1, "maximum IR collisions"};
} eventSelections;

static constexpr float defaultSqrtScalingParameters[1][4] = {{0.1, 0.1, 0, 128}};

Check failure on line 127 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".

// preselection options
struct : ConfigurableGroup {
Expand Down Expand Up @@ -239,7 +239,7 @@
Zorro zorro;
OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};

static constexpr float defaultLifetimeCuts[1][2] = {{30., 20.}};

Check failure on line 242 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
Configurable<LabeledArray<float>> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"};

ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f}, "Centrality"};
Expand All @@ -259,16 +259,18 @@

// Sqrt scaling function
// Author: Marian Ivanov
int codeSqrtScaling(float val, float sigma0, float sigma1, int clampMin, int clampMax) {
int codeSqrtScaling(float val, float sigma0, float sigma1, int clampMin, int clampMax)
{
float code_f = std::asinh((sigma1 * val) / sigma0) / sigma0;

Check failure on line 264 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return std::clamp(static_cast<int>(std::round(code_f)), clampMin, clampMax);
}

// Function to decode the sqrt scaling
// Function to decode the sqrt scaling
// Author: Marian Ivanov
float decodeSqrtScaling(int code, float sigma0, float sigma1, int clampMin, int clampMax) {
float code_f = static_cast<float>(code);
return (sigma0 / sigma1) * std::sinh(sigma0 * code_f);
float decodeSqrtScaling(int code, float sigma0, float sigma1, int clampMin, int clampMax)
{
float code_f = static_cast<float>(code);

Check failure on line 272 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return (sigma0 / sigma1) * std::sinh(sigma0 * code_f);
}

void init(InitContext const&)
Expand Down Expand Up @@ -454,7 +456,7 @@
if (fillHists)
histos.fill(HIST("hEventSelection"), 16 /* INEL > 0 */);

if (eventSelections.requireINEL1 && collision.multNTracksPVeta1() < 2) {

Check failure on line 459 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.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 false;
}
if (fillHists)
Expand Down Expand Up @@ -506,7 +508,7 @@
} else {
centrality = collision.centFT0C();
occupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange();
if(encodingOpts.useSqrtEncodingForOccupancy)
if (encodingOpts.useSqrtEncodingForOccupancy)
occupancy = std::sqrt(occupancy);
}
histos.fill(HIST("hEventCentrality"), centrality);
Expand Down Expand Up @@ -637,7 +639,7 @@

//
// armenteros
if (v0Selections.armPodCut > 1e-4 && v0.qtarm() * v0Selections.armPodCut < std::fabs(v0.alpha()))

Check failure on line 642 in PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.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 false;

return true;
Expand Down
Loading