forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCluster.cxx
More file actions
83 lines (71 loc) · 2.84 KB
/
Cluster.cxx
File metadata and controls
83 lines (71 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// 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.
/// \file Cluster.cxx
/// \brief Implementation of the TOF cluster
#include "DataFormatsTOF/Cluster.h"
#include <fairlogger/Logger.h>
#include <TString.h>
#include <cstdlib>
using namespace o2::tof;
ClassImp(o2::tof::Cluster);
Cluster::Cluster(std::int16_t sensid, float x, float y, float z, float sy2, float sz2, float syz, double timeRaw, double time, float tot, int L0L1Latency, int deltaBC, float geanttime, double t0) : o2::BaseCluster<float>(sensid, x, y, z, sy2, sz2, syz), mTimeRaw(timeRaw), mTime(time), mTot(tot), mL0L1Latency(L0L1Latency), mDeltaBC(deltaBC), mTgeant(geanttime), mT0true(t0)
{
// caching R and phi
mR = o2::gpu::CAMath::Sqrt(x * x + y * y);
mPhi = o2::gpu::CAMath::ATan2(y, x);
}
//______________________________________________________________________
int Cluster::getNumOfContributingChannels() const
{
//
// returning how many hits contribute to this cluster
//
int nContributingChannels = 1;
if (isAdditionalChannelSet(kUpLeft)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kUp)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kUpRight)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kRight)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kDownRight)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kDown)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kDownLeft)) {
nContributingChannels++;
}
if (isAdditionalChannelSet(kLeft)) {
nContributingChannels++;
}
return nContributingChannels;
}
//______________________________________________________________________
std::ostream& operator<<(std::ostream& os, Cluster& c)
{
os << (o2::BaseCluster<float>&)c;
os << " TOF cluster: raw time = " << std::scientific << c.getTimeRaw() << ", time = " << std::scientific << c.getTime() << ", Tot = " << std::scientific << c.getTot() << ", L0L1Latency = " << c.getL0L1Latency() << ", deltaBC = " << c.getDeltaBC() << ", R = " << c.getR() << ", mPhi = " << c.getPhi() << ", Number of contributingChannels = " << c.getNumOfContributingChannels() << "\n";
return os;
}
//______________________________________________________________________
void Cluster::setDigitInfo(int idig, int ch, double t, float tot)
{
mDigitInfoCh[idig] = ch;
mDigitInfoT[idig] = t;
mDigitInfoTOT[idig] = tot;
}