File indexing completed on 2025-01-31 09:21:47
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
0040
0041
0042
0043 #include "PhotonHit.hh"
0044 #include "G4VVisManager.hh"
0045 #include "G4Circle.hh"
0046 #include "G4Colour.hh"
0047 #include "G4VisAttributes.hh"
0048 #include <G4Point3D.hh>
0049 #include <G4ThreeVector.hh>
0050 #include <G4VHit.hh>
0051
0052 #include "PhotonHit.hh"
0053
0054 template <class Type>
0055 class G4Allocator;
0056 G4ThreadLocal G4Allocator<PhotonHit>* PhotonHitAllocator = nullptr;
0057
0058 PhotonHit::PhotonHit()
0059 : G4VHit()
0060 {}
0061
0062 PhotonHit::PhotonHit(unsigned iid, unsigned ipid, G4double iwavelength,
0063 G4double itime, G4ThreeVector iposition,
0064 G4ThreeVector idirection, G4ThreeVector ipolarization)
0065 : G4VHit()
0066 {
0067 fid = iid;
0068 fpid = ipid;
0069 fwavelength = iwavelength;
0070 ftime = itime;
0071 fposition = iposition;
0072 fdirection = idirection;
0073 fpolarization = ipolarization;
0074 }
0075
0076 PhotonHit::PhotonHit(const PhotonHit& right)
0077 : G4VHit()
0078 {
0079 fid = right.fid;
0080 fpid = right.fpid;
0081 fwavelength = right.fwavelength;
0082 ftime = right.ftime;
0083 fposition = right.fposition;
0084 fdirection = right.fdirection;
0085 fpolarization = right.fpolarization;
0086 }
0087
0088 const PhotonHit& PhotonHit::operator=(const PhotonHit& right)
0089 {
0090 fid = right.fid;
0091 fpid = right.fpid;
0092 fwavelength = right.fwavelength;
0093 ftime = right.ftime;
0094 fposition = right.fposition;
0095 fdirection = right.fdirection;
0096 fpolarization = right.fpolarization;
0097 return *this;
0098 }
0099
0100 G4bool PhotonHit::operator==(const PhotonHit& right) const
0101 {
0102 return (this == &right) ? true : false;
0103 }
0104
0105 void PhotonHit::Draw()
0106 {
0107 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0108 if(pVVisManager)
0109 {
0110 G4Circle circle(fposition);
0111 circle.SetScreenSize(2.);
0112 circle.SetFillStyle(G4Circle::filled);
0113 G4Colour colour(1., 0., 0.);
0114 G4VisAttributes attribs(colour);
0115 circle.SetVisAttributes(attribs);
0116 pVVisManager->Draw(circle);
0117 }
0118 }