ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrTPCnv
src
TrkDetDescrUtils
BinUtilityCnv_p1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrkDetDescrUtils/BinUtility.h
"
6
#include "
TrkDetDescrUtils/BinningData.h
"
7
#include "
TrkDetDescrUtils/BinningType.h
"
8
#include "
TrkDetDescrTPCnv/TrkDetDescrUtils/BinUtilityCnv_p1.h
"
9
10
void
BinUtilityCnv_p1::persToTrans
(
const
Trk::BinUtility_p1
*persObj,
11
Trk::BinUtility
*transObj,
12
MsgStream&)
13
{
14
transObj->
clear
();
15
16
// the loop has to go over the type
17
for
(
size_t
ib = 0; ib < persObj->
type
.size(); ++ib) {
18
int
typ = persObj->
type
[ib];
19
20
// check the type
21
if
( typ ==
Trk::equidistant
)
// equidistant binning
22
(*transObj) +=
Trk::BinUtility
(
size_t
((persObj->
bins
)[ib]),
23
float
((persObj->
min
)[ib]),
24
float
((persObj->
max
)[ib]),
25
Trk::BinningOption
((persObj->
option
)[ib]),
26
Trk::BinningValue
((persObj->
binvalue
)[ib]));
27
else
if
( typ ==
Trk::biequidistant
) {
28
// biequidistant binning
29
size_t
subbins = size_t(0.5*((persObj->
bins
)[ib]-1));
30
(*transObj) +=
Trk::BinUtility
(
size_t
(subbins),
31
float
((persObj->
subStep
)[ib]),
32
float
((persObj->
min
)[ib]),
33
float
((persObj->
max
)[ib]),
34
Trk::BinningOption
((persObj->
option
)[ib]),
35
Trk::BinningValue
((persObj->
binvalue
)[ib]));
36
}
else
{
37
// arbitary
38
if
((persObj->
binvalue
)[ib] !=
Trk::binH
){
39
std::vector<float> cboundaries = (persObj->
boundaries
)[ib];
40
(*transObj) +=
Trk::BinUtility
(cboundaries,
41
Trk::BinningOption
((persObj->
option
)[ib]),
42
Trk::BinningValue
((persObj->
binvalue
)[ib]));
43
}
else
{
44
std::vector< std::pair<int,float> > chbounds = ((persObj->
hbounds
)[ib]);
45
(*transObj) +=
Trk::BinUtility
(
float
((persObj->
refphi
)[ib]),
46
chbounds);
47
}
48
}
49
}
50
}
51
52
void
BinUtilityCnv_p1::transToPers
(
const
Trk::BinUtility
*transObj,
53
Trk::BinUtility_p1
*persObj,
54
MsgStream& )
55
{
56
// loop over the BinningData and dump it into the persistent object
57
for
(
const
Trk::BinningData
& bd : transObj->
binningData
()) {
58
persObj->
type
.push_back(bd.type);
59
persObj->
option
.push_back(bd.option);
60
persObj->
binvalue
.push_back(bd.binvalue);
61
persObj->
bins
.push_back(bd.bins);
62
persObj->
min
.push_back(bd.min);
63
persObj->
max
.push_back(bd.max);
64
persObj->
step
.push_back(bd.step);
65
persObj->
subStep
.push_back(bd.subStep);
66
persObj->
boundaries
.push_back(bd.boundaries);
67
persObj->
refphi
.push_back(bd.refphi);
68
persObj->
hbounds
.push_back(bd.hbounds);
69
}
70
}
BinUtilityCnv_p1.h
BinUtility.h
BinningData.h
BinningType.h
BinUtilityCnv_p1::transToPers
virtual void transToPers(const Trk::BinUtility *transObj, Trk::BinUtility_p1 *persObj, MsgStream &log)
Definition
BinUtilityCnv_p1.cxx:52
BinUtilityCnv_p1::persToTrans
virtual void persToTrans(const Trk::BinUtility_p1 *persObj, Trk::BinUtility *transObj, MsgStream &log)
Definition
BinUtilityCnv_p1.cxx:10
Trk::BinUtility_p1
Definition
BinUtility_p1.h:19
Trk::BinUtility_p1::bins
std::vector< unsigned int > bins
Definition
BinUtility_p1.h:38
Trk::BinUtility_p1::option
std::vector< int > option
Definition
BinUtility_p1.h:36
Trk::BinUtility_p1::step
std::vector< float > step
Definition
BinUtility_p1.h:41
Trk::BinUtility_p1::hbounds
std::vector< std::vector< std::pair< int, float > > > hbounds
Definition
BinUtility_p1.h:45
Trk::BinUtility_p1::subStep
std::vector< float > subStep
Definition
BinUtility_p1.h:42
Trk::BinUtility_p1::boundaries
std::vector< std::vector< float > > boundaries
Definition
BinUtility_p1.h:43
Trk::BinUtility_p1::type
std::vector< int > type
Definition
BinUtility_p1.h:35
Trk::BinUtility_p1::min
std::vector< float > min
Definition
BinUtility_p1.h:39
Trk::BinUtility_p1::refphi
std::vector< float > refphi
Definition
BinUtility_p1.h:44
Trk::BinUtility_p1::binvalue
std::vector< int > binvalue
Definition
BinUtility_p1.h:37
Trk::BinUtility_p1::max
std::vector< float > max
Definition
BinUtility_p1.h:40
Trk::BinUtility
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
Definition
BinUtility.h:39
Trk::BinUtility::clear
void clear()
Clear the data.
Definition
BinUtility.h:246
Trk::BinUtility::binningData
const std::vector< BinningData > & binningData() const
return the binning data
Definition
BinUtility.h:123
Trk::BinningData
This class holds all the data necessary for the bin calculation.
Definition
BinningData.h:49
Trk::BinningOption
BinningOption
enum BinValue
Definition
BinningType.h:39
Trk::biequidistant
@ biequidistant
Definition
BinningType.h:33
Trk::equidistant
@ equidistant
Definition
BinningType.h:32
Trk::BinningValue
BinningValue
how to take the global / local position
Definition
BinningType.h:46
Trk::binH
@ binH
Definition
BinningType.h:53
Generated on
for ATLAS Offline Software by
1.17.0