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
66 changes: 37 additions & 29 deletions PWGLF/DataModel/LFStrangenessPIDTables.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,18 +8,21 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// Defines TOF PID tables for strangeness.
// Entries calculated per candidate, tables are joinable with v0/cascdata tables.

#ifndef PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_
#define PWGLF_DATAMODEL_LFSTRANGENESSPIDTABLES_H_

#include <cmath>
#include "Framework/AnalysisDataModel.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/Core/RecoDecay.h"

#include "CommonConstants/PhysicsConstants.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "Framework/AnalysisDataModel.h"

#include <cmath>

namespace o2::aod
{
Expand All @@ -29,40 +32,44 @@
namespace packing
{
// define variables for packing
static constexpr int nbins = (1 << 8 * sizeof(int8_t)) - 2;

Check failure on line 35 in PWGLF/DataModel/LFStrangenessPIDTables.h

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".
static constexpr int8_t overflowBin = nbins >> 1;
static constexpr int8_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 6.35;

Check failure on line 38 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
static constexpr float binned_min = -6.35;

Check failure on line 39 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
static constexpr float bin_width = (binned_max - binned_min) / nbins;

Check failure on line 40 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
static constexpr float underflow_return = -100.0f;

Check failure on line 41 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
static constexpr float overflow_return = +100.0f;

Check failure on line 42 in PWGLF/DataModel/LFStrangenessPIDTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

// define helper function to do packing
int8_t packInInt8(float nSigma){
int8_t packInInt8(float nSigma)
{
// calculate
if(nSigma<=binned_min) return underflowBin;
if(nSigma>=binned_max) return overflowBin;
if(nSigma>=0){
return static_cast<int8_t>((nSigma/bin_width)+0.5f);
if (nSigma <= binned_min)
return underflowBin;
if (nSigma >= binned_max)
return overflowBin;
if (nSigma >= 0) {
return static_cast<int8_t>((nSigma / bin_width) + 0.5f);
}
// automatic: this is the case in which nSigma < 0
return static_cast<int8_t>((nSigma/bin_width)-0.5f);
return static_cast<int8_t>((nSigma / bin_width) - 0.5f);
}

// define helper function to do unpacking
float unpackInt8(int8_t nSigma){
if(nSigma == underflowBin){
float unpackInt8(int8_t nSigma)
{
if (nSigma == underflowBin) {
return underflow_return;
}
if(nSigma == overflowBin){
if (nSigma == overflowBin) {
return overflow_return;
}
return bin_width*nSigma;
return bin_width * nSigma;
}

} // end packing namespace
} // end dautrack namespace
} // namespace packing
} // namespace dautrack

namespace dautrack_legacy
{
Expand All @@ -72,11 +79,12 @@
DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNSigmaKa, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNSigmaPr, float); //! Nsigma proton
DECLARE_SOA_COLUMN(TPCNSigmaHe, tpcNSigmaHe, float); //! Nsigma proton
}
} // namespace dautrack_legacy

namespace dautrack{
// ==== COMPACT TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float); //! track TPC signal
namespace dautrack
{
// ==== COMPACT TPC INFORMATION (full size tables) ===
DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float); //! track TPC signal
DECLARE_SOA_COLUMN(PackedTPCNSigmaEl, packedTpcNSigmaEl, int8_t); //! Nsigma proton
DECLARE_SOA_COLUMN(PackedTPCNSigmaPi, packedTpcNSigmaPi, int8_t); //! Nsigma proton
DECLARE_SOA_COLUMN(PackedTPCNSigmaKa, packedTpcNSigmaKa, int8_t); //! Nsigma proton
Expand All @@ -92,7 +100,7 @@
[](int8_t nsigma_packed) -> float { return o2::aod::dautrack::packing::unpackInt8(nsigma_packed); });

// ==== TOF INFORMATION ===
DECLARE_SOA_INDEX_COLUMN(DauTrackExtra, dauTrackExtra); //! point to daughter this TOF info belongs to
DECLARE_SOA_INDEX_COLUMN(DauTrackExtra, dauTrackExtra); //! point to daughter this TOF info belongs to
DECLARE_SOA_INDEX_COLUMN(StraCollision, straCollision); //! point to collision associated with this track (not the V0/Casc)
DECLARE_SOA_COLUMN(TOFSignal, tofSignal, float); //! track TOF signal
DECLARE_SOA_COLUMN(TOFEvTime, tofEvTime, float); //! event time
Expand Down Expand Up @@ -132,13 +140,13 @@
dautrack_legacy::TPCNSigmaPr, dautrack_legacy::TPCNSigmaHe);

