ATLAS Offline Software
Loading...
Searching...
No Matches
TBBPCRaw.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 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 <vector>
29
30
31
33{
34 public:
35
37 typedef std::vector< ElementLink<TBTDCRawCont> > tdc_store_type;
38 typedef tdc_store_type::const_iterator tdc_store_iterator;
39
41 typedef std::vector< ElementLink<TBADCRawCont> > adc_store_type;
42 typedef adc_store_type::const_iterator adc_store_iterator;
43
51
53 // Constructors and Destructor //
55
56 TBBPCRaw();
57
59
60 TBBPCRaw(const std::string& thisBPCName) : TBBeamDetector(thisBPCName)
61 {}
62
63 TBBPCRaw(const std::string& thisBPCName,
64 const TBTDCRawCont* theTDCCont,
65 const std::vector<const TBTDCRaw*>& theTDCs,
66 const TBADCRawCont* theADCCont,
67 const std::vector<const TBADCRaw*>& theADCs);
68
69 ~TBBPCRaw();
70
72 // Data Access //
74 void setSignals(const TBTDCRawCont* theTDCCont,
75 const std::vector<const TBTDCRaw*>& theTDCs,
76 const TBADCRawCont* theADCCont,
77 const std::vector<const TBADCRaw*>& theADCs);
78
84
88
89 // access overflow
90 virtual bool isOverflow() const;
91 virtual bool isOverflow(SignalSource theSource) const;
92
93 // iterator on time measurements
96 SignalSource getSignalSource(tdc_store_iterator& theTDCIterator) const;
97
98 // iterator on amplitude mesaurement
101 SignalSource getSignalSource(adc_store_iterator& theADCIterator) const;
102
103 private:
104
106 // Private Data //
108
111
113 // Private Functions //
115
116/* template<typename T> */
117/* size_t findIndex(const T& theStore,T::const_iterator& theIterator) */
118/* { */
119/* T::const_iterator firstInStore = theStore.begin(); */
120/* T::const_iterator lastInStore = theStore.end(); */
121/* size_t theIndex = 0; */
122/* while ( firstInStore != theIterator && firstInStore != lastInStore ) */
123/* { */
124/* theIndex++; */
125/* firstInStore++; */
126/* } */
127/* if ( firstInStore == lastInStore ) theIndex = size_t(-1); */
128/* return theIndex; */
129/* } */
130
131
132 size_t findIndex( const tdc_store_type& theStore,tdc_store_iterator& theIterator) const
133 {
134 tdc_store_type::const_iterator firstInStore = theStore.begin();
135 tdc_store_type::const_iterator lastInStore = theStore.end();
136 size_t theIndex = 0;
137 while ( firstInStore != theIterator && firstInStore != lastInStore )
138 {
139 ++theIndex;
140 ++firstInStore;
141 }
142 if ( firstInStore == lastInStore ) theIndex = size_t(-1);
143 return theIndex;
144 }
145 size_t findIndex(const adc_store_type& theStore,adc_store_type::const_iterator& theIterator) const
146 {
147 adc_store_type::const_iterator firstInStore = theStore.begin();
148 adc_store_type::const_iterator lastInStore = theStore.end();
149 size_t theIndex = 0;
150 while ( firstInStore != theIterator && firstInStore != lastInStore )
151 {
152 ++theIndex;
153 ++firstInStore;
154 }
155 if ( firstInStore == lastInStore ) theIndex = size_t(-1);
156 return theIndex;
157 }
158
159};
160
162// Inline Functions //
164
165// global overflow
166inline bool TBBPCRaw::isOverflow() const
167{
168 return m_overflow;
169}
170
171// specific signals
176
181
186
191
196
201
202// iterators
204{
205 return m_tdcSignals.begin();
206}
208{
209 return m_tdcSignals.end();
210}
212{
213 return m_adcSignals.begin();
214}
216{
217 return m_adcSignals.end();
218}
219#endif
"TBEvent/TBADCRawCont.h"
unsigned int signal_type
Definition TBADCRaw.h:24
adc_store_iterator adc_begin() const
Definition TBBPCRaw.h:211
@ tdcLeft
Definition TBBPCRaw.h:44
@ unknown
Definition TBBPCRaw.h:50
@ tdcDown
Definition TBBPCRaw.h:47
@ adcVertical
Definition TBBPCRaw.h:49
@ tdcRight
Definition TBBPCRaw.h:45
@ adcHorizontal
Definition TBBPCRaw.h:48
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:145
TBBPCRaw(const std::string &thisBPCName)
standard constructor
Definition TBBPCRaw.h:60
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:132
tdc_signal_type getTDCUp() const
Definition TBBPCRaw.h:182
adc_store_type m_adcSignals
Definition TBBPCRaw.h:110
virtual bool isOverflow() const
Definition TBBPCRaw.h:166
std::vector< ElementLink< TBADCRawCont > > adc_store_type
Definition TBBPCRaw.h:41
adc_store_iterator adc_end() const
Definition TBBPCRaw.h:215
tdc_signal_type getTDCDown() const
Definition TBBPCRaw.h:187
tdc_signal_type getTDCRight() const
Definition TBBPCRaw.h:177
tdc_store_iterator tdc_end() const
Definition TBBPCRaw.h:207
tdc_store_type::const_iterator tdc_store_iterator
Definition TBBPCRaw.h:38
tdc_store_type m_tdcSignals
Definition TBBPCRaw.h:109
std::vector< ElementLink< TBTDCRawCont > > tdc_store_type
Definition TBBPCRaw.h:37
TBADCRaw::signal_type adc_signal_type
Definition TBBPCRaw.h:40
tdc_signal_type getTDCLeft() const
Definition TBBPCRaw.h:172
TBTDCRaw::signal_type tdc_signal_type
Definition TBBPCRaw.h:36
tdc_store_iterator tdc_begin() const
Definition TBBPCRaw.h:203
adc_signal_type getADCHorizontal() const
Definition TBBPCRaw.h:192
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:42
adc_signal_type getADCVertical() const
Definition TBBPCRaw.h:197
bool m_overflow
Detector Name.
"TBEvent/TBTDCRawCont.h"
unsigned int signal_type
Definition TBTDCRaw.h:24