ATLAS Offline Software
InDetSimData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Simulation data object associated with an InDetRawData object
7  ------------------------------------------------------
8  ATLAS Collaboration
9  ***************************************************************************
10  An object of this class stores the simulation information associated with
11  a RawData object, in two data members.
12 
13  One is an integer, the "simulation data word", in which is packed
14  information summarizing the digitization. Its interpretation may depend on
15  which of the three subdetectors is concerned, but will typically contain
16  bit-flags for "noise", "lost in readout", etc.
17 
18  The other consists of a number (normally only one) of pair<int, float>
19  specifying the barcode and energy (charge) deposited by a charged particle,
20  or rather that part of the charge attributed to the corresponding RDO.
21  Encoding and decoding methods will be supplied outside this class.
22 
23  The implementation emphasizes compactness in memory, at the expense of speed,
24  because objects of this class will be persistent, but will not be accessed
25  in real production running.
26 
27  ***************************************************************************/
28 
29 // $Id: InDetSimData.h,v 1.15 2004-07-08 20:57:03 costanzo Exp $
30 
31 #ifndef INDETSIMDATA_InDetSimData_H
32 # define INDETSIMDATA_InDetSimData_H
33 
34 //#include "InDetSimData/PixelSimHelper.h"
35 #include <utility>
36 #include <vector>
38 
39 class PixelSimHelper;
40 
41 class InDetSimData final
42 {
43  friend class PixelSimHelper;
44  friend class SCT_SimHelper;
45  friend class TRT_SimHelper;
46 
47 public:
48  typedef std::pair<HepMcParticleLink, float> Deposit; // A particle link, and the
49  // energy (charge) which its hits contribute to the current RDO.
50  InDetSimData();
51  InDetSimData(InDetSimData&& other) noexcept = default;
52  InDetSimData (const std::vector< Deposit >& deposits, int simDataWord = 0);
53  InDetSimData (std::vector< Deposit >&& deposits, int simDataWord = 0);
57  ~InDetSimData() = default;
58  int word() const; // Get the packed simdata word
59  void deposits(std::vector<Deposit>& deposits) const; // Get the Deposits
60  //std::vector< Deposit > getdeposits() const; // for some reason I can't get this to return by reference! It won't compile. EJWM
61  const std::vector< Deposit >& getdeposits() const;
62 
63 private:
64  int m_word;
65  // Deposit* m_p_deposits; but use vector meantime, needs more work
66  std::vector<Deposit> m_deposits;
67 };
68 
69 inline int InDetSimData::word() const
70 {
71  return m_word & 0x1fffffff;
72 }
73 
74 inline const std::vector< InDetSimData::Deposit >& InDetSimData::getdeposits() const
75 {
76  return m_deposits;
77 }
78 
79 inline void InDetSimData::deposits(std::vector< InDetSimData::Deposit>& deposits) const
80 {
81  // I really don't understand what the point of this is ... it does EXACTLY the same as the getdeposits() method, just in a different way. EJWM
83  return;
84 }
85 
86 #endif // INDETSIMDATA_InDetSimData_H
InDetSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: InDetSimData.h:74
InDetSimData::InDetSimData
InDetSimData(InDetSimData &&other) noexcept=default
InDetSimData::InDetSimData
InDetSimData()
Definition: InDetSimData.cxx:17
InDetSimData::InDetSimData
InDetSimData(const InDetSimData &other)
TRT_SimHelper
Definition: TRT_SimHelper.h:28
InDetSimData::deposits
void deposits(std::vector< Deposit > &deposits) const
Definition: InDetSimData.h:79
InDetSimData
Definition: InDetSimData.h:42
InDetSimData::m_deposits
std::vector< Deposit > m_deposits
Definition: InDetSimData.h:66
InDetSimData::word
int word() const
Definition: InDetSimData.h:69
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
PixelSimHelper
Definition: PixelSimHelper.h:28
InDetSimData::m_word
int m_word
Definition: InDetSimData.h:64
SCT_SimHelper
Definition: SCT_SimHelper.h:28
InDetSimData::Deposit
std::pair< HepMcParticleLink, float > Deposit
Definition: InDetSimData.h:48
InDetSimData::operator=
InDetSimData & operator=(const InDetSimData &other)
Definition: InDetSimData.cxx:42
InDetSimData::~InDetSimData
~InDetSimData()=default