DECLARE_SOA_TABLE_VERSIONED(DauTrackTPCPIDs_001, "AOD", "DAUTRACKTPCPID", 1, // nsigma table (for analysis)
dautrack::TPCSignal,
dautrack::PackedTPCNSigmaEl, dautrack::PackedTPCNSigmaPi,
dautrack::PackedTPCNSigmaKa, dautrack::PackedTPCNSigmaPr,
dautrack::TPCNSigmaEl<dautrack::PackedTPCNSigmaEl>,
dautrack::TPCNSigmaPi<dautrack::PackedTPCNSigmaPi>,
dautrack::TPCNSigmaKa<dautrack::PackedTPCNSigmaKa>,
dautrack::TPCNSigmaPr<dautrack::PackedTPCNSigmaPr>);
dautrack::TPCSignal,
dautrack::PackedTPCNSigmaEl, dautrack::PackedTPCNSigmaPi,
dautrack::PackedTPCNSigmaKa, dautrack::PackedTPCNSigmaPr,
dautrack::TPCNSigmaEl<dautrack::PackedTPCNSigmaEl>,
dautrack::TPCNSigmaPi<dautrack::PackedTPCNSigmaPi>,
dautrack::TPCNSigmaKa<dautrack::PackedTPCNSigmaKa>,
dautrack::TPCNSigmaPr<dautrack::PackedTPCNSigmaPr>);

using DauTrackTPCPIDs = DauTrackTPCPIDs_001; // second gen: packed Nsigma, no He

Expand All @@ -148,8 +156,8 @@
DECLARE_SOA_TABLE_VERSIONED(DauTrackTOFPIDs_001, "AOD", "DAUTRACKTOFPID", 1, // raw table (for posterior TOF calculation)
o2::soa::Index<>,
dautrack::StraCollisionId, dautrack::DauTrackExtraId,
dautrack::TOFSignal, dautrack::TOFEvTime,
dautrack::Length, dautrack::TOFExpMom,
dautrack::TOFSignal, dautrack::TOFEvTime,
dautrack::Length, dautrack::TOFExpMom,
dautrack::TOFExpTimeEl<dautrack::Length, dautrack::TOFExpMom>,
dautrack::TOFExpTimePi<dautrack::Length, dautrack::TOFExpMom>,
dautrack::TOFExpTimeKa<dautrack::Length, dautrack::TOFExpMom>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::framework;
Expand All @@ -24,7 +25,7 @@
void process(aod::DauTrackTOFPIDs_000 const& dauTrackTOFPIDs)
{
for (int ii = 0; ii < dauTrackTOFPIDs.size(); ii++) {
auto dauTrackTOFPID = dauTrackTOFPIDs.rawIteratorAt(ii);
auto dauTrackTOFPID = dauTrackTOFPIDs.rawIteratorAt(ii);
dautracktofpids(-1, -1, dauTrackTOFPID.tofSignal(), dauTrackTOFPID.tofEvTime(), dauTrackTOFPID.length(), 0.0f);
}
}
Expand All @@ -34,4 +35,5 @@
{
return WorkflowSpec{
adaptAnalysisTask<stradautrackstofpidconverter2>(cfgc)};
}
}

Check failure on line 39 in PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter2.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::framework;
Expand All @@ -24,10 +25,10 @@
void process(aod::DauTrackTPCPIDs_000 const& v000s)
{
for (int ii = 0; ii < v000s.size(); ii++) {
auto dauTrackTPCPID = v000s.rawIteratorAt(ii);
dautrackpcpids(dauTrackTPCPID.tpcSignal(),
auto dauTrackTPCPID = v000s.rawIteratorAt(ii);
dautrackpcpids(dauTrackTPCPID.tpcSignal(),
aod::dautrack::packing::packInInt8(dauTrackTPCPID.tpcNSigmaEl()),
aod::dautrack::packing::packInInt8(dauTrackTPCPID.tpcNSigmaPi()),
aod::dautrack::packing::packInInt8(dauTrackTPCPID.tpcNSigmaPi()),
aod::dautrack::packing::packInInt8(dauTrackTPCPID.tpcNSigmaKa()),
aod::dautrack::packing::packInInt8(dauTrackTPCPID.tpcNSigmaPr()));
}
Expand All @@ -38,4 +39,5 @@
{
return WorkflowSpec{
adaptAnalysisTask<stradautrackstpcpidconverter>(cfgc)};
}
}

Check failure on line 43 in PWGLF/TableProducer/Strangeness/Converters/stradautrackstpcpidconverter.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
Loading
Loading