ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DriftCircleOnTrackCnv_p2.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: TRT_DriftCircleOnTrackCnv_p2.cxx
8//
9//-----------------------------------------------------------------------------
10
14
15
17
19 m_elCnv.persToTrans(&persObj->m_prdLink,&rio,log);
20
21 Trk::LocalParameters localParams;
22 fillTransFromPStore( &m_localParCnv, persObj->m_localParams, &localParams, log );
23
24 Trk::ErrorMatrix dummy;
25 Amg::MatrixX localCovariance;
26 fillTransFromPStore( &m_errorMxCnv, persObj->m_localErrMat, &dummy, log );
27 EigenHelpers::vectorToEigenMatrix(dummy.values, localCovariance, "TRT_DriftCircleOnTrackCnv_p2");
28
29 *transObj = InDet::TRT_DriftCircleOnTrack (rio,
30 localParams,
31 localCovariance,
32 persObj->m_idDE,
33 Identifier(persObj->m_id),
34 persObj->m_positionAlongWire,
35 persObj->m_localAngle,
36 static_cast<Trk::DriftCircleStatus>( persObj->m_status ),
37 persObj->m_highLevel,
38 persObj->m_timeOverThreshold
39 );
40
41 m_eventCnvTool->recreateRIO_OnTrack(transObj);
42 if (transObj->detectorElement()==nullptr)
43 log << MSG::WARNING<<"Unable to reset DetEl for this RIO_OnTrack, "
44 << "probably because of a problem with the Identifier/IdentifierHash : ("
45 << transObj->identify()<<"/"<<transObj->idDE()<<endmsg;
46
47}
48
49
51 if (transObj==nullptr or persObj==nullptr) return;
52
53 persObj->m_id = transObj->identify().get_identifier32().get_compact();
54 persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
56 EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "TRT_DriftCircleOnTrackCnv_p2");
57 persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
58 persObj->m_idDE = transObj->idDE();
59 persObj->m_status = static_cast<unsigned int>( transObj->status() );
60 persObj->m_highLevel = transObj->highLevel();
61 persObj->m_localAngle = transObj->localAngle();
62 persObj->m_positionAlongWire = transObj->positionAlongWire();
63 // added in 12.5
64 persObj->m_timeOverThreshold = static_cast<float>(transObj->timeOverThreshold());
65
66 static const SG::InitializedReadHandleKey<InDet::TRT_DriftCircleContainer> trtCircleContName ("TRT_DriftCircles");
68 bool isFound{m_eventCnvTool->getHashAndIndex<InDet::TRT_DriftCircleContainer, InDet::TRT_DriftCircleOnTrack>(transObj, trtCircleContName, hashAndIndex)};
69 if(m_eventCnvTool->doTrackOverlay()){
70 persObj->m_prdLink.m_contName = (isFound ? "Bkg_TRT_DriftCircles" : "");
71 if(!isFound){ //in this case the input collection is called Bkg_TRT_DriftCircles as well
72 static const SG::InitializedReadHandleKey<InDet::TRT_DriftCircleContainer> trtCircleContName("Bkg_TRT_DriftCircles");
73 isFound=m_eventCnvTool->getHashAndIndex<InDet::TRT_DriftCircleContainer, InDet::TRT_DriftCircleOnTrack>(transObj, trtCircleContName, hashAndIndex);
74 persObj->m_prdLink.m_contName = (isFound ? "Bkg_TRT_DriftCircles" : "");
75 }
76 }
77 else persObj->m_prdLink.m_contName = (isFound ? trtCircleContName.key() : "");
78 persObj->m_prdLink.m_elementIndex = hashAndIndex;
79}
#define endmsg
ElementLink< InDet::TRT_DriftCircleContainer > ElementLinkToIDCTRT_DriftCircleContainer
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
ElementLinkInt_p1 m_prdLink
Link to PRD.
Represents 'corrected' measurements from the TRT (for example, corrected for wire sag).
bool highLevel() const
returns true if the high level threshold was passed
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
double timeOverThreshold() const
returns time over threshold in ns for valid digits; zero otherwise
virtual IdentifierHash idDE() const override final
returns the DE hashID
Trk::DriftCircleStatus status() const
returns the status of the drift radius calibration.
ReadHandleKey that initializes during construction.
const std::string & key() const
Return the StoreGate ID for the referenced object.
ElementLinkCnv_p1< ElementLinkToIDCTRT_DriftCircleContainer > m_elCnv
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
void transToPers(const InDet ::TRT_DriftCircleOnTrack *transObj, InDet ::TRT_DriftCircleOnTrack_p2 *persObj, MsgStream &log)
void persToTrans(const InDet ::TRT_DriftCircleOnTrack_p2 *persObj, InDet ::TRT_DriftCircleOnTrack *transObj, MsgStream &log)
std::vector< float > values
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Identifier identify() const
return the identifier -extends MeasurementBase
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
DriftCircleStatus
Enumerates the 'status' of the wire on which the tracks passed (based on the TRT_Side enum,...