ATLAS Offline Software
Loading...
Searching...
No Matches
TBBPCRaw.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TBEVENT_TBBPCRAW_H
6#define TBEVENT_TBBPCRAW_H
19
21
24
25#include "AthLinks/ElementLink.h"
26
27#include <string>
28#include <string_view>
29#include <vector>
30
31
32
34{
35 public:
36
38 typedef std::vector< ElementLink<TBTDCRawCont> > tdc_store_type;
39 typedef tdc_store_type::const_iterator tdc_store_iterator;
40
42 typedef std::vector< ElementLink<TBADCRawCont> > adc_store_type;
43 typedef adc_store_type::const_iterator adc_store_iterator;
44
52
54 // Constructors and Destructor //
56
57 TBBPCRaw();
58
60
61 TBBPCRaw(std::string_view thisBPCName) : TBBeamDetector(thisBPCName)
62 {}
63
64 TBBPCRaw(std::string_view thisBPCName,
65 const TBTDCRawCont* theTDCCont,
66 const std::vector<const TBTDCRaw*>& theTDCs,
67 const TBADCRawCont* theADCCont,
68 const std::vector<const TBADCRaw*>& theADCs);
69
70 ~TBBPCRaw();
71
73 // Data Access //
75 void setSignals(const TBTDCRawCont* theTDCCont,
76 const std::vector<const TBTDCRaw*>& theTDCs,
77 const TBADCRawCont* theADCCont,
78 const std::vector<const TBADCRaw*>& theADCs);
79
85
89
90 // access overflow
91 virtual bool isOverflow() const;
92 virtual bool isOverflow(SignalSource theSource) const;
93
94 // iterator on time measurements
97 SignalSource getSignalSource(tdc_store_iterator& theTDCIterator) const;
98
99 // iterator on amplitude mesaurement
102 SignalSource getSignalSource(adc_store_iterator& theADCIterator) const;
103
104 private:
105
107 // Private Data //
109
112
114 // Private Functions //
116
117/* template<typename T> */
118/* size_t findIndex(const T& theStore,T::const_iterator& theIterator) */
119/* { */
120/* T::const_iterator firstInStore = theStore.begin(); */
121/* T::const_iterator lastInStore = theStore.end(); */
122/* size_t theIndex = 0; */
123/* while ( firstInStore != theIterator && firstInStore != lastInStore ) */
124/* { */
125/* theIndex++; */
126/* firstInStore++; */
127/* } */
128/* if ( firstInStore == lastInStore ) theIndex = size_t(-1); */
129/* return theIndex; */
130/* } */
131
132
133 size_t findIndex( const tdc_store_type& theStore,tdc_store_iterator& theIterator) const
134 {
135 tdc_store_type::const_iterator firstInStore = theStore.begin();
136 tdc_store_type::const_iterator lastInStore = theStore.end();
137 size_t theIndex = 0;
138 while ( firstInStore != theIterator && firstInStore != lastInStore )
139 {
140 ++theIndex;
141 ++firstInStore;
142 }
143 if ( firstInStore == lastInStore ) theIndex = size_t(-1);
144 return theIndex;
145 }
146 size_t findIndex(const adc_store_type& theStore,adc_store_type::const_iterator& theIterator) const
147 {
148 adc_store_type::const_iterator firstInStore = theStore.begin();
149 adc_store_type::const_iterator lastInStore = theStore.end();
150 size_t theIndex = 0;
151 while ( firstInStore != theIterator && firstInStore != lastInStore )
152 {
153 ++theIndex;
154 ++firstInStore;
155 }
156 if ( firstInStore == lastInStore ) theIndex = size_t(-1);
157 return theIndex;
158 }
159
160};
161
163// Inline Functions //
165
166// global overflow
167inline bool TBBPCRaw::isOverflow() const
168{
169 return m_overflow;
170}
171
172// specific signals
177
182
187
192
197
202
203// iterators
205{
206 return m_tdcSignals.begin();
207}
209{
210 return m_tdcSignals.end();
211}
213{
214 return m_adcSignals.begin();
215}
217{
218 return m_adcSignals.end();
219}
220#endif
"TBEvent/TBADCRawCont.h"
unsigned int signal_type
Definition TBADCRaw.h:24
adc_store_iterator adc_begin() const
Definition TBBPCRaw.h:212
@ tdcLeft
Definition TBBPCRaw.h:45
@ unknown
Definition TBBPCRaw.h:51
@ tdcDown
Definition TBBPCRaw.h:48
@ adcVertical
Definition TBBPCRaw.h:50
@ tdcRight
Definition TBBPCRaw.h:46
@ adcHorizontal
Definition TBBPCRaw.h:49
SignalSource getSignalSource(tdc_store_iterator &theTDCIterator) const
Definition TBBPCRaw.cxx:144
size_t findIndex(const adc_store_type &theStore, adc_store_type::const_iterator &theIterator) const
Definition TBBPCRaw.h:146
tdc_signal_type getTDCSignal(SignalSource theSource) const
Definition TBBPCRaw.cxx:100
adc_signal_type getADCSignal(SignalSource theSource) const
Definition TBBPCRaw.cxx:123
size_t findIndex(const tdc_store_type &theStore, tdc_store_iterator &theIterator) const
Definition TBBPCRaw.h:133
tdc_signal_type getTDCUp() const
Definition TBBPCRaw.h:183
adc_store_type m_adcSignals
Definition TBBPCRaw.h:111
virtual bool isOverflow() const
Definition TBBPCRaw.h:167
std::vector< ElementLink< TBADCRawCont > > adc_store_type
Definition TBBPCRaw.h:42
adc_store_iterator adc_end() const
Definition TBBPCRaw.h:216
tdc_signal_type getTDCDown() const
Definition TBBPCRaw.h:188
tdc_signal_type getTDCRight() const
Definition TBBPCRaw.h:178
tdc_store_iterator tdc_end() const
Definition TBBPCRaw.h:208
tdc_store_type::const_iterator tdc_store_iterator
Definition TBBPCRaw.h:39
TBBPCRaw(std::string_view thisBPCName)
standard constructor
Definition TBBPCRaw.h:61
tdc_store_type m_tdcSignals
Definition TBBPCRaw.h:110
std::vector< ElementLink< TBTDCRawCont > > tdc_store_type
Definition TBBPCRaw.h:38
TBADCRaw::signal_type adc_signal_type
Definition TBBPCRaw.h:41
tdc_signal_type getTDCLeft() const
Definition TBBPCRaw.h:173
TBTDCRaw::signal_type tdc_signal_type
Definition TBBPCRaw.h:37
tdc_store_iterator tdc_begin() const
Definition TBBPCRaw.h:204
adc_signal_type getADCHorizontal() const
Definition TBBPCRaw.h:193
void setSignals(const TBTDCRawCont *theTDCCont, const std::vector< const TBTDCRaw * > &theTDCs, const TBADCRawCont *theADCCont, const std::vector< const TBADCRaw * > &theADCs)
Definition TBBPCRaw.cxx:35
adc_store_type::const_iterator adc_store_iterator
Definition TBBPCRaw.h:43
adc_signal_type getADCVertical() const
Definition TBBPCRaw.h:198
bool m_overflow
Detector Name.
"TBEvent/TBTDCRawCont.h"
unsigned int signal_type
Definition TBTDCRaw.h:24