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
22 changes: 13 additions & 9 deletions PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,23 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMCASCADESELECTION_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMCASCADESELECTION_H_

#include <iostream>
#include <string>
#include <vector>

#include <TDatabasePDG.h> // FIXME

#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h"
#include "PWGCF/FemtoDream/Core/femtoDreamSelection.h"
#include "PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h"

#include "Common/Core/RecoDecay.h"

#include "Framework/HistogramRegistry.h"
#include "ReconstructionDataFormats/PID.h"

#include <TDatabasePDG.h> // FIXME

Check failure on line 34 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

#include <iostream>

Check failure on line 36 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <string>
#include <vector>

using namespace o2::framework;

Check failure on line 40 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::analysis::femtoDream::femtoDreamSelection;

Check failure on line 41 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

namespace o2::analysis::femtoDream
{
Expand Down Expand Up @@ -293,8 +295,8 @@

// float nSigmaPIDOffsetTPC;

FemtoDreamTrackSelection PosDaughTrack;

Check failure on line 298 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
FemtoDreamTrackSelection NegDaughTrack;

Check failure on line 299 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
FemtoDreamTrackSelection BachDaughTrack;

static constexpr int kNcascadeSelection = 16;
Expand Down Expand Up @@ -346,8 +348,8 @@
}; ///< Helper information for the
///< different selections

static constexpr int kNcutStages = 2;
static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"};
// static constexpr int kNcutStages = 2;
// static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"};
}; // namespace femtoDream

template <o2::aod::femtodreamparticle::ParticleType part, o2::aod::femtodreamparticle::ParticleType daugh, o2::aod::femtodreamparticle::ParticleType bach, typename cutContainerType>
Expand Down Expand Up @@ -377,7 +379,7 @@
/// \todo this should be an automatic check in the parent class, and the
/// return type should be templated
size_t nSelections = getNSelections();
if (nSelections > 8 * sizeof(cutContainerType)) {

Check failure on line 382 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

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.
LOGF(info, "Number of selections %i", nSelections);
LOG(fatal) << "FemtoDreamCascadeCuts: Number of selections to large for your "
"container - quitting!";
Expand All @@ -388,7 +390,7 @@
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hSign").c_str(), "; Sign of the Cascade ; Entries", kTH1I, {{3, -1, 2}});
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{1000, 0, 10}});
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}});
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{1000, 0, 2. * M_PI}});

Check failure on line 393 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 393 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hDCADaugh").c_str(), "; daughters DCA; Entries", kTH1F, {DCADaughAxis});
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hCPA").c_str(), "; Cos PA; Entries", kTH1F, {CPAAxis});
mQAHistogramRegistry->add((folderName + "/" + static_cast<std::string>(mCutStage[istage]) + "/hTranRad").c_str(), "; Transverse Radius; Entries", kTH1F, {tranRadAxis});
Expand Down Expand Up @@ -586,7 +588,7 @@
const auto v0dcatopv = casc.dcav0topv(col.posX(), col.posY(), col.posZ());

