File indexing completed on 2025-01-31 09:21:50
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
0044 #ifndef CEXMC_TRACK_POINT_INFO_HH
0045 #define CEXMC_TRACK_POINT_INFO_HH
0046
0047 #include <iosfwd>
0048 #include <G4ThreeVector.hh>
0049 #include <G4ParticleDefinition.hh>
0050 #include <G4Allocator.hh>
0051 #include <G4UnitsTable.hh>
0052 #include <G4Types.hh>
0053 #include "CexmcCommon.hh"
0054
0055
0056 struct CexmcTrackPointInfo
0057 {
0058
0059
0060 explicit CexmcTrackPointInfo( G4double unused = 0. ) :
0061 momentumAmp ( unused ), trackId( CexmcInvalidTrackId )
0062 {}
0063
0064 CexmcTrackPointInfo( const G4ThreeVector & positionLocal_,
0065 const G4ThreeVector & positionWorld_,
0066 const G4ThreeVector & directionLocal_,
0067 const G4ThreeVector & directionWorld_,
0068 G4double momentumAmp_,
0069 const G4ParticleDefinition * particle_,
0070 G4int trackId_, CexmcTrackType trackType_ ) :
0071 positionLocal( positionLocal_ ), positionWorld( positionWorld_ ),
0072 directionLocal( directionLocal_ ), directionWorld( directionWorld_ ),
0073 momentumAmp( momentumAmp_ ), particle( particle_ ), trackId( trackId_ ),
0074 trackType( trackType_ )
0075 {}
0076
0077 G4bool IsValid( void ) const
0078 {
0079 return trackId != CexmcInvalidTrackId;
0080 }
0081
0082 void * operator new( size_t size );
0083
0084 void operator delete( void * obj );
0085
0086 G4ThreeVector positionLocal;
0087
0088 G4ThreeVector positionWorld;
0089
0090 G4ThreeVector directionLocal;
0091
0092 G4ThreeVector directionWorld;
0093
0094 G4double momentumAmp;
0095
0096 const G4ParticleDefinition * particle;
0097
0098 G4int trackId;
0099
0100 CexmcTrackType trackType;
0101
0102
0103
0104 operator G4double()
0105 {
0106 return 0;
0107 }
0108 };
0109
0110
0111 extern G4Allocator< CexmcTrackPointInfo > trackPointInfoAllocator;
0112
0113
0114 inline void * CexmcTrackPointInfo::operator new( size_t )
0115 {
0116 return trackPointInfoAllocator.MallocSingle();
0117 }
0118
0119
0120 inline void CexmcTrackPointInfo::operator delete( void * obj )
0121 {
0122 trackPointInfoAllocator.FreeSingle(
0123 reinterpret_cast< CexmcTrackPointInfo * >( obj ) );
0124 }
0125
0126
0127 std::ostream & operator<<( std::ostream & out,
0128 const CexmcTrackPointInfo & trackPointInfo );
0129
0130
0131 #endif
0132