Project
Loading...
Searching...
No Matches
CfChargePos.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 O2_GPU_CHARGE_POS_H
16#define O2_GPU_CHARGE_POS_H
17
18#include "GPUCommonDef.h"
19
20#include "clusterFinderDefs.h"
21
22namespace o2::gpu
23{
24
25#define INVALID_TIME_BIN (-GPUCF_PADDING_TIME - 1)
26
30
31 GPUdDefault() CfChargePos() = default;
32
33 constexpr GPUhdi() CfChargePos(tpccf::Row row, tpccf::Pad pad, tpccf::TPCFragmentTime t)
34 : gpad(tpcGlobalPadIdx(row, pad)), timePadded(t + GPUCF_PADDING_TIME)
35 {
36 }
37
38 GPUdi() CfChargePos(const tpccf::GlobalPad& p, const tpccf::TPCFragmentTime& t) : gpad(p), timePadded(t) {}
39
40 GPUdi() CfChargePos delta(const tpccf::Delta2& d) const
41 {
43 }
44
45 GPUdi() bool valid() const { return timePadded >= 0; }
46
47 GPUdi() tpccf::Row row() const { return gpad / TPC_CLUSTERER_ROW_STRIDE; }
48 GPUdi() tpccf::Pad pad() const { return gpad % TPC_CLUSTERER_ROW_STRIDE - GPUCF_PADDING_PAD; }
49 GPUdi() tpccf::TPCFragmentTime time() const { return timePadded - GPUCF_PADDING_TIME; }
50 GPUdi() tpccf::TPCFragmentTime globalTime() const { return timePadded; }
51
52 private:
53 // Maps the position of a pad given as row and index in that row to a unique
54 // index between 0 and TPC_NUM_OF_PADS.
55 static constexpr GPUdi() tpccf::GlobalPad tpcGlobalPadIdx(tpccf::Row row, tpccf::Pad pad)
56 {
58 }
59};
60
61inline GPUglobalconstexpr() CfChargePos INVALID_CHARGE_POS{255, 255, INVALID_TIME_BIN};
62
63} // namespace o2::gpu
64
65#endif
#define INVALID_TIME_BIN
Definition CfChargePos.h:25
int16_t time
Definition RawEventData.h:4
bool valid
#define TPC_CLUSTERER_ROW_STRIDE
#define GPUCF_PADDING_PAD
#define GPUCF_PADDING_TIME
GPUglobalconstexpr() float MaxSinPhi=0.999f
Definition CfChargePos.h:61
tpccf::GlobalPad gpad
Definition CfChargePos.h:28
constexpr GPUhdi() CfChargePos(tpccf
Definition CfChargePos.h:33
GPUdi() CfChargePos(const tpccf
Definition CfChargePos.h:38
tpccf::TPCFragmentTime timePadded
Definition CfChargePos.h:29
GPUdDefault() CfChargePos()=default
GPUdi() CfChargePos delta(const tpccf
Definition CfChargePos.h:40
std::vector< int > row