File indexing completed on 2025-01-31 09:22:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #ifndef GammaRayTelDigi_h
0040 #define GammaRayTelDigi_h 1
0041
0042 #include "G4VDigi.hh"
0043 #include "G4TDigiCollection.hh"
0044 #include "G4Allocator.hh"
0045 #include "G4ThreeVector.hh"
0046
0047 class GammaRayTelDigi: public G4VDigi {
0048 public:
0049 explicit GammaRayTelDigi();
0050
0051 ~GammaRayTelDigi() override;
0052
0053 GammaRayTelDigi(const GammaRayTelDigi&);
0054
0055 auto operator=(const GammaRayTelDigi& right) -> const GammaRayTelDigi&;
0056
0057 auto operator==(const GammaRayTelDigi &right) const -> G4bool;
0058
0059 inline auto operator new(size_t) -> void*;
0060
0061 inline auto operator delete(void *digit) -> void;
0062
0063 void Draw() override;
0064
0065 void Print() override;
0066
0067 inline void SetPlaneNumber(G4int value) {
0068 planeNumber = value;
0069 }
0070
0071 inline void SetPlaneType(G4int value) {
0072 planeType = value;
0073 }
0074
0075 inline void SetStripNumber(G4int value) {
0076 stripNumber = value;
0077 }
0078
0079 inline void SetDigitType(G4int value) {
0080 digitType = value;
0081 }
0082
0083 inline void SetEnergy(G4double value) {
0084 energy = value;
0085 }
0086
0087 [[nodiscard]]
0088 inline auto GetPlaneNumber() const -> G4int {
0089 return planeNumber;
0090 }
0091
0092 [[nodiscard]]
0093 inline auto GetPlaneType() const -> G4int {
0094 return planeType;
0095 }
0096
0097 [[nodiscard]]
0098 inline auto GetStripNumber() const -> G4int {
0099 return stripNumber;
0100 }
0101
0102 [[nodiscard]]
0103 inline auto GetDigitType() const -> G4int {
0104 return digitType;
0105 }
0106
0107 [[nodiscard]]
0108 inline auto GetEnergy() const -> G4double {
0109 return energy;
0110 }
0111
0112 private:
0113 G4int planeType{0};
0114
0115 G4int planeNumber{0};
0116
0117 G4int stripNumber{0};
0118
0119 G4int digitType{0};
0120
0121 G4double energy{0.};
0122 };
0123
0124 using GammaRayTelDigitsCollection = G4TDigiCollection<GammaRayTelDigi>;
0125 extern G4ThreadLocal G4Allocator<GammaRayTelDigi> *digitAllocator;
0126
0127 inline auto GammaRayTelDigi::operator new(size_t) -> void* {
0128 if (digitAllocator == nullptr) {
0129 digitAllocator = new G4Allocator<GammaRayTelDigi>;
0130 }
0131 return (void*) digitAllocator->MallocSingle();
0132 }
0133
0134 inline auto GammaRayTelDigi::operator delete(void *digit) -> void {
0135 digitAllocator->FreeSingle((GammaRayTelDigi*) digit);
0136 }
0137 #endif