ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBEvent
src
TBBPCRaw.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "AthLinks/ElementLink.h"
7
8
#include "
TBEvent/TBBeamDetector.h
"
9
#include "
TBEvent/TBADCRaw.h
"
10
#include "
TBEvent/TBADCRawCont.h
"
11
#include "
TBEvent/TBTDCRaw.h
"
12
#include "
TBEvent/TBTDCRawCont.h
"
13
#include "
TBEvent/TBBPCRaw.h
"
14
15
#include <string>
16
#include <list>
17
19
// Constructors and Destructors //
21
22
TBBPCRaw::TBBPCRaw
() :
TBBeamDetector
()
23
{ }
24
25
TBBPCRaw::TBBPCRaw
(std::string_view thisBPCName,
26
const
TBTDCRawCont
* theTDCCont,
27
const
std::vector<const TBTDCRaw*>& theTDCs,
28
const
TBADCRawCont
* theADCCont,
29
const
std::vector<const TBADCRaw*>& theADCs)
30
:
TBBeamDetector
(thisBPCName)
31
{
32
setSignals
(theTDCCont,theTDCs,theADCCont,theADCs);
33
}
34
35
void
TBBPCRaw::setSignals
(
const
TBTDCRawCont
* theTDCCont,
36
const
std::vector<const TBTDCRaw*>& theTDCs,
37
const
TBADCRawCont
* theADCCont,
38
const
std::vector<const TBADCRaw*>& theADCs)
39
{
40
// store TDC measurement
41
for
(
const
TBTDCRaw
* tdc : theTDCs)
42
{
43
ElementLink<TBTDCRawCont>
theLink;
44
// const TBTDCRaw* tbtdc= tdc;
45
theLink.
toContainedElement
(*theTDCCont,tdc);
46
m_tdcSignals
.push_back(theLink);
47
m_overflow
=
m_overflow
|| tdc->isOverflow();
48
}
49
50
// store ADC measurement
51
for
(
const
TBADCRaw
* adc : theADCs)
52
{
53
ElementLink<TBADCRawCont>
theLink;
54
theLink.
toContainedElement
(*theADCCont,adc);
55
m_adcSignals
.push_back(theLink);
56
m_overflow
=
m_overflow
|| adc->isOverflow();
57
}
58
}
59
60
TBBPCRaw::~TBBPCRaw
()
61
{ }
62
64
// Data Access //
66
67
// specific overflow condition
68
bool
TBBPCRaw::isOverflow
(
SignalSource
theSource)
const
69
{
70
bool
test;
71
switch
( theSource )
72
{
73
case
TBBPCRaw::tdcLeft
:
74
case
TBBPCRaw::tdcRight
:
75
case
TBBPCRaw::tdcUp
:
76
case
TBBPCRaw::tdcDown
:
77
{
78
size_t
theIndex = (size_t)theSource;
79
const
TBTDCRaw
* theTDC = (*
m_tdcSignals
[theIndex]);
80
test = theTDC->
isOverflow
();
81
}
82
break
;
83
case
TBBPCRaw::adcHorizontal
:
84
case
TBBPCRaw::adcVertical
:
85
{
86
size_t
theIndex = (size_t)theSource - (
size_t
)
TBBPCRaw::adcHorizontal
;
87
const
TBADCRaw
* theADC = (*
m_adcSignals
[theIndex]);
88
test = theADC->
isOverflow
();
89
}
90
break
;
91
default
:
92
test =
false
;
93
break
;
94
}
95
return
test;
96
}
97
98
// TDC data
99
TBBPCRaw::tdc_signal_type
100
TBBPCRaw::getTDCSignal
(
TBBPCRaw::SignalSource
theSource)
const
101
{
102
tdc_signal_type
theSignal;
103
switch
( theSource )
104
{
105
case
TBBPCRaw::tdcLeft
:
106
case
TBBPCRaw::tdcRight
:
107
case
TBBPCRaw::tdcUp
:
108
case
TBBPCRaw::tdcDown
:
109
{
110
size_t
theIndex = (size_t)theSource;
111
theSignal = (*(*
m_tdcSignals
[theIndex])).
getTDC
();
112
}
113
break
;
114
default
:
115
theSignal = 0;
116
break
;
117
}
118
return
theSignal;
119
}
120
121
// ADC data
122
TBBPCRaw::adc_signal_type
123
TBBPCRaw::getADCSignal
(
TBBPCRaw::SignalSource
theSource)
const
124
{
125
adc_signal_type
theSignal;
126
switch
( theSource )
127
{
128
case
TBBPCRaw::adcHorizontal
:
129
case
TBBPCRaw::adcVertical
:
130
{
131
size_t
theIndex = (size_t)theSource - (
size_t
)
TBBPCRaw::adcHorizontal
;
132
theSignal = (*(*
m_adcSignals
[theIndex])).
getADC
();
133
}
134
break
;
135
default
:
136
theSignal = 0;
137
break
;
138
}
139
return
theSignal;
140
}
141
142
// signal source from iterators
143
TBBPCRaw::SignalSource
144
TBBPCRaw::getSignalSource
(
TBBPCRaw::tdc_store_iterator
& theIterator)
const
145
{
146
size_t
theIndex = this->
findIndex
(
m_tdcSignals
,theIterator);
147
SignalSource
theSource;
148
switch
( theIndex )
149
{
150
case
0:
151
theSource =
TBBPCRaw::tdcLeft
;
152
break
;
153
case
1:
154
theSource =
TBBPCRaw::tdcRight
;
155
break
;
156
case
2:
157
theSource =
TBBPCRaw::tdcUp
;
158
break
;
159
case
3:
160
theSource =
TBBPCRaw::tdcDown
;
161
break
;
162
default
:
163
theSource =
TBBPCRaw::unknown
;
164
break
;
165
}
166
return
theSource;
167
}
168
169
TBBPCRaw::SignalSource
170
TBBPCRaw::getSignalSource
(
adc_store_iterator
& theIterator)
const
171
{
172
size_t
theIndex = this->
findIndex
(
m_adcSignals
,theIterator);
173
SignalSource
theSource;
174
switch
( theIndex )
175
{
176
case
0:
177
theSource =
TBBPCRaw::adcHorizontal
;
178
break
;
179
case
1 :
180
theSource =
TBBPCRaw::adcVertical
;
181
break
;
182
default
:
183
theSource =
TBBPCRaw::unknown
;
184
break
;
185
}
186
return
theSource;
187
}
188
getTDC
float getTDC(const AFP_SiDigi &digi)
Definition
AFP_SiDigi.h:25
getADC
float getADC(const AFP_SiDigi &digi)
Definition
AFP_SiDigi.h:29
TBADCRawCont.h
TBADCRaw.h
TBBPCRaw.h
TBBeamDetector.h
TBTDCRawCont.h
TBTDCRaw.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
ElementLink::toContainedElement
bool toContainedElement(BaseConstReference container, ElementType element)
Set link to point to given element (slowest).
TBADCRawCont
"TBEvent/TBADCRawCont.h"
Definition
TBADCRawCont.h:20
TBADCRaw
Data object holding adc measurement.
Definition
TBADCRaw.h:21
TBBPCRaw::SignalSource
SignalSource
Definition
TBBPCRaw.h:45
TBBPCRaw::tdcLeft
@ tdcLeft
Definition
TBBPCRaw.h:45
TBBPCRaw::unknown
@ unknown
Definition
TBBPCRaw.h:51
TBBPCRaw::tdcDown
@ tdcDown
Definition
TBBPCRaw.h:48
TBBPCRaw::adcVertical
@ adcVertical
Definition
TBBPCRaw.h:50
TBBPCRaw::tdcUp
@ tdcUp
Definition
TBBPCRaw.h:47
TBBPCRaw::tdcRight
@ tdcRight
Definition
TBBPCRaw.h:46
TBBPCRaw::adcHorizontal
@ adcHorizontal
Definition
TBBPCRaw.h:49
TBBPCRaw::getSignalSource
SignalSource getSignalSource(tdc_store_iterator &theTDCIterator) const
Definition
TBBPCRaw.cxx:144
TBBPCRaw::getTDCSignal
tdc_signal_type getTDCSignal(SignalSource theSource) const
Definition
TBBPCRaw.cxx:100
TBBPCRaw::getADCSignal
adc_signal_type getADCSignal(SignalSource theSource) const
Definition
TBBPCRaw.cxx:123
TBBPCRaw::findIndex
size_t findIndex(const tdc_store_type &theStore, tdc_store_iterator &theIterator) const
Definition
TBBPCRaw.h:133
TBBPCRaw::m_adcSignals
adc_store_type m_adcSignals
Definition
TBBPCRaw.h:111
TBBPCRaw::isOverflow
virtual bool isOverflow() const
Definition
TBBPCRaw.h:167
TBBPCRaw::~TBBPCRaw
~TBBPCRaw()
Definition
TBBPCRaw.cxx:60
TBBPCRaw::TBBPCRaw
TBBPCRaw()
Definition
TBBPCRaw.cxx:22
TBBPCRaw::tdc_store_iterator
tdc_store_type::const_iterator tdc_store_iterator
Definition
TBBPCRaw.h:39
TBBPCRaw::m_tdcSignals
tdc_store_type m_tdcSignals
Definition
TBBPCRaw.h:110
TBBPCRaw::adc_signal_type
TBADCRaw::signal_type adc_signal_type
Definition
TBBPCRaw.h:41
TBBPCRaw::tdc_signal_type
TBTDCRaw::signal_type tdc_signal_type
Definition
TBBPCRaw.h:37
TBBPCRaw::setSignals
void setSignals(const TBTDCRawCont *theTDCCont, const std::vector< const TBTDCRaw * > &theTDCs, const TBADCRawCont *theADCCont, const std::vector< const TBADCRaw * > &theADCs)
Definition
TBBPCRaw.cxx:35
TBBPCRaw::adc_store_iterator
adc_store_type::const_iterator adc_store_iterator
Definition
TBBPCRaw.h:43
TBBeamDetector::isOverflow
bool isOverflow() const
Definition
TBBeamDetector.h:65
TBBeamDetector::m_overflow
bool m_overflow
Detector Name.
Definition
TBBeamDetector.h:82
TBBeamDetector::TBBeamDetector
TBBeamDetector()
Definition
TBBeamDetector.h:24
TBTDCRawCont
"TBEvent/TBTDCRawCont.h"
Definition
TBTDCRawCont.h:21
TBTDCRaw
Data object holding tdc measurement.
Definition
TBTDCRaw.h:21
Generated on
for ATLAS Offline Software by
1.17.0