ATLAS Offline Software
CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------------
6 //
7 // file: InDetCompetingRIOsOnTrackCnv_p1.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
16 #include "TrkSurfaces/Surface.h"
17 
18 
19 void
22  MsgStream &log )
23 {
24  auto containedChildRots = std::vector< const InDet::TRT_DriftCircleOnTrack * >{};
25 
26  for (const TPObjRef& ref : persObj->m_containedChildRots) {
27  ITPConverterFor<Trk::MeasurementBase> *rotCnv = nullptr;
28  const InDet::TRT_DriftCircleOnTrack* mcot = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(createTransFromPStore(&rotCnv, ref, log));
29  containedChildRots.push_back( mcot );
30  }
31 
32  ITPConverterFor<Trk::Surface> *surfaceCnv = nullptr;
33  Trk::Surface* associatedSurface = createTransFromPStore(&surfaceCnv, persObj->m_associatedSurface, log);
34 
35  *transObj = InDet::CompetingTRT_DriftCirclesOnTrack (associatedSurface,
36  std::move(containedChildRots),
37  std::vector<double>{},
38  {},
39  {},
40  0);
41 
42  fillTransFromPStore( &m_cRotCnv, persObj->m_competingROT, transObj, log );
43 }
44 
45 void
48  MsgStream &log )
49 {
50  persObj->m_competingROT = baseToPersistent( &m_cRotCnv, transObj, log );
51 
52  for (const InDet::TRT_DriftCircleOnTrack* cl : transObj->containedROTs()) {
53  ITPConverterFor<Trk::MeasurementBase> *rotCnv = nullptr;
54  persObj->m_containedChildRots.push_back( toPersistent(&rotCnv, cl, log) );
55  }
56 
57  ITPConverterFor<Trk::Surface> *surfaceCnv = nullptr;
58  persObj->m_associatedSurface = toPersistent(&surfaceCnv, &transObj->associatedSurface(), log);
59 
60 }
61 
62 
CompetingTRT_DriftCirclesOnTrack.h
ITPConverterFor< Trk::MeasurementBase >
CompetingTRT_DriftCirclesOnTrackCnv_p1::transToPers
virtual void transToPers(const InDet::CompetingTRT_DriftCirclesOnTrack *transObj, InDet::CompetingTRT_DriftCirclesOnTrack_p1 *persObj, MsgStream &log)
Definition: CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx:46
MeasurementBase.h
Surface.h
InDet::CompetingTRT_DriftCirclesOnTrack_p1
Version 1 of the persistent class representing the transient class InDet::CompetingTRT_DriftCirclesOn...
Definition: CompetingTRT_DriftCirclesOnTrack_p1.h:17
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
TPObjRef
Definition: TPObjRef.h:20
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
InDet::CompetingTRT_DriftCirclesOnTrack_p1::m_containedChildRots
std::vector< TPObjRef > m_containedChildRots
Definition: CompetingTRT_DriftCirclesOnTrack_p1.h:24
InDet::CompetingTRT_DriftCirclesOnTrack_p1::m_competingROT
TPObjRef m_competingROT
link to base CompetingRIOsOnTrack
Definition: CompetingTRT_DriftCirclesOnTrack_p1.h:22
InDet::CompetingTRT_DriftCirclesOnTrack::containedROTs
const std::vector< const InDet::TRT_DriftCircleOnTrack * > & containedROTs() const
returns the vector of TRT_DriftCircleOnTrack objects .
Definition: CompetingTRT_DriftCirclesOnTrack.h:147
InDet::CompetingTRT_DriftCirclesOnTrack_p1::m_associatedSurface
TPObjRef m_associatedSurface
Definition: CompetingTRT_DriftCirclesOnTrack_p1.h:25
TRT_DriftCircleOnTrack.h
CompetingTRT_DriftCirclesOnTrackCnv_p1::persToTrans
virtual void persToTrans(const InDet::CompetingTRT_DriftCirclesOnTrack_p1 *persObj, InDet::CompetingTRT_DriftCirclesOnTrack *transObj, MsgStream &log)
Definition: CompetingTRT_DriftCirclesOnTrackCnv_p1.cxx:20
ITPConverterFor< TRANS_BASE >::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
ITPConverterFor< TRANS_BASE >::baseToPersistent
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Persistify bass class of a given object and store the persistent represenation in the storage vector ...
Definition: TPConverter.h:97
RIO_OnTrack.h
InDet::CompetingTRT_DriftCirclesOnTrack
Class for competing TRT_DriftCircles, it extends the Trk::CompetingRIOsOnTrack base class.
Definition: CompetingTRT_DriftCirclesOnTrack.h:48
InDet::CompetingTRT_DriftCirclesOnTrack::associatedSurface
const Trk::Surface & associatedSurface() const
returns the surface for the local to global transformation .
Definition: CompetingTRT_DriftCirclesOnTrack.h:141
ref
const boost::regex ref(r_ef)
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CompetingTRT_DriftCirclesOnTrackCnv_p1::m_cRotCnv
CompetingRIOsOnTrackCnv_p1 * m_cRotCnv
Definition: CompetingTRT_DriftCirclesOnTrackCnv_p1.h:38
CompetingTRT_DriftCirclesOnTrackCnv_p1.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
ITPConverterFor< TRANS_BASE >::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