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
2 changes: 1 addition & 1 deletion Common/Core/PID/TPCPIDResponse.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 Common/Core/PID/TPCPIDResponse.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 @@ -12,7 +12,7 @@
/// \file TPCPIDResponse.h
/// \author Annalena Kalteyer <annalena.sophie.kalteyer@cern.ch>
/// \author Christian Sonnabend
/// \brief

Check failure on line 15 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

#ifndef COMMON_CORE_PID_TPCPIDRESPONSE_H_
#define COMMON_CORE_PID_TPCPIDRESPONSE_H_
Expand All @@ -39,13 +39,13 @@
~Response() = default;

/// Setter and Getter for the private parameters
void SetBetheBlochParams(const std::array<float, 5>& betheBlochParams) { mBetheBlochParams = betheBlochParams; }

Check failure on line 42 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetResolutionParamsDefault(const std::array<float, 2>& resolutionParamsDefault) { mResolutionParamsDefault = resolutionParamsDefault; }

Check failure on line 43 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetResolutionParams(const std::vector<double>& resolutionParams) { mResolutionParams = resolutionParams; }

Check failure on line 44 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetMIP(const float mip) { mMIP = mip; }

Check failure on line 45 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetChargeFactor(const float chargeFactor) { mChargeFactor = chargeFactor; }

Check failure on line 46 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetMultiplicityNormalization(const float multNormalization) { mMultNormalization = multNormalization; }

Check failure on line 47 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetNClNormalization(const float nclnorm) { nClNorm = nclnorm; }

Check failure on line 48 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
void SetUseDefaultResolutionParam(const bool useDefault) { mUseDefaultResolutionParam = useDefault; }
void SetParameters(const Response* response)
{
Expand Down Expand Up @@ -124,7 +124,7 @@
inline float Response::GetExpectedSigma(const CollisionType& collision, const TrackType& track, const o2::track::PID::ID id) const
{
// use multTPC (legacy behaviour) if multTPC not provided
return Response::GetExpectedSigma(collision, collision.multTPC(), track, id);
return Response::GetExpectedSigma(collision, collision.multTPC(), track, id);
}

/// Gets the expected resolution of the measurement
Expand All @@ -149,7 +149,7 @@

const std::vector<double> values{1.f / dEdx, track.tgl(), std::sqrt(ncl), relReso, track.signed1Pt(), multTPC / mMultNormalization};

const float reso = sqrt(pow(mResolutionParams[0], 2) * values[0] + pow(mResolutionParams[1], 2) * (values[2] * mResolutionParams[5]) * pow(values[0] / sqrt(1 + pow(values[1], 2)), mResolutionParams[2]) + values[2] * pow(values[3], 2) + pow(mResolutionParams[4] * values[4], 2) + pow(values[5] * mResolutionParams[6], 2) + pow(values[5] * (values[0] / sqrt(1 + pow(values[1], 2))) * mResolutionParams[7], 2)) * dEdx * mMIP;

Check failure on line 152 in Common/Core/PID/TPCPIDResponse.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
reso >= 0.f ? resolution = reso : resolution = -999.f;
}
return resolution;
Expand Down
25 changes: 12 additions & 13 deletions Common/TableProducer/PID/pidTPCModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
#include "TableHelper.h"
#include "pidTPCBase.h"

#include "Common/CCDB/ctpRateFetcher.h"
#include "Common/Core/PID/TPCPIDResponse.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/CCDB/ctpRateFetcher.h"
#include "Tools/ML/model.h"

#include "CCDB/BasicCCDBManager.h"
Expand All @@ -51,7 +51,6 @@
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"


namespace o2::aod
{
namespace pid
Expand All @@ -61,7 +60,7 @@ struct pidTPCProducts : o2::framework::ProducesGroup {
o2::framework::Produces<aod::DEdxsCorrected> dEdxCorrected;
o2::framework::Produces<aod::PIDMults> mult;

// Tables produced by TPC component
// Tables produced by TPC component
o2::framework::Produces<o2::aod::pidTPCFullEl> tablePIDFullEl;
o2::framework::Produces<o2::aod::pidTPCFullMu> tablePIDFullMu;
o2::framework::Produces<o2::aod::pidTPCFullPi> tablePIDFullPi;
Expand Down Expand Up @@ -354,7 +353,7 @@ class pidTPCModule
return;
}
}
} // end init
} // end init

//__________________________________________________
template <typename TCCDB, typename TCCDBApi, typename C, typename M, typename T, typename B>
Expand Down Expand Up @@ -490,7 +489,7 @@ class pidTPCModule
}
auto expSignal = response->GetExpectedSignal(trk, pid);
auto expSigma = trk.has_collision() ? response->GetExpectedSigma(collisions.iteratorAt(trk.collisionId()), multTPC, trk, pid) : 0.07 * expSignal; // use default sigma value of 7% if no collision information to estimate resolution
if (expSignal < 0. || expSigma < 0.) { // skip if expected signal invalid
if (expSignal < 0. || expSigma < 0.) { // skip if expected signal invalid
if (flagFull)
tableFull(-999.f, -999.f);
if (flagTiny)
Expand Down Expand Up @@ -538,17 +537,17 @@ class pidTPCModule
}

// preparatory step: we need the multiplicities for each collision
std::vector<int> pidmults;
std::vector<int> pidmults;
long totalTPCtracks = 0;
long totalTPCnotStandalone = 0;
pidmults.resize(cols.size(), 0);

// faster counting
for (const auto& track : tracks) {
if(track.hasTPC()&&track.collisionId()>-1){
if (track.hasTPC() && track.collisionId() > -1) {
pidmults[track.collisionId()]++;
totalTPCtracks++;
if(track.hasITS()||track.hasTOF()||track.hasTRD()){
if (track.hasITS() || track.hasTOF() || track.hasTRD()) {
totalTPCnotStandalone++;
}
}
Expand Down Expand Up @@ -594,11 +593,11 @@ class pidTPCModule
uint64_t count_tracks = 0;

for (auto const& trk : tracks) {
// get the TPC signal to be used in the PID
float tpcSignalToEvaluatePID = trk.tpcSignal();
// get the TPC signal to be used in the PID
float tpcSignalToEvaluatePID = trk.tpcSignal();

// if corrected dE/dx is requested, correct it here on the spot and use that
if(pidTPCopts.useCorrecteddEdx){
if (pidTPCopts.useCorrecteddEdx) {
double hadronicRate;
int multTPC;
int occupancy;
Expand Down Expand Up @@ -658,7 +657,7 @@ class pidTPCModule
// change the signal used for PID
tpcSignalToEvaluatePID = fTPCSignal / fTPCSignalN_CR1;

if(pidTPCopts.savedEdxsCorrected){
if (pidTPCopts.savedEdxsCorrected) {
// populated cursor if requested or autodetected
products.dEdxCorrected(tpcSignalToEvaluatePID);
}
Expand Down Expand Up @@ -686,7 +685,7 @@ class pidTPCModule
response->PrintAll();
}

// if this is a MC process function, go for MC tune on data processing
// if this is a MC process function, go for MC tune on data processing
if constexpr (soa::is_table<TMCParticles>) {
// Perform TuneOnData sampling for MC dE/dx
float mcTunedTPCSignal = 0.;
Expand Down
2 changes: 1 addition & 1 deletion Common/TableProducer/PID/pidTPCService.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

//===============================================================
//
// Modularized version of TPC PID task
// Modularized version of TPC PID task
//
//===============================================================

Expand Down
Loading