ATLAS Offline Software
TrackParticleBaseCnv_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: TrackParticleBaseCnv_p1.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
12 #include "TrkTrack/TrackInfo.h"
14 
16 {
21 
23 
24  transObj->m_trackParticleOrigin = static_cast<Trk::TrackParticleOrigin>(persObj->m_trackParticleOrigin);
27 
28 //reading the persistent TrackInfo if any
29 
31  Trk::ParticleHypothesis hypothesis = static_cast<Trk::ParticleHypothesis>(persObj->m_particleHypo);
32  Trk::TrackInfo info(fitter, hypothesis);
33  transObj->m_trackInfo = info;
34 
35  transObj->m_trackInfo.m_properties = std::bitset<Trk::TrackInfo::NumberOfTrackProperties>(persObj->m_properties);
36 // transObj->m_trackInfo.m_patternRecognition = std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo>(persObj->m_patternRecognition);
37 
38  transObj->m_trackInfo.m_patternRecognition = std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo>(persObj->m_patternRecognition);
39  for (unsigned int i = 32;i<Trk::TrackInfo::NumberOfTrackRecoInfo;++i) {
40  unsigned int mask = (1<<(i-32));
42  }
43 }
44 
45 
47 {
52 
54 
55  persObj->m_trackParticleOrigin = static_cast<unsigned int>(transObj->m_trackParticleOrigin);
57  persObj->m_fitQuality = toPersistent( &m_fitQualityCnv, transObj->m_fitQuality, log );
58 
59  Trk::TrackInfo info = transObj->m_trackInfo;
60  persObj->m_fitter = static_cast<unsigned int>(info.m_fitter);
61  persObj->m_particleHypo = static_cast<unsigned int>(info.m_particleHypo);
62  persObj->m_properties = info.m_properties.to_ulong();
63 // persObj->m_patternRecognition = info.m_patternRecognition.to_ulong();
64  if (info.m_patternRecognition.size()<32) {
65  persObj->m_patternRecognition = info.m_patternRecognition.to_ulong();
66  } else {
67  // more 32 bits so have to do it the hard way.
68  unsigned int i = 0;
69  unsigned int size=info.m_patternRecognition.size();
70  persObj->m_patternRecognition=0;
71  persObj->m_extPatternRecognition=0;
72  for (;i<32;++i) persObj->m_patternRecognition |= ((transObj->m_trackInfo.m_patternRecognition[i]) << i);
73  for (i=32;i<size;++i) persObj->m_extPatternRecognition |= ((transObj->m_trackInfo.m_patternRecognition[i]) << (i-32));
74  }
75 
76  // std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> test = std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo>(persObj->m_patternRecognition);
77  // for (unsigned int i = 32;i<Trk::TrackInfo::NumberOfTrackRecoInfo;++i)
78  // {
79  // unsigned int mask = (1<<(i-32));
80  // test[i] = (persObj->m_extPatternRecognition & mask );
81  // }
82  //
83  // // Leave test in for the moment.
84  // // TODO - remove.
85  // if (test!=transObj->m_trackInfo.m_patternRecognition){
86  // log<<MSG::WARNING<<"TPBC Trackinfos don't match! "<<endmsg;
87  // std::cout<<"Trans: "<<transObj->m_trackInfo.m_patternRecognition.to_string<char, std::char_traits<char>,std::allocator<char> >()<<std::endl;
88  // std::cout<<"Read back: "<<test.to_string<char, std::char_traits<char>,std::allocator<char> >()<<std::endl;
89  // std::cout<<"persObj->m_patternRecognition: "<<std::hex<<persObj->m_patternRecognition<<std::endl;
90  // std::cout<<"persObj->m_extPatternRecognition: "<<persObj->m_extPatternRecognition<<std::dec<<std::endl;
91  // std::cout<<"transObj->m_trackInfo.m_patternRecognition[i]: "<<std::endl;
92  // for (unsigned int i=0;i<info.m_patternRecognition.size();++i) std::cout<<" "<<(transObj->m_trackInfo.m_patternRecognition[i]);
93  // for (unsigned int i=0;i<info.m_patternRecognition.size();++i) std::cout<<" "<<i;
94  // std::cout<<std::endl;
95  //
96  // }
97 
98 }
grepfile.info
info
Definition: grepfile.py:38
Trk::TrackInfo::NumberOfTrackRecoInfo
@ NumberOfTrackRecoInfo
Maximum number of enums.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:268
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackInfo::m_properties
std::bitset< NumberOfTrackProperties > m_properties
A bitset providing information on the properties of the track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:378
Trk::TrackParticleBase_p1::m_fitQuality
TPObjRef m_fitQuality
Definition: TrackParticleBase_p1.h:41
TrackParticleBaseCnv_p1::m_vecParametersBaseCnv
vecParametersBaseCnv_p1 m_vecParametersBaseCnv
Definition: TrackParticleBaseCnv_p1.h:59
TrackParticleBaseCnv_p1::m_elementLinkVxContainerConverter
ElementLinkCnv_p2< ElementLink< VxContainer > > m_elementLinkVxContainerConverter
Definition: TrackParticleBaseCnv_p1.h:58
Trk::TrackParticleBase_p1::m_trackParameters
std::vector< TPObjRef > m_trackParameters
Definition: TrackParticleBase_p1.h:36
Trk::TrackParticleBase_p1::m_elVxCandidate
ElementLinkInt_p2 m_elVxCandidate
Definition: TrackParticleBase_p1.h:33
ElementLinkCnv_p2::transToPers
void transToPers(State &state, const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
Trk::TrackParticleBase_p1::m_originalTrack
ElementLinkInt_p2 m_originalTrack
Definition: TrackParticleBase_p1.h:30
Trk::TrackParticleBase_p1::m_patternRecognition
unsigned int m_patternRecognition
Definition: TrackParticleBase_p1.h:49
TrackParticleBase.h
Trk::TrackParticleBase_p1::m_particleHypo
unsigned int m_particleHypo
Definition: TrackParticleBase_p1.h:45
Trk::VertexType
VertexType
Definition: VertexType.h:25
Trk::TrackParticleBase_p1::m_elVxCandidateNames
ElementLinkContNames_p2 m_elVxCandidateNames
Definition: TrackParticleBase_p1.h:34
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
TrackParticleBaseCnv_p1.h
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::TrackParticleBase_p1::m_extPatternRecognition
unsigned int m_extPatternRecognition
Definition: TrackParticleBase_p1.h:50
TrackParticleBaseCnv_p1::m_fitQualityCnv
FitQualityCnv_p1 * m_fitQualityCnv
Definition: TrackParticleBaseCnv_p1.h:56
Trk::TrackParticleBase_p1::m_properties
unsigned int m_properties
Definition: TrackParticleBase_p1.h:48
Trk::TrackInfo::m_patternRecognition
std::bitset< NumberOfTrackRecoInfo > m_patternRecognition
A bitset providing information on the actual pattern recognition algotithm.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:384
Trk::TrackInfo::TrackFitter
TrackFitter
enums to identify who created this track and what propertis does it have.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrackParticleBaseCnv_p1::persToTrans
virtual void persToTrans(const Trk ::TrackParticleBase_p1 *persObj, Trk ::TrackParticleBase *transObj, MsgStream &log)
Definition: TrackParticleBaseCnv_p1.cxx:15
Trk::TrackParticleBase::m_elVxCandidate
ElementLink< VxContainer > m_elVxCandidate
ElementLink to a VxCandidate.
Definition: TrackParticleBase.h:170
TPPtrVectorCnv::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:929
TPPolyVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1122
Trk::TrackParticleBase_p1::m_trackParticleOrigin
unsigned int m_trackParticleOrigin
Definition: TrackParticleBase_p1.h:38
ElementLinkCnv_p2::persToTrans
void persToTrans(State &state, const PersLink_t &pers, Link_t &trans, MsgStream &log) const
ITPConverterFor::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::TrackParticleBase_p1::m_originalTrackNames
ElementLinkContNames_p2 m_originalTrackNames
Definition: TrackParticleBase_p1.h:31
TrackInfo.h
Trk::TrackParticleBase::m_fitQuality
const FitQuality * m_fitQuality
the fit quality of this TrackParticle.
Definition: TrackParticleBase.h:179
Trk::TrackParticleBase::m_trackInfo
TrackInfo m_trackInfo
This is a class which stores the identity of where the track was created, fitted,...
Definition: TrackParticleBase.h:186
Trk::TrackParticleBase::m_trackParameters
std::vector< const TrackParameters * > m_trackParameters
DataVector of TrackParameters stored inside this TrackParticle.
Definition: TrackParticleBase.h:173
Trk::TrackParticleBase::m_trackSummary
const TrackSummary * m_trackSummary
the summary of this TrackParticle.
Definition: TrackParticleBase.h:176
Trk::TrackParticleBase_p1::m_trackSummary
TPObjRef m_trackSummary
Definition: TrackParticleBase_p1.h:40
Trk::TrackParticleBase::m_originalTrack
ElementLink< TrackCollection > m_originalTrack
ElementLink to the Track used to create this TrackParticleBase object Before writing to disk,...
Definition: TrackParticleBase.h:164
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::TrackParticleBase_p1::m_fitter
unsigned int m_fitter
Definition: TrackParticleBase_p1.h:44
ElementLinkCnv_p2::resetForCnv
void resetForCnv(ElementLinkContNames_p2 &lookupTable)
Trk::TrackParticleBase::m_trackParticleOrigin
TrackParticleOrigin m_trackParticleOrigin
specifies the origin type of the particle (prim.vertex, ...)
Definition: TrackParticleBase.h:167
TrackParticleBaseCnv_p1::transToPers
virtual void transToPers(const Trk ::TrackParticleBase *transObj, Trk ::TrackParticleBase_p1 *persObj, MsgStream &log)
Definition: TrackParticleBaseCnv_p1.cxx:46
TrackParticleBaseCnv_p1::m_trackSummaryCnv
TrackSummaryCnv_p1 * m_trackSummaryCnv
Definition: TrackParticleBaseCnv_p1.h:55
Trk::TrackParticleBase_p1
Definition: TrackParticleBase_p1.h:23
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
TrackParticleBaseCnv_p1::m_elementLinkTrackCollectionConverter
ElementLinkCnv_p2< ElementLink< TrackCollection > > m_elementLinkTrackCollectionConverter
Definition: TrackParticleBaseCnv_p1.h:57