Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "GT_Hit.h"
00019
00020
00021
00022 #include "G4Allocator.hh"
00023
00024 #include "G4VVisManager.hh"
00025 #include "G4Circle.hh"
00026 #include "G4VisAttributes.hh"
00027 #include "G4Colour.hh"
00028
00029
00030
00031 using namespace std;
00032
00033
00034
00035
00036
00037
00038
00039 GT_Hit::GT_Hit(){}
00040
00041
00042
00043 GT_Hit::GT_Hit( const GT_Hit & hit ) {
00044 copyno = hit.copyno;
00045 trackid = hit.trackid;
00046 edep = hit.edep;
00047 time = hit.time;
00048 tworld = hit.tworld;
00049 tlocal = hit.tlocal;
00050 world = hit.world;
00051 local = hit.local;
00052 }
00053
00054
00055
00056 const GT_Hit & GT_Hit::operator = ( const GT_Hit & hit ) {
00057 copyno = hit.copyno;
00058 trackid = hit.trackid;
00059 edep = hit.edep;
00060 time = hit.time;
00061 tworld = hit.tworld;
00062 tlocal = hit.tlocal;
00063 world = hit.world;
00064 local = hit.local;
00065 return *this;
00066 }
00067
00068
00069
00070 GT_Hit::~GT_Hit(){}
00071
00072
00073
00074
00075
00076 G4int GT_Hit::operator == ( const GT_Hit & hit ) const {
00077 return ( this == &hit ) ? 1 : 0;
00078 }
00079
00080
00081
00082 G4Allocator< GT_Hit > GT_HitAllocator;
00083
00084
00085
00086 void * GT_Hit::operator new( size_t ) {
00087 return ( void * ) GT_HitAllocator.MallocSingle();
00088 }
00089
00090
00091
00092 void GT_Hit::operator delete( void * aHit ) {
00093 GT_HitAllocator.FreeSingle( ( GT_Hit * ) aHit );
00094 }
00095
00096
00097
00098 void GT_Hit::Draw() {
00099
00100 G4VVisManager * pVVisManager = G4VVisManager::GetConcreteInstance();
00101 if( pVVisManager ) {
00102
00103 G4Circle circle( world );
00104 circle.SetScreenSize( 5.0 );
00105 circle.SetFillStyle( G4Circle::filled );
00106 circle.SetVisAttributes( G4VisAttributes( G4Colour( 0.0,1.0,0.0) ) );
00107 pVVisManager->Draw( circle );
00108 }
00109 }
00110
00111
00112
00113 void GT_Hit::Print() {
00114 G4cout.precision(3);
00115 G4cout << fixed
00116 << "GT Hit Copy # " << copyno
00117 << " Track # = " << trackid << "\n"
00118 << " Edep = " << edep/eV << " [eV] "
00119 << " Time = " << time/ns << " [ns]\n"
00120 << " True World = " << tworld/cm << " [cm] "
00121 << " True Local = " << tlocal/cm << " [cm]\n"
00122 << " Smeared World = " << world/cm << " [cm] "
00123 << " Smeared Local = " << local/cm << " [cm]\n"
00124 << G4endl;
00125 }