ATLAS Offline Software
Loading...
Searching...
No Matches
TrackInfoCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------------
6//
7// file: TrackInfoCnv_p1.cxx
8//
9//-----------------------------------------------------------------------------
10#include "TrkTrack/TrackInfo.h"
12
13void TrackInfoCnv_p1::persToTrans( const Trk::TrackInfo_p1 * persObj, Trk::TrackInfo * transObj, MsgStream& )
14{
15 // set first 32 bits
16 std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> patrec(persObj->m_patternRecognition);
17
18
19 for (unsigned int i = 32;i<Trk::TrackInfo::NumberOfTrackRecoInfo;++i)
20 {
21 unsigned int mask = (1<<(i-32));
22 patrec[i] = (persObj->m_extPatternRecognition & mask );
23 }
24
25
26 *transObj = Trk::TrackInfo (static_cast<Trk::TrackInfo::TrackFitter>(persObj->m_fitter),
27 static_cast<Trk::ParticleHypothesis>(persObj->m_particleHypo),
28 std::bitset<Trk::TrackInfo::NumberOfTrackProperties>(persObj->m_properties),
29 patrec);
30}//end of pers to trans method
31
32
33void TrackInfoCnv_p1::transToPers( const Trk::TrackInfo * transObj, Trk::TrackInfo_p1 * persObj, MsgStream& )
34{
35// std::cout<<"Writing object out "<<std::endl;
36// if(transObj->patternRecoInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_LowMomentum) )
37// std::cout<<"This is low Pt !"<<std::endl;
38
39 persObj->m_fitter = static_cast<unsigned int>(transObj->trackFitter());
40 persObj->m_particleHypo = static_cast<unsigned int>(transObj->particleHypothesis());
41 persObj->m_properties = transObj->properties().to_ulong();
42
43 if (transObj->patternRecognition().size()<32)
44 {
45 persObj->m_patternRecognition = transObj->patternRecognition().to_ulong();
46 }else{
47
48// more 32 bits so have to do it the hard way.
49 unsigned int i = 0;
50 unsigned int size=transObj->patternRecognition().size();
51
52 // std::cout<<transObj->dumpBitsPatternRecoInfo()<<std::endl;
53
54 for (;i<32;++i) persObj->m_patternRecognition |= ((transObj->patternRecognition()[i]) << i);
55 for (i=32;i<size;++i) persObj->m_extPatternRecognition |= ((transObj->patternRecognition()[i]) << (i-32));
56
57// CHECK!
58 // set first 32 bits
59 // std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> test = std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo>(persObj->m_patternRecognition);
60 //
61 //
62 // for (unsigned int i = 32;i<Trk::TrackInfo::NumberOfTrackRecoInfo;++i)
63 // {
64 // unsigned int mask = (1<<(i-32));
65 // test[i] = (persObj->m_extPatternRecognition & mask );
66 // }
67 //
68 // if (test!=transObj->m_patternRecognition){
69 // log<<MSG::WARNING<<"TIC Trackinfos don't match! "<<endmsg;
70 // log<<MSG::WARNING<<test.to_string<char, std::char_traits<char>,std::allocator<char> >()<<endmsg;
71 // log<<MSG::WARNING<<transObj->m_patternRecognition.to_string<char, std::char_traits<char>,std::allocator<char> >()<<endmsg;
72 // }
73
74
75 }
76}//end of trans to pers method
virtual void transToPers(const Trk::TrackInfo *transObj, Trk::TrackInfo_p1 *persObj, MsgStream &log)
virtual void persToTrans(const Trk::TrackInfo_p1 *persObj, Trk::TrackInfo *transObj, MsgStream &log)
unsigned int m_extPatternRecognition
unsigned int m_properties
unsigned int m_particleHypo
unsigned int m_patternRecognition
unsigned int m_fitter
Contains information about the 'fitter' of this track.
const std::bitset< NumberOfTrackProperties > & properties() const
TrackFitter
enums to identify who created this track and what propertis does it have.
ParticleHypothesis particleHypothesis() const
Returns the particle hypothesis used for Track fitting.
const TrackFitter & trackFitter() const
Access methods for track fitter.
const std::bitset< NumberOfTrackRecoInfo > & patternRecognition() const
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.