File indexing completed on 2025-01-31 09:21:54
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 #include <iostream>
0045 #include "CexmcTrackPointInfo.hh"
0046
0047
0048 std::ostream & operator<<( std::ostream & out,
0049 const CexmcTrackPointInfo & trackPointInfo )
0050 {
0051 if ( ! trackPointInfo.IsValid() )
0052 return out << "tp is not valid";
0053
0054 const char * trackTypeInfo = "???";
0055
0056 switch ( trackPointInfo.trackType )
0057 {
0058 case CexmcBeamParticleTrack :
0059 trackTypeInfo = "bp";
0060 break;
0061 case CexmcOutputParticleTrack :
0062 trackTypeInfo = "op";
0063 break;
0064 case CexmcNucleusParticleTrack :
0065 trackTypeInfo = "np";
0066 break;
0067 case CexmcOutputParticleDecayProductTrack :
0068 trackTypeInfo = "opdp";
0069 break;
0070 default :
0071 break;
0072 }
0073
0074 std::ostream::fmtflags savedFlags( out.flags() );
0075 std::streamsize prec( out.precision() );
0076
0077 out.precision( 4 );
0078
0079 out << trackPointInfo.particle->GetParticleName() << " [" <<
0080 trackPointInfo.trackId << "," << trackTypeInfo << "] " <<
0081 G4BestUnit( trackPointInfo.momentumAmp, "Energy" ) << " : " <<
0082 G4BestUnit( trackPointInfo.positionLocal, "Length" ) << " [" <<
0083 trackPointInfo.directionLocal.x() << ", " <<
0084 trackPointInfo.directionLocal.y() << ", " <<
0085 trackPointInfo.directionLocal.z() << "]";
0086 #ifdef CEXMC_DEBUG_TP
0087 out << std::endl << " < in world: " <<
0088 G4BestUnit( trackPointInfo.positionWorld, "Length" ) << " [" <<
0089 trackPointInfo.directionWorld.x() << ", " <<
0090 trackPointInfo.directionWorld.y() << ", " <<
0091 trackPointInfo.directionWorld.z() << "] >";
0092 #endif
0093
0094 out.precision( prec );
0095 out.flags( savedFlags );
0096
0097 return out;
0098 }
0099