ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBTPCnv
src
TBTDCRawContCnv_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/TBTDCRawContCnv_p1.h
"
6
#include "
TBEvent/TBTDCRawCont.h
"
7
#include "Identifier/Identifier.h"
8
#include "
TBTPCnv/TBTDCRawCont_p1.h
"
9
10
11
12
void
13
TBTDCRawContCnv_p1::persToTrans
(
const
TBTDCRawCont_p1
* pers,
14
TBTDCRawCont
* trans, MsgStream &
/*log*/
)
const
15
{
16
17
const
unsigned
nTDCRaws = pers->
m_tdc
.size();
18
19
// clear the trans contained and reserve space for the new scints
20
trans->
clear
();
21
trans->
reserve
(nTDCRaws);
22
23
// copy all the scints from the pers to the trans
24
for
(
unsigned
nTDCRawNow=0; nTDCRawNow<nTDCRaws; nTDCRawNow++) {
25
TBTDCRaw
* TDCRaw =
new
TBTDCRaw
();
26
27
// fill in the scint properties
28
TDCRaw -> setTDC( pers->
m_tdc
[nTDCRawNow] );
29
TDCRaw -> setUnderThreshold( pers->
m_underThreshold
[nTDCRawNow] );
30
TDCRaw -> setDetectorName( pers->
m_tbDetectorName
[nTDCRawNow] );
31
TDCRaw -> setOverflow( pers->
m_overflow
[nTDCRawNow] );
32
33
// fill the container with the scint object
34
trans->
push_back
(TDCRaw);
35
}
36
}
37
38
39
void
40
TBTDCRawContCnv_p1::transToPers
(
const
TBTDCRawCont
* trans,
41
TBTDCRawCont_p1
* pers, MsgStream &
/*log*/
)
const
42
{
43
44
const
unsigned
nTDCRaws = trans->
size
();
45
46
pers -> m_tdc.reserve(nTDCRaws);
47
pers -> m_underThreshold.reserve(nTDCRaws);
48
pers -> m_tbDetectorName.reserve(nTDCRaws);
49
pers -> m_overflow.reserve(nTDCRaws);
50
51
// iterators for the container
52
TBTDCRawCont::const_iterator
TDCRawIt = trans->
begin
();
53
TBTDCRawCont::const_iterator
TDCRawIt_e = trans->
end
();
54
55
// copy all the scints from the trans to the pers
56
for
(; TDCRawIt!=TDCRawIt_e; ++TDCRawIt) {
57
const
TBTDCRaw
* TDCRaw = * TDCRawIt;
58
59
pers -> m_tdc.push_back( TDCRaw->
getTDC
() );
60
pers -> m_underThreshold.push_back( TDCRaw->
isUnderThreshold
() );
61
pers -> m_tbDetectorName.push_back( TDCRaw->
getDetectorName
() );
62
pers -> m_overflow.push_back( TDCRaw->
isOverflow
() );
63
64
}
65
66
}
67
TBTDCRawContCnv_p1.h
TBTDCRawCont.h
TBTDCRawCont_p1.h
DataVector< TBTDCRaw >::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.
TBBeamDetector::isOverflow
bool isOverflow() const
Definition
TBBeamDetector.h:65
TBBeamDetector::getDetectorName
const std::string & getDetectorName() const
Definition
TBBeamDetector.h:62
TBTDCRawContCnv_p1::transToPers
virtual void transToPers(const TBTDCRawCont *trans, TBTDCRawCont_p1 *pers, MsgStream &log) const override
Definition
TBTDCRawContCnv_p1.cxx:40
TBTDCRawContCnv_p1::persToTrans
virtual void persToTrans(const TBTDCRawCont_p1 *pers, TBTDCRawCont *trans, MsgStream &log) const override
Definition
TBTDCRawContCnv_p1.cxx:13
TBTDCRawCont_p1
Definition
TBTDCRawCont_p1.h:15
TBTDCRawCont_p1::m_overflow
std::vector< bool > m_overflow
Definition
TBTDCRawCont_p1.h:25
TBTDCRawCont_p1::m_tdc
std::vector< signal_type > m_tdc
Definition
TBTDCRawCont_p1.h:21
TBTDCRawCont_p1::m_underThreshold
std::vector< bool > m_underThreshold
Definition
TBTDCRawCont_p1.h:22
TBTDCRawCont_p1::m_tbDetectorName
std::vector< std::string > m_tbDetectorName
Definition
TBTDCRawCont_p1.h:24
TBTDCRawCont
"TBEvent/TBTDCRawCont.h"
Definition
TBTDCRawCont.h:21
TBTDCRaw
Data object holding tdc measurement.
Definition
TBTDCRaw.h:21
TBTDCRaw::getTDC
signal_type getTDC() const
Definition
TBTDCRaw.h:42
TBTDCRaw::isUnderThreshold
signal_type isUnderThreshold() const
Definition
TBTDCRaw.h:43
Generated on
for ATLAS Offline Software by
1.17.0