ATLAS Offline Software
Loading...
Searching...
No Matches
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
23persToTrans( 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
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}
static const std::vector< std::string > types
Common base class for all TP converters, specialized for a given transient type.
Definition TPConverter.h:37
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
virtual void transToPers(const Trk::TrackStateOnSurface *transObj, Trk::TrackStateOnSurface_p2 *persObj, MsgStream &log)
virtual void persToTrans(const Trk::TrackStateOnSurface_p2 *persObj, Trk::TrackStateOnSurface *transObj, MsgStream &log)
base class to integrate material effects on Trk::Track in a flexible way.
This class is the pure abstract base class for all fittable tracking measurements.
represents the track state (measurement, material, fit parameters and quality) at a surface.
void setHints(const uint8_t hints) const
Use this method to set persistification hints.
static void splitToBitsets(const unsigned int long input, std::bitset< NumberOfTrackStateOnSurfaceTypes > &types, std::bitset< NumberOfPersistencyHints > &hints)
ParametersBase< TrackParametersDim, Charged > TrackParameters