ATLAS Offline Software
TrackSummaryCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
10 
11  std::cout << "-------------------------------------------" <<std::endl;
12  std::cout << "m_idHitPattern:\t" << t->m_idHitPattern << std::endl;
13 
14  std::cout << " std::vector m_information size: "<< t->m_information.size() <<std::endl;
15  for (int i : t->m_information) std::cout<<"\t "<<i;
16  std::cout<<std::endl;
17 
18  if(t->m_muonTrackSummary){
19  std::cout << " m_muonTrackSummary->m_nscatterers: "<< t->m_muonTrackSummary->nscatterers() <<std::endl;
20  std::cout << " m_muonTrackSummary->m_npseudoMeasurements: "<< t->m_muonTrackSummary->npseudoMeasurements() <<std::endl;
21  std::cout << " std::vector m_muonTrackSummary->m_chamberHitSummary size: "<< t->m_muonTrackSummary->chamberHitSummary().size() <<std::endl;
23  t->m_muonTrackSummary->chamberHitSummary())
24  {
25  std::cout<<"\t m_chId "<<s.chamberId() <<std::endl;
26  std::cout<<"\t m_isMdt "<<s.isMdt() <<std::endl;
27  std::cout<<"\t m_first.nhits "<<s.mdtMl1().nhits <<std::endl;
28  std::cout<<"\t m_first.nholes "<<s.mdtMl1().nholes <<std::endl;
29  std::cout<<"\t m_first.noutliers "<<s.mdtMl1().noutliers <<std::endl;
30  std::cout<<"\t m_first.ndeltas "<<s.mdtMl1().ndeltas <<std::endl;
31  std::cout<<"\t m_first.ncloseHits "<<s.mdtMl1().ncloseHits<<std::endl;
32  std::cout<<"\t m_second.nhits "<<s.mdtMl2().nhits <<std::endl;
33  std::cout<<"\t m_second.nholes "<<s.mdtMl2().nholes <<std::endl;
34  std::cout<<"\t m_second.noutliers "<<s.mdtMl2().noutliers <<std::endl;
35  std::cout<<"\t m_second.ndeltas "<<s.mdtMl2().ndeltas <<std::endl;
36  std::cout<<"\t m_second.ncloseHits"<<s.mdtMl2().ncloseHits<<std::endl;
37  }
38  }
39 
40 }
41 
42 
43 void TrackSummaryCnv_p2::persToTrans( const Trk::TrackSummary_p2 *persObj, Trk::TrackSummary *transObj, MsgStream &/*log*/ ){
44  transObj->m_information = persObj->m_information;
45  if (transObj->m_information.size() < Trk::numberOfTrackSummaryTypes)
48 
49  if (persObj->m_information.size() <= Trk::numberOfInnermostPixelLayerHits) {
52  }
53 
57  }
58 
59 
60  transObj->m_idHitPattern = persObj->m_idHitPattern;
61 
62  std::size_t s = persObj->m_muonTrackSummary.size();
63  if(s){ // MUON TRACK SUMMARY
65  std::vector<unsigned int>::const_iterator i = persObj->m_muonTrackSummary.begin();
66 
67  ts->m_nscatterers = *i; ++i;
68  ts->m_npseudoMeasurements = *i; ++i;
69 
70  size_t size=(s-2)/12;
71  ts->m_chamberHitSummary.reserve(size);
72 
73  for (size_t sc=0; sc<size ; ++sc ){
74  ts->m_chamberHitSummary.emplace_back(Identifier(*i), bool(*(++i)));
75  ++i;
76  ts->m_chamberHitSummary[sc].m_first.nhits =(*i);++i;
77  ts->m_chamberHitSummary[sc].m_first.nholes =(*i);++i;
78  ts->m_chamberHitSummary[sc].m_first.noutliers =(*i);++i;
79  ts->m_chamberHitSummary[sc].m_first.ndeltas =(*i);++i;
80  ts->m_chamberHitSummary[sc].m_first.ncloseHits =(*i);++i;
81  ts->m_chamberHitSummary[sc].m_second.nhits =(*i);++i;
82  ts->m_chamberHitSummary[sc].m_second.nholes =(*i);++i;
83  ts->m_chamberHitSummary[sc].m_second.noutliers =(*i);++i;
84  ts->m_chamberHitSummary[sc].m_second.ndeltas =(*i);++i;
85  ts->m_chamberHitSummary[sc].m_second.ncloseHits=(*i);++i;
86  }
87 
88  transObj->m_muonTrackSummary.reset(ts);
89  }
90 
91  // dbgPrint(transObj);
92 }
93 
94 
95 void TrackSummaryCnv_p2::transToPers( const Trk::TrackSummary *transObj, Trk::TrackSummary_p2 *persObj, MsgStream & /*log*/ ){
96 
97  // dbgPrint(transObj);
98 
99  persObj->m_information = transObj->m_information;
100  persObj->m_idHitPattern = transObj->m_idHitPattern;
101 
102  if(transObj->m_muonTrackSummary){ // MUON TRACK SUMMARY
103 
104  size_t size = transObj->m_muonTrackSummary->m_chamberHitSummary.size();
105 
106  persObj->m_muonTrackSummary.reserve(2 + 12 * size);
107  persObj->m_muonTrackSummary.push_back(transObj->m_muonTrackSummary->m_nscatterers);
108  persObj->m_muonTrackSummary.push_back(transObj->m_muonTrackSummary->m_npseudoMeasurements);
109 
111  transObj->m_muonTrackSummary->chamberHitSummary())
112  {
113  persObj->m_muonTrackSummary.push_back(s.chamberId().get_identifier32().get_compact() );
114  persObj->m_muonTrackSummary.push_back(s.isMdt() ); // these are just bits and should be compressed by us
115  persObj->m_muonTrackSummary.push_back(s.mdtMl1().nhits );
116  persObj->m_muonTrackSummary.push_back(s.mdtMl1().nholes );
117  persObj->m_muonTrackSummary.push_back(s.mdtMl1().noutliers );
118  persObj->m_muonTrackSummary.push_back(s.mdtMl1().ndeltas );
119  persObj->m_muonTrackSummary.push_back(s.mdtMl1().ncloseHits );
120  persObj->m_muonTrackSummary.push_back(s.mdtMl2().nhits );
121  persObj->m_muonTrackSummary.push_back(s.mdtMl2().nholes );
122  persObj->m_muonTrackSummary.push_back(s.mdtMl2().noutliers );
123  persObj->m_muonTrackSummary.push_back(s.mdtMl2().ndeltas );
124  persObj->m_muonTrackSummary.push_back(s.mdtMl2().ncloseHits );
125  }
126 
127  }
128 }
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trk::TrackSummary_p2
Definition: TrackSummary_p2.h:13
Trk::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:53
MuonTrackSummary.h
Trk::TrackSummary::m_idHitPattern
unsigned long m_idHitPattern
contains the 'hit pattern'
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:367
TrackSummaryCnv_p2::dbgPrint
static void dbgPrint(const Trk ::TrackSummary *transObj)
Definition: TrackSummaryCnv_p2.cxx:9
Trk::numberOfTrackSummaryTypes
@ numberOfTrackSummaryTypes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:189
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::MuonTrackSummary::ChamberHitSummary
structure to hold information per chamber in the muon system
Definition: MuonTrackSummary.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::numberOfBLayerHits
@ numberOfBLayerHits
these are the hits in the 0th pixel layer?
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:51
Trk::TrackSummary_p2::m_information
std::vector< int > m_information
Definition: TrackSummary_p2.h:17
TrackSummaryCnv_p2.h
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::TrackSummary_p2::m_idHitPattern
unsigned long m_idHitPattern
contains the 'hit pattern'
Definition: TrackSummary_p2.h:20
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::MuonTrackSummary
Detailed track summary for the muon system Give access to hit counts per chamber.
Definition: MuonTrackSummary.h:26
TrackSummary.h
Trk::legacy_numberOfInnermostPixelLayerSharedHits
@ legacy_numberOfInnermostPixelLayerSharedHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:175
Trk::TrackSummary::SummaryTypeNotSet
static const int SummaryTypeNotSet
Value set in the cxx file to -1.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:297
TrackSummaryCnv_p2::persToTrans
virtual void persToTrans(const Trk ::TrackSummary_p2 *persObj, Trk ::TrackSummary *transObj, MsgStream &log)
Definition: TrackSummaryCnv_p2.cxx:43
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
TrackSummaryCnv_p2::transToPers
virtual void transToPers(const Trk ::TrackSummary *transObj, Trk ::TrackSummary_p2 *persObj, MsgStream &log)
Definition: TrackSummaryCnv_p2.cxx:95
Trk::TrackSummary::m_information
std::vector< int > m_information
vector containing the persistent summary information.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:364
Trk::TrackSummary_p2::m_muonTrackSummary
std::vector< unsigned int > m_muonTrackSummary
Definition: TrackSummary_p2.h:28
Trk::legacy_numberOfBLayerSharedHits
@ legacy_numberOfBLayerSharedHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:170
Trk::TrackSummary::m_muonTrackSummary
std::unique_ptr< MuonTrackSummary > m_muonTrackSummary
pointer to the MuonTrackSummary
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:370
python.CaloScaleNoiseConfig.ts
ts
Definition: CaloScaleNoiseConfig.py:86
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
Identifier
Definition: IdentifierFieldParser.cxx:14