ATLAS Offline Software
CaloEnergyCnv_p1.cxx
Go to the documentation of this file.
1 
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
17 
18 // muonEvent includes
20 #include "muonEvent/CaloEnergy.h"
21 
22 // RecTPCnv includes
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 
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 
56  trans->set_caloMuonIdTag (pers->m_caloMuonIdTag);
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 
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 }
EnergyLossCnv_p1.h
DepositInCaloCnv_p1
Definition: DepositInCaloCnv_p1.h:28
EnergyLossCnv_p1::persToTrans
virtual void persToTrans(const Trk ::EnergyLoss_p1 *persObj, Trk ::EnergyLoss *transObj, MsgStream &log) const override
Definition: EnergyLossCnv_p1.cxx:8
CaloEnergy::EnergyLossType
EnergyLossType
Calo Energy Loss Type Parametrized : reconstruction configured to use the parametrization w/o looking...
Definition: CaloEnergy.h:43
CaloEnergy
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
Definition: CaloEnergy.h:28
CaloEnergy::set_energyLossType
void set_energyLossType(const CaloEnergy::EnergyLossType lossType)
set methods
Definition: CaloEnergy.h:102
EnergyLoss_p1.h
Trk::EnergyLoss_p1
Persistent representation of class EnergyLoss.h.
Definition: EnergyLoss_p1.h:14
CaloEnergyCnv_p1.h
CaloEnergy_p1::m_caloLRLikelihood
float m_caloLRLikelihood
Definition: CaloEnergy_p1.h:63
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
CaloEnergy_p1::m_caloMuonIdTag
unsigned short m_caloMuonIdTag
Definition: CaloEnergy_p1.h:64
EnergyLossCnv_p1
T/P converter for class EnergyLoss.
Definition: EnergyLossCnv_p1.h:20
CaloEnergy_p1::m_energySigmaPlus
float m_energySigmaPlus
Definition: CaloEnergy_p1.h:61
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
T_AthenaPoolTPConverter.h
CaloEnergy_p1::m_energyDeposit
float m_energyDeposit
Definition: CaloEnergy_p1.h:59
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
DepositInCalo.h
CaloEnergy_p1::m_fsrCandidateEnergy
float m_fsrCandidateEnergy
Definition: CaloEnergy_p1.h:65
DepositInCalo_p1
Definition: DepositInCalo_p1.h:17
DepositInCaloCnv_p1.h
CaloEnergy::set_caloLRLikelihood
void set_caloLRLikelihood(const float likelihood)
set the likelihood
Definition: CaloEnergy.h:105
Trk::EnergyLoss_p1::m_sigmaMinusDeltaE
float m_sigmaMinusDeltaE
Definition: EnergyLoss_p1.h:20
DepositInCaloCnv_p1::persToTrans
virtual void persToTrans(const DepositInCalo_p1 *persObj, DepositInCalo *transObj, MsgStream &msg) const override
Method creating the transient representation of DepositInCalo from its persistent representation Depo...
Definition: DepositInCaloCnv_p1.cxx:25
CaloEnergy::set_caloMuonIdTag
void set_caloMuonIdTag(unsigned short tag)
set the tag
Definition: CaloEnergy.h:108
CaloEnergy_p1::m_energyLossType
int m_energyLossType
Definition: CaloEnergy_p1.h:62
CaloEnergy::set_fsrCandidateEnergy
void set_fsrCandidateEnergy(const float fs)
FSR Candidate Energy.
Definition: CaloEnergy.h:118
Trk::EnergyLoss_p1::m_sigmaPlusDeltaE
float m_sigmaPlusDeltaE
Definition: EnergyLoss_p1.h:21
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_p1::m_deposits
std::vector< DepositInCalo_p1 > m_deposits
Definition: CaloEnergy_p1.h:66
CaloEnergy_p1
Definition: CaloEnergy_p1.h:25
CaloEnergy_p1::m_energySigmaMinus
float m_energySigmaMinus
Definition: CaloEnergy_p1.h:60
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::EnergyLoss_p1::m_deltaE
float m_deltaE
Definition: EnergyLoss_p1.h:18
CaloEnergy.h