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
51 changes: 26 additions & 25 deletions PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,39 @@
//
// Build hypertriton candidates from V0s and tracks

#include <memory>
#include <string>
#include <array>
#include <vector>
#include <algorithm>
#include "PWGLF/DataModel/EPCalibrationTables.h"
#include "PWGLF/DataModel/LFHypernucleiTables.h"
#include "PWGLF/Utils/svPoolCreator.h"

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
#include "ReconstructionDataFormats/Track.h"
#include "Common/Core/PID/PIDTOF.h"
#include "Common/Core/PID/TPCPIDResponse.h"
#include "Common/Core/RecoDecay.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "PWGLF/DataModel/EPCalibrationTables.h"
#include "DetectorsBase/Propagator.h"
#include "DetectorsBase/GeometryManager.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "CCDB/BasicCCDBManager.h"

#include "Common/TableProducer/PID/pidTOFBase.h"
#include "EventFiltering/Zorro.h"
#include "EventFiltering/ZorroSummary.h"

#include "Common/Core/PID/TPCPIDResponse.h"
#include "Common/Core/PID/PIDTOF.h"
#include "Common/TableProducer/PID/pidTOFBase.h"
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "CCDB/BasicCCDBManager.h"
#include "DCAFitter/DCAFitterN.h"
#include "PWGLF/Utils/svPoolCreator.h"
#include "PWGLF/DataModel/LFHypernucleiTables.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"

#include <algorithm>
#include <array>
#include <memory>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -168,6 +168,7 @@

Configurable<bool> useCustomVertexer{"useCustomVertexer", false, "Use custom vertexer"};
Configurable<bool> skipAmbiTracks{"skipAmbiTracks", false, "Skip ambiguous tracks"};
Configurable<bool> disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROC cut for event selection"};
Configurable<float> customVertexerTimeMargin{"customVertexerTimeMargin", 800, "Time margin for custom vertexer (ns)"};
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for He3"};
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", true, "If true, divide tpcInnerParam by the electric charge"};
Expand Down Expand Up @@ -341,7 +342,7 @@
initCCDB(bc);
hEvents->Fill(0.);

if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) {
if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) {
continue;
}

Expand Down Expand Up @@ -540,7 +541,7 @@
if (mBBparamsHe[5] < 0) {
LOG(fatal) << "Bethe-Bloch parameters for He3 not set, please check your CCDB and configuration";
}
for (auto& v0 : V0s) {

Check failure on line 544 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

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.
// if(v0.isStandardV0())
// continue;
auto posTrack = tracks.rawIteratorAt(v0.posTrackId());
Expand Down Expand Up @@ -581,7 +582,7 @@
svCreator.clearPools();
svCreator.fillBC2Coll(collisions, bcs);

for (auto& track : tracks) {

Check failure on line 585 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

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.

if (std::abs(track.eta()) > etaMax)
continue;
Expand All @@ -603,7 +604,7 @@
auto& svPool = svCreator.getSVCandPool(collisions);
LOG(debug) << "SV pool size: " << svPool.size();

for (auto& svCand : svPool) {

Check failure on line 607 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

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.
auto heTrack = tracks.rawIteratorAt(svCand.tr0Idx);
auto piTrack = tracks.rawIteratorAt(svCand.tr1Idx);
auto collIdxs = svCand.collBracket;
Expand All @@ -614,7 +615,7 @@
}
void fillMCinfo(aod::McTrackLabels const& trackLabels, aod::McParticles const&)
{
for (auto& hypCand : hyperCandidates) {

Check failure on line 618 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

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.
auto mcLabHe = trackLabels.rawIteratorAt(hypCand.heTrackID);
auto mcLabPi = trackLabels.rawIteratorAt(hypCand.piTrackID);

Expand All @@ -622,19 +623,19 @@
auto mcTrackHe = mcLabHe.mcParticle_as<aod::McParticles>();
auto mcTrackPi = mcLabPi.mcParticle_as<aod::McParticles>();
if (mcTrackHe.has_mothers() && mcTrackPi.has_mothers()) {
for (auto& heMother : mcTrackHe.mothers_as<aod::McParticles>()) {

Check failure on line 626 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

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.
for (auto& piMother : mcTrackPi.mothers_as<aod::McParticles>()) {
if (heMother.globalIndex() != piMother.globalIndex())
continue;
if (std::abs(mcTrackHe.pdgCode()) != heDauPdg || std::abs(mcTrackPi.pdgCode()) != 211)

Check failure on line 630 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
continue;
if (std::abs(heMother.pdgCode()) != hyperPdg)
continue;

auto primVtx = array{heMother.vx(), heMother.vy(), heMother.vz()};

Check failure on line 635 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
auto secVtx = array{mcTrackHe.vx(), mcTrackHe.vy(), mcTrackHe.vz()};

Check failure on line 636 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hypCand.gMom = array{heMother.px(), heMother.py(), heMother.pz()};

Check failure on line 637 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hypCand.gMomHe3 = array{mcTrackHe.px(), mcTrackHe.py(), mcTrackHe.pz()};

Check failure on line 638 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
for (int i = 0; i < 3; i++) {
hypCand.gDecVtx[i] = secVtx[i] - primVtx[i];
}
Expand Down
Loading