Project
Loading...
Searching...
No Matches
Cluster.cxx
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
16#include <fairlogger/Logger.h>
17
18#include <TString.h>
19
20#include <cstdlib>
21
22using namespace o2::tof;
23
25
26Cluster::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)
27{
28
29 // caching R and phi
30 mR = o2::gpu::CAMath::Sqrt(x * x + y * y);
31 mPhi = o2::gpu::CAMath::ATan2(y, x);
32}
33//______________________________________________________________________
34int Cluster::getNumOfContributingChannels() const
35{
36 //
37 // returning how many hits contribute to this cluster
38 //
39 int nContributingChannels = 1;
40
42 nContributingChannels++;
43 }
45 nContributingChannels++;
46 }
48 nContributingChannels++;
49 }
51 nContributingChannels++;
52 }
54 nContributingChannels++;
55 }
57 nContributingChannels++;
58 }
60 nContributingChannels++;
61 }
63 nContributingChannels++;
64 }
65
66 return nContributingChannels;
67}
68
69//______________________________________________________________________
70std::ostream& operator<<(std::ostream& os, Cluster& c)
71{
73 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";
74 return os;
75}
76
77//______________________________________________________________________
78void Cluster::setDigitInfo(int idig, int ch, double t, float tot)
79{
80 mDigitInfoCh[idig] = ch;
81 mDigitInfoT[idig] = t;
82 mDigitInfoTOT[idig] = tot;
83}
Definition of the TOF cluster.
ClassImp(o2::tof::Cluster)
int16_t time
Definition RawEventData.h:4
uint32_t c
Definition RawData.h:2
Cluster class for TOF.
Definition Cluster.h:37
bool isAdditionalChannelSet(int bit) const
Definition Cluster.h:120
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition glcorearb.h:5034
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::ostream & operator<<(std::ostream &os, Cluster &c)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...