Skip to content
Open
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
35 changes: 35 additions & 0 deletions Common/MathUtils/include/MathUtils/BetheBlochAleph.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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 AliceO2_COMMON_BETHEBLOCH_H_
#define AliceO2_COMMON_BETHEBLOCH_H_

#include "GPUCommonDef.h"
#include "GPUCommonMath.h"

namespace o2::common
{

template <typename T>
GPUdi() T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
{
T beta = bg / o2::gpu::GPUCommonMath::Sqrt(static_cast<T>(1.) + bg * bg);

T aa = o2::gpu::GPUCommonMath::Pow(beta, kp4);
T bb = o2::gpu::GPUCommonMath::Pow(static_cast<T>(1.) / bg, kp5);
bb = o2::gpu::GPUCommonMath::Log(kp3 + bb);

return (kp2 - aa - bb) * kp1 / aa;
}

} // namespace o2::common

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,17 @@
#ifndef AliceO2_TPC_BETHEBLOCH_H_
#define AliceO2_TPC_BETHEBLOCH_H_

#include "GPUCommonDef.h"
#include "GPUCommonMath.h"
#include "MathUtils/BetheBlochAleph.h"

namespace o2
{
namespace tpc
namespace o2::tpc
{

template <typename T>
GPUdi() T BetheBlochAleph(T bg, T kp1, T kp2, T kp3, T kp4, T kp5)
{
T beta = bg / o2::gpu::GPUCommonMath::Sqrt(static_cast<T>(1.) + bg * bg);

T aa = o2::gpu::GPUCommonMath::Pow(beta, kp4);
T bb = o2::gpu::GPUCommonMath::Pow(static_cast<T>(1.) / bg, kp5);
bb = o2::gpu::GPUCommonMath::Log(kp3 + bb);

return (kp2 - aa - bb) * kp1 / aa;
return o2::common::BetheBlochAleph(bg, kp1, kp2, kp3, kp4, kp5);
}

} // namespace tpc
} // namespace o2
} // namespace o2::tpc

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PIDStudy : public Task
std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool isMC,
std::shared_ptr<o2::steer::MCKinematicsReader> kineReader) : mDataRequest{dr}, mGGCCDBRequest(gr), mUseMC(isMC), mKineReader(kineReader){};
~PIDStudy() final = default;
~PIDStudy() override = default;
void init(InitContext& ic) final;
void run(ProcessingContext&) final;
void endOfStream(EndOfStreamContext&) final;
Expand Down