ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecTPCnv
src
CaloEnergyCnv_p1.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// CaloEnergyCnv_p1.cxx
8
// Implementation file for class CaloEnergyCnv_p1
9
// Author: S.Binet<binet@cern.ch>
11
12
13
// STL includes
14
15
// AthenaPoolCnvSvc includes
16
#include "
AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h
"
17
18
// muonEvent includes
19
#include "
muonEvent/DepositInCalo.h
"
20
#include "
muonEvent/CaloEnergy.h
"
21
22
// RecTPCnv includes
23
#include "
TrkEventTPCnv/TrkMaterialOnTrack/EnergyLossCnv_p1.h
"
24
#include "
TrkEventTPCnv/TrkMaterialOnTrack/EnergyLoss_p1.h
"
25
#include "
RecTPCnv/DepositInCaloCnv_p1.h
"
26
#include "
RecTPCnv/CaloEnergyCnv_p1.h
"
27
28
// pre-allocate converters
29
static
const
EnergyLossCnv_p1
energyLossCnv
;
30
31
// pre-allocate converters
32
static
const
DepositInCaloCnv_p1
depositCnv
;
33
35
// Non-Const methods:
37
38
void
CaloEnergyCnv_p1::persToTrans
(
const
CaloEnergy_p1
* pers,
39
CaloEnergy
* trans,
40
MsgStream&
msg
)
const
41
{
42
// msg << MSG::DEBUG << "Loading CaloEnergy from persistent state..."
43
// << endmsg;
44
Trk::EnergyLoss_p1
energyLoss;
45
energyLoss.
m_deltaE
= pers->
m_energyDeposit
;
46
energyLoss.
m_sigmaMinusDeltaE
= pers->
m_energySigmaMinus
;
47
energyLoss.
m_sigmaPlusDeltaE
= pers->
m_energySigmaPlus
;
48
49
//Trk :: EnergyLoss * transObject = trans;
50
energyLossCnv
.persToTrans( &energyLoss,
51
trans,
52
msg
);
53
54
trans->
set_energyLossType
(
static_cast<
CaloEnergy::EnergyLossType
>
(pers->
m_energyLossType
));
55
trans->
set_caloLRLikelihood
(pers->
m_caloLRLikelihood
);
56
trans->
set_caloMuonIdTag
(pers->
m_caloMuonIdTag
);
57
trans->
set_fsrCandidateEnergy
(pers->
m_fsrCandidateEnergy
);
58
59
// reserve enough space so no re-alloc occurs
60
std::vector<DepositInCalo> deposits (pers->
m_deposits
.size());
61
62
size_t
ideposit = 0;
63
for
(
const
DepositInCalo_p1
& pers_dep : pers->
m_deposits
) {
64
depositCnv
.persToTrans( &pers_dep, &deposits[ideposit++],
msg
);
65
}
66
trans->
set_deposits
(std::move (deposits));
67
68
// msg << MSG::DEBUG << "Loaded CaloEnergy from persistent state [OK]"
69
// << endmsg;
70
71
return
;
72
}
73
74
void
CaloEnergyCnv_p1::transToPers
(
const
CaloEnergy
* trans,
75
CaloEnergy_p1
* pers,
76
MsgStream&
msg
)
const
77
{
78
79
msg
<< MSG::ERROR <<
"CaloEnergy at "
<< trans <<
" Persistent CaloEnergy_p1 at "
80
<< pers <<
" Cannot write to CaloEnergy_p1"
<<
endmsg
;
81
throw
std::runtime_error(
"Writing to CaloEnergy_p1 is not supported - CaloEnergyCnv_p1::transToPers(...)"
);
82
return
;
83
84
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
depositCnv
static const DepositInCaloCnv_p1 depositCnv
Definition
CaloEnergyCnv_p1.cxx:32
energyLossCnv
static const EnergyLossCnv_p1 energyLossCnv
Definition
CaloEnergyCnv_p1.cxx:29
CaloEnergyCnv_p1.h
CaloEnergy.h
DepositInCaloCnv_p1.h
DepositInCalo.h
EnergyLossCnv_p1.h
EnergyLoss_p1.h
T_AthenaPoolTPConverter.h
CaloEnergyCnv_p1::transToPers
virtual void transToPers(const CaloEnergy *transObj, CaloEnergy_p1 *persObj, MsgStream &msg) const override
Method creating the persistent representation CaloEnergy_p1 from its transient representation CaloEne...
Definition
CaloEnergyCnv_p1.cxx:74
CaloEnergyCnv_p1::persToTrans
virtual void persToTrans(const CaloEnergy_p1 *persObj, CaloEnergy *transObj, MsgStream &msg) const override
Method creating the transient representation of CaloEnergy from its persistent representation CaloEne...
Definition
CaloEnergyCnv_p1.cxx:38
CaloEnergy_p1
Definition
CaloEnergy_p1.h:25
CaloEnergy_p1::m_deposits
std::vector< DepositInCalo_p1 > m_deposits
Definition
CaloEnergy_p1.h:66
CaloEnergy_p1::m_energySigmaPlus
float m_energySigmaPlus
Definition
CaloEnergy_p1.h:61
CaloEnergy_p1::m_energyLossType
int m_energyLossType
Definition
CaloEnergy_p1.h:62
CaloEnergy_p1::m_caloLRLikelihood
float m_caloLRLikelihood
Definition
CaloEnergy_p1.h:63
CaloEnergy_p1::m_energySigmaMinus
float m_energySigmaMinus
Definition
CaloEnergy_p1.h:60
CaloEnergy_p1::m_fsrCandidateEnergy
float m_fsrCandidateEnergy
Definition
CaloEnergy_p1.h:65
CaloEnergy_p1::m_caloMuonIdTag
unsigned short m_caloMuonIdTag
Definition
CaloEnergy_p1.h:64
CaloEnergy_p1::m_energyDeposit
float m_energyDeposit
Definition
CaloEnergy_p1.h:59
CaloEnergy
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
Definition
CaloEnergy.h:28
CaloEnergy::EnergyLossType
EnergyLossType
Calo Energy Loss Type Parametrized : reconstruction configured to use the parametrization w/o looking...
Definition
CaloEnergy.h:43
CaloEnergy::set_deposits
void set_deposits(const std::vector< DepositInCalo > &deposits)
set the detailed energy deposits in the calorimeter layers
Definition
CaloEnergy.h:111
CaloEnergy::set_fsrCandidateEnergy
void set_fsrCandidateEnergy(const float fs)
FSR Candidate Energy.
Definition
CaloEnergy.h:118
CaloEnergy::set_caloMuonIdTag
void set_caloMuonIdTag(unsigned short tag)
set the tag
Definition
CaloEnergy.h:108
CaloEnergy::set_caloLRLikelihood
void set_caloLRLikelihood(const float likelihood)
set the likelihood
Definition
CaloEnergy.h:105
CaloEnergy::set_energyLossType
void set_energyLossType(const CaloEnergy::EnergyLossType lossType)
set methods
Definition
CaloEnergy.h:102
DepositInCaloCnv_p1
Definition
DepositInCaloCnv_p1.h:28
DepositInCalo_p1
Definition
DepositInCalo_p1.h:17
EnergyLossCnv_p1
T/P converter for class EnergyLoss.
Definition
EnergyLossCnv_p1.h:20
Trk::EnergyLoss_p1
Persistent representation of class EnergyLoss.h.
Definition
EnergyLoss_p1.h:14
Trk::EnergyLoss_p1::m_sigmaMinusDeltaE
float m_sigmaMinusDeltaE
Definition
EnergyLoss_p1.h:20
Trk::EnergyLoss_p1::m_deltaE
float m_deltaE
Definition
EnergyLoss_p1.h:18
Trk::EnergyLoss_p1::m_sigmaPlusDeltaE
float m_sigmaPlusDeltaE
Definition
EnergyLoss_p1.h:21
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0