Project
Loading...
Searching...
No Matches
Digit.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
12
#include "
TOFBase/Digit.h
"
13
14
#include <iostream>
15
16
using namespace
o2::tof
;
17
18
ClassImp
(
o2::tof::Digit
);
19
20
Digit::Digit
(Int_t channel, Int_t tdc, Int_t tot, uint64_t
bc
, Int_t
label
, uint32_t triggerorbit,
uint16_t
triggerbunch,
float
geanttime,
double
t0
)
21
: mChannel(channel), mTDC(tdc), mTOT(tot), mIR(0, 0), mLabel(
label
), mTriggerOrbit(triggerorbit), mTriggerBunch(triggerbunch), mIsUsedInCluster(kFALSE), mTgeant(geanttime), mT0true(
t0
)
22
{
23
mIR.
setFromLong
(
bc
);
24
}
25
//______________________________________________________________________
26
Digit::Digit
(Int_t channel, Int_t tdc, Int_t tot, uint32_t
orbit
,
uint16_t
bc
, Int_t
label
, uint32_t triggerorbit,
uint16_t
triggerbunch,
float
geanttime,
double
t0
)
27
: mChannel(channel), mTDC(tdc), mTOT(tot), mIR(
bc
,
orbit
), mLabel(
label
), mTriggerOrbit(triggerorbit), mTriggerBunch(triggerbunch), mIsUsedInCluster(kFALSE), mTgeant(geanttime), mT0true(
t0
)
28
{
29
}
30
//______________________________________________________________________
31
32
void
Digit::printStream
(std::ostream&
stream
)
const
33
{
34
stream
<<
"TOF Digit: Channel "
<< mChannel <<
" TDC "
<< mTDC <<
" TOT "
<< mTOT <<
"Bunch Crossing index"
<< mIR.
toLong
() <<
" Label "
<< mLabel <<
"\n"
;
35
}
36
37
//______________________________________________________________________
38
39
std::ostream&
operator<<
(std::ostream&
stream
,
const
Digit
& digi)
40
{
41
digi.
printStream
(
stream
);
42
return
stream
;
43
}
44
45
//______________________________________________________________________
46
47
bool
Digit::merge
(Int_t tdc, Int_t tot)
48
{
49
50
// merging two digits
51
52
if
(tdc < mTDC) {
53
mTDC = tdc;
54
return
1;
// new came first
55
// TODO: adjust TOT
56
}
else
{
57
// TODO: adjust TOT
58
return
0;
59
}
60
}
61
62
//______________________________________________________________________
63
64
void
Digit::getPhiAndEtaIndex
(
int
& phi,
int
& eta)
const
65
{
66
67
// method that returns the index in phi and eta of the digit
68
69
int
chan;
70
int
detId[5];
71
chan =
getChannel
();
// note that inside the strip the digits are ordered per channel number
72
Geo::getVolumeIndices
(chan, detId);
// Get volume index from channel index
73
eta = detId[2]
/*strip*/
* 2 + detId[3]
/*pad Z*/
;
74
if
(detId[1]
/*module*/
== 0) {
75
eta += 0;
76
}
else
if
(detId[1] == 1) {
77
eta += 38;
78
}
else
if
(detId[1] == 2) {
79
eta += 76;
80
}
else
if
(detId[1] == 3) {
81
eta += 106;
82
}
else
if
(detId[1] == 4) {
83
eta += 144;
84
}
85
phi = detId[0]
/*phi sector*/
* 48 + detId[4]
/*pad x*/
;
86
87
return
;
88
}
Digit.h
ClassImp
ClassImp(o2::tof::Digit)
orbit
uint64_t orbit
Definition
RawEventData.h:6
bc
uint64_t bc
Definition
RawEventData.h:5
uint16_t
unsigned short int uint16_t
Definition
FairRunIdGenerator.h:15
o2::tof::Digit
TOF digit implementation.
Definition
Digit.h:31
o2::tof::Digit::printStream
void printStream(std::ostream &stream) const
Definition
Digit.cxx:32
o2::tof::Digit::getChannel
Int_t getChannel() const
Definition
Digit.h:49
o2::tof::Digit::Digit
Digit()=default
o2::tof::Digit::merge
bool merge(Int_t tdc, Int_t tot)
Definition
Digit.cxx:47
o2::tof::Digit::getPhiAndEtaIndex
void getPhiAndEtaIndex(int &phi, int &eta) const
Definition
Digit.cxx:64
o2::tof::Geo::getVolumeIndices
static void getVolumeIndices(Int_t index, Int_t *detId)
Definition
Geo.cxx:543
label
GLuint GLsizei const GLchar * label
Definition
glcorearb.h:2519
t0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition
glcorearb.h:5034
stream
GLuint GLuint stream
Definition
glcorearb.h:1806
o2::tof
Definition
SimTraits.h:132
o2::tof::operator<<
std::ostream & operator<<(std::ostream &os, Cluster &c)
o2::InteractionRecord::toLong
int64_t toLong() const
Definition
InteractionRecord.h:116
o2::InteractionRecord::setFromLong
void setFromLong(int64_t l)
Definition
InteractionRecord.h:122
Detectors
TOF
base
src
Digit.cxx
Generated on Tue Nov 17 2026 08:58:34 for Project by
1.9.8