TrackSummaryCnv_p1.cxx 2.19 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

#include "TrkTrackSummary/TrackSummary.h"
#include "TrkEventTPCnv/TrkTrackSummary/TrackSummaryCnv_p1.h"

void TrackSummaryCnv_p1::persToTrans( const Trk::TrackSummary_p1 *persObj,
                                            Trk::TrackSummary    *transObj, MsgStream &log )
{
   transObj->m_information       = persObj->m_information;
   if (transObj->m_information.size() < Trk::numberOfTrackSummaryTypes)
     transObj->m_information.resize(Trk::numberOfTrackSummaryTypes,
                                    Trk::TrackSummary::SummaryTypeNotSet);
15
16
17
18
19
20
21
22
23
24
    if (persObj->m_information.size() <= Trk::numberOfInnermostPixelLayerHits) {
      transObj->m_information[Trk::numberOfInnermostPixelLayerHits] =
        transObj->m_information[Trk::numberOfBLayerHits];
    }

    if (persObj->m_information.size() <= Trk::numberOfInnermostPixelLayerSharedHits) {
      transObj->m_information[Trk::numberOfInnermostPixelLayerSharedHits] =
        transObj->m_information[Trk::numberOfBLayerSharedHits];
    }

25
26
   transObj->m_idHitPattern      = persObj->m_idHitPattern;
   transObj->m_eProbability      = persObj->m_eProbability;
27
28
   transObj->m_indetTrackSummary.reset(createTransFromPStore( &m_indetSummaryCnv, persObj->m_indetTrackSummary, log ));
   transObj->m_muonTrackSummary.reset(createTransFromPStore( &m_muonSummaryCnv, persObj->m_muonTrackSummary, log ));
29
30
31
32
33
34
35
36
37
38
39
   transObj->m_dedx              = persObj->m_pixeldEdx;
   transObj->m_nhitsdedx         = persObj->m_nhitsfordEdx;
}


void TrackSummaryCnv_p1::transToPers( const Trk::TrackSummary    *transObj,
                                            Trk::TrackSummary_p1 *persObj, MsgStream & log )
{
   persObj->m_information       = transObj->m_information;
   persObj->m_idHitPattern      = transObj->m_idHitPattern;
   persObj->m_eProbability      = transObj->m_eProbability;
40
41
   persObj->m_indetTrackSummary = toPersistent( &m_indetSummaryCnv, transObj->m_indetTrackSummary.get(), log );
   persObj->m_muonTrackSummary  = toPersistent( &m_muonSummaryCnv, transObj->m_muonTrackSummary.get(), log );
42
43
44
   persObj->m_pixeldEdx         = transObj->m_dedx;
   persObj->m_nhitsfordEdx      = transObj->m_nhitsdedx;
}