source: trunk/source/event/include/G4PrimaryTransformer.hh @ 816

Last change on this file since 816 was 816, checked in by garnier, 16 years ago

import all except CVS

File size: 4.0 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4PrimaryTransformer.hh,v 1.12 2006/06/29 18:08:46 gunter Exp $
28// GEANT4 tag $Name:  $
29//
30
31#ifndef G4PromaryTransformer_h
32#define G4PromaryTransformer_h 1
33
34#include "G4TrackVector.hh"
35#include "G4ParticleTable.hh"
36#include "globals.hh"
37class G4Event;
38class G4PrimaryVertex;
39#include "G4PrimaryParticle.hh"
40#include "G4DynamicParticle.hh"
41
42// class description:
43//
44//  This class is exclusively used by G4EventManager for the conversion
45// from G4PrimaryVertex/G4PrimaryParticle to G4DynamicParticle/G4Track.
46//
47
48class G4PrimaryTransformer
49{
50  public:
51    G4PrimaryTransformer();
52    virtual ~G4PrimaryTransformer();
53   
54    G4TrackVector* GimmePrimaries(G4Event* anEvent, G4int trackIDCounter=0);
55    void CheckUnknown();
56
57  protected:
58    G4TrackVector TV;
59    G4ParticleTable* particleTable;
60    G4int verboseLevel;
61    G4int trackID;
62
63    G4ParticleDefinition* unknown;
64    G4bool unknownParticleDefined;
65
66  public:
67    inline void SetVerboseLevel(G4int vl)
68    { verboseLevel = vl; };
69
70  public: //with description
71    void SetUnknnownParticleDefined(G4bool vl);
72    // By invoking this Set method, the user can alter the treatment of unknown
73    // particle. The ideal place to invoke this method is in the BeginOfRunAction.
74
75    inline G4bool GetUnknownParticleDefined() const
76    { return unknownParticleDefined; }
77
78  protected:
79    void GenerateTracks(G4PrimaryVertex* primaryVertex);
80    void GenerateSingleTrack(G4PrimaryParticle* primaryParticle,
81              G4double x0,G4double y0,G4double z0,G4double t0,G4double wv);
82    void SetDecayProducts(G4PrimaryParticle* mother,
83                            G4DynamicParticle* motherDP);
84    G4bool CheckDynamicParticle(G4DynamicParticle*DP);
85
86  protected: //with description
87  // Following two virtual methods are provided to customize the use of PrimaryTransformer
88  // for particle types exotic to Geant4.
89
90    virtual G4ParticleDefinition* GetDefinition(G4PrimaryParticle*pp);
91    // Return appropriate G4ParticleDefinition w.r.t. the primary particle.
92    // If NULL is returned, the particle will not be treated as a track, but its daughters
93    // will be examined in case it has "pre-assigned decay products".
94
95    virtual G4bool IsGoodForTrack(G4ParticleDefinition*pd);
96    // Return true if a primary particle should be converted into a track.
97    // By default, all particles of non-shortlived and shortlived with valid decay
98    // tables are converted.
99};
100
101#endif
102
103
Note: See TracBrowser for help on using the repository browser.