Main Page
Namespaces
Classes
Package Documentation
DataFormats
DTDigi
src
DTDigi.cc
Go to the documentation of this file.
1
8
#include <
DataFormats/DTDigi/interface/DTDigi.h
>
9
10
11
using namespace
std
;
12
13
14
const
double
DTDigi::reso
= 25./32.;
//ns
15
16
17
DTDigi::DTDigi
(
int
wire,
int
nTDC,
int
number) :
18
theWire(wire),
19
theCounts(nTDC),
20
theNumber(number)
21
{}
22
23
24
DTDigi::DTDigi
(
int
wire
,
double
tdrift,
int
number
):
25
theWire
(wire),
26
theCounts
(static_cast<
int
>(tdrift/
reso
)),
27
theNumber
(number)
28
{}
29
30
31
// DTDigi::DTDigi (ChannelType channel, int nTDC):
32
// theWire(0),
33
// theCounts(nTDC),
34
// theNumber(0)
35
// {
36
// theNumber = channel&number_mask;
37
// theWire = (channel&wire_mask)>>wire_offset;
38
// }
39
40
41
DTDigi::DTDigi
():
42
theWire
(0),
43
theCounts
(0),
44
theNumber
(0)
45
{}
46
47
48
// Comparison
49
bool
50
DTDigi::operator ==
(
const
DTDigi
& digi)
const
{
51
if
(
theWire
!= digi.
wire
() ||
52
// theNumber != digi.number() || //FIXME required ??
53
theCounts
!= digi.
countsTDC
() )
return
false
;
54
return
true
;
55
}
56
57
// Getters
58
// DTDigi::ChannelType
59
// DTDigi::channel() const {
60
// return (theNumber & number_mask) | (theWire<<wire_offset)&wire_mask;
61
// }
62
63
double
DTDigi::time
()
const
{
return
theCounts
*
reso
; }
64
65
uint32_t
DTDigi::countsTDC
()
const
{
return
theCounts
; }
66
67
int
DTDigi::wire
()
const
{
return
theWire
; }
68
69
int
DTDigi::number
()
const
{
return
theNumber
; }
70
71
// Setters
72
73
void
DTDigi::setTime
(
double
time
){
74
theCounts
=
static_cast<
int
>
(time/
reso
);
75
}
76
77
void
DTDigi::setCountsTDC
(
int
nTDC) {
78
if
(nTDC<0)
cout
<<
"WARNING: DTDigi::setCountsTDC: negative TDC count not supported "
79
<< nTDC << endl;
80
theCounts
= nTDC;
81
}
82
83
84
// Debug
85
86
void
87
DTDigi::print
()
const
{
88
cout
<<
"Wire "
<<
wire
()
89
<<
" Digi # "
<<
number
()
90
<<
" Drift time (ns) "
<<
time
() << endl;
91
}
92
DTDigi::theCounts
uint32_t theCounts
Definition:
DTDigi.h:76
DTDigi::theNumber
uint16_t theNumber
Definition:
DTDigi.h:77
DTDigi::print
void print() const
Print content of digi.
Definition:
DTDigi.cc:87
DTDigi::operator==
bool operator==(const DTDigi &digi) const
Digis are equal if they are on the same cell and have same TDC count.
Definition:
DTDigi.cc:50
std
Definition:
JetResolutionObject.h:80
DTDigi::wire
int wire() const
Return wire number.
Definition:
DTDigi.cc:67
DTDigi::setCountsTDC
void setCountsTDC(int nTDC)
Set with a TDC count.
Definition:
DTDigi.cc:77
DTDigi::theWire
uint16_t theWire
Definition:
DTDigi.h:75
DTDigi::time
double time() const
Get time in ns.
Definition:
DTDigi.cc:63
createfilelist.int
int
Definition:
createfilelist.py:10
DTDigi::DTDigi
DTDigi()
Default construction.
Definition:
DTDigi.cc:41
DTDigi
Definition:
DTDigi.h:17
DTDigi::countsTDC
uint32_t countsTDC() const
Get raw TDC count.
Definition:
DTDigi.cc:65
DTDigi::reso
static const double reso
Definition:
DTDigi.h:68
DTDigi::setTime
void setTime(double time)
Set with a time in ns.
Definition:
DTDigi.cc:73
DTDigi::number
int number() const
Identifies different digis within the same.
Definition:
DTDigi.cc:69
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DTDigi.h
Generated for CMSSW Reference Manual by
1.8.11