ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSimData.h
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 Simulation data object associated with an MuonRawData object
7 Adapated from the InnerDetector by Ketevi A. Assamagan
8 ------------------------------------------------------
9 ATLAS Collaboration
10 ***************************************************************************
11 An object of this class stores the simulation information associated with
12 a RawData object, in two data members.
13
14 One is an integer, the "simulation data word", in which is packed
15 information summarizing the digitization. Its interpretation may depend on
16 which of the three subdetectors is concerned, but will typically contain
17 bit-flags for "noise", "lost in readout", etc.
18
19 The other consists of a number (normally only one) of pair<int, float>
20 specifying the barcode and one additional piece of information depending
21 on the Muon technology: it could deposited energy (charge), hit time, to
22 be associated to a particular Muon Digit. - Ketevi A. Assamagan
23 Encoding and decoding methods will be supplied outside this class.
24
25 The implementation emphasizes compactness in memory, at the expense of speed,
26 because objects of this class will be persistent, but will not be accessed
27 in real production running.
28
29// $Id: MuonSimData.h,v 1.4 2004-07-03 09:04:40 ketevi Exp $
30
31------
32 Changed by Niels van Eldik <nveldik@nikhef.nl> 2004/06/03
33
34 - Added MuonMCData, which allows the storage of two values per Deposit
35 (needed by the MDT's: radius + local z position)
36
37***************************************************************************/
38
39#ifndef MUONSIMDATA_MuonSimData_H
40# define MUONSIMDATA_MuonSimData_H
41
43 public:
44 MuonMCData() : m_first(0.), m_second(0.) {};
45 MuonMCData(double f, float s) : m_first(f), m_second(s) {};
46
47 void SetData(double f, float s) { m_first = f; m_second = s ;}
48 double firstEntry() const { return m_first; }
49 float secondEntry() const { return m_second; }
50 void addToFirstEntry (const double fEntry) { m_first += fEntry; }
51 void addToSecondEntry(const float sEntry) { m_second += sEntry; }
52 private:
53 double m_first;
54 float m_second;
55};
56
57#include <utility>
58#include <vector>
61
63
64public:
65
66 typedef std::pair<HepMcParticleLink, MuonMCData> Deposit; // A particle link, and two
67 // other values relevent for the subsystem
69 MuonSimData (const std::vector< Deposit >& deposits, int simDataWord = 0);
70 MuonSimData (std::vector< Deposit >&& deposits, int simDataWord = 0);
71 int word() const; // Get the packed simdata word
72 void deposits(std::vector<Deposit>& deposits) const; // Get the Deposits
73 const std::vector< Deposit >& getdeposits() const;
74 void setPosition(const Amg::Vector3D& pos);
75 const Amg::Vector3D globalPosition() const;
76 void setTime(const float& time);
77 float getTime() const;
78
79private:
80 int m_word;
81 std::vector<Deposit> m_deposits;
82 float m_x;
83 float m_y;
84 float m_z;
85 float m_t;
86};
87
88
89inline int MuonSimData::word() const
90{
91 return m_word & 0x1fffffff;
92}
93
94inline const std::vector< MuonSimData::Deposit >& MuonSimData::getdeposits() const
95{
96 return m_deposits;
97}
98
99inline void MuonSimData::deposits(std::vector< MuonSimData::Deposit>& deposits) const
100{
102 return;
103}
104
105
107{
108 m_x = pos.x();
109 m_y = pos.y();
110 m_z = pos.z();
111}
112
114{
115 Amg::Vector3D globPos(m_x, m_y, m_z);
116 return globPos;
117}
118
119inline void MuonSimData::setTime(const float& time)
120{
121 m_t =time;
122}
123
124inline float MuonSimData::getTime() const
125{
126 float time= m_t;
127 return time;
128}
129
130#endif // MUONSIMDATA_MuonSimData_H
131
void SetData(double f, float s)
Definition MuonSimData.h:47
float secondEntry() const
Definition MuonSimData.h:49
MuonMCData(double f, float s)
Definition MuonSimData.h:45
float m_second
Definition MuonSimData.h:54
void addToSecondEntry(const float sEntry)
Definition MuonSimData.h:51
double m_first
Definition MuonSimData.h:53
void addToFirstEntry(const double fEntry)
Definition MuonSimData.h:50
double firstEntry() const
Definition MuonSimData.h:48
int word() const
Definition MuonSimData.h:89
const std::vector< Deposit > & getdeposits() const
Definition MuonSimData.h:94
std::vector< Deposit > m_deposits
Definition MuonSimData.h:81
void deposits(std::vector< Deposit > &deposits) const
Definition MuonSimData.h:99
void setTime(const float &time)
const Amg::Vector3D globalPosition() const
std::pair< HepMcParticleLink, MuonMCData > Deposit
Definition MuonSimData.h:66
void setPosition(const Amg::Vector3D &pos)
float getTime() const
Eigen::Matrix< double, 3, 1 > Vector3D