ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBTPCnv
src
TBADCRawContCnv_p1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TBTPCnv/TBADCRawContCnv_p1.h
"
6
#include "
TBEvent/TBADCRawCont.h
"
7
#include "Identifier/Identifier.h"
8
#include "
TBTPCnv/TBADCRawCont_p1.h
"
9
10
11
12
void
13
TBADCRawContCnv_p1::persToTrans
(
const
TBADCRawCont_p1
* pers,
14
TBADCRawCont
* trans, MsgStream &
/*log*/
)
const
15
{
16
17
const
unsigned
nADCRaws = pers->
m_adc
.size();
18
19
// clear the trans contained and reserve space for the new scints
20
trans->
clear
();
21
trans->
reserve
(nADCRaws);
22
23
// copy all the scints from the pers to the trans
24
for
(
unsigned
nADCRawNow=0; nADCRawNow<nADCRaws; nADCRawNow++) {
25
TBADCRaw
* ADCRaw =
new
TBADCRaw
();
26
27
// fill in the scint properties
28
ADCRaw -> setADC( pers->
m_adc
[nADCRawNow] );
29
ADCRaw -> setDetectorName( pers->
m_tbDetectorName
[nADCRawNow] );
30
ADCRaw -> setOverflow( pers->
m_overflow
[nADCRawNow] );
31
32
// fill the container with the scint object
33
trans->
push_back
(ADCRaw);
34
}
35
36
}
37
38
39
void
40
TBADCRawContCnv_p1::transToPers
(
const
TBADCRawCont
* trans,
41
TBADCRawCont_p1
* pers, MsgStream &
/*log*/
)
const
42
{
43
44
const
unsigned
nADCRaws = trans->
size
();
45
46
pers -> m_adc.reserve(nADCRaws);
47
pers -> m_tbDetectorName.reserve(nADCRaws);
48
pers -> m_overflow.reserve(nADCRaws);
49
50
// iterators for the container
51
TBADCRawCont::const_iterator
ADCRawIt = trans->
begin
();
52
TBADCRawCont::const_iterator
ADCRawIt_e = trans->
end
();
53
54
// copy all the scints from the trans to the pers
55
for
(; ADCRawIt!=ADCRawIt_e; ++ADCRawIt) {
56
const
TBADCRaw
* ADCRaw = * ADCRawIt;
57
58
pers -> m_adc.push_back( ADCRaw->
getADC
() );
59
pers -> m_tbDetectorName.push_back( ADCRaw->
getDetectorName
() );
60
pers -> m_overflow.push_back( ADCRaw->
isOverflow
() );
61
62
}
63
64
}
65
TBADCRawContCnv_p1.h
TBADCRawCont.h
TBADCRawCont_p1.h
DataVector< TBADCRaw >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::clear
void clear()
Erase all the elements in the collection.
TBADCRawContCnv_p1::transToPers
virtual void transToPers(const TBADCRawCont *trans, TBADCRawCont_p1 *pers, MsgStream &log) const override
Definition
TBADCRawContCnv_p1.cxx:40
TBADCRawContCnv_p1::persToTrans
virtual void persToTrans(const TBADCRawCont_p1 *pers, TBADCRawCont *trans, MsgStream &log) const override
Definition
TBADCRawContCnv_p1.cxx:13
TBADCRawCont_p1
Definition
TBADCRawCont_p1.h:15
TBADCRawCont_p1::m_overflow
std::vector< bool > m_overflow
Definition
TBADCRawCont_p1.h:24
TBADCRawCont_p1::m_adc
std::vector< signal_type > m_adc
Definition
TBADCRawCont_p1.h:21
TBADCRawCont_p1::m_tbDetectorName
std::vector< std::string > m_tbDetectorName
Definition
TBADCRawCont_p1.h:23
TBADCRawCont
"TBEvent/TBADCRawCont.h"
Definition
TBADCRawCont.h:20
TBADCRaw
Data object holding adc measurement.
Definition
TBADCRaw.h:21
TBADCRaw::getADC
signal_type getADC() const
Definition
TBADCRaw.h:35
TBBeamDetector::isOverflow
bool isOverflow() const
Definition
TBBeamDetector.h:65
TBBeamDetector::getDetectorName
const std::string & getDetectorName() const
Definition
TBBeamDetector.h:62
Generated on
for ATLAS Offline Software by
1.17.0