ATLAS Offline Software
MaterialEffectsOnTrackCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <cmath>
9 
10 #include <typeinfo>
11 #include <cmath>
12 
13 //#include "TrkSurfaces/Surface.h"
15 
17  const Trk::MaterialEffectsOnTrack_p2 *persObj,
19  MsgStream& log)
20 {
21  fillTransFromPStore(&m_mefBaseCnv, persObj->m_mefBase, transObj, log);
22  if ((std::abs(persObj->m_deltaPhi) + std::abs(persObj->m_deltaTheta) >
23  1.0e-10) ||
24  (persObj->m_sigmaDeltaPhi + persObj->m_sigmaDeltaTheta > 1.0e-10)) {
25  transObj->m_scatteringAngles =
27  persObj->m_deltaTheta,
28  persObj->m_sigmaDeltaPhi,
29  persObj->m_sigmaDeltaTheta);
30  } else
31  transObj->m_scatteringAngles = std::nullopt;
32  transObj->m_energyLoss.reset(createTransFromPStore(
33  (ITPConverterFor<Trk::EnergyLoss>**)nullptr, persObj->m_energyLoss, log));
34 }
35 
37  const Trk::MaterialEffectsOnTrack *transObj,
39  MsgStream& log)
40 {
41  persObj->m_mefBase = baseToPersistent( &m_mefBaseCnv, transObj, log );
42  if (transObj->scatteringAngles()!=nullptr) {
43  persObj->m_deltaPhi = (float)transObj->scatteringAngles()->deltaPhi();
44  persObj->m_deltaTheta = (float)transObj->scatteringAngles()->deltaTheta();
45  persObj->m_sigmaDeltaPhi = (float)transObj->scatteringAngles()->sigmaDeltaPhi();
46  persObj->m_sigmaDeltaTheta = (float)transObj->scatteringAngles()->sigmaDeltaTheta();
47  }
48  // persObj->m_energyLoss = toPersistent( &m_elossCnv, transObj->m_energyLoss, log );
49 // if (transObj->m_energyLoss!=0) std::cout<<"Ending MaterialEffectsOnTrackCnv_p2::transToPers: "<<(typeid(*(transObj->m_energyLoss))).name()<<std::endl;
50  persObj->m_energyLoss = toPersistent( (ITPConverterFor<Trk::EnergyLoss>**)nullptr, transObj->energyLoss(), log );
51 }
52 
53 
54 
Trk::ScatteringAngles::deltaPhi
double deltaPhi() const
returns the
Definition: ScatteringAngles.h:82
EnergyLoss.h
ScatteringAngles.h
ITPConverterFor
Definition: TPConverter.h:37
Trk::MaterialEffectsOnTrack_p2::m_deltaPhi
float m_deltaPhi
Definition: MaterialEffectsOnTrack_p2.h:31
MaterialEffectsOnTrackCnv_p2::m_mefBaseCnv
ITPConverterFor< Trk::MaterialEffectsBase > * m_mefBaseCnv
Definition: MaterialEffectsOnTrackCnv_p2.h:34
MaterialEffectsOnTrackCnv_p2.h
Trk::MaterialEffectsOnTrack_p2::m_sigmaDeltaTheta
float m_sigmaDeltaTheta
Definition: MaterialEffectsOnTrack_p2.h:34
Trk::ScatteringAngles
represents a deflection of the track caused through multiple scattering in material.
Definition: ScatteringAngles.h:26
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
MaterialEffectsOnTrack.h
Trk::MaterialEffectsOnTrack::m_scatteringAngles
std::optional< ScatteringAngles > m_scatteringAngles
holds the scattering angles+errors in a separate object
Definition: MaterialEffectsOnTrack.h:146
Trk::MaterialEffectsOnTrack
represents the full description of deflection and e-loss of a track in material.
Definition: MaterialEffectsOnTrack.h:40
Trk::ScatteringAngles::sigmaDeltaTheta
double sigmaDeltaTheta() const
returns the
Definition: ScatteringAngles.h:100
Trk::MaterialEffectsOnTrack_p2::m_sigmaDeltaPhi
float m_sigmaDeltaPhi
Definition: MaterialEffectsOnTrack_p2.h:33
MaterialEffectsOnTrackCnv_p2::persToTrans
void persToTrans(const Trk::MaterialEffectsOnTrack_p2 *persObj, Trk::MaterialEffectsOnTrack *transObj, MsgStream &log)
Definition: MaterialEffectsOnTrackCnv_p2.cxx:16
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
Trk::MaterialEffectsOnTrack_p2::m_deltaTheta
float m_deltaTheta
Definition: MaterialEffectsOnTrack_p2.h:32
ITPConverterFor< TRANS_BASE >::baseToPersistent
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Persistify bass class of a given object and store the persistent represenation in the storage vector ...
Definition: TPConverter.h:97
Trk::MaterialEffectsOnTrack_p2
persistent representation v2 of MaterialEffectsOnTrack
Definition: MaterialEffectsOnTrack_p2.h:24
Trk::MaterialEffectsOnTrack::m_energyLoss
std::unique_ptr< const EnergyLoss > m_energyLoss
holds the measured and/or estimated energy loss in a separate object
Definition: MaterialEffectsOnTrack.h:148
Trk::MaterialEffectsOnTrack_p2::m_energyLoss
TPObjRef m_energyLoss
Definition: MaterialEffectsOnTrack_p2.h:36
Trk::MaterialEffectsOnTrack::energyLoss
const EnergyLoss * energyLoss() const
returns the energy loss object.
Trk::MaterialEffectsOnTrack::scatteringAngles
const ScatteringAngles * scatteringAngles() const
returns the MCS-angles object.
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::ScatteringAngles::sigmaDeltaPhi
double sigmaDeltaPhi() const
returns the
Definition: ScatteringAngles.h:94
Trk::ScatteringAngles::deltaTheta
double deltaTheta() const
returns the
Definition: ScatteringAngles.h:88
MaterialEffectsOnTrackCnv_p2::transToPers
void transToPers(const Trk::MaterialEffectsOnTrack *transObj, Trk::MaterialEffectsOnTrack_p2 *persObj, MsgStream &log)
Definition: MaterialEffectsOnTrackCnv_p2.cxx:36
Trk::MaterialEffectsOnTrack_p2::m_mefBase
TPObjRef m_mefBase
Definition: MaterialEffectsOnTrack_p2.h:28
readCCLHist.float
float
Definition: readCCLHist.py:83
ITPConverterFor< TRANS_BASE >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172