Project
Loading...
Searching...
No Matches
MatCell.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ALICEO2_MATCELL_H
16#define ALICEO2_MATCELL_H
17
18#include "GPUCommonDef.h"
19#include "GPUCommonRtypes.h"
20
21namespace o2
22{
23namespace base
24{
25
26struct MatCell {
27 // small struct to hold <X/X0> and <rho> of the voxel
28
29 static constexpr int NParams = 2; // number of material parameters described
30 float meanRho;
31 float meanX2X0;
32
33 GPUd() MatCell() : meanRho(0.f), meanX2X0(0.f) {}
34 GPUdDefault() MatCell(const MatCell& src) = default;
35
36 GPUd() void set(const MatCell& c)
37 {
39 meanX2X0 = c.meanX2X0;
40 }
41
42 GPUd() void scale(float scale)
43 {
44 meanRho *= scale;
45 meanX2X0 *= scale;
46 }
47
49};
50
52
53 // small struct to hold <X/X0>, <rho> and length traversed by track in the voxel
54 static constexpr int NParams = 3; // number of material parameters described
55 float length;
56
57 GPUd() MatBudget() : length(0.f) {}
58 GPUdDefault() MatBudget(const MatBudget& src) = default;
59
60 GPUd() void scale(float scale)
61 {
62 MatCell::scale(scale);
63 length *= scale;
64 }
65
66 GPUd() float getXRho() const
67 {
68 return meanRho * length;
69 }
70
71 GPUd() float getXRho(int signCorr) const
72 {
73 return meanRho * (signCorr < 0 ? -length : length);
74 }
75
77};
78
79} // namespace base
80} // namespace o2
81
82#endif
uint32_t c
Definition RawData.h:2
GLenum src
Definition glcorearb.h:1767
GLdouble f
Definition glcorearb.h:310
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUd() float getXRho(int signCorr) const
Definition MatCell.h:71
static constexpr int NParams
Definition MatCell.h:54
float length
length in material
Definition MatCell.h:55
ClassDefNV(MatBudget, 1)
GPUd() float getXRho() const
Definition MatCell.h:66
GPUdDefault() MatBudget(const MatBudget &src)=default
GPUd() MatBudget()
Definition MatCell.h:57
static constexpr int NParams
Definition MatCell.h:29
float meanRho
mean density, g/cm^3
Definition MatCell.h:30
GPUd() void scale(float scale)
Definition MatCell.h:42
GPUd() MatCell()
Definition MatCell.h:33
float meanX2X0
fraction of radiaton lenght
Definition MatCell.h:31
ClassDefNV(MatCell, 1)
GPUdDefault() MatCell(const MatCell &src)=default