Skip to content

Commit

Permalink
Merge branch 'master' into strdatmo1
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobrigk authored Nov 29, 2023
2 parents adc5e30 + b5dd95d commit 54e8088
Show file tree
Hide file tree
Showing 140 changed files with 3,192 additions and 1,951 deletions.
25 changes: 25 additions & 0 deletions EventFiltering/PWGCF/CFFilterAll.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static const std::vector<std::string> TPCTOFAvgName{"TPC Avg", "TOF Avg"};
static const std::vector<std::string> PidCutsName{"TPC min", "TPC max", "TOF min", "TOF max", "TPCTOF max"};
static const std::vector<std::string> PtCutsName{"Pt min (particle)", "Pt max (particle)", "Pt min (antiparticle)", "Pt max (antiparticle)", "P thres"};
static const std::vector<std::string> MomCorCutsName{"Momemtum Correlation min", "Momemtum Correlation max"};
static const std::vector<std::string> PIDForTrackingName{"Switch", "Momemtum Threshold"};
static const std::vector<std::string> ThreeBodyFilterNames{"PPP", "PPL", "PLL", "LLL"};
static const std::vector<std::string> TwoBodyFilterNames{"PD", "LD"};
static const std::vector<std::string> ParticleNames{"PPP", "aPaPaP", "PPL", "aPaPaL", "PLL", "aPaLaL", "LLL", "aLaLaL", "PD", "aPaD", "LD", "aLaD"};
Expand Down Expand Up @@ -135,6 +136,9 @@ static const float NClustersMin[1][nTracks]{
static const float MomCorLimits[2][nMomCorCuts] =
{{-99, 99},
{-99, 99}};
static const float PIDForTrackingTable[2][nTracks]{
{-1, 0.75},
{-1, 1.2}};

static const float triggerSwitches[1][nAllTriggers]{
{1, 1, 1, 1, 1, 1}};
Expand Down Expand Up @@ -383,6 +387,11 @@ struct CFFilter {
"Cut on momentum correlation ratio (antipartilce)"};
Configurable<bool> ConfMomCorRatioCutFlag{"ConfMomCorRatioFlag", false, "Flag for cut on momentum correlation ratio"};

Configurable<LabeledArray<float>> ConfPIDForTracking{
"ConfPIDForTracking",
{CFTrigger::PIDForTrackingTable[0], CFTrigger::nTracks, 2, CFTrigger::SpeciesName, CFTrigger::PIDForTrackingName},
"Use PID used in tracking up to momentum threshold"};

Configurable<LabeledArray<float>> ConfPtCuts{
"ConfPtCuts",
{CFTrigger::ptcutsTable[0], CFTrigger::kNParticleSpecies, CFTrigger::nPtCuts, CFTrigger::SpeciesNameAll, CFTrigger::PtCutsName},
Expand Down Expand Up @@ -971,6 +980,22 @@ struct CFFilter {
bool pThres = true;
float nSigma = -999.;

// check tracking PID
uint8_t SpeciesForTracking = 0;
if (partSpecies == CFTrigger::kProton) {
SpeciesForTracking = o2::track::PID::Proton;
} else if (partSpecies == CFTrigger::kDeuteron) {
SpeciesForTracking = o2::track::PID::Deuteron;
} else {
LOG(warn) << "Unknown PID for tracking encountered";
}

if (ConfPIDForTracking->get(partSpecies, "Switch") > 0 && track.tpcInnerParam() < ConfPIDForTracking->get(partSpecies, "Momemtum Threshold")) {
if (track.pidForTracking() != SpeciesForTracking) {
return false;
}
}

// check momentum threshold
if (track.tpcInnerParam() <= ConfPtCuts->get(partSpecies, "P thres")) {
pThres = true;
Expand Down
17 changes: 9 additions & 8 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h> // needed for HFFilterHelpers, to be fixed

#include "CommonConstants/PhysicsConstants.h"
#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
Expand Down Expand Up @@ -422,7 +423,7 @@ struct HfFilter { // Main struct for HF triggers
auto pt2Prong = RecoDecay::pt(pVec2Prong);

if (applyOptimisation) {
optimisationTreeCharm(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2]);
}

auto selD0 = helper.isSelectedD0InMassRange(pVecPos, pVecNeg, pt2Prong, preselD0, activateQA, hMassVsPtC[kD0]);
Expand Down Expand Up @@ -468,7 +469,7 @@ struct HfFilter { // Main struct for HF triggers
keepEvent[kBeauty3P] = true;
// fill optimisation tree for D0
if (applyOptimisation) {
optimisationTreeBeauty(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], dcaThird[0]);
}
if (activateQA) {
hMassVsPtB[kBplus]->Fill(ptCand, massCand);
Expand Down Expand Up @@ -529,7 +530,7 @@ struct HfFilter { // Main struct for HF triggers
if (isProton) {
float relativeMomentum = helper.computeRelativeMomentum(pVecThird, pVec2Prong, massD0);
if (applyOptimisation) {
optimisationTreeFemto(thisCollId, pdg::Code::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scoresToFill[0], scoresToFill[1], scoresToFill[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr());
}
if (relativeMomentum < femtoMaxRelativeMomentum) {
keepEvent[kFemto2P] = true;
Expand Down Expand Up @@ -757,25 +758,25 @@ struct HfFilter { // Main struct for HF triggers
if (is3Prong[0]) {
is3ProngInMass[0] = helper.isSelectedDplusInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, activateQA, hMassVsPtC[kDplus]);
if (applyOptimisation) {
optimisationTreeCharm(thisCollId, pdg::Code::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDPlus, pt3Prong, scoresToFill[0][0], scoresToFill[0][1], scoresToFill[0][2]);
}
}
if (is3Prong[1]) {
is3ProngInMass[1] = helper.isSelectedDsInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[1], activateQA, hMassVsPtC[kDs]);
if (applyOptimisation) {
optimisationTreeCharm(thisCollId, pdg::Code::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kDS, pt3Prong, scoresToFill[1][0], scoresToFill[1][1], scoresToFill[1][2]);
}
}
if (is3Prong[2]) {
is3ProngInMass[2] = helper.isSelectedLcInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[2], activateQA, hMassVsPtC[kLc]);
if (applyOptimisation) {
optimisationTreeCharm(thisCollId, pdg::Code::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kLambdaCPlus, pt3Prong, scoresToFill[2][0], scoresToFill[2][1], scoresToFill[2][2]);
}
}
if (is3Prong[3]) {
is3ProngInMass[3] = helper.isSelectedXicInMassRange(pVecFirst, pVecThird, pVecSecond, pt3Prong, is3Prong[3], activateQA, hMassVsPtC[kXic]);
if (applyOptimisation) {
optimisationTreeCharm(thisCollId, pdg::Code::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
optimisationTreeCharm(thisCollId, o2::constants::physics::Pdg::kXiCPlus, pt3Prong, scoresToFill[3][0], scoresToFill[3][1], scoresToFill[3][2]);
}
}

Expand Down Expand Up @@ -806,7 +807,7 @@ struct HfFilter { // Main struct for HF triggers
getPxPyPz(trackParFourth, pVecFourth);
}

int charmParticleID[kNBeautyParticles - 2] = {pdg::Code::kDPlus, pdg::Code::kDS, pdg::Code::kLambdaCPlus, pdg::Code::kXiCPlus};
int charmParticleID[kNBeautyParticles - 2] = {o2::constants::physics::Pdg::kDPlus, o2::constants::physics::Pdg::kDS, o2::constants::physics::Pdg::kLambdaCPlus, o2::constants::physics::Pdg::kXiCPlus};

float massCharmHypos[kNBeautyParticles - 2] = {massDPlus, massDs, massLc, massXic};
float massBeautyHypos[kNBeautyParticles - 2] = {massB0, massBs, massLb, massXib};
Expand Down
38 changes: 19 additions & 19 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,25 @@ static const std::tuple pdgCharmDaughters{
std::array{2212, -321, 211}, // Lc
std::array{2212, -321, 211}}; // Xic

constexpr float massPi = o2::analysis::pdg::MassPiPlus;
constexpr float massKa = o2::analysis::pdg::MassKPlus;
constexpr float massProton = o2::analysis::pdg::MassProton;
constexpr float massGamma = o2::analysis::pdg::MassGamma;
constexpr float massK0S = o2::analysis::pdg::MassK0Short;
constexpr float massLambda = o2::analysis::pdg::MassLambda0;
constexpr float massXi = o2::analysis::pdg::MassXiMinus;
constexpr float massPhi = o2::analysis::pdg::MassPhi;
constexpr float massD0 = o2::analysis::pdg::MassD0;
constexpr float massDPlus = o2::analysis::pdg::MassDPlus;
constexpr float massDs = o2::analysis::pdg::MassDS;
constexpr float massLc = o2::analysis::pdg::MassLambdaCPlus;
constexpr float massXic = o2::analysis::pdg::MassXiCPlus;
constexpr float massDStar = o2::analysis::pdg::MassDStar;
constexpr float massBPlus = o2::analysis::pdg::MassBPlus;
constexpr float massB0 = o2::analysis::pdg::MassB0;
constexpr float massBs = o2::analysis::pdg::MassBS;
constexpr float massLb = o2::analysis::pdg::MassLambdaB0;
constexpr float massXib = o2::analysis::pdg::MassXiB0;
constexpr float massPi = o2::constants::physics::MassPiPlus;
constexpr float massKa = o2::constants::physics::MassKPlus;
constexpr float massProton = o2::constants::physics::MassProton;
constexpr float massGamma = o2::constants::physics::MassGamma;
constexpr float massK0S = o2::constants::physics::MassK0Short;
constexpr float massLambda = o2::constants::physics::MassLambda0;
constexpr float massXi = o2::constants::physics::MassXiMinus;
constexpr float massPhi = o2::constants::physics::MassPhi;
constexpr float massD0 = o2::constants::physics::MassD0;
constexpr float massDPlus = o2::constants::physics::MassDPlus;
constexpr float massDs = o2::constants::physics::MassDS;
constexpr float massLc = o2::constants::physics::MassLambdaCPlus;
constexpr float massXic = o2::constants::physics::MassXiCPlus;
constexpr float massDStar = o2::constants::physics::MassDStar;
constexpr float massBPlus = o2::constants::physics::MassBPlus;
constexpr float massB0 = o2::constants::physics::MassB0;
constexpr float massBs = o2::constants::physics::MassBS;
constexpr float massLb = o2::constants::physics::MassLambdaB0;
constexpr float massXib = o2::constants::physics::MassXiB0;

static const o2::framework::AxisSpec ptAxis{50, 0.f, 50.f};
static const o2::framework::AxisSpec pAxis{50, 0.f, 10.f};
Expand Down
11 changes: 6 additions & 5 deletions EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h> // needed for HFFilterHelpers, to be fixed

#include "CommonConstants/PhysicsConstants.h"
#include "CCDB/BasicCCDBManager.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
Expand Down Expand Up @@ -121,7 +122,7 @@ struct HfFilterPrepareMlSamples { // Main struct

// D0(bar) → π± K∓
bool isInCorrectColl{false};
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, o2::constants::physics::Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign);
if (indexRec > -1) {
auto particle = mcParticles.rawIteratorAt(indexRec);
flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle);
Expand Down Expand Up @@ -202,27 +203,27 @@ struct HfFilterPrepareMlSamples { // Main struct
int8_t channel = -1;

// D± → π± K∓ π±
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
if (indexRec >= 0) {
channel = kDplus;
}
if (indexRec < 0) {
// Ds± → K± K∓ π±
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
if (indexRec >= 0) {
channel = kDs;
}
}
if (indexRec < 0) {
// Λc± → p± K∓ π±
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
if (indexRec >= 0) {
channel = kLc;
}
}
if (indexRec < 0) {
// Ξc± → p± K∓ π±
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, o2::constants::physics::Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
if (indexRec >= 0) {
channel = kXic;
}
Expand Down
10 changes: 5 additions & 5 deletions EventFiltering/PWGLF/filterf1proton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGHF/Core/PDG.h"
#include "CommonConstants/PhysicsConstants.h"
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
Expand Down Expand Up @@ -316,7 +316,7 @@ struct filterf1proton {
const float dcaDaughv0 = candidate.dcaV0daughters();
const float cpav0 = candidate.v0cosPA();

float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::analysis::pdg::MassK0Short;
float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short;
float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0;
float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0;

Expand Down Expand Up @@ -390,10 +390,10 @@ struct filterf1proton {

std::vector<double> BBProton, BBAntiproton, BBPion, BBAntipion, BBKaon, BBAntikaon;
ROOT::Math::PtEtaPhiMVector F1Vector, KKs0Vector;
double massPi = o2::analysis::pdg::MassPiPlus;
double massKa = o2::analysis::pdg::MassKPlus;
double massPi = o2::constants::physics::MassPiPlus;
double massKa = o2::constants::physics::MassKPlus;
double massPr = o2::constants::physics::MassProton;
double massK0s = o2::analysis::pdg::MassK0Short;
double massK0s = o2::constants::physics::MassK0Short;
double massF1{0.};
double masskKs0{0.};
double pT{0.};
Expand Down
Loading

0 comments on commit 54e8088

Please sign in to comment.