All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AuxDetSimChannel.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file AuxDetSimChannel.h
3 ///
4 /// \brief object containing MC truth information necessary for making RawDigits
5 /// and doing back tracking
6 ///
7 /// \author miceli@fnal.gov
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef SIM_AUXDETSIMCHANNEL_H
11 #define SIM_AUXDETSIMCHANNEL_H
12 
13 // C/C++ standard libraries
14 #include <stdint.h> // C header (need to be compatible with Reflex)
15 #include <utility>
16 #include <vector>
17 
18 namespace sim {
19 
20  /**
21  * @brief MC truth information to make RawDigits and do back tracking
22  *
23  * This structure describes the true position of momentum of a MC particle
24  * entering and exiting a scintillator cell (channel) of an auxiliary
25  * scintillator detector.
26  */
27  class AuxDetIDE {
28 
29  public:
30  AuxDetIDE();
31 
32  //constructor for IDEs applying G4 offset...
33  AuxDetIDE(AuxDetIDE const&, int);
34 
35  int trackID; ///< Geant4 supplied track ID
36  float energyDeposited; ///< total energy deposited for this track ID and time
37  float entryX; ///< Entry position X of particle
38  float entryY; ///< Entry position Y of particle
39  float entryZ; ///< Entry position Z of particle
40  float entryT; ///< Entry time of particle
41  float exitX; ///< Exit position X of particle
42  float exitY; ///< Exit position Y of particle
43  float exitZ; ///< Exit position Z of particle
44  float exitT; ///< Exit time of particle
45  float exitMomentumX; ///< Exit X-Momentum of particle
46  float exitMomentumY; ///< Exit Y-Momentum of particle
47  float exitMomentumZ; ///< Exit Z-Momentum of particle
48 
49  bool operator< (const AuxDetIDE& other) const;
50  bool operator== (const AuxDetIDE& other) const;
51 
52 }; // class AuxDetIDE
53 
54  /**
55  * @brief Collection of particles crossing one auxiliary detector cell
56  *
57  * This structure collects information (as sim::AuxDetIDE) from all the MC
58  * particles crossing a single auxiliary detector cell (channel).
59  */
61 
62  public:
63  /// Default constructor (invalid, empty data)
65 
66  private:
67  uint32_t fAuxDetID; ///< geo->AuxDet(auxDetID), integer used to retrieve AuxDetGeo objec
68  uint32_t fAuxDetSensitiveID; ///< integer used to retrieve AuxDetSensitiveGeo object
69  std::vector<sim::AuxDetIDE> fAuxDetIDEs; ///< one sim::AuxDetIDE for each G4 track id
70 
71  public:
72 
73  AuxDetSimChannel(uint32_t inputAuxDetID,
74  uint32_t inputAuxDetSensitiveID);
75 
76  /// Constructor: copies from the specified IDE vector
77  AuxDetSimChannel(uint32_t inputAuxDetID,
78  const std::vector<sim::AuxDetIDE>& inputAuxDetIDEs,
79  uint32_t inputAuxDetSensitiveID=0);
80 
81  /// Constructor: moves data from the specified IDE vector
82  AuxDetSimChannel(uint32_t inputAuxDetID,
83  std::vector<sim::AuxDetIDE>&& inputAuxDetIDEs,
84  uint32_t inputAuxDetSensitiveID=0);
85 
86  std::pair<int,int> MergeAuxDetSimChannel(const AuxDetSimChannel&,
87  int);
88 
89  ///@name Getters
90  ///@{
91  uint32_t AuxDetID() const;
92  uint32_t AuxDetSensitiveID() const;
93 
94  bool operator< (const AuxDetSimChannel& other) const;
95  bool operator== (const AuxDetSimChannel& other) const;
96 
97  std::vector<sim::AuxDetIDE> const& AuxDetIDEs() const;
98  ///@}
99 
100  //typedef std::vector<AuxDetSimChannel> AuxDetSimChannelCollection;
101 
102 
103  }; // class AuxDetSimChannel
104  typedef std::vector<AuxDetSimChannel> AuxDetSimChannelCollection;
105 } // namespace sim
106 
107 
108 inline bool sim::AuxDetIDE::operator< (const AuxDetIDE& other) const { return trackID < other.trackID; }
109 inline bool sim::AuxDetIDE::operator== (const AuxDetIDE& other) const { return other.trackID == trackID; }
110 inline uint32_t sim::AuxDetSimChannel::AuxDetID() const { return fAuxDetID; }
111 inline uint32_t sim::AuxDetSimChannel::AuxDetSensitiveID() const { return fAuxDetSensitiveID; }
112 inline std::vector<sim::AuxDetIDE> const& sim::AuxDetSimChannel::AuxDetIDEs() const { return fAuxDetIDEs; }
113 
114 #endif // SIM_AUXDETSIMCHANNEL_H
115 
116 ////////////////////////////////////////////////////////////////////////
uint32_t fAuxDetSensitiveID
integer used to retrieve AuxDetSensitiveGeo object
std::vector< sim::AuxDetIDE > fAuxDetIDEs
one sim::AuxDetIDE for each G4 track id
std::pair< int, int > MergeAuxDetSimChannel(const AuxDetSimChannel &, int)
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
bool operator<(const AuxDetSimChannel &other) const
AuxDetSimChannel()
Default constructor (invalid, empty data)
bool operator<(const AuxDetIDE &other) const
float exitY
Exit position Y of particle.
Collection of particles crossing one auxiliary detector cell.
uint32_t AuxDetID() const
float entryT
Entry time of particle.
uint32_t fAuxDetID
geo-&gt;AuxDet(auxDetID), integer used to retrieve AuxDetGeo objec
float exitMomentumX
Exit X-Momentum of particle.
float exitT
Exit time of particle.
std::vector< sim::AuxDetIDE > const & AuxDetIDEs() const
float exitZ
Exit position Z of particle.
float entryZ
Entry position Z of particle.
float exitX
Exit position X of particle.
float energyDeposited
total energy deposited for this track ID and time
float entryX
Entry position X of particle.
float entryY
Entry position Y of particle.
uint32_t AuxDetSensitiveID() const
MC truth information to make RawDigits and do back tracking.
std::vector< AuxDetSimChannel > AuxDetSimChannelCollection
float exitMomentumY
Exit Y-Momentum of particle.
bool operator==(const AuxDetSimChannel &other) const
bool operator==(const AuxDetIDE &other) const