float observable = 0.;
for (auto& sel : mSelections) {

Check failure on line 591 in PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h

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.

const auto selVariable = sel.getSelectionVariable();
switch (selVariable) {
Expand Down Expand Up @@ -663,6 +665,8 @@
const float cpaCasc = casc.casccosPA(col.posX(), col.posY(), col.posZ());
const float cpav0 = casc.v0cosPA(col.posX(), col.posY(), col.posZ());
const float v0dcatopv = casc.dcav0topv(col.posX(), col.posY(), col.posZ());
const float invMass = isCascOmega ? casc.mOmega() : casc.mXi();

if (mQAHistogramRegistry) {
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hSign"), casc.sign());
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hPt"), casc.pt());
Expand All @@ -674,7 +678,7 @@
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxX"), decVtx.at(0));
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxY"), decVtx.at(1));
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxZ"), decVtx.at(2));
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMass"), casc.mXi());
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMass"), invMass);
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0DCADaugh"), casc.dcaV0daughters());
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0CPA"), cpav0);
mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0TranRad"), casc.v0radius());
Expand Down
21 changes: 13 additions & 8 deletions PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMPARTICLEHISTO_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMPARTICLEHISTO_H_

#include <TMath.h>
#include <string>
#include "PWGCF/DataModel/FemtoDerived.h"
#include "Framework/HistogramRegistry.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/HistogramRegistry.h"

#include <TMath.h>

#include <string>

using namespace o2::framework;

Expand Down Expand Up @@ -690,11 +693,13 @@ class FemtoDreamParticleHisto
}

private:
HistogramRegistry* mHistogramRegistry; ///< For QA output
static constexpr o2::aod::femtodreamparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis
static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below
static constexpr std::string_view mFolderSuffix[9] = {"", "_one", "_two", "_pos", "_neg", "_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C)
int mPDG = 0; ///< PDG code of the selected particle
HistogramRegistry* mHistogramRegistry; ///< For QA output
static constexpr o2::aod::femtodreamparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis
static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below
static constexpr std::string_view mFolderSuffix[12] = {"", "_one", "_two", "_pos", "_neg",
"_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach",
"_two_pos", "_two_neg", "_two_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C)
int mPDG = 0; ///< PDG code of the selected particle
};
} // namespace o2::analysis::femtoDream

Expand Down
9 changes: 7 additions & 2 deletions PWGCF/FemtoDream/Core/femtoDreamSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMSELECTION_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMSELECTION_H_

#include <cmath>
#include "Framework/HistogramRegistry.h"
#include "PWGCF/DataModel/FemtoDerived.h"

#include "Framework/HistogramRegistry.h"

#include <cmath>

using namespace o2;
using namespace o2::framework;

Expand All @@ -36,6 +38,9 @@ enum SelectionType { kUpperLimit, ///< simple upper limit for the value, e.g.
kEqual ///< values need to be equal, e.g. sign = 1
};

static constexpr int kNcutStages = 2;
static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"};

} // namespace femtoDreamSelection

/// Simple class taking care of individual selections
Expand Down
25 changes: 13 additions & 12 deletions PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMTRACKSELECTION_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMTRACKSELECTION_H_

#include <string>
#include <vector>
#include <cmath>
#include <iostream>

#include "PWGCF/DataModel/FemtoDerived.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/PIDResponseITS.h"
#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h"

#include "Common/Core/TrackSelection.h"
#include "Common/Core/TrackSelectionDefaults.h"
#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h"
#include "ReconstructionDataFormats/PID.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/PIDResponseITS.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/HistogramRegistry.h"
#include "ReconstructionDataFormats/PID.h"

#include <cmath>
#include <iostream>
#include <string>
#include <vector>

using namespace o2::framework;
using namespace o2::analysis::femtoDream::femtoDreamSelection;

namespace o2::analysis::femtoDream
{
Expand Down Expand Up @@ -301,8 +304,6 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
"Maximal DCA_z (cm)",
"Minimal DCA (cm)",
"Maximal PID (nSigma)"}; ///< Helper information for the different selections
static constexpr int kNcutStages = 2;
static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"};
}; // namespace femtoDream

template <o2::aod::femtodreamparticle::ParticleType part, o2::aod::femtodreamparticle::TrackType tracktype, typename cutContainerType>
Expand Down
14 changes: 10 additions & 4 deletions PWGCF/FemtoDream/Core/femtoDreamUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMUTILS_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMUTILS_H_

#include <vector>
#include <string>
#include "CommonConstants/PhysicsConstants.h"
#include "PWGCF/DataModel/FemtoDerived.h"

#include "CommonConstants/PhysicsConstants.h"

#include <string>
#include <vector>

namespace o2::analysis::femtoDream
{

Expand Down Expand Up @@ -67,8 +69,12 @@ inline float getMass(int pdgCode)
case o2::constants::physics::Pdg::kHelium3:
mass = o2::constants::physics::MassHelium3;
break;
// case o2::constants::physics::Pdg::kOmegaMinus:
case kOmegaMinus:
mass = o2::constants::physics::MassOmegaMinus;
break;
default:
LOG(fatal) << "PDG code is not suppored";
LOG(fatal) << "PDG code is not supported";
}
return mass;
}
Expand Down
Loading
Loading