![]() |
|
|||
File indexing completed on 2025-09-17 08:59:16
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 // G4PrimaryTransformer 0027 // 0028 // Class description: 0029 // 0030 // This class is exclusively used by G4EventManager for the conversion 0031 // from G4PrimaryVertex/G4PrimaryParticle to G4DynamicParticle/G4Track. 0032 0033 // Author: Makoto Asai, 1999 0034 // -------------------------------------------------------------------- 0035 #ifndef G4PrimaryTransformer_hh 0036 #define G4PrimaryTransformer_hh 1 0037 0038 #include "globals.hh" 0039 #include "G4TrackVector.hh" 0040 #include "G4ParticleTable.hh" 0041 #include "G4PrimaryParticle.hh" 0042 #include "G4DynamicParticle.hh" 0043 #include "G4ExceptionSeverity.hh" 0044 0045 class G4Event; 0046 class G4PrimaryVertex; 0047 0048 class G4PrimaryTransformer 0049 { 0050 public: 0051 0052 G4PrimaryTransformer(); 0053 virtual ~G4PrimaryTransformer() = default; 0054 0055 G4TrackVector* GimmePrimaries(G4Event* anEvent, G4int trackIDCounter=0); 0056 void CheckUnknown(); 0057 0058 inline void SetVerboseLevel(G4int vl) 0059 { verboseLevel = vl; } 0060 0061 void SetUnknownParticleDefined(G4bool vl); 0062 void SetChargedUnknownParticleDefined(G4bool vl); 0063 // By invoking these methods, the user can alter the treatment of, 0064 // respectively, 'unknown' and 'chargedunknown' particles. 0065 // The ideal place to invoke these methods is in the BeginOfRunAction(). 0066 0067 inline G4bool GetUnknownParticleDefined() const 0068 { return unknownParticleDefined; } 0069 0070 inline G4bool GetChargedUnknownParticleDefined() const 0071 { return chargedUnknownParticleDefined; } 0072 0073 protected: 0074 0075 void GenerateTracks(G4PrimaryVertex* primaryVertex); 0076 void GenerateSingleTrack(G4PrimaryParticle* primaryParticle, 0077 G4double x0, G4double y0, G4double z0, 0078 G4double t0, G4double wv); 0079 void SetDecayProducts(G4PrimaryParticle* mother, 0080 G4DynamicParticle* motherDP); 0081 G4bool CheckDynamicParticle(G4DynamicParticle*DP); 0082 0083 // Following two virtual methods are provided to customize the use 0084 // of G4PrimaryTransformer for particle types exotic to Geant4. 0085 0086 virtual G4ParticleDefinition* GetDefinition(G4PrimaryParticle* pp); 0087 // Return appropriate G4ParticleDefinition w.r.t. the primary particle. 0088 // If nullptr is returned, the particle will not be treated as a track, 0089 // but its daughters will be examined in case it has "pre-assigned 0090 // decay products". 0091 0092 virtual G4bool IsGoodForTrack(G4ParticleDefinition* pd); 0093 // Return true if a primary particle should be converted into a track. 0094 // By default, all particles of non-shortlived and shortlived with 0095 // valid decay tables are converted. 0096 0097 protected: 0098 0099 G4TrackVector TV; 0100 G4ParticleTable* particleTable = nullptr; 0101 0102 G4ParticleDefinition* unknown = nullptr; 0103 G4ParticleDefinition* chargedunknown = nullptr; 0104 G4ParticleDefinition* opticalphoton = nullptr; 0105 G4int verboseLevel = 0; 0106 G4int trackID = 0; 0107 G4int nWarn = 0; 0108 G4bool unknownParticleDefined = false; 0109 G4bool chargedUnknownParticleDefined = false; 0110 G4bool opticalphotonDefined = false; 0111 0112 static G4double kETolerance; 0113 static G4ExceptionSeverity kETSeverity; 0114 public: 0115 static void SetKETolerance(G4double val, G4ExceptionSeverity sev = JustWarning) 0116 { kETolerance = val; kETSeverity = sev; } 0117 0118 }; 0119 0120 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |