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_STUDIED_PHYSICS_HH
0045 #define CEXMC_STUDIED_PHYSICS_HH
0046
0047 #include <G4VPhysicsConstructor.hh>
0048 #include <G4ProcessManager.hh>
0049 #include <G4ParticleDefinition.hh>
0050 #include "CexmcFakeCrossSectionData.hh"
0051 #include "CexmcStudiedProcess.hh"
0052 #include "CexmcPhysicsManager.hh"
0053 #include "CexmcProductionModel.hh"
0054
0055 class G4VProcess;
0056
0057
0058 template < typename Process >
0059 class CexmcStudiedPhysics : public G4VPhysicsConstructor
0060 {
0061 public:
0062 explicit CexmcStudiedPhysics( CexmcPhysicsManager * physicsManager );
0063
0064 virtual ~CexmcStudiedPhysics();
0065
0066 public:
0067 void ConstructParticle( void );
0068
0069 void ConstructProcess( void );
0070
0071 public:
0072 CexmcProductionModel * GetProductionModel( void );
0073
0074 protected:
0075 virtual void ApplyInteractionModel( G4VProcess * process );
0076
0077 protected:
0078 CexmcPhysicsManager * physicsManager;
0079
0080 CexmcProductionModel * productionModel;
0081
0082 private:
0083 G4bool wasActivated;
0084 };
0085
0086
0087 template < typename Process >
0088 CexmcStudiedPhysics< Process >::CexmcStudiedPhysics(
0089 CexmcPhysicsManager * physicsManager_ ) :
0090 G4VPhysicsConstructor( "studiedPhysics" ),
0091 physicsManager( physicsManager_ ), productionModel( NULL ),
0092 wasActivated( false )
0093 {
0094 }
0095
0096
0097 template < typename Process >
0098 CexmcStudiedPhysics< Process >::~CexmcStudiedPhysics()
0099 {
0100 }
0101
0102
0103 template < typename Process >
0104 void CexmcStudiedPhysics< Process >::ConstructParticle( void )
0105 {
0106 if ( productionModel )
0107 productionModel->GetIncidentParticle();
0108 }
0109
0110
0111 template < typename Process >
0112 void CexmcStudiedPhysics< Process >::ConstructProcess( void )
0113 {
0114 if ( wasActivated )
0115 return;
0116
0117 wasActivated = true;
0118
0119 Process * process( new Process );
0120
0121 process->AddDataSet( new CexmcFakeCrossSectionData );
0122
0123 CexmcStudiedProcess * studiedProcess( new CexmcStudiedProcess(
0124 physicsManager, process->GetProcessType() ) );
0125
0126 ApplyInteractionModel( process );
0127
0128 studiedProcess->RegisterProcess( process );
0129
0130 G4ParticleDefinition * particle( NULL );
0131
0132 if ( productionModel )
0133 particle = productionModel->GetIncidentParticle();
0134
0135 if ( particle )
0136 {
0137 G4ProcessManager * processManager( particle->GetProcessManager() );
0138 processManager->AddDiscreteProcess( studiedProcess );
0139 }
0140 }
0141
0142
0143 template < typename Process >
0144 CexmcProductionModel * CexmcStudiedPhysics< Process >::GetProductionModel(
0145 void )
0146 {
0147 return productionModel;
0148 }
0149
0150
0151 template < typename Process >
0152 void CexmcStudiedPhysics< Process >::ApplyInteractionModel( G4VProcess * )
0153 {
0154 }
0155
0156
0157 #endif
0158