ATLAS Offline Software
TrackStateOnSurfaceCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------------
6 //
7 // file: TrackStateOnSurfaceCnv_p2.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
15 
18 
19 //#include "TrkEventTPCnv/TrkParameters/TrackParametersCnv_p1.h"
20 
21 
23 persToTrans( const Trk::TrackStateOnSurface_p2 *persObj, Trk::TrackStateOnSurface *transObj, MsgStream &log )
24 {
25  ITPConverterFor<Trk::MeasurementBase> *measureCnv = nullptr;
26  Trk::MeasurementBase* meas = createTransFromPStore( &measureCnv, persObj->m_measurementOnTrack, log );
27 
28  ITPConverterFor<Trk::TrackParameters> *paramsCnv = nullptr;
29  Trk::TrackParameters* trackParameters = dynamic_cast<Trk::TrackParameters*>(createTransFromPStore( &paramsCnv, persObj->m_trackParameters, log ));
30 
31  std::unique_ptr<const Trk::FitQuality> fitQ(createTransFromPStore( &m_fitQCnv, persObj->m_fitQualityOnSurface, log));
32  auto fitQos = fitQ ? Trk::FitQualityOnSurface(*fitQ) : Trk::FitQualityOnSurface{};
33 
34  ITPConverterFor<Trk::MaterialEffectsBase> *matBaseCnv = nullptr;
35  Trk::MaterialEffectsBase* materialEffects = createTransFromPStore( &matBaseCnv, persObj->m_materialEffects, log );
36 
37  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> types;
38  std::bitset<Trk::TrackStateOnSurface::NumberOfPersistencyHints> hints;
40  *transObj = Trk::TrackStateOnSurface (fitQos,
41  std::unique_ptr<Trk::MeasurementBase> (meas),
42  std::unique_ptr<Trk::TrackParameters>(trackParameters),
43  std::unique_ptr<Trk::MaterialEffectsBase>(materialEffects),
44  types);
45  //Hints are atomic. Set once here if TSOS was slimmed
46  //aka not 0. If 0 we want to allow setting them later on
47  uint8_t hintsUInt = hints.to_ulong();
48  if(hintsUInt!=0){
49  transObj->setHints(hintsUInt);
50  }
51 
52 }
53 
54 
57 {
58  throw std::runtime_error("TrackStateOnSurfaceCnv_p2::transToPers is deprecated!");
59 }
ITPConverterFor< Trk::MeasurementBase >
Trk::TrackStateOnSurface_p2::m_measurementOnTrack
TPObjRef m_measurementOnTrack
Definition: TrackStateOnSurface_p2.h:30
Trk::TrackStateOnSurface_p2
Definition: TrackStateOnSurface_p2.h:19
TrackParameters.h
MeasurementBase.h
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Trk::MaterialEffectsBase
base class to integrate material effects on Trk::Track in a flexible way.
Definition: MaterialEffectsBase.h:35
MaterialEffectsBase.h
Trk::FitQualityOnSurface
Definition: FitQualityOnSurface.h:19
TrackStateOnSurfaceCnv_p2::persToTrans
virtual void persToTrans(const Trk::TrackStateOnSurface_p2 *persObj, Trk::TrackStateOnSurface *transObj, MsgStream &log)
Definition: TrackStateOnSurfaceCnv_p2.cxx:23
Trk::TrackStateOnSurface_p2::m_fitQualityOnSurface
TPObjRef m_fitQualityOnSurface
Definition: TrackStateOnSurface_p2.h:26
Trk::TrackStateOnSurface_p2::m_materialEffects
TPObjRef m_materialEffects
Definition: TrackStateOnSurface_p2.h:28
ParametersT.h
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::TrackStateOnSurface_p2::m_typeFlags
long m_typeFlags
Definition: TrackStateOnSurface_p2.h:31
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::TrackStateOnSurface::splitToBitsets
static void splitToBitsets(const unsigned int long input, std::bitset< NumberOfTrackStateOnSurfaceTypes > &types, std::bitset< NumberOfPersistencyHints > &hints)
Definition: TrackStateOnSurface.h:196
Trk::TrackStateOnSurface::setHints
void setHints(const uint8_t hints) const
Use this method to set persistification hints.
Definition: TrackStateOnSurface.cxx:235
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrackStateOnSurfaceCnv_p2.h
TrackStateOnSurfaceCnv_p2::transToPers
virtual void transToPers(const Trk::TrackStateOnSurface *transObj, Trk::TrackStateOnSurface_p2 *persObj, MsgStream &log)
Definition: TrackStateOnSurfaceCnv_p2.cxx:56
TrackStateOnSurfaceCnv_p2::m_fitQCnv
FitQualityCnv_p1 * m_fitQCnv
Definition: TrackStateOnSurfaceCnv_p2.h:37
TrackStateOnSurface.h
Trk::TrackStateOnSurface_p2::m_trackParameters
TPObjRef m_trackParameters
Definition: TrackStateOnSurface_p2.h:24
ITPConverterFor::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