Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:58

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 
0044 class G4Event;
0045 class G4PrimaryVertex;
0046 
0047 class G4PrimaryTransformer
0048 {
0049   public:
0050 
0051     G4PrimaryTransformer();
0052     virtual ~G4PrimaryTransformer() = default;
0053     
0054     G4TrackVector* GimmePrimaries(G4Event* anEvent, G4int trackIDCounter=0);
0055     void CheckUnknown();
0056 
0057     inline void SetVerboseLevel(G4int vl)
0058       { verboseLevel = vl; }
0059 
0060     void SetUnknnownParticleDefined(G4bool vl);
0061       // By invoking this method, the user can alter the treatment of unknown
0062       // particles. The ideal place to invoke this method is in the
0063       // BeginOfRunAction().
0064 
0065     inline G4bool GetUnknownParticleDefined() const
0066       { return unknownParticleDefined; }
0067 
0068   protected:
0069 
0070     void GenerateTracks(G4PrimaryVertex* primaryVertex);
0071     void GenerateSingleTrack(G4PrimaryParticle* primaryParticle,
0072                              G4double x0, G4double y0, G4double z0,
0073                              G4double t0, G4double wv);
0074     void SetDecayProducts(G4PrimaryParticle* mother,
0075                           G4DynamicParticle* motherDP);
0076     G4bool CheckDynamicParticle(G4DynamicParticle*DP);
0077 
0078     // Following two virtual methods are provided to customize the use
0079     // of G4PrimaryTransformer for particle types exotic to Geant4.
0080 
0081     virtual G4ParticleDefinition* GetDefinition(G4PrimaryParticle* pp);
0082       // Return appropriate G4ParticleDefinition w.r.t. the primary particle. 
0083       // If nullptr is returned, the particle will not be treated as a track,
0084       // but its daughters will be examined in case it has "pre-assigned
0085       // decay products".
0086 
0087     virtual G4bool IsGoodForTrack(G4ParticleDefinition* pd);
0088       // Return true if a primary particle should be converted into a track.
0089       // By default, all particles of non-shortlived and shortlived with
0090       // valid decay tables are converted.
0091 
0092   protected:
0093 
0094     G4TrackVector TV;
0095     G4ParticleTable* particleTable = nullptr;
0096 
0097     G4ParticleDefinition* unknown = nullptr;
0098     G4ParticleDefinition* opticalphoton = nullptr;
0099     G4int verboseLevel = 0;
0100     G4int trackID = 0;
0101     G4int nWarn = 0;
0102     G4bool unknownParticleDefined = false;
0103     G4bool opticalphotonDefined = false;
0104 };
0105 
0106 #endif