Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider the following formatting changes to #9100 #370

Merged
merged 1 commit into from
Dec 21, 2024
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
20 changes: 10 additions & 10 deletions PWGLF/DataModel/LFStrangenessTables.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 warning on line 1 in PWGLF/DataModel/LFStrangenessTables.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,7 +8,7 @@
// 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.
#ifndef PWGLF_DATAMODEL_LFSTRANGENESSTABLES_H_

Check warning on line 11 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

Check warning on line 11 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 11 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.
#define PWGLF_DATAMODEL_LFSTRANGENESSTABLES_H_

#include <cmath>
Expand Down Expand Up @@ -230,7 +230,7 @@
DECLARE_SOA_TABLE(StraFT0CQVsEv, "AOD", "STRAFT0CQVSEv", //! events used to compute t0c Qvec
epcalibrationtable::TriggerEventEP);
DECLARE_SOA_TABLE(StraZDCSP, "AOD", "STRAZDCSP", //! ZDC SP information
spcalibrationtable::TriggerEventSP,
spcalibrationtable::TriggerEventSP,
spcalibrationtable::PsiZDCA, spcalibrationtable::PsiZDCC,
spcalibrationtable::QXZDCA, spcalibrationtable::QXZDCC,
spcalibrationtable::QYZDCA, spcalibrationtable::QYZDCC);
Expand Down Expand Up @@ -267,10 +267,10 @@
// Daughter track declarations for derived data analysis
// These definitions are for the first version of the table
// The latest version will inherit most properties from TracksExtra
DECLARE_SOA_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, float); //! ITS chi2 per N cluster

Check warning on line 270 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DetectorMap, detectorMap, uint8_t); //! detector map for reference (see DetectorMapEnum)
DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t); //! ITS cluster sizes per layer

Check warning on line 272 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCClusters, tpcClusters, uint8_t); //! N TPC clusters

Check warning on line 273 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCCrossedRows, tpcCrossedRows, uint8_t); //! N TPC clusters

//______________________________________________________
Expand Down Expand Up @@ -312,16 +312,16 @@
DECLARE_SOA_DYNAMIC_COLUMN(HasITSAfterburner, hasITSAfterburner, //! Flag to check if track is from ITS AB
[](uint8_t detectorMap, float itsChi2PerNcl) -> bool { return (detectorMap & o2::aod::track::ITS) ? (itsChi2PerNcl < -1e-3f) : false; });

//sub-namespace for compatibility purposes
// sub-namespace for compatibility purposes
namespace compatibility
{ // adds dynamics that ensure full backwards compatibility with previous getters
{ // adds dynamics that ensure full backwards compatibility with previous getters
DECLARE_SOA_DYNAMIC_COLUMN(TPCClusters, tpcClusters, //! number of TPC clusters
[](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; });
DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRows, tpcCrossedRows, //! Number of crossed TPC Rows
[](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t)tpcNClsFindable - TPCNClsFindableMinusCrossedRows; });
DECLARE_SOA_DYNAMIC_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, //! simple equivalent return
[](float itsChi2NCl) -> float { return (float)itsChi2NCl; });
}
} // namespace compatibility

} // namespace dautrack

Expand Down Expand Up @@ -355,18 +355,18 @@
dautrack::HasITSAfterburner<dautrack::DetectorMap, dautrack::ITSChi2PerNcl>);

DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_002, "AOD", "DAUTRACKEXTRA", 2, //! detector properties of decay daughters
track::ITSChi2NCl,
track::ITSChi2NCl,
dautrack::DetectorMap, // here we don´t save everything so we simplify this
track::ITSClusterSizes,
track::TPCNClsFindable,
track::TPCNClsFindable,
track::TPCNClsFindableMinusFound,
track::TPCNClsFindableMinusCrossedRows,

// Dynamics for ITS matching TracksExtra
track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
track::v001::ITSClusterMap<track::ITSClusterSizes>,
track::v001::ITSNCls<track::ITSClusterSizes>,
track::v001::ITSClusterMap<track::ITSClusterSizes>,
track::v001::ITSNCls<track::ITSClusterSizes>,
track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
/*compatibility*/ dautrack::HasITSTracker<dautrack::DetectorMap, track::ITSChi2NCl>,
/*compatibility*/ dautrack::HasITSAfterburner<dautrack::DetectorMap, track::ITSChi2NCl>,
Expand All @@ -384,7 +384,7 @@
dautrack::HasITS<dautrack::DetectorMap>,
dautrack::HasTPC<dautrack::DetectorMap>,
dautrack::HasTRD<dautrack::DetectorMap>,
dautrack::HasTOF<dautrack::DetectorMap>);
dautrack::HasTOF<dautrack::DetectorMap>);

DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds
dautrack::ParticleMCId);
Expand Down Expand Up @@ -558,7 +558,7 @@
// Distance Over To Mom
DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to V0decay distance over total momentum
[](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) {
float P = RecoDecay::sqrtSumOfSquares(Px, Py, Pz);

Check warning on line 561 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10);
});

Expand Down Expand Up @@ -594,14 +594,14 @@
DECLARE_SOA_DYNAMIC_COLUMN(PFracPos, pfracpos,
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
float ppos = RecoDecay::sqrtSumOfSquares(pxpos, pypos, pzpos);
float PV0 = RecoDecay::sqrtSumOfSquares(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);

Check warning on line 597 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return (ppos / PV0);
});

