ATLAS Offline Software
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 
25  Amg::MatrixX localCovariance;
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 );
55  Trk::ErrorMatrix pMat;
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 }
InDet::TRT_DriftCircleOnTrack_p2::m_localErrMat
TPObjRef m_localErrMat
Definition: TRT_DriftCircleOnTrack_p2.h:32
Trk::LocalParameters
Definition: LocalParameters.h:98
InDet::TRT_DriftCircleOnTrack_p2
Definition: TRT_DriftCircleOnTrack_p2.h:19
InDet::TRT_DriftCircleOnTrack::status
Trk::DriftCircleStatus status() const
returns the status of the drift radius calibration.
Definition: TRT_DriftCircleOnTrack.h:229
InDet::TRT_DriftCircleOnTrack_p2::m_localParams
TPObjRef m_localParams
Definition: TRT_DriftCircleOnTrack_p2.h:31
InDet::TRT_DriftCircleOnTrack::idDE
virtual IdentifierHash idDE() const override final
returns the DE hashID
Definition: TRT_DriftCircleOnTrack.h:219
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDet::TRT_DriftCircleOnTrack_p2::m_timeOverThreshold
float m_timeOverThreshold
Definition: TRT_DriftCircleOnTrack_p2.h:37
Trk::DriftCircleStatus
DriftCircleStatus
Enumerates the 'status' of the wire on which the tracks passed (based on the TRT_Side enum,...
Definition: DriftCircleStatus.h:16
InDet::TRT_DriftCircleOnTrack_p2::m_localAngle
float m_localAngle
Definition: TRT_DriftCircleOnTrack_p2.h:39
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
InDet::TRT_DriftCircleOnTrack::highLevel
bool highLevel() const
returns true if the high level threshold was passed
Definition: TRT_DriftCircleOnTrack.h:234
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
TRT_DriftCircleOnTrackCnv_p2::transToPers
void transToPers(const InDet ::TRT_DriftCircleOnTrack *transObj, InDet ::TRT_DriftCircleOnTrack_p2 *persObj, MsgStream &log)
Definition: TRT_DriftCircleOnTrackCnv_p2.cxx:50
InDet::TRT_DriftCircleOnTrack::detectorElement
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: TRT_DriftCircleOnTrack.h:224
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
TRT_DriftCircleOnTrackCnv_p2::persToTrans
void persToTrans(const InDet ::TRT_DriftCircleOnTrack_p2 *persObj, InDet ::TRT_DriftCircleOnTrack *transObj, MsgStream &log)
Definition: TRT_DriftCircleOnTrackCnv_p2.cxx:16
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::TRT_DriftCircleOnTrack_p2::m_positionAlongWire
float m_positionAlongWire
Definition: TRT_DriftCircleOnTrack_p2.h:40
Trk::ErrorMatrix
Definition: ErrorMatrixCnv_p1.h:25
InDet::TRT_DriftCircleOnTrack_p2::m_prdLink
ElementLinkInt_p1 m_prdLink
Link to PRD.
Definition: TRT_DriftCircleOnTrack_p2.h:43
EigenHelpers::vectorToEigenMatrix
static void vectorToEigenMatrix(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to fill the covariance from the raw data (vec<float>)
Definition: EigenHelpers.h:22
TRT_DriftCircleOnTrackCnv_p2.h
InDet::TRT_DriftCircleOnTrack_p2::m_id
unsigned int m_id
Definition: TRT_DriftCircleOnTrack_p2.h:30
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
InDet::TRT_DriftCircleOnTrack_p2::m_highLevel
bool m_highLevel
Definition: TRT_DriftCircleOnTrack_p2.h:36
EigenHelpers.h
python.xAODType.dummy
dummy
Definition: xAODType.py:4
TRT_DriftCircleOnTrack.h
EigenHelpers::eigenMatrixToVector
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to get raw data (vec<float>) from the covariance.
Definition: EigenHelpers.h:30
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
InDet::TRT_DriftCircleContainer
Trk::PrepRawDataContainer< TRT_DriftCircleCollection > TRT_DriftCircleContainer
Definition: TRT_DriftCircleContainer.h:27
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
InDet::TRT_DriftCircleOnTrack::timeOverThreshold
double timeOverThreshold() const
returns time over threshold in ns for valid digits; zero otherwise
Definition: TRT_DriftCircleOnTrack.h:239
TRT_DriftCircleOnTrackCnv_p2::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: TRT_DriftCircleOnTrackCnv_p2.h:35
SG::InitializedReadHandleKey
ReadHandleKey that initializes during construction.
Definition: StoreGate/StoreGate/ReadHandleKey.h:133
Trk::ErrorMatrix::values
std::vector< float > values
Definition: ErrorMatrixCnv_p1.h:27
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
InDet::TRT_DriftCircleOnTrack::localAngle
float localAngle() const
Definition: TRT_DriftCircleOnTrack.h:244
InDet::TRT_DriftCircleOnTrack::positionAlongWire
float positionAlongWire() const
Definition: TRT_DriftCircleOnTrack.h:249
TRT_DriftCircleOnTrackCnv_p2::m_elCnv
ElementLinkCnv_p1< ElementLinkToIDCTRT_DriftCircleContainer > m_elCnv
Definition: TRT_DriftCircleOnTrackCnv_p2.h:34
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TRT_DriftCircleOnTrackCnv_p2::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: TRT_DriftCircleOnTrackCnv_p2.h:36
TRT_DriftCircleOnTrackCnv_p2::m_eventCnvTool
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Definition: TRT_DriftCircleOnTrackCnv_p2.h:33
InDet::TRT_DriftCircleOnTrack_p2::m_status
unsigned int m_status
Definition: TRT_DriftCircleOnTrack_p2.h:35
InDet::TRT_DriftCircleOnTrack_p2::m_idDE
IdentifierHash::value_type m_idDE
Definition: TRT_DriftCircleOnTrack_p2.h:34
Identifier
Definition: IdentifierFieldParser.cxx:14