Loading...
Searching...
No Matches
LXePMTHit.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27/// \file optical/LXe/include/LXePMTHit.hh
28/// \brief Definition of the LXePMTHit class
29//
30//
31#ifndef LXePMTHit_h
32#define LXePMTHit_h 1
33
34#include "G4Allocator.hh"
35#include "G4LogicalVolume.hh"
36#include "G4THitsCollection.hh"
37#include "G4VHit.hh"
38#include "G4VPhysicalVolume.hh"
39
40class LXePMTHit : public G4VHit
41{
42 public:
43 LXePMTHit() = default;
45 ~LXePMTHit() override = default;
46
47 const LXePMTHit& operator=(const LXePMTHit& right);
48 G4bool operator==(const LXePMTHit& right) const;
49
50 inline void* operator new(size_t);
51 inline void operator delete(void* aHit);
52
53 void Draw() override;
54 void Print() override;
55
56 inline void SetDrawit(G4bool b) { fDrawit = b; }
57 inline G4bool GetDrawit() { return fDrawit; }
58
59 inline void IncPhotonCount() { ++fPhotons; }
60 inline G4int GetPhotonCount() { return fPhotons; }
61
62 inline void SetPMTNumber(G4int n) { fPmtNumber = n; }
63 inline G4int GetPMTNumber() { return fPmtNumber; }
64
65 inline void SetPMTPhysVol(G4VPhysicalVolume* physVol)
66 {
67 fPhysVol = physVol;
68 }
70
71 inline void SetPMTPos(G4double x, G4double y, G4double z)
72 {
73 fPos = G4ThreeVector(x, y, z);
74 }
75
76 inline G4ThreeVector GetPMTPos() { return fPos; }
77
78 private:
79 G4int fPmtNumber = -1;
80 G4int fPhotons = 0;
81 G4ThreeVector fPos;
83 G4bool fDrawit = false;
84};
85
87
88extern G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator;
89
90inline void* LXePMTHit::operator new(size_t)
91{
94 return (void*) LXePMTHitAllocator->MallocSingle();
95}
96
97inline void LXePMTHit::operator delete(void* aHit)
98{
99 LXePMTHitAllocator->FreeSingle((LXePMTHit*) aHit);
100}
101
102#endif
G4ThreadLocal G4Allocator< LXePMTHit > * LXePMTHitAllocator
Definition LXePMTHit.cc:40
G4THitsCollection< LXePMTHit > LXePMTHitsCollection
Definition LXePMTHit.hh:86
void Print() override
Definition LXePMTHit.cc:94
G4int GetPMTNumber()
Definition LXePMTHit.hh:63
G4int fPmtNumber
Definition LXePMTHit.hh:79
void IncPhotonCount()
Definition LXePMTHit.hh:59
void SetPMTPos(G4double x, G4double y, G4double z)
Definition LXePMTHit.hh:71
G4ThreeVector fPos
Definition LXePMTHit.hh:81
const LXePMTHit & operator=(const LXePMTHit &right)
Definition LXePMTHit.cc:55
G4bool operator==(const LXePMTHit &right) const
Definition LXePMTHit.cc:66
G4bool GetDrawit()
Definition LXePMTHit.hh:57
G4ThreeVector GetPMTPos()
Definition LXePMTHit.hh:76
void Draw() override
Definition LXePMTHit.cc:73
~LXePMTHit() override=default
G4VPhysicalVolume * fPhysVol
Definition LXePMTHit.hh:82
G4bool fDrawit
Definition LXePMTHit.hh:83
void SetPMTPhysVol(G4VPhysicalVolume *physVol)
Definition LXePMTHit.hh:65
LXePMTHit()=default
G4int fPhotons
Definition LXePMTHit.hh:80
G4VPhysicalVolume * GetPMTPhysVol()
Definition LXePMTHit.hh:69
void SetPMTNumber(G4int n)
Definition LXePMTHit.hh:62
void SetDrawit(G4bool b)
Definition LXePMTHit.hh:56
G4int GetPhotonCount()
Definition LXePMTHit.hh:60

Applications | User Support | Publications | Collaboration