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
57 changes: 6 additions & 51 deletions EventFiltering/PWGLF/filterf1proton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#include <Framework/Configurable.h>
#include <Math/GenVector/Boost.h>
#include <Math/Vector4D.h>
#include <TLorentzVector.h>

Check failure on line 20 in EventFiltering/PWGLF/filterf1proton.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 <TMath.h>
#include <fairlogger/Logger.h>
#include <iostream>

Check failure on line 23 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

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

#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "ReconstructionDataFormats/Track.h"
Expand Down Expand Up @@ -373,7 +374,7 @@
template <typename Collision, typename V0>
bool SelectionV0(Collision const& collision, V0 const& candidate)
{
if (fabs(candidate.dcav0topv()) > cMaxV0DCA) {

Check failure on line 377 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}

Expand All @@ -384,8 +385,8 @@
const float cpav0 = candidate.v0cosPA();

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

Check failure on line 388 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0;

Check failure on line 389 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.

if (pT < ConfV0PtMin) {
return false;
Expand All @@ -407,7 +408,7 @@
return false;
}
}
if (fabs(CtauK0s) > cMaxV0LifeTime || candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) {

Check failure on line 411 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return false;
}
return true;
Expand Down Expand Up @@ -477,10 +478,11 @@
// using EventCandidates = soa::Join<aod::Collisions, aod::EvSels, aod::Mults>;
using EventCandidates = aod::Collisions;
using ResoV0s = aod::V0Datas;
using PrimaryTrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksCovIU, aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection,
using PrimaryTrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection,
aod::pidTPCFullPi, aod::pidTOFFullPi,
aod::pidTPCFullKa, aod::pidTOFFullKa,
aod::pidTPCFullPr, aod::pidTOFFullPr>>;
using PrimaryTrackCandidatesIU = soa::Filtered<soa::Join<aod::TracksCovIU, aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr>>;

void processF1Proton(EventCandidates::iterator const& collision, aod::BCsWithTimestamps const&, PrimaryTrackCandidates const& tracks, ResoV0s const& V0s)
{
Expand Down Expand Up @@ -698,32 +700,13 @@
tags(keepEventF1Proton);
}
PROCESS_SWITCH(filterf1proton, processF1Proton, "Process for trigger", false);
TLorentzVector v0Dummy;

