ATLAS Offline Software
TrigMuonEFInfoCnv_p4.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
11  TrigMuonEFInfo* transObj,
12  MsgStream &log)
13 {
14  log << MSG::DEBUG << "TrigMuonEFInfoCnv_p4::persToTrans called " << endmsg;
15  std::unique_ptr<TrigMuonEFInfoTrackContainer> tracks
17  std::unique_ptr<TrigMuonEFTrack> spectrometerTrack
19  std::unique_ptr<TrigMuonEFTrack> extrapolatedTrack
21  std::unique_ptr<TrigMuonEFCbTrack> combinedTrack
23 
24  *transObj = TrigMuonEFInfo (persObj->m_roi,
25  std::move (tracks),
26  std::move (spectrometerTrack),
27  std::move (extrapolatedTrack),
28  std::move (combinedTrack));
29  transObj->setNSegments (persObj->m_nSegments);
30  transObj->setNMdtHits (persObj->m_nMdtHits);
31  transObj->setNRpcHits (persObj->m_nRpcHits);
32  transObj->setNTgcHits (persObj->m_nTgcHits);
33  transObj->setNCscHits (persObj->m_nCscHits);
34 
35  transObj->setEtaPreviousLevel (persObj->m_etaPreviousLevel);
36  transObj->setPhiPreviousLevel (persObj->m_phiPreviousLevel);
37 }
38 
39 
41  TrigMuonEFInfo_p4* persObj,
42  MsgStream &log)
43 {
44  log << MSG::DEBUG << "TrigMuonEFInfoCnv_p3::transToPers called " << endmsg;
45 
46  persObj->m_roi = transObj->RoINum();
47  persObj->m_nSegments = transObj->NSegments();
48  persObj->m_nMdtHits = transObj->NMdtHits();
49  persObj->m_nRpcHits = transObj->NRpcHits();
50  persObj->m_nTgcHits = transObj->NTgcHits();
51  persObj->m_nCscHits = transObj->NCscHits();
52  persObj->m_etaPreviousLevel = transObj->EtaPreviousLevel();
53  persObj->m_phiPreviousLevel = transObj->PhiPreviousLevel();
54 
55  // check for legacy
56  if (transObj->hasLegacyTrack()) {
57  log << MSG::DEBUG << "TrigMuonEFInfoCnv_p3::transToPers: has legacy track " << endmsg;
58  // has a legacy track.
59  // this situation occurs if old BS files are read.
60  // make a tmp track container to safeguard const correctness of transObj.
62  TrigMuonEFInfoTrack * tmpTrack = new TrigMuonEFInfoTrack();
63  TrigMuonEFTrack * tmpSpecTrack = new TrigMuonEFTrack( *(transObj->legacySpectrometerTrack() ));
64  tmpTrack->setSpectrometerTrack( tmpSpecTrack );
65  TrigMuonEFTrack * tmpExtrTrack = new TrigMuonEFTrack( *(transObj->legacyExtrapolatedTrack() ));
66  tmpTrack->setExtrapolatedTrack( tmpExtrTrack );
67  TrigMuonEFCbTrack * tmpCbTrack = new TrigMuonEFCbTrack( *(transObj->legacyCombinedTrack() ));
68  tmpTrack->setCombinedTrack( tmpCbTrack );
69  tmpTrkCont->push_back( tmpTrack );
70 
71  // persistify the tmp track container
72  persObj->m_trackContainer = toPersistent( &m_trackContainerCnv, tmpTrkCont, log);
73 
74  // clean up
75  delete tmpTrkCont;
76  delete tmpTrack;
77  delete tmpSpecTrack;
78  delete tmpExtrTrack;
79  delete tmpCbTrack;
80  }
81  else {
83  }
84 
85 }
TrigMuonEFInfo_p4::m_etaPreviousLevel
float m_etaPreviousLevel
Definition: TrigMuonEFInfo_p4.h:52
TrigMuonEFInfo::setPhiPreviousLevel
void setPhiPreviousLevel(double thePhiPreviousLevel)
Definition: TrigMuonEFInfo.cxx:261
TrigMuonEFInfo::hasLegacyTrack
bool hasLegacyTrack() const
Definition: TrigMuonEFInfo.cxx:355
TrigMuonEFInfoCnv_p4.h
TrigMuonEFInfo::RoINum
unsigned short int RoINum() const
Definition: TrigMuonEFInfo.h:86
TrigMuonEFInfo::NTgcHits
unsigned short int NTgcHits() const
Definition: TrigMuonEFInfo.h:90
TrigMuonEFInfoCnv_p4::m_cbTrackCnv
ITPConverterFor< TrigMuonEFCbTrack > * m_cbTrackCnv
Definition: TrigMuonEFInfoCnv_p4.h:50
TrigMuonEFInfo_p4::m_nSegments
unsigned short int m_nSegments
Definition: TrigMuonEFInfo_p4.h:47
TrigMuonEFInfo::setNMdtHits
void setNMdtHits(unsigned short int theNMdtHits)
Definition: TrigMuonEFInfo.cxx:231
TrigMuonEFInfoTrack::setSpectrometerTrack
void setSpectrometerTrack(TrigMuonEFTrack *track)
Definition: TrigMuonEFInfoTrack.cxx:68
TrigMuonEFTrack
Definition: TrigMuonEFTrack.h:27
TrigMuonEFInfo::setNCscHits
void setNCscHits(unsigned short int theNCscHits)
Definition: TrigMuonEFInfo.cxx:249
TrigMuonEFInfo_p4::m_phiPreviousLevel
float m_phiPreviousLevel
Definition: TrigMuonEFInfo_p4.h:53
TrigMuonEFInfo_p4::m_combinedTrack
TPObjRef m_combinedTrack
Definition: TrigMuonEFInfo_p4.h:57
TrigMuonEFInfo_p4::m_nTgcHits
unsigned short int m_nTgcHits
Definition: TrigMuonEFInfo_p4.h:50
TrigMuonEFInfoTrack::setCombinedTrack
void setCombinedTrack(TrigMuonEFCbTrack *track)
Definition: TrigMuonEFInfoTrack.cxx:78
TrigMuonEFInfo::NSegments
unsigned short int NSegments() const
Definition: TrigMuonEFInfo.h:87
TrigMuonEFInfo::NRpcHits
unsigned short int NRpcHits() const
Definition: TrigMuonEFInfo.h:89
TrigMuonEFInfo_p4.h
TrigMuonEFInfo_p4::m_trackContainer
TPObjRef m_trackContainer
Definition: TrigMuonEFInfo_p4.h:58
TrigMuonEFInfoTrack::setExtrapolatedTrack
void setExtrapolatedTrack(TrigMuonEFTrack *track)
Definition: TrigMuonEFInfoTrack.cxx:73
TrigMuonEFInfo::legacyCombinedTrack
const TrigMuonEFCbTrack * legacyCombinedTrack() const
Definition: TrigMuonEFInfo.h:102
Trk::combinedTrack
void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo)
Definition: XYZtrp.cxx:113
TrigMuonEFInfo::EtaPreviousLevel
double EtaPreviousLevel() const
Definition: TrigMuonEFInfo.h:92
TrigMuonEFInfo_p4::m_nCscHits
unsigned short int m_nCscHits
Definition: TrigMuonEFInfo_p4.h:51
TrigMuonEFInfo::legacyExtrapolatedTrack
const TrigMuonEFTrack * legacyExtrapolatedTrack() const
Definition: TrigMuonEFInfo.h:101
TrigMuonEFInfo::NCscHits
unsigned short int NCscHits() const
Definition: TrigMuonEFInfo.h:91
TrigMuonEFInfo.h
TrigMuonEFInfo_p4
Definition: TrigMuonEFInfo_p4.h:26
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigMuonEFInfoCnv_p4::m_trackCnv
ITPConverterFor< TrigMuonEFTrack > * m_trackCnv
Definition: TrigMuonEFInfoCnv_p4.h:49
TrigMuonEFInfo::setNRpcHits
void setNRpcHits(unsigned short int theNRpcHits)
Definition: TrigMuonEFInfo.cxx:237
TrigMuonEFInfo::legacySpectrometerTrack
const TrigMuonEFTrack * legacySpectrometerTrack() const
Definition: TrigMuonEFInfo.h:100
TrigMuonEFInfoTrackContainer
Definition: TrigMuonEFInfoTrackContainer.h:27
TrigMuonEFInfo_p4::m_spectrometerTrack
TPObjRef m_spectrometerTrack
Definition: TrigMuonEFInfo_p4.h:55
TrigMuonEFInfoCnv_p4::persToTrans
virtual void persToTrans(const TrigMuonEFInfo_p4 *persObj, TrigMuonEFInfo *transObj, MsgStream &log)
Definition: TrigMuonEFInfoCnv_p4.cxx:10
TrigMuonEFInfo_p4::m_roi
unsigned short int m_roi
Definition: TrigMuonEFInfo_p4.h:46
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
TrigMuonEFInfoCnv_p4::transToPers
virtual void transToPers(const TrigMuonEFInfo *transObj, TrigMuonEFInfo_p4 *persObj, MsgStream &log)
Definition: TrigMuonEFInfoCnv_p4.cxx:40
TrigMuonEFCbTrack
Definition: TrigMuonEFCbTrack.h:28
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TrigMuonEFInfoTrack
Definition: TrigMuonEFInfoTrack.h:22
TrigMuonEFInfo::setNTgcHits
void setNTgcHits(unsigned short int theNTgcHits)
Definition: TrigMuonEFInfo.cxx:243
TrigMuonEFInfo::setNSegments
void setNSegments(unsigned short int theNSegments)
Definition: TrigMuonEFInfo.cxx:224
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigMuonEFInfo::setEtaPreviousLevel
void setEtaPreviousLevel(double theEtaPreviousLevel)
Definition: TrigMuonEFInfo.cxx:255
TrigMuonEFInfo::TrackContainer
const TrigMuonEFInfoTrackContainer * TrackContainer() const
Definition: TrigMuonEFInfo.h:94
TrigMuonEFInfoCnv_p4::m_trackContainerCnv
ITPConverterFor< TrigMuonEFInfoTrackContainer > * m_trackContainerCnv
Definition: TrigMuonEFInfoCnv_p4.h:51
TrigMuonEFInfo::PhiPreviousLevel
double PhiPreviousLevel() const
Definition: TrigMuonEFInfo.h:93
TrigMuonEFInfo
Definition: TrigMuonEFInfo.h:24
TrigMuonEFInfo_p4::m_nMdtHits
unsigned short int m_nMdtHits
Definition: TrigMuonEFInfo_p4.h:48
TrigMuonEFInfo_p4::m_extrapolatedTrack
TPObjRef m_extrapolatedTrack
Definition: TrigMuonEFInfo_p4.h:56
TrigMuonEFInfo::NMdtHits
unsigned short int NMdtHits() const
Definition: TrigMuonEFInfo.h:88
TrigMuonEFInfo_p4::m_nRpcHits
unsigned short int m_nRpcHits
Definition: TrigMuonEFInfo_p4.h:49
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