ATLAS Offline Software
TgcCoinDataCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------------
6 //
7 // file: TgcCoinDataCnv_p1.cxx
8 //* Takashi Kubota - June 30, 2008 */
9 //-----------------------------------------------------------------------------
10 
13 #include <algorithm>
16 
18 persToTrans( const Muon::TgcCoinData_p1 *persObj, Muon::TgcCoinData *transObj,MsgStream &log )
19 {
21  switch(persObj->m_type){
23  case 1: type=Muon::TgcCoinData::TYPE_HIPT; break;
24  case 2: type=Muon::TgcCoinData::TYPE_SL; break;
27  default: break;
28  }
29 
30  auto posIn = std::unique_ptr<Amg::Vector2D>
32  auto posOut = std::unique_ptr<Amg::Vector2D>
34 
37  auto tempMat = std::make_unique<Amg::MatrixX>();
38  EigenHelpers::vectorToEigenMatrix(dummy.values, *tempMat, "TgcCoinDataCnv_p1");
39 
40  *transObj = Muon::TgcCoinData (Identifier(persObj->m_channelIdIn),
41  Identifier(persObj->m_channelIdOut),
42  persObj->m_collectionIdHash,
43  transObj->detectorElementIn(),
44  transObj->detectorElementOut(),
45  type,
46  persObj->m_isAside,
47  persObj->m_phi,
48  false, // isInner
49  persObj->m_isForward,
50  persObj->m_isStrip,
51  persObj->m_trackletId,
52  posIn.release(),
53  posOut.release(),
54  persObj->m_widthIn,
55  persObj->m_widthOut,
56  persObj->m_delta,
57  0, // sub
58  0, // tile
59  persObj->m_roi,
60  persObj->m_pt,
61  persObj->m_trackletIdStrip,
62  tempMat.release()
63  );
64 
65  transObj->setHashAndIndex(persObj->m_indexAndHash);
66 }
67 
69 transToPers( const Muon::TgcCoinData *transObj, Muon::TgcCoinData_p1 *persObj, MsgStream &log )
70 {
71  //log << MSG::DEBUG << "TgcCoinDataCnv_p1::transToPers" << endmsg;
72 
73  persObj->m_channelIdIn = transObj->channelIdIn().get_identifier32().get_compact();
74  persObj->m_channelIdOut = transObj->channelIdOut().get_identifier32().get_compact();
75  persObj->m_collectionIdHash = transObj->identifyHash();
76  persObj->m_indexAndHash=transObj->getHashAndIndex().hashAndIndex();
77  switch(transObj->type()){
78  case Muon::TgcCoinData::TYPE_TRACKLET: persObj->m_type=0; break;
79  case Muon::TgcCoinData::TYPE_HIPT: persObj->m_type=1; break;
80  case Muon::TgcCoinData::TYPE_SL: persObj->m_type=2; break;
81  case Muon::TgcCoinData::TYPE_UNKNOWN: persObj->m_type=3; break;
82  case Muon::TgcCoinData::TYPE_TRACKLET_EIFI: persObj->m_type=4; break;
83  default: break;
84  }
85  //persObj->m_type = transObj->m_type;
86  persObj->m_isAside = transObj->isAside();
87  persObj->m_phi = transObj->phi();
88  persObj->m_isForward = transObj->isForward();
89  persObj->m_isStrip = transObj->isStrip();
90  persObj->m_trackletId = transObj->trackletId();
91  persObj->m_trackletIdStrip = transObj->trackletIdStrip();
92  persObj->m_widthIn = transObj->widthIn();
93  persObj->m_widthOut = transObj->widthOut();
94  persObj->m_posIn = toPersistent( &m_localPosCnv, transObj->posInPtr(), log );
95  persObj->m_posOut = toPersistent( &m_localPosCnv, transObj->posOutPtr(), log );
96  // persObj->m_errMat = toPersistent( &m_errorMxCnv, transObj->m_errMat, log );
97  if (transObj->hasErrMat() )
98  {
99  Trk::ErrorMatrix pMat;
100  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->errMat(), "TgcCoinDataCnv_p1");
101  persObj->m_errMat = toPersistent( &m_errorMxCnv, &pMat, log );
102  }
103  persObj->m_delta = transObj->delta();
104  persObj->m_roi = transObj->roi();
105  persObj->m_pt = transObj->pt();
106 }
107 
108 
Muon::TgcCoinData::hasErrMat
bool hasErrMat() const
Test to see if the error matrix is present.
Definition: TgcCoinData.h:368
Muon::TgcCoinData_p1::m_isAside
bool m_isAside
Definition: TgcCoinData_p1.h:52
Muon::TgcCoinData_p1::m_isStrip
bool m_isStrip
Definition: TgcCoinData_p1.h:55
Muon::TgcCoinData_p1::m_trackletIdStrip
int m_trackletIdStrip
Definition: TgcCoinData_p1.h:57
Muon::TgcCoinData_p1
Definition: TgcCoinData_p1.h:24
Muon::TgcCoinData_p1::m_posOut
TPObjRef m_posOut
Definition: TgcCoinData_p1.h:60
Muon::TgcCoinData::channelIdOut
Identifier channelIdOut() const
return offlineID on track on TGC3
Definition: TgcCoinData.h:344
Muon::TgcCoinData_p1::m_delta
int m_delta
Definition: TgcCoinData_p1.h:65
Muon::TgcCoinData::isAside
bool isAside() const
Aside or Cside.
Definition: TgcCoinData.h:348
Muon::TgcCoinData::type
CoinDataType type() const
return the coincidence type (HIPT, LPT, SL)
Definition: TgcCoinData.h:346
Muon::TgcCoinData::isStrip
bool isStrip() const
Strip hit or Wire hit?
Definition: TgcCoinData.h:356
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
TgcCoinDataCnv_p1.h
Muon::TgcCoinData::TYPE_TRACKLET
@ TYPE_TRACKLET
Definition: TgcCoinData.h:50
Muon::TgcCoinData::trackletId
int trackletId() const
return trackletId (Identifier for each track)
Definition: TgcCoinData.h:358
Muon::TgcCoinData_p1::m_widthIn
double m_widthIn
Definition: TgcCoinData_p1.h:62
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
Muon::TgcCoinData::identifyHash
IdentifierHash identifyHash() const
return the identifierHash of Outer Hit
Definition: TgcCoinData.h:319
Muon::TgcCoinData
Definition: TgcCoinData.h:37
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
Trk::ErrorMatrix
Definition: ErrorMatrixCnv_p1.h:25
Muon::TgcCoinData::trackletIdStrip
int trackletIdStrip() const
return trackletId for strip (Identifier for each track)
Definition: TgcCoinData.h:360
Muon::TgcCoinData_p1::m_widthOut
double m_widthOut
Definition: TgcCoinData_p1.h:63
Muon::TgcCoinData::delta
int delta() const
return the deviation from Pt=oo track
Definition: TgcCoinData.h:376
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
TgcCoinDataCnv_p1::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: TgcCoinDataCnv_p1.h:41
Muon::TgcCoinData_p1::m_collectionIdHash
IdentifierHash m_collectionIdHash
Definition: TgcCoinData_p1.h:47
TgcCoinDataCnv_p1::m_localPosCnv
LocalPositionCnv_p1 * m_localPosCnv
Definition: TgcCoinDataCnv_p1.h:40
Muon::TgcCoinData::CoinDataType
CoinDataType
Definition: TgcCoinData.h:49
Muon::TgcCoinData::TYPE_HIPT
@ TYPE_HIPT
Definition: TgcCoinData.h:51
TgcCoinDataCnv_p1::transToPers
void transToPers(const Muon::TgcCoinData *transObj, Muon::TgcCoinData_p1 *persObj, MsgStream &log)
Definition: TgcCoinDataCnv_p1.cxx:69
Muon::TgcCoinData::setHashAndIndex
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
Definition: TgcCoinData.h:326
Muon::TgcCoinData_p1::m_phi
int m_phi
Definition: TgcCoinData_p1.h:53
Muon::TgcCoinData::widthIn
double widthIn() const
return region width of hit on TGC1
Definition: TgcCoinData.h:372
Muon::TgcCoinData::errMat
const Amg::MatrixX & errMat() const
return 2d width of ROI for SL: errMat[0][0]==(width for R), errMat[1][1]==(width for phi)
Definition: TgcCoinData.h:370
Muon::TgcCoinData::widthOut
double widthOut() const
return region width of hit on TGC2(TRACKLET) or TGC3(HIPT)
Definition: TgcCoinData.h:374
EigenHelpers.h
python.xAODType.dummy
dummy
Definition: xAODType.py:4
Muon::TgcCoinData::posInPtr
const Amg::Vector2D * posInPtr() const
Definition: TgcCoinData.h:363
Muon::TgcCoinData_p1::m_errMat
TPObjRef m_errMat
Definition: TgcCoinData_p1.h:61
Muon::TgcCoinData::TYPE_UNKNOWN
@ TYPE_UNKNOWN
Definition: TgcCoinData.h:53
Muon::TgcCoinData::detectorElementIn
const MuonGM::TgcReadoutElement * detectorElementIn() const
return TgcReadoutElement of track on TGC1(HIPT) or TGC2(TRACKLET)
Definition: TgcCoinData.h:390
Muon::TgcCoinData_p1::m_trackletId
int m_trackletId
Definition: TgcCoinData_p1.h:56
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
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
IdentContIndex::hashAndIndex
unsigned int hashAndIndex() const
combined index
Definition: IdentContIndex.h:99
Muon::TgcCoinData_p1::m_type
int m_type
Definition: TgcCoinData_p1.h:51
Muon::TgcCoinData::getHashAndIndex
const IdentContIndex & getHashAndIndex() const
Definition: TgcCoinData.h:337
IdentContIndex.h
Muon::TgcCoinData_p1::m_channelIdIn
Identifier32::value_type m_channelIdIn
Definition: TgcCoinData_p1.h:45
Muon::TgcCoinData_p1::m_posIn
TPObjRef m_posIn
Definition: TgcCoinData_p1.h:59
Muon::TgcCoinData::roi
int roi() const
return ROI number
Definition: TgcCoinData.h:378
Muon::TgcCoinData::posOutPtr
const Amg::Vector2D * posOutPtr() const
Definition: TgcCoinData.h:366
Muon::TgcCoinData_p1::m_pt
int m_pt
Definition: TgcCoinData_p1.h:67
Trk::ErrorMatrix::values
std::vector< float > values
Definition: ErrorMatrixCnv_p1.h:27
Muon::TgcCoinData::isForward
bool isForward() const
Forward region or Endcap region.
Definition: TgcCoinData.h:354
Muon::TgcCoinData_p1::m_roi
int m_roi
Definition: TgcCoinData_p1.h:66
Muon::TgcCoinData::pt
int pt() const
return pt threshold value
Definition: TgcCoinData.h:380
Muon::TgcCoinData_p1::m_isForward
bool m_isForward
Definition: TgcCoinData_p1.h:54
Muon::TgcCoinData::TYPE_SL
@ TYPE_SL
Definition: TgcCoinData.h:52
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::TgcCoinData::TYPE_TRACKLET_EIFI
@ TYPE_TRACKLET_EIFI
Definition: TgcCoinData.h:54
Muon::TgcCoinData_p1::m_indexAndHash
unsigned int m_indexAndHash
Definition: TgcCoinData_p1.h:49
Muon::TgcCoinData::channelIdIn
Identifier channelIdIn() const
return offlineID on TGC1(HIPT) or TGC2(TRACKLET)
Definition: TgcCoinData.h:342
Muon::TgcCoinData::detectorElementOut
const MuonGM::TgcReadoutElement * detectorElementOut() const
return TgcReadoutElement of track on TGC3
Definition: TgcCoinData.h:395
TgcCoinData.h
Muon::TgcCoinData_p1::m_channelIdOut
Identifier32::value_type m_channelIdOut
Definition: TgcCoinData_p1.h:46
TgcCoinDataCnv_p1::persToTrans
void persToTrans(const Muon::TgcCoinData_p1 *persObj, Muon::TgcCoinData *transObj, MsgStream &log)
Definition: TgcCoinDataCnv_p1.cxx:18
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
Muon::TgcCoinData::phi
int phi() const
return phi number of trigger sector
Definition: TgcCoinData.h:350
Identifier
Definition: IdentifierFieldParser.cxx:14