Check failure on line 703 in EventFiltering/PWGLF/filterf1proton.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.
void processF1ProtonHelper(EventCandidates::iterator const& collision, aod::BCsWithTimestamps const&, PrimaryTrackCandidates const& tracks, aod::V0s const& V0s)
void processF1ProtonHelper(EventCandidates::iterator const& collision, aod::BCs const&, PrimaryTrackCandidatesIU const& tracks, aod::V0s const& V0s)
{
initCCDB(collision.bc().runNumber());
bool keepEventF1Proton = false;
int numberF1 = 0;
if (isSelectedEvent(collision)) {
if (ConfUseManualPIDproton || ConfUseManualPIDkaon || ConfUseManualPIDpion) {
currentRunNumber = collision.bc_as<aod::BCsWithTimestamps>().runNumber();
if (currentRunNumber != lastRunNumber) {
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
if (ConfUseManualPIDproton) {
BBProton = setValuesBB(ccdbApi, bc, ConfPIDBBProton);
BBAntiproton = setValuesBB(ccdbApi, bc, ConfPIDBBAntiProton);
}
if (ConfUseManualPIDpion) {
BBPion = setValuesBB(ccdbApi, bc, ConfPIDBBPion);
BBAntipion = setValuesBB(ccdbApi, bc, ConfPIDBBAntiPion);
}
if (ConfUseManualPIDkaon) {
BBKaon = setValuesBB(ccdbApi, bc, ConfPIDBBKaon);
BBAntikaon = setValuesBB(ccdbApi, bc, ConfPIDBBAntiKaon);
}
lastRunNumber = currentRunNumber;
}
}

// keep track of indices
std::vector<int> PionIndex = {};
Expand All @@ -749,27 +732,6 @@
qaRegistry.fill(HIST("hPhi"), track.phi());
double nTPCSigmaP[3]{track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()};
double nTPCSigmaN[3]{track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()};
if (ConfUseManualPIDproton) {
auto bgScalingProton = 1 / massPr; // momentum scaling?
if (BBProton.size() == 6)
nTPCSigmaP[2] = updatePID(track, bgScalingProton, BBProton);
if (BBAntiproton.size() == 6)
nTPCSigmaN[2] = updatePID(track, bgScalingProton, BBAntiproton);
}
if (ConfUseManualPIDkaon) {
auto bgScalingKaon = 1 / massKa; // momentum scaling?
if (BBKaon.size() == 6)
nTPCSigmaP[1] = updatePID(track, bgScalingKaon, BBKaon);
if (BBAntikaon.size() == 6)
nTPCSigmaN[1] = updatePID(track, bgScalingKaon, BBAntikaon);
}
if (ConfUseManualPIDpion) {
auto bgScalingPion = 1 / massPi; // momentum scaling?
if (BBPion.size() == 6)
nTPCSigmaP[0] = updatePID(track, bgScalingPion, BBPion);
if (BBAntipion.size() == 6)
nTPCSigmaN[0] = updatePID(track, bgScalingPion, BBAntipion);
}

if ((track.sign() > 0 && SelectionPID(track, strategyPIDPion, 0, nTPCSigmaP[0])) || (track.sign() < 0 && SelectionPID(track, strategyPIDPion, 0, nTPCSigmaN[0]))) {
ROOT::Math::PtEtaPhiMVector temp(track.pt(), track.eta(), track.phi(), massPi);
Expand Down Expand Up @@ -829,15 +791,15 @@

for (auto& v0 : V0s) {

auto postrack = v0.template posTrack_as<PrimaryTrackCandidates>();
auto negtrack = v0.template negTrack_as<PrimaryTrackCandidates>();
auto postrack = v0.template posTrack_as<PrimaryTrackCandidatesIU>();
auto negtrack = v0.template negTrack_as<PrimaryTrackCandidatesIU>();
auto trackparpos = getTrackParCov(postrack);
auto trackparneg = getTrackParCov(negtrack);
if (!mStraHelper.buildV0Candidate(v0.collisionId(), collision.posX(), collision.posY(), collision.posZ(), postrack, negtrack, trackparpos, trackparneg)) {
continue;
}

if (fabs(mStraHelper.v0.dcaToPV) > cMaxV0DCA) {

Check failure on line 802 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
}
auto v0px = mStraHelper.v0.momentum[0];
Expand All @@ -857,20 +819,13 @@
if (distovertotmom * o2::constants::physics::MassK0Short > cMaxV0LifeTime) {
continue;
}
float lowmasscutks0 = 0.497 - 2.0 * cSigmaMassKs0;

Check failure on line 822 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
float highmasscutks0 = 0.497 + 2.0 * cSigmaMassKs0;

Check failure on line 823 in EventFiltering/PWGLF/filterf1proton.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
if (mStraHelper.v0.massK0Short < lowmasscutks0 || mStraHelper.v0.massK0Short > highmasscutks0) {
continue;
}
double nTPCSigmaPos[1]{postrack.tpcNSigmaPi()};
double nTPCSigmaNeg[1]{negtrack.tpcNSigmaPi()};
if (ConfUseManualPIDdaughterPion) {
auto bgScalingPion = 1 / massPi; // momentum scaling?
if (BBPion.size() == 6)
nTPCSigmaPos[0] = updatePID(postrack, bgScalingPion, BBPion);
if (BBAntipion.size() == 6)
nTPCSigmaNeg[0] = updatePID(negtrack, bgScalingPion, BBAntipion);
}
if (!isSelectedV0Daughter(postrack, 1, nTPCSigmaPos[0])) {
continue;
}
Expand Down
Loading