Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:50

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /*
0027  * =============================================================================
0028  *
0029  *       Filename:  CexmcStudiedPhysics.hh
0030  *
0031  *    Description:  studied physics in the target
0032  *
0033  *        Version:  1.0
0034  *        Created:  18.10.2009 16:10:52
0035  *       Revision:  none
0036  *       Compiler:  gcc
0037  *
0038  *         Author:  Alexey Radkov (), 
0039  *        Company:  PNPI
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