ATLAS Offline Software
CscSimData.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 // CscSimData.h
6 
7 // CSC simulation data object associated with an MuonRawData object
8 
9 // D. Adams
10 // March 2007
11 //
12 // Modification of a copy of MuonSimData.
13 
14 #ifndef MUONSIMDATA_CscSimData_H
15 #define MUONSIMDATA_CscSimData_H
16 
17 // An object of this type will be constructed for each step
18 // contributing to each hit strip.
19 // energy = energy deposited in step
20 // (ypos, zpos) = transverse position where step crosses wire plane
21 // charge = charge on strip for the first hit for the strip;
22 // otherwise zero
23 class CscMcData {
24 public:
25  CscMcData() : m_energy(-9999.), m_ypos(-9999.), m_zpos(-9999.), m_charge(0.0) { }
26  CscMcData(float energy, float ypos, float zpos)
27  : m_energy(energy), m_ypos(ypos), m_zpos(zpos), m_charge(0.0) { }
28  void setCharge(float chg) { m_charge = chg; }
29  float energy() const { return m_energy; }
30  float ypos() const { return m_ypos; }
31  float zpos() const { return m_zpos; }
32  float charge() const { return m_charge; }
33 private:
34  float m_energy;
35  float m_ypos;
36  float m_zpos;
37  float m_charge;
38 };
39 
40 #include <utility>
41 #include <vector>
43 
44 class CscSimData {
45 
46 public:
47  typedef std::pair<HepMcParticleLink, CscMcData> Deposit;
48 
49 public:
50  CscSimData();
51  CscSimData (const std::vector<Deposit>& deposits, int simDataWord =0);
52  CscSimData ( std::vector<Deposit>&& deposits, int simDataWord =0);
53  int word() const; // Get the packed simdata word
54  void deposits(std::vector<Deposit>& deposits) const; // Get the Deposits
55  const std::vector< Deposit >& getdeposits() const;
56 
57 private:
58  int m_word;
59  std::vector<Deposit> m_deposits;
60 };
61 
62 
63 inline int CscSimData::word() const {
64  return m_word & 0x1fffffff;
65 }
66 
67 inline const std::vector<CscSimData::Deposit>& CscSimData::getdeposits() const {
68  return m_deposits;
69 }
70 
71 inline void CscSimData::deposits(std::vector<CscSimData::Deposit>& deposits) const {
73  return;
74 }
75 
76 #endif // MUONSIMDATA_CscSimData_H
77 
CscMcData::CscMcData
CscMcData(float energy, float ypos, float zpos)
Definition: CscSimData.h:26
CscMcData::m_charge
float m_charge
Definition: CscSimData.h:37
CscSimData::m_deposits
std::vector< Deposit > m_deposits
Definition: CscSimData.h:59
CscSimData::m_word
int m_word
Definition: CscSimData.h:58
CscMcData::m_energy
float m_energy
Definition: CscSimData.h:34
CscMcData::m_zpos
float m_zpos
Definition: CscSimData.h:36
CscSimData::CscSimData
CscSimData()
Definition: CscSimData.cxx:10
CscMcData
Definition: CscSimData.h:23
CscMcData::ypos
float ypos() const
Definition: CscSimData.h:30
CscSimData::word
int word() const
Definition: CscSimData.h:63
CscMcData::CscMcData
CscMcData()
Definition: CscSimData.h:25
CscMcData::setCharge
void setCharge(float chg)
Definition: CscSimData.h:28
CscSimData
Definition: CscSimData.h:44
CscSimData::deposits
void deposits(std::vector< Deposit > &deposits) const
Definition: CscSimData.h:71
CscMcData::charge
float charge() const
Definition: CscSimData.h:32
CscMcData::m_ypos
float m_ypos
Definition: CscSimData.h:35
CscSimData::Deposit
std::pair< HepMcParticleLink, CscMcData > Deposit
Definition: CscSimData.h:47
CscMcData::energy
float energy() const
Definition: CscSimData.h:29
CscSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: CscSimData.h:67
CscMcData::zpos
float zpos() const
Definition: CscSimData.h:31