DECLARE_SOA_DYNAMIC_COLUMN(PFracNeg, pfracneg,
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
float pneg = RecoDecay::sqrtSumOfSquares(pxneg, pyneg, pzneg);
float PV0 = RecoDecay::sqrtSumOfSquares(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);

Check warning on line 604 in PWGLF/DataModel/LFStrangenessTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
return (pneg / PV0);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
dauTrackExtras_002(values.itsChi2PerNcl(),
values.detectorMap(),
values.itsClusterSizes(),
static_cast<uint8_t>(0), // findable (unknown in old format)
-values.tpcClusters(), // findable minus found: we know found
values.tpcCrossedRows()); // findable minus crossed rows: we know crossed rows
static_cast<uint8_t>(0), // findable (unknown in old format)
-values.tpcClusters(), // findable minus found: we know found
values.tpcCrossedRows()); // findable minus crossed rows: we know crossed rows
}
}
};
Expand All @@ -38,4 +38,5 @@
{
return WorkflowSpec{
adaptAnalysisTask<stradautracksextraconverter2>(cfgc)};
}
}

Check failure on line 42 in PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
12 changes: 6 additions & 6 deletions PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ struct strangederivedbuilder {
for (auto const& tr : tracksExtra) {
if (trackMap[tr.globalIndex()] >= 0) {
dauTrackExtras(tr.itsChi2NCl(),
tr.detectorMap(),
tr.detectorMap(),
tr.itsClusterSizes(),
tr.tpcNClsFindable(),
tr.tpcNClsFindableMinusFound(),
tr.tpcNClsFindableMinusFound(),
tr.tpcNClsFindableMinusCrossedRows());
}
}
Expand Down Expand Up @@ -577,10 +577,10 @@ struct strangederivedbuilder {
for (auto const& tr : tracksExtra) {
if (trackMap[tr.globalIndex()] >= 0) {
dauTrackExtras(tr.itsChi2NCl(),
tr.detectorMap(),
tr.detectorMap(),
tr.itsClusterSizes(),
tr.tpcNClsFindable(),
tr.tpcNClsFindableMinusFound(),
tr.tpcNClsFindableMinusFound(),
tr.tpcNClsFindableMinusCrossedRows());

// if the table has MC info
Expand Down Expand Up @@ -813,8 +813,8 @@ struct strangederivedbuilder {
}
void processZDCSP(soa::Join<aod::Collisions, aod::SPCalibrationTables>::iterator const& collision)
{
StraZDCSP(collision.triggereventsp(),
collision.psiZDCA(), collision.psiZDCC(),
StraZDCSP(collision.triggereventsp(),
collision.psiZDCA(), collision.psiZDCC(),
collision.qxZDCA(), collision.qxZDCC(),
collision.qyZDCA(), collision.qyZDCC());
}
Expand Down
21 changes: 10 additions & 11 deletions PWGLF/Tasks/Strangeness/lambdapolsp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -432,32 +432,33 @@ struct lambdapolsp {
}

template <typename TV0>
bool isCompatible(TV0 const& v0, int pid /*0: lambda, 1: antilambda*/){
bool isCompatible(TV0 const& v0, int pid /*0: lambda, 1: antilambda*/)
{
// checks if this V0 is compatible with the requested hypothesis

// de-ref track extras
auto posTrackExtra = v0.template posTrackExtra_as<dauTracks>();
auto negTrackExtra = v0.template negTrackExtra_as<dauTracks>();

// check for desired kinematics
if(pid == 0 && (v0.positivept() < cfgDaughPrPt || v0.negativept() < cfgDaughPiPt)) {
if (pid == 0 && (v0.positivept() < cfgDaughPrPt || v0.negativept() < cfgDaughPiPt)) {
return false; // doesn´t pass lambda pT sels
}
if(pid == 1 && (v0.positivept() < cfgDaughPiPt || v0.negativept() < cfgDaughPrPt)) {
if (pid == 1 && (v0.positivept() < cfgDaughPiPt || v0.negativept() < cfgDaughPrPt)) {
return false; // doesn´t pass antilambda pT sels
}
if(std::abs(v0.positiveeta()) > ConfDaughEta || std::abs(v0.negativeeta()) > ConfDaughEta) {
if (std::abs(v0.positiveeta()) > ConfDaughEta || std::abs(v0.negativeeta()) > ConfDaughEta) {
return false;
}

// check TPC tracking properties
if(posTrackExtra.tpcNClsCrossedRows() < 70 || negTrackExtra.tpcNClsCrossedRows() < 70) {
if (posTrackExtra.tpcNClsCrossedRows() < 70 || negTrackExtra.tpcNClsCrossedRows() < 70) {
return false;
}
if(posTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin) {
if (posTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < ConfDaughTPCnclsMin) {
return false;
}
if(posTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8 || negTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8) {
if (posTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8 || negTrackExtra.tpcCrossedRowsOverFindableCls() < 0.8) {
return false;
}

Expand Down Expand Up @@ -794,7 +795,7 @@ struct lambdapolsp {
void processDerivedData(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP>::iterator const& collision, v0Candidates const& V0s, dauTracks const&)
{
//___________________________________________________________________________________________________
// event selection
// event selection
if (!collision.sel8()) {
return;
}
Expand Down Expand Up @@ -870,7 +871,7 @@ struct lambdapolsp {
Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi);
}
Lambda = Proton + Pion;

ROOT::Math::Boost boost{Lambda.BoostToCM()};
fourVecDauCM = boost(Proton);
threeVecDauCM = fourVecDauCM.Vect();
Expand Down Expand Up @@ -932,8 +933,6 @@ struct lambdapolsp {
} // end loop over V0s
}
PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false);


};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
Expand Down
Loading