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