File indexing completed on 2026-09-22 08:08:44
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 #include "SAXSSensitiveDetectorHit.hh"
0030
0031 #include "G4AttDef.hh"
0032 #include "G4AttDefStore.hh"
0033 #include "G4AttValue.hh"
0034 #include "G4Circle.hh"
0035 #include "G4Colour.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4UIcommand.hh"
0039 #include "G4UnitsTable.hh"
0040 #include "G4VVisManager.hh"
0041 #include "G4VisAttributes.hh"
0042 #include "G4ios.hh"
0043
0044
0045
0046 G4ThreadLocal G4Allocator<SAXSSensitiveDetectorHit>* hitAllocator = nullptr;
0047
0048
0049
0050 SAXSSensitiveDetectorHit::SAXSSensitiveDetectorHit() : G4VHit()
0051 {
0052 fTime = 0.;
0053 fPos = G4ThreeVector(0., 0., 0.);
0054 fMom = G4ThreeVector(0., 0., 0.);
0055 fEnergy = 0.;
0056 fType = -1;
0057 fTrackID = -1;
0058 fWeight = -1;
0059 }
0060
0061
0062
0063 SAXSSensitiveDetectorHit::SAXSSensitiveDetectorHit(const SAXSSensitiveDetectorHit& right) : G4VHit()
0064 {
0065 fTrackID = right.fTrackID;
0066 fTrackIDP = right.fTrackIDP;
0067 fPos = right.fPos;
0068 fMom = right.fMom;
0069 fTime = right.fTime;
0070 fEnergy = right.fEnergy;
0071 fType = right.fType;
0072 fWeight = right.fWeight;
0073 }
0074
0075
0076
0077 const SAXSSensitiveDetectorHit&
0078 SAXSSensitiveDetectorHit::operator=(const SAXSSensitiveDetectorHit& right)
0079 {
0080 fTrackID = right.fTrackID;
0081 fTrackIDP = right.fTrackIDP;
0082 fPos = right.fPos;
0083 fMom = right.fMom;
0084 fTime = right.fTime;
0085 fEnergy = right.fEnergy;
0086 fType = right.fType;
0087 fWeight = right.fWeight;
0088
0089 return *this;
0090 }
0091
0092
0093
0094 int SAXSSensitiveDetectorHit::operator==(const SAXSSensitiveDetectorHit&) const
0095 {
0096 return 0;
0097 }
0098
0099
0100
0101 void SAXSSensitiveDetectorHit::Draw()
0102 {
0103 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0104 if (pVVisManager) {
0105 G4Circle circle(fPos);
0106 circle.SetScreenSize(2);
0107 circle.SetFillStyle(G4Circle::filled);
0108 G4Colour colour(1., 1., 0.);
0109 G4VisAttributes attribs(colour);
0110 circle.SetVisAttributes(attribs);
0111 pVVisManager->Draw(circle);
0112 }
0113 }
0114
0115
0116
0117 void SAXSSensitiveDetectorHit::Print()
0118 {
0119 G4cout << " Hit at time " << fTime / ns << " (nsec) - pos(x,y,z) " << fPos / mm
0120 << " (mm) - mom(x,y,z) " << fMom / eV << " eV" << G4endl;
0121 }
0122
0123