Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /* 26 /* 27 * =========================================== 27 * ============================================================================= 28 * 28 * 29 * Filename: CexmcStudiedPhysics.hh 29 * Filename: CexmcStudiedPhysics.hh 30 * 30 * 31 * Description: studied physics in the tar 31 * Description: studied physics in the target 32 * 32 * 33 * Version: 1.0 33 * Version: 1.0 34 * Created: 18.10.2009 16:10:52 34 * Created: 18.10.2009 16:10:52 35 * Revision: none 35 * Revision: none 36 * Compiler: gcc 36 * Compiler: gcc 37 * 37 * 38 * Author: Alexey Radkov (), 38 * Author: Alexey Radkov (), 39 * Company: PNPI 39 * Company: PNPI 40 * 40 * 41 * =========================================== 41 * ============================================================================= 42 */ 42 */ 43 43 44 #ifndef CEXMC_STUDIED_PHYSICS_HH 44 #ifndef CEXMC_STUDIED_PHYSICS_HH 45 #define CEXMC_STUDIED_PHYSICS_HH 45 #define CEXMC_STUDIED_PHYSICS_HH 46 46 47 #include <G4VPhysicsConstructor.hh> 47 #include <G4VPhysicsConstructor.hh> 48 #include <G4ProcessManager.hh> 48 #include <G4ProcessManager.hh> 49 #include <G4ParticleDefinition.hh> 49 #include <G4ParticleDefinition.hh> 50 #include "CexmcFakeCrossSectionData.hh" << 51 #include "CexmcStudiedProcess.hh" 50 #include "CexmcStudiedProcess.hh" 52 #include "CexmcPhysicsManager.hh" 51 #include "CexmcPhysicsManager.hh" 53 #include "CexmcProductionModel.hh" 52 #include "CexmcProductionModel.hh" 54 53 55 class G4VProcess; 54 class G4VProcess; 56 55 57 56 58 template < typename Process > 57 template < typename Process > 59 class CexmcStudiedPhysics : public G4VPhysics 58 class CexmcStudiedPhysics : public G4VPhysicsConstructor 60 { 59 { 61 public: 60 public: 62 explicit CexmcStudiedPhysics( CexmcPhy 61 explicit CexmcStudiedPhysics( CexmcPhysicsManager * physicsManager ); 63 62 64 virtual ~CexmcStudiedPhysics(); 63 virtual ~CexmcStudiedPhysics(); 65 64 66 public: 65 public: 67 void ConstructParti 66 void ConstructParticle( void ); 68 67 69 void ConstructProce 68 void ConstructProcess( void ); 70 69 71 public: 70 public: 72 CexmcProductionModel * GetProductionM 71 CexmcProductionModel * GetProductionModel( void ); 73 72 74 protected: 73 protected: 75 virtual void ApplyInteractionModel( G 74 virtual void ApplyInteractionModel( G4VProcess * process ); 76 75 77 protected: 76 protected: 78 CexmcPhysicsManager * physicsManager 77 CexmcPhysicsManager * physicsManager; 79 78 80 CexmcProductionModel * productionMode 79 CexmcProductionModel * productionModel; 81 80 82 private: 81 private: 83 G4bool wasActivated; 82 G4bool wasActivated; 84 }; 83 }; 85 84 86 85 87 template < typename Process > 86 template < typename Process > 88 CexmcStudiedPhysics< Process >::CexmcStudiedPh 87 CexmcStudiedPhysics< Process >::CexmcStudiedPhysics( 89 CexmcPhysi << 88 CexmcPhysicsManager * physicsManager ) : 90 G4VPhysicsConstructor( "studiedPhysics" ), << 89 G4VPhysicsConstructor( "studiedPhysics" ), physicsManager( physicsManager ), 91 physicsManager( physicsManager_ ), product << 90 productionModel( NULL ), wasActivated( false ) 92 wasActivated( false ) << 93 { 91 { 94 } 92 } 95 93 96 94 97 template < typename Process > 95 template < typename Process > 98 CexmcStudiedPhysics< Process >::~CexmcStudiedP 96 CexmcStudiedPhysics< Process >::~CexmcStudiedPhysics() 99 { 97 { 100 } 98 } 101 99 102 100 103 template < typename Process > 101 template < typename Process > 104 void CexmcStudiedPhysics< Process >::Construc 102 void CexmcStudiedPhysics< Process >::ConstructParticle( void ) 105 { 103 { 106 if ( productionModel ) 104 if ( productionModel ) 107 productionModel->GetIncidentParticle() 105 productionModel->GetIncidentParticle(); 108 } 106 } 109 107 110 108 111 template < typename Process > << 109 template <typename Process > 112 void CexmcStudiedPhysics< Process >::Construc 110 void CexmcStudiedPhysics< Process >::ConstructProcess( void ) 113 { 111 { 114 if ( wasActivated ) 112 if ( wasActivated ) 115 return; 113 return; 116 114 117 wasActivated = true; 115 wasActivated = true; 118 116 119 Process * process( new Process ); 117 Process * process( new Process ); 120 << 121 process->AddDataSet( new CexmcFakeCrossSec << 122 118 123 CexmcStudiedProcess * studiedProcess( new 119 CexmcStudiedProcess * studiedProcess( new CexmcStudiedProcess( 124 physicsManager 120 physicsManager, process->GetProcessType() ) ); 125 121 126 ApplyInteractionModel( process ); 122 ApplyInteractionModel( process ); 127 123 128 studiedProcess->RegisterProcess( process ) 124 studiedProcess->RegisterProcess( process ); 129 125 130 G4ParticleDefinition * particle( NULL ); 126 G4ParticleDefinition * particle( NULL ); 131 127 132 if ( productionModel ) 128 if ( productionModel ) 133 particle = productionModel->GetInciden 129 particle = productionModel->GetIncidentParticle(); 134 130 135 if ( particle ) 131 if ( particle ) 136 { 132 { 137 G4ProcessManager * processManager( pa 133 G4ProcessManager * processManager( particle->GetProcessManager() ); 138 processManager->AddDiscreteProcess( st 134 processManager->AddDiscreteProcess( studiedProcess ); 139 } 135 } 140 } 136 } 141 137 142 138 143 template < typename Process > 139 template < typename Process > 144 CexmcProductionModel * CexmcStudiedPhysics< P 140 CexmcProductionModel * CexmcStudiedPhysics< Process >::GetProductionModel( 145 141 void ) 146 { 142 { 147 return productionModel; 143 return productionModel; 148 } 144 } 149 145 150 146 151 template < typename Process > 147 template < typename Process > 152 void CexmcStudiedPhysics< Process >::ApplyInt 148 void CexmcStudiedPhysics< Process >::ApplyInteractionModel( G4VProcess * ) 153 { 149 { 154 } 150 } 155 151 156 152 157 #endif 153 #endif 158 154 159 155