ATLAS Offline Software
TileCosmicMuonCnv_p2.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // TileCosmicMuonCnv_p2.cxx
8 // Implementation file for class TileCosmicMuonCnv_p2
9 // Author: Jose Maneira <maneira@lip.pt>
10 // Date: July 2009
12 
15 
16 #include <algorithm>
17 
18 void TileCosmicMuonCnv_p2::transToPers(const TileCosmicMuon* transObj, TileCosmicMuon_p2* persObj, MsgStream &/*log*/) const {
19 
20  persObj->m_time = transObj->GetTime();
21  persObj->m_positionX = transObj->GetPositionX();
22  persObj->m_positionY = transObj->GetPositionY();
23  persObj->m_positionZ = transObj->GetPositionZ();
24  persObj->m_directionPhi = transObj->GetDirectionPhi();
25  persObj->m_directionTheta = transObj->GetDirectionTheta();
26  persObj->m_fitQuality = transObj->GetFitQuality();
27  persObj->m_fitNCells = transObj->GetFitNCells();
28 
29  size_t sz = transObj->GetNSamples();
30  persObj->m_pathTop.resize(sz);
31  persObj->m_pathBottom.resize(sz);
32  persObj->m_energyTop.resize(sz);
33  persObj->m_energyBottom.resize(sz);
34  for (size_t i = 0; i < sz; i++) {
35  persObj->m_pathTop[i] = transObj->GetPathTop(i);
36  persObj->m_pathBottom[i] = transObj->GetPathBottom(i);
37  persObj->m_energyTop[i] = transObj->GetEnergyTop(i);
38  persObj->m_energyBottom[i] = transObj->GetEnergyBottom(i);
39  }
40 
41  size_t ncells = transObj->GetTrackNCells();
42  persObj->m_trackCellHash.resize(ncells);
43  for (size_t i = 0; i < ncells; i++) {
44  persObj->m_trackCellHash[i] = transObj->GetTrackCellHash(i);
45  }
46 
47  size_t nseg = transObj->GetNSegments();
48  persObj->m_segmentPath.resize(nseg);
49  persObj->m_segmentPartitionModuleSampling.resize(nseg);
50  for (size_t i = 0; i < nseg; i++) {
51  persObj->m_segmentPath[i] = transObj->GetSegmentPath(i);
52  int part = transObj->GetSegmentPartition(i);
53  int mod = transObj->GetSegmentModule(i);
54  int samp = transObj->GetSegmentSampling(i);
56  ((part&0xFF)<<24) | ((mod&0xFF)<<16) | ((samp&0xFF)<<8);
57 
58  }
59 }
60 
61 
62 void TileCosmicMuonCnv_p2::persToTrans(const TileCosmicMuon_p2* persObj, TileCosmicMuon* transObj, MsgStream &/*log*/) const {
63 
64  transObj->SetTime (persObj->m_time);
65  transObj->SetPositionX (persObj->m_positionX);
66  transObj->SetPositionY (persObj->m_positionY);
67  transObj->SetPositionZ (persObj->m_positionZ);
68  transObj->SetDirectionPhi (persObj->m_directionPhi);
69  transObj->SetDirectionTheta (persObj->m_directionTheta);
70  transObj->SetFitQuality (persObj->m_fitQuality);
71  transObj->SetFitNCells (persObj->m_fitNCells);
72 
73  transObj->SetPathTop (std::vector<double> (persObj->m_pathTop.begin(),
74  persObj->m_pathTop.end()));
75 
76  transObj->SetPathBottom (std::vector<double> (persObj->m_pathBottom.begin(),
77  persObj->m_pathBottom.end()));
78 
79  transObj->SetEnergyTop (std::vector<double> (persObj->m_energyTop.begin(),
80  persObj->m_energyTop.end()));
81 
82  transObj->SetEnergyBottom (std::vector<double> (persObj->m_energyBottom.begin(),
83  persObj->m_energyBottom.end()));
84 
85 
86  transObj->SetTrackCellHash (std::vector<IdentifierHash> (persObj->m_trackCellHash.begin(),
87  persObj->m_trackCellHash.end()));
88 
89 
90  transObj->SetSegmentPath (std::vector<double> (persObj->m_segmentPath.begin(),
91  persObj->m_segmentPath.end()));
92 
93 
94  unsigned int pms = persObj->m_segmentPartitionModuleSampling.size();
95  std::vector<int> segmentPartition(pms);
96  std::vector<int> segmentModule(pms);
97  std::vector<int> segmentSampling(pms);
98 
99  for (size_t i = 0; i < pms; i++) {
100  unsigned int x = persObj->m_segmentPartitionModuleSampling[i];
101  segmentPartition[i] = (x>>24) & 0xFF;
102  segmentModule[i] = (x>>16) & 0xFF;
103  segmentSampling[i] = (x>>8) & 0xFF;
104  }
105 
106  transObj->SetSegmentPartition (std::move (segmentPartition));
107  transObj->SetSegmentModule (std::move (segmentModule));
108  transObj->SetSegmentSampling (std::move (segmentSampling));
109 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
TileCosmicMuonCnv_p2::persToTrans
virtual void persToTrans(const TileCosmicMuon_p2 *persObj, TileCosmicMuon *transObj, MsgStream &log) const override
Method creating the transient representation TileCosmicMuon from its persistent representation TileCo...
Definition: TileCosmicMuonCnv_p2.cxx:62
TileCosmicMuon::GetDirectionPhi
double GetDirectionPhi() const
Definition: TileCosmicMuon.h:103
TileCosmicMuon::SetSegmentPath
void SetSegmentPath(const std::vector< double > &path)
Definition: TileCosmicMuon.h:69
fitman.sz
sz
Definition: fitman.py:527
TileCosmicMuon::GetFitQuality
double GetFitQuality() const
Definition: TileCosmicMuon.h:105
TileCosmicMuon
Class containing detailed results from TileMuonFitter.
Definition: TileCosmicMuon.h:35
TileCosmicMuon::GetNSamples
int GetNSamples() const
Definition: TileCosmicMuon.h:108
TileCosmicMuon::GetSegmentModule
int GetSegmentModule(int ind) const
Definition: TileCosmicMuon.h:117
TileCosmicMuon::SetPositionX
void SetPositionX(double posx)
Definition: TileCosmicMuon.h:51
TileCosmicMuon_p2::m_fitNCells
int m_fitNCells
Number of cells used in fit.
Definition: TileCosmicMuon_p2.h:47
TileCosmicMuon_p2::m_energyBottom
std::vector< float > m_energyBottom
Vector with sum energy of cells close to track on bottom modules [0]:sampling A; [1]: BC; [2]: D.
Definition: TileCosmicMuon_p2.h:56
TileCosmicMuon_p2::m_directionTheta
float m_directionTheta
Theta angle of track direction.
Definition: TileCosmicMuon_p2.h:45
TileCosmicMuon::SetSegmentSampling
void SetSegmentSampling(const std::vector< int > &sampling)
Definition: TileCosmicMuon.h:75
TileCosmicMuon::SetEnergyBottom
void SetEnergyBottom(const std::vector< double > &energy)
Definition: TileCosmicMuon.h:65
TileCosmicMuon_p2::m_energyTop
std::vector< float > m_energyTop
Vector with sum energy of cells close to track on top modules [0]:sampling A; [1]: BC; [2]: D.
Definition: TileCosmicMuon_p2.h:54
TileCosmicMuon::GetPathBottom
double GetPathBottom(int ind) const
Definition: TileCosmicMuon.h:111
TileCosmicMuon_p2::m_directionPhi
float m_directionPhi
Phi angle of track direction.
Definition: TileCosmicMuon_p2.h:44
TileCosmicMuon_p2::m_pathTop
std::vector< float > m_pathTop
Vector with length of track within Tile on top modules [0]:sampling A; [1]: BC; [2]: D.
Definition: TileCosmicMuon_p2.h:50
TileCosmicMuon_p2::m_fitQuality
float m_fitQuality
Fit parameter: 0= no fit; (Hough) 1=fit ok; (Minuit) >0 chi-square.
Definition: TileCosmicMuon_p2.h:46
TileCosmicMuon::GetTime
double GetTime() const
Getters.
Definition: TileCosmicMuon.h:99
TileCosmicMuon_p2::m_positionX
float m_positionX
X coordinate of point in track at selected plane (y=0 for cosmics z=0 for beam)
Definition: TileCosmicMuon_p2.h:41
TileCosmicMuon::SetEnergyTop
void SetEnergyTop(const std::vector< double > &energy)
Definition: TileCosmicMuon.h:63
x
#define x
TileCosmicMuon::GetTrackCellHash
IdentifierHash GetTrackCellHash(int ind) const
Definition: TileCosmicMuon.h:114
TileCosmicMuon::SetPositionY
void SetPositionY(double posy)
Definition: TileCosmicMuon.h:52
TileCosmicMuon.h
TileCosmicMuonCnv_p2.h
TileCosmicMuon_p2::m_positionY
float m_positionY
Y coordinate of point in track at selected plane (y=0 for cosmics z=0 for beam)
Definition: TileCosmicMuon_p2.h:42
TileCosmicMuon_p2
Definition: TileCosmicMuon_p2.h:20
TileCosmicMuon::GetSegmentPath
double GetSegmentPath(int ind) const
Definition: TileCosmicMuon.h:115
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileCosmicMuon::SetDirectionPhi
void SetDirectionPhi(double phi)
Definition: TileCosmicMuon.h:54
TileCosmicMuon_p2::m_segmentPartitionModuleSampling
std::vector< unsigned int > m_segmentPartitionModuleSampling
Vector with segment partition/module/sampling - one byte for each.
Definition: TileCosmicMuon_p2.h:63
TileCosmicMuon::GetSegmentSampling
int GetSegmentSampling(int ind) const
Definition: TileCosmicMuon.h:118
TileCosmicMuon::SetPositionZ
void SetPositionZ(double posz)
Definition: TileCosmicMuon.h:53
TileCosmicMuon::SetSegmentPartition
void SetSegmentPartition(const std::vector< int > &partition)
Definition: TileCosmicMuon.h:71
TileCosmicMuon::GetTrackNCells
int GetTrackNCells() const
Definition: TileCosmicMuon.h:107
TileCosmicMuon::GetPathTop
double GetPathTop(int ind) const
Definition: TileCosmicMuon.h:110
TileCosmicMuon::SetSegmentModule
void SetSegmentModule(const std::vector< int > &module)
Definition: TileCosmicMuon.h:73
TileCosmicMuon::GetDirectionTheta
double GetDirectionTheta() const
Definition: TileCosmicMuon.h:104
TileCosmicMuon::GetEnergyBottom
double GetEnergyBottom(int ind) const
Definition: TileCosmicMuon.h:113
TileCosmicMuon::GetEnergyTop
double GetEnergyTop(int ind) const
Definition: TileCosmicMuon.h:112
TileCosmicMuon::GetNSegments
int GetNSegments() const
Definition: TileCosmicMuon.h:109
TileCosmicMuon_p2::m_segmentPath
std::vector< float > m_segmentPath
Vector with length of track within Tile on a given segment.
Definition: TileCosmicMuon_p2.h:61
TileCosmicMuon::SetPathBottom
void SetPathBottom(const std::vector< double > &path)
Definition: TileCosmicMuon.h:61
TileCosmicMuon::SetFitNCells
void SetFitNCells(int ncells)
Definition: TileCosmicMuon.h:57
TileCosmicMuon_p2::m_positionZ
float m_positionZ
Z coordinate of point in track at selected plane (y=0 for cosmics z=0 for beam)
Definition: TileCosmicMuon_p2.h:43
TileCosmicMuon::GetPositionX
double GetPositionX() const
Definition: TileCosmicMuon.h:100
TileCosmicMuon_p2::m_time
float m_time
Time of track at selected plane (y=0 for cosmics z=0 for beam)
Definition: TileCosmicMuon_p2.h:40
TileCosmicMuonCnv_p2::transToPers
virtual void transToPers(const TileCosmicMuon *transObj, TileCosmicMuon_p2 *persObj, MsgStream &log) const override
Method creating the persistent representation TileCosmicMuon_p2 from its transient representation Til...
Definition: TileCosmicMuonCnv_p2.cxx:18
TileCosmicMuon_p2::m_trackCellHash
std::vector< unsigned int > m_trackCellHash
Vector with list of Identifier Hash of cells close to track.
Definition: TileCosmicMuon_p2.h:59
TileCosmicMuon::SetDirectionTheta
void SetDirectionTheta(double theta)
Definition: TileCosmicMuon.h:55
TileCosmicMuon::GetFitNCells
int GetFitNCells() const
Definition: TileCosmicMuon.h:106
TileCosmicMuon::SetTrackCellHash
void SetTrackCellHash(const std::vector< IdentifierHash > &cells)
Definition: TileCosmicMuon.h:67
TileCosmicMuon_p2::m_pathBottom
std::vector< float > m_pathBottom
Vector with length of track within Tile on bottom modules [0]:sampling A; [1]: BC; [2]: D.
Definition: TileCosmicMuon_p2.h:52
TileCosmicMuon::SetFitQuality
void SetFitQuality(double quality)
Definition: TileCosmicMuon.h:56
TileCosmicMuon::SetPathTop
void SetPathTop(const std::vector< double > &path)
Definition: TileCosmicMuon.h:59
TileCosmicMuon::GetPositionY
double GetPositionY() const
Definition: TileCosmicMuon.h:101
TileCosmicMuon::GetSegmentPartition
int GetSegmentPartition(int ind) const
Definition: TileCosmicMuon.h:116
TileCosmicMuon::GetPositionZ
double GetPositionZ() const
Definition: TileCosmicMuon.h:102
TileCosmicMuon::SetTime
void SetTime(double time)
Setters.
Definition: TileCosmicMuon